From 21c4da936d18645a30b7102f8e132f4af11c4bba Mon Sep 17 00:00:00 2001 From: SamueleA Date: Wed, 29 Nov 2023 16:01:10 +0000 Subject: [PATCH] Build: (95c8b09) typing fix --- assets/{ccip-a56349b9.js => ccip-bb77ee49.js} | 2 +- assets/events-d5745873.js | 1 + .../{index-99fac179.js => index-3a237630.js} | 2 +- assets/index-748504a6.js | 25 ++ assets/index-7c92980a.js | 6 - assets/index-cc134824.js | 6 + .../{index-d66ad66e.js => index-da732aeb.js} | 216 +++++++++--------- assets/index-e4b650d6.js | 1 + assets/index.es-47158634.js | 27 --- assets/index.es-69483be7.js | 27 +++ index.html | 2 +- 11 files changed, 171 insertions(+), 144 deletions(-) rename assets/{ccip-a56349b9.js => ccip-bb77ee49.js} (84%) create mode 100644 assets/events-d5745873.js rename assets/{index-99fac179.js => index-3a237630.js} (93%) create mode 100644 assets/index-748504a6.js delete mode 100644 assets/index-7c92980a.js create mode 100644 assets/index-cc134824.js rename assets/{index-d66ad66e.js => index-da732aeb.js} (55%) create mode 100644 assets/index-e4b650d6.js delete mode 100644 assets/index.es-47158634.js create mode 100644 assets/index.es-69483be7.js diff --git a/assets/ccip-a56349b9.js b/assets/ccip-bb77ee49.js similarity index 84% rename from assets/ccip-a56349b9.js rename to assets/ccip-bb77ee49.js index 63c941b3..f4067587 100644 --- a/assets/ccip-a56349b9.js +++ b/assets/ccip-bb77ee49.js @@ -1 +1 @@ -import{an as f,ao as w,ap as y,aq as p,ar as h,as as g,at as k,au as O,av as L,aw as m,ax as E}from"./index-d66ad66e.js";class x extends f{constructor({callbackSelector:e,cause:t,data:n,extraData:c,sender:d,urls:a}){var i;super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],(i=t.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",a&&[" Gateway URL(s):",...a.map(u=>` ${w(u)}`)],` Sender: ${d}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class M extends f{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(t)}`,`Response: ${y(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class R extends f{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}function $(s,e){if(!p(s))throw new h({address:s});if(!p(e))throw new h({address:e});return s.toLowerCase()===e.toLowerCase()}const C="0x556f1830",S={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function P(s,{blockNumber:e,blockTag:t,data:n,to:c}){const{args:d}=g({data:n,abi:[S]}),[a,i,u,r,o]=d;try{if(!$(c,a))throw new R({sender:a,to:c});const l=await v({data:u,sender:a,urls:i}),{data:b}=await k(s,{blockNumber:e,blockTag:t,data:O([r,L([{type:"bytes"},{type:"bytes"}],[l,o])]),to:c});return b}catch(l){throw new x({callbackSelector:r,cause:l,data:n,extraData:o,sender:a,urls:i})}}async function v({data:s,sender:e,urls:t}){var c;let n=new Error("An unknown error occurred.");for(let d=0;d` ${w(u)}`)],` Sender: ${d}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class M extends f{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(t)}`,`Response: ${y(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class R extends f{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}function $(s,e){if(!p(s))throw new h({address:s});if(!p(e))throw new h({address:e});return s.toLowerCase()===e.toLowerCase()}const C="0x556f1830",A={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function P(s,{blockNumber:e,blockTag:t,data:n,to:c}){const{args:d}=g({data:n,abi:[A]}),[a,i,u,r,o]=d;try{if(!$(c,a))throw new R({sender:a,to:c});const l=await S({data:u,sender:a,urls:i}),{data:b}=await k(s,{blockNumber:e,blockTag:t,data:O([r,L([{type:"bytes"},{type:"bytes"}],[l,o])]),to:c});return b}catch(l){throw new x({callbackSelector:r,cause:l,data:n,extraData:o,sender:a,urls:i})}}async function S({data:s,sender:e,urls:t}){var c;let n=new Error("An unknown error occurred.");for(let d=0;d0&&(s=n[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var c=f[e];if(c===void 0)return!1;if(typeof c=="function")d(c,this,n);else for(var h=c.length,O=E(c,h),r=0;r0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,j(u)}return t}o.prototype.addListener=function(e,n){return g(this,e,n,!1)};o.prototype.on=o.prototype.addListener;o.prototype.prependListener=function(e,n){return g(this,e,n,!0)};function N(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=N.bind(r);return i.listener=n,r.wrapFn=i,i}o.prototype.once=function(e,n){return v(n),this.on(e,_(this,e,n)),this};o.prototype.prependOnceListener=function(e,n){return v(n),this.prependListener(e,_(this,e,n)),this};o.prototype.removeListener=function(e,n){var r,i,f,s,u;if(v(n),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||n));else if(typeof r!="function"){for(f=-1,s=r.length-1;s>=0;s--)if(r[s]===n||r[s].listener===n){u=r[s].listener,f=s;break}if(f<0)return this;f===0?r.shift():R(r,f),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||n)}return this};o.prototype.off=o.prototype.removeListener;o.prototype.removeAllListeners=function(e){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var f=Object.keys(r),s;for(i=0;i=0;i--)this.removeListener(e,n[i]);return this};function w(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?M(i):E(i,i.length)}o.prototype.listeners=function(e){return w(this,e,!0)};o.prototype.rawListeners=function(e){return w(this,e,!1)};o.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):b.call(t,e)};o.prototype.listenerCount=b;function b(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function E(t,e){for(var n=new Array(e),r=0;rMath.min(Math.max(r,e),t),H={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},he=e=>typeof e=="number",Et=e=>Array.isArray(e)&&!he(e[0]),jo=(e,t,r)=>{const n=t-e;return((r-e)%n+n)%n+e};function Wo(e,t){return Et(e)?e[jo(0,e.length,t)]:e}const no=(e,t,r)=>-r*e+r*t+e,io=()=>{},it=e=>e,pr=(e,t,r)=>t-e===0?1:(r-e)/(t-e);function so(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const o=pr(0,t,n);e.push(no(r,1,o))}}function Ho(e){const t=[0];return so(t,e-1),t}function zo(e,t=Ho(e.length),r=it){const n=e.length,o=n-t.length;return o>0&&so(t,o),i=>{let s=0;for(;sArray.isArray(e)&&he(e[0]),sr=e=>typeof e=="object"&&!!e.createAnimation,Ot=e=>typeof e=="function",Fo=e=>typeof e=="string",zt={ms:e=>e*1e3,s:e=>e/1e3},lo=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Zo=1e-7,Vo=12;function Ko(e,t,r,n,o){let i,s,a=0;do s=t+(r-t)/2,i=lo(s,n,o)-e,i>0?r=s:t=s;while(Math.abs(i)>Zo&&++aKo(i,0,1,e,r);return i=>i===0||i===1?i:lo(o(i),t,n)}const qo=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*e,o=t==="end"?Math.floor(n):Math.ceil(n);return oo(0,1,o/e)},Ar={ease:Ht(.25,.1,.25,1),"ease-in":Ht(.42,0,1,1),"ease-in-out":Ht(.42,0,.58,1),"ease-out":Ht(0,0,.58,1)},Yo=/\((.*?)\)/;function _r(e){if(Ot(e))return e;if(ao(e))return Ht(...e);if(Ar[e])return Ar[e];if(e.startsWith("steps")){const t=Yo.exec(e);if(t){const r=t[1].split(",");return qo(parseFloat(r[0]),r[1].trim())}}return it}class co{constructor(t,r=[0,1],{easing:n,duration:o=H.duration,delay:i=H.delay,endDelay:s=H.endDelay,repeat:a=H.repeat,offset:l,direction:c="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=it,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((b,h)=>{this.resolve=b,this.reject=h}),n=n||H.easing,sr(n)){const b=n.createAnimation(r);n=b.easing,r=b.keyframes||r,o=b.duration||o}this.repeat=a,this.easing=Et(n)?it:_r(n),this.updateDuration(o);const d=zo(r,l,Et(n)?n.map(_r):it);this.tick=b=>{var h;i=i;let u=0;this.pauseTime!==void 0?u=this.pauseTime:u=(b-this.startTime)*this.rate,this.t=u,u/=1e3,u=Math.max(u-i,0),this.playState==="finished"&&this.pauseTime===void 0&&(u=this.totalDuration);const p=u/this.duration;let g=Math.floor(p),$=p%1;!$&&p>=1&&($=1),$===1&&g--;const f=g%2;(c==="reverse"||c==="alternate"&&f||c==="alternate-reverse"&&!f)&&($=1-$);const y=u>=this.totalDuration?1:Math.min($,1),v=d(this.easing(y));t(v),this.pauseTime===void 0&&(this.playState==="finished"||u>=this.totalDuration+s)?(this.playState="finished",(h=this.resolve)===null||h===void 0||h.call(this,v)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(t=this.reject)===null||t===void 0||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){this.pauseTime!==void 0||this.rate===0?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}class Go{setAnimation(t){this.animation=t,t==null||t.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Ce=new WeakMap;function ho(e){return Ce.has(e)||Ce.set(e,{transforms:[],values:new Map}),Ce.get(e)}function Qo(e,t){return e.has(t)||e.set(t,new Go),e.get(t)}const Jo=["","X","Y","Z"],Xo=["translate","scale","rotate","skew"],ue={x:"translateX",y:"translateY",z:"translateZ"},Or={syntax:"",initialValue:"0deg",toDefaultUnit:e=>e+"deg"},tn={translate:{syntax:"",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:Or,scale:{syntax:"",initialValue:1,toDefaultUnit:it},skew:Or},Zt=new Map,wr=e=>`--motion-${e}`,me=["x","y","z"];Xo.forEach(e=>{Jo.forEach(t=>{me.push(e+t),Zt.set(wr(e+t),tn[e])})});const en=(e,t)=>me.indexOf(e)-me.indexOf(t),rn=new Set(me),uo=e=>rn.has(e),on=(e,t)=>{ue[t]&&(t=ue[t]);const{transforms:r}=ho(e);Uo(r,t),e.style.transform=nn(r)},nn=e=>e.sort(en).reduce(sn,"").trim(),sn=(e,t)=>`${e} ${t}(var(${wr(t)}))`,ar=e=>e.startsWith("--"),kr=new Set;function an(e){if(!kr.has(e)){kr.add(e);try{const{syntax:t,initialValue:r}=Zt.has(e)?Zt.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:r})}catch{}}}const Ee=(e,t)=>document.createElement("div").animate(e,t),Ir={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Ee({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Ee({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{Ee({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Ae={},Ct={};for(const e in Ir)Ct[e]=()=>(Ae[e]===void 0&&(Ae[e]=Ir[e]()),Ae[e]);const ln=.015,cn=(e,t)=>{let r="";const n=Math.round(t/ln);for(let o=0;oOt(e)?Ct.linearEasing()?`linear(${cn(e,t)})`:H.easing:ao(e)?dn(e):e,dn=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`;function hn(e,t){for(let r=0;rArray.isArray(e)?e:[e];function lr(e){return ue[e]&&(e=ue[e]),uo(e)?wr(e):e}const Xt={get:(e,t)=>{t=lr(t);let r=ar(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!r&&r!==0){const n=Zt.get(t);n&&(r=n.initialValue)}return r},set:(e,t,r)=>{t=lr(t),ar(t)?e.style.setProperty(t,r):e.style[t]=r}};function mo(e,t=!0){if(!(!e||e.playState==="finished"))try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch{}}function mn(e,t){var r;let n=(t==null?void 0:t.toDefaultUnit)||it;const o=e[e.length-1];if(Fo(o)){const i=((r=o.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";i&&(n=s=>s+i)}return n}function gn(){return window.__MOTION_DEV_TOOLS_RECORD}function fn(e,t,r,n={},o){const i=gn(),s=n.record!==!1&&i;let a,{duration:l=H.duration,delay:c=H.delay,endDelay:d=H.endDelay,repeat:b=H.repeat,easing:h=H.easing,persist:u=!1,direction:p,offset:g,allowWebkitAcceleration:$=!1}=n;const f=ho(e),y=uo(t);let v=Ct.waapi();y&&on(e,t);const w=lr(t),k=Qo(f.values,w),I=Zt.get(w);return mo(k.animation,!(sr(h)&&k.generator)&&n.record!==!1),()=>{const R=()=>{var P,F;return(F=(P=Xt.get(e,w))!==null&&P!==void 0?P:I==null?void 0:I.initialValue)!==null&&F!==void 0?F:0};let T=hn(un(r),R);const z=mn(T,I);if(sr(h)){const P=h.createAnimation(T,t!=="opacity",R,w,k);h=P.easing,T=P.keyframes||T,l=P.duration||l}if(ar(w)&&(Ct.cssRegisterProperty()?an(w):v=!1),y&&!Ct.linearEasing()&&(Ot(h)||Et(h)&&h.some(Ot))&&(v=!1),v){I&&(T=T.map(Z=>he(Z)?I.toDefaultUnit(Z):Z)),T.length===1&&(!Ct.partialKeyframes()||s)&&T.unshift(R());const P={delay:zt.ms(c),duration:zt.ms(l),endDelay:zt.ms(d),easing:Et(h)?void 0:Tr(h,l),direction:p,iterations:b+1,fill:"both"};a=e.animate({[w]:T,offset:g,easing:Et(h)?h.map(Z=>Tr(Z,l)):void 0},P),a.finished||(a.finished=new Promise((Z,V)=>{a.onfinish=Z,a.oncancel=V}));const F=T[T.length-1];a.finished.then(()=>{u||(Xt.set(e,w,F),a.cancel())}).catch(io),$||(a.playbackRate=1.000001)}else if(o&&y)T=T.map(P=>typeof P=="string"?parseFloat(P):P),T.length===1&&T.unshift(parseFloat(R())),a=new o(P=>{Xt.set(e,w,z?z(P):P)},T,Object.assign(Object.assign({},n),{duration:l,easing:h}));else{const P=T[T.length-1];Xt.set(e,w,I&&he(P)?I.toDefaultUnit(P):P)}return s&&i(e,t,T,{duration:l,delay:c,easing:h,repeat:b,offset:g},"motion-one"),k.setAnimation(a),a}}const pn=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function wn(e,t){var r;return typeof e=="string"?t?((r=t[e])!==null&&r!==void 0||(t[e]=document.querySelectorAll(e)),e=t[e]):e=document.querySelectorAll(e):e instanceof Element&&(e=[e]),Array.from(e||[])}const vn=e=>e(),go=(e,t,r=H.duration)=>new Proxy({animations:e.map(vn).filter(Boolean),duration:r,options:t},yn),bn=e=>e.animations[0],yn={get:(e,t)=>{const r=bn(e);switch(t){case"duration":return e.duration;case"currentTime":return zt.s((r==null?void 0:r[t])||0);case"playbackRate":case"playState":return r==null?void 0:r[t];case"finished":return e.finished||(e.finished=Promise.all(e.animations.map(xn)).catch(io)),e.finished;case"stop":return()=>{e.animations.forEach(n=>mo(n))};case"forEachNative":return n=>{e.animations.forEach(o=>n(o,e))};default:return typeof(r==null?void 0:r[t])>"u"?void 0:()=>e.animations.forEach(n=>n[t]())}},set:(e,t,r)=>{switch(t){case"currentTime":r=zt.ms(r);case"playbackRate":for(let n=0;ne.finished;function $n(e,t,r){return Ot(e)?e(t,r):e}function Cn(e){return function(r,n,o={}){r=wn(r);const i=r.length,s=[];for(let a=0;aMath.min(Math.max(r,e),t),H={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},he=e=>typeof e=="number",Et=e=>Array.isArray(e)&&!he(e[0]),jo=(e,t,r)=>{const n=t-e;return((r-e)%n+n)%n+e};function Wo(e,t){return Et(e)?e[jo(0,e.length,t)]:e}const no=(e,t,r)=>-r*e+r*t+e,io=()=>{},it=e=>e,pr=(e,t,r)=>t-e===0?1:(r-e)/(t-e);function so(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const o=pr(0,t,n);e.push(no(r,1,o))}}function Ho(e){const t=[0];return so(t,e-1),t}function zo(e,t=Ho(e.length),r=it){const n=e.length,o=n-t.length;return o>0&&so(t,o),i=>{let s=0;for(;sArray.isArray(e)&&he(e[0]),sr=e=>typeof e=="object"&&!!e.createAnimation,Ot=e=>typeof e=="function",Fo=e=>typeof e=="string",zt={ms:e=>e*1e3,s:e=>e/1e3},lo=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Zo=1e-7,Vo=12;function Ko(e,t,r,n,o){let i,s,a=0;do s=t+(r-t)/2,i=lo(s,n,o)-e,i>0?r=s:t=s;while(Math.abs(i)>Zo&&++aKo(i,0,1,e,r);return i=>i===0||i===1?i:lo(o(i),t,n)}const qo=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*e,o=t==="end"?Math.floor(n):Math.ceil(n);return oo(0,1,o/e)},Ar={ease:Ht(.25,.1,.25,1),"ease-in":Ht(.42,0,1,1),"ease-in-out":Ht(.42,0,.58,1),"ease-out":Ht(0,0,.58,1)},Yo=/\((.*?)\)/;function _r(e){if(Ot(e))return e;if(ao(e))return Ht(...e);if(Ar[e])return Ar[e];if(e.startsWith("steps")){const t=Yo.exec(e);if(t){const r=t[1].split(",");return qo(parseFloat(r[0]),r[1].trim())}}return it}class co{constructor(t,r=[0,1],{easing:n,duration:o=H.duration,delay:i=H.delay,endDelay:s=H.endDelay,repeat:a=H.repeat,offset:l,direction:c="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=it,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((b,h)=>{this.resolve=b,this.reject=h}),n=n||H.easing,sr(n)){const b=n.createAnimation(r);n=b.easing,r=b.keyframes||r,o=b.duration||o}this.repeat=a,this.easing=Et(n)?it:_r(n),this.updateDuration(o);const d=zo(r,l,Et(n)?n.map(_r):it);this.tick=b=>{var h;i=i;let u=0;this.pauseTime!==void 0?u=this.pauseTime:u=(b-this.startTime)*this.rate,this.t=u,u/=1e3,u=Math.max(u-i,0),this.playState==="finished"&&this.pauseTime===void 0&&(u=this.totalDuration);const p=u/this.duration;let g=Math.floor(p),$=p%1;!$&&p>=1&&($=1),$===1&&g--;const f=g%2;(c==="reverse"||c==="alternate"&&f||c==="alternate-reverse"&&!f)&&($=1-$);const y=u>=this.totalDuration?1:Math.min($,1),v=d(this.easing(y));t(v),this.pauseTime===void 0&&(this.playState==="finished"||u>=this.totalDuration+s)?(this.playState="finished",(h=this.resolve)===null||h===void 0||h.call(this,v)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(t=this.reject)===null||t===void 0||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){this.pauseTime!==void 0||this.rate===0?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}class Go{setAnimation(t){this.animation=t,t==null||t.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Ce=new WeakMap;function ho(e){return Ce.has(e)||Ce.set(e,{transforms:[],values:new Map}),Ce.get(e)}function Qo(e,t){return e.has(t)||e.set(t,new Go),e.get(t)}const Jo=["","X","Y","Z"],Xo=["translate","scale","rotate","skew"],ue={x:"translateX",y:"translateY",z:"translateZ"},Or={syntax:"",initialValue:"0deg",toDefaultUnit:e=>e+"deg"},tn={translate:{syntax:"",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:Or,scale:{syntax:"",initialValue:1,toDefaultUnit:it},skew:Or},Zt=new Map,wr=e=>`--motion-${e}`,me=["x","y","z"];Xo.forEach(e=>{Jo.forEach(t=>{me.push(e+t),Zt.set(wr(e+t),tn[e])})});const en=(e,t)=>me.indexOf(e)-me.indexOf(t),rn=new Set(me),uo=e=>rn.has(e),on=(e,t)=>{ue[t]&&(t=ue[t]);const{transforms:r}=ho(e);Uo(r,t),e.style.transform=nn(r)},nn=e=>e.sort(en).reduce(sn,"").trim(),sn=(e,t)=>`${e} ${t}(var(${wr(t)}))`,ar=e=>e.startsWith("--"),kr=new Set;function an(e){if(!kr.has(e)){kr.add(e);try{const{syntax:t,initialValue:r}=Zt.has(e)?Zt.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:r})}catch{}}}const Ee=(e,t)=>document.createElement("div").animate(e,t),Ir={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Ee({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Ee({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{Ee({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Ae={},Ct={};for(const e in Ir)Ct[e]=()=>(Ae[e]===void 0&&(Ae[e]=Ir[e]()),Ae[e]);const ln=.015,cn=(e,t)=>{let r="";const n=Math.round(t/ln);for(let o=0;oOt(e)?Ct.linearEasing()?`linear(${cn(e,t)})`:H.easing:ao(e)?dn(e):e,dn=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`;function hn(e,t){for(let r=0;rArray.isArray(e)?e:[e];function lr(e){return ue[e]&&(e=ue[e]),uo(e)?wr(e):e}const Xt={get:(e,t)=>{t=lr(t);let r=ar(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!r&&r!==0){const n=Zt.get(t);n&&(r=n.initialValue)}return r},set:(e,t,r)=>{t=lr(t),ar(t)?e.style.setProperty(t,r):e.style[t]=r}};function mo(e,t=!0){if(!(!e||e.playState==="finished"))try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch{}}function mn(e,t){var r;let n=(t==null?void 0:t.toDefaultUnit)||it;const o=e[e.length-1];if(Fo(o)){const i=((r=o.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";i&&(n=s=>s+i)}return n}function gn(){return window.__MOTION_DEV_TOOLS_RECORD}function fn(e,t,r,n={},o){const i=gn(),s=n.record!==!1&&i;let a,{duration:l=H.duration,delay:c=H.delay,endDelay:d=H.endDelay,repeat:b=H.repeat,easing:h=H.easing,persist:u=!1,direction:p,offset:g,allowWebkitAcceleration:$=!1}=n;const f=ho(e),y=uo(t);let v=Ct.waapi();y&&on(e,t);const w=lr(t),k=Qo(f.values,w),I=Zt.get(w);return mo(k.animation,!(sr(h)&&k.generator)&&n.record!==!1),()=>{const R=()=>{var P,F;return(F=(P=Xt.get(e,w))!==null&&P!==void 0?P:I==null?void 0:I.initialValue)!==null&&F!==void 0?F:0};let T=hn(un(r),R);const z=mn(T,I);if(sr(h)){const P=h.createAnimation(T,t!=="opacity",R,w,k);h=P.easing,T=P.keyframes||T,l=P.duration||l}if(ar(w)&&(Ct.cssRegisterProperty()?an(w):v=!1),y&&!Ct.linearEasing()&&(Ot(h)||Et(h)&&h.some(Ot))&&(v=!1),v){I&&(T=T.map(Z=>he(Z)?I.toDefaultUnit(Z):Z)),T.length===1&&(!Ct.partialKeyframes()||s)&&T.unshift(R());const P={delay:zt.ms(c),duration:zt.ms(l),endDelay:zt.ms(d),easing:Et(h)?void 0:Tr(h,l),direction:p,iterations:b+1,fill:"both"};a=e.animate({[w]:T,offset:g,easing:Et(h)?h.map(Z=>Tr(Z,l)):void 0},P),a.finished||(a.finished=new Promise((Z,V)=>{a.onfinish=Z,a.oncancel=V}));const F=T[T.length-1];a.finished.then(()=>{u||(Xt.set(e,w,F),a.cancel())}).catch(io),$||(a.playbackRate=1.000001)}else if(o&&y)T=T.map(P=>typeof P=="string"?parseFloat(P):P),T.length===1&&T.unshift(parseFloat(R())),a=new o(P=>{Xt.set(e,w,z?z(P):P)},T,Object.assign(Object.assign({},n),{duration:l,easing:h}));else{const P=T[T.length-1];Xt.set(e,w,I&&he(P)?I.toDefaultUnit(P):P)}return s&&i(e,t,T,{duration:l,delay:c,easing:h,repeat:b,offset:g},"motion-one"),k.setAnimation(a),a}}const pn=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function wn(e,t){var r;return typeof e=="string"?t?((r=t[e])!==null&&r!==void 0||(t[e]=document.querySelectorAll(e)),e=t[e]):e=document.querySelectorAll(e):e instanceof Element&&(e=[e]),Array.from(e||[])}const vn=e=>e(),go=(e,t,r=H.duration)=>new Proxy({animations:e.map(vn).filter(Boolean),duration:r,options:t},yn),bn=e=>e.animations[0],yn={get:(e,t)=>{const r=bn(e);switch(t){case"duration":return e.duration;case"currentTime":return zt.s((r==null?void 0:r[t])||0);case"playbackRate":case"playState":return r==null?void 0:r[t];case"finished":return e.finished||(e.finished=Promise.all(e.animations.map(xn)).catch(io)),e.finished;case"stop":return()=>{e.animations.forEach(n=>mo(n))};case"forEachNative":return n=>{e.animations.forEach(o=>n(o,e))};default:return typeof(r==null?void 0:r[t])>"u"?void 0:()=>e.animations.forEach(n=>n[t]())}},set:(e,t,r)=>{switch(t){case"currentTime":r=zt.ms(r);case"playbackRate":for(let n=0;ne.finished;function $n(e,t,r){return Ot(e)?e(t,r):e}function Cn(e){return function(r,n,o={}){r=wn(r);const i=r.length,s=[];for(let a=0;an[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Lc={},Qn={},bs={};Object.defineProperty(bs,"__esModule",{value:!0});bs.walletLogo=void 0;const F0=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};bs.walletLogo=F0;var gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.LINK_API_URL=void 0;gs.LINK_API_URL="https://www.walletlink.org";var ys={};Object.defineProperty(ys,"__esModule",{value:!0});ys.ScopedLocalStorage=void 0;class W0{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}ys.ScopedLocalStorage=W0;var tn={},Ir={};Object.defineProperty(Ir,"__esModule",{value:!0});const H0=Nc;function qu(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function V0(t){const e=t.length,r=new Array(e);for(let n=0;n0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")qu(s,this,r);else{const o=s.length,a=V0(s);for(let c=0;c"u"&&(n=wh()),nc(t,"",0,[],void 0,0,n);var i;try{br.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,Eh(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;_r.length!==0;){var s=_r.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function Qr(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),_r.push([n,r,e,i])):br.push([e,r,t]):(n[r]=t,_r.push([n,r,e]))}function nc(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;ao.depthLimit){Qr(Xi,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Qr(Xi,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;ae?1:0}function Sh(t,e,r,n){typeof n>"u"&&(n=wh());var i=ic(t,"",0,[],void 0,0,n)||t,s;try{br.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,Eh(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;_r.length!==0;){var o=_r.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function ic(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;ao.depthLimit){Qr(Xi,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Qr(Xi,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a0)for(var n=0;n=1e3&&t<=4999}function Z0(t,e){if(e!=="[Circular]")return e}var $c={},er={};Object.defineProperty(er,"__esModule",{value:!0});er.errorValues=er.errorCodes=void 0;er.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};er.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=er,r=Xt,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(h,p=i){if(Number.isInteger(h)){const v=h.toString();if(f(e.errorValues,v))return e.errorValues[v].message;if(u(h))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return p}t.getMessageFromCode=o;function a(h){if(!Number.isInteger(h))return!1;const p=h.toString();return!!(e.errorValues[p]||u(h))}t.isValidCode=a;function c(h,{fallbackError:p=s,shouldIncludeStack:v=!1}={}){var E,_;if(!p||!Number.isInteger(p.code)||typeof p.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(h instanceof r.EthereumRpcError)return h.serialize();const d={};if(h&&typeof h=="object"&&!Array.isArray(h)&&f(h,"code")&&a(h.code)){const m=h;d.code=m.code,m.message&&typeof m.message=="string"?(d.message=m.message,f(m,"data")&&(d.data=m.data)):(d.message=o(d.code),d.data={originalError:l(h)})}else{d.code=p.code;const m=(E=h)===null||E===void 0?void 0:E.message;d.message=m&&typeof m=="string"?m:p.message,d.data={originalError:l(h)}}const y=(_=h)===null||_===void 0?void 0:_.stack;return v&&h&&y&&typeof y=="string"&&(d.stack=y),d}t.serializeError=c;function u(h){return h>=-32099&&h<=-32e3}function l(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function f(h,p){return Object.prototype.hasOwnProperty.call(h,p)}})($c);var vs={};Object.defineProperty(vs,"__esModule",{value:!0});vs.ethErrors=void 0;const Dc=Xt,xh=$c,De=er;vs.ethErrors={rpc:{parse:t=>Xe(De.errorCodes.rpc.parse,t),invalidRequest:t=>Xe(De.errorCodes.rpc.invalidRequest,t),invalidParams:t=>Xe(De.errorCodes.rpc.invalidParams,t),methodNotFound:t=>Xe(De.errorCodes.rpc.methodNotFound,t),internal:t=>Xe(De.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Xe(e,t)},invalidInput:t=>Xe(De.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>Xe(De.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Xe(De.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Xe(De.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Xe(De.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Xe(De.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Nn(De.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>Nn(De.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>Nn(De.errorCodes.provider.unsupportedMethod,t),disconnected:t=>Nn(De.errorCodes.provider.disconnected,t),chainDisconnected:t=>Nn(De.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Dc.EthereumProviderError(e,r,n)}}};function Xe(t,e){const[r,n]=Ih(e);return new Dc.EthereumRpcError(t,r||xh.getMessageFromCode(t),n)}function Nn(t,e){const[r,n]=Ih(e);return new Dc.EthereumProviderError(t,r||xh.getMessageFromCode(t),n)}function Ih(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=Xt;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=$c;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=vs;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=er;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Pc);var be={},ms={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))})(ms);Object.defineProperty(be,"__esModule",{value:!0});be.EthereumAddressFromSignedMessageResponse=be.SubmitEthereumTransactionResponse=be.SignEthereumTransactionResponse=be.SignEthereumMessageResponse=be.isRequestEthereumAccountsResponse=be.SelectProviderResponse=be.WatchAssetReponse=be.RequestEthereumAccountsResponse=be.SwitchEthereumChainResponse=be.AddEthereumChainResponse=be.isErrorResponse=void 0;const Tt=ms;function Y0(t){var e,r;return((e=t)===null||e===void 0?void 0:e.method)!==void 0&&((r=t)===null||r===void 0?void 0:r.errorMessage)!==void 0}be.isErrorResponse=Y0;function K0(t){return{method:Tt.Web3Method.addEthereumChain,result:t}}be.AddEthereumChainResponse=K0;function X0(t){return{method:Tt.Web3Method.switchEthereumChain,result:t}}be.SwitchEthereumChainResponse=X0;function eb(t){return{method:Tt.Web3Method.requestEthereumAccounts,result:t}}be.RequestEthereumAccountsResponse=eb;function tb(t){return{method:Tt.Web3Method.watchAsset,result:t}}be.WatchAssetReponse=tb;function rb(t){return{method:Tt.Web3Method.selectProvider,result:t}}be.SelectProviderResponse=rb;function nb(t){return t&&t.method===Tt.Web3Method.requestEthereumAccounts}be.isRequestEthereumAccountsResponse=nb;function ib(t){return{method:Tt.Web3Method.signEthereumMessage,result:t}}be.SignEthereumMessageResponse=ib;function sb(t){return{method:Tt.Web3Method.signEthereumTransaction,result:t}}be.SignEthereumTransactionResponse=sb;function ob(t){return{method:Tt.Web3Method.submitEthereumTransaction,result:t}}be.SubmitEthereumTransactionResponse=ob;function ab(t){return{method:Tt.Web3Method.ethereumAddressFromSignedMessage,result:t}}be.EthereumAddressFromSignedMessageResponse=ab;var mn={};Object.defineProperty(mn,"__esModule",{value:!0});mn.LIB_VERSION=void 0;mn.LIB_VERSION="3.7.2";(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;const e=Pc,r=be,n=mn;t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},e.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},e.errorCodes.provider),{unsupportedChain:4902}))}));function i(l){return l!==void 0?(0,e.getMessageFromCode)(l):"Unknown error"}t.standardErrorMessage=i,t.standardErrors=Object.freeze(Object.assign(Object.assign({},e.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},e.ethErrors.provider),{unsupportedChain:(l="")=>e.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:`Unrecognized chain ID ${l}. Try adding the chain using wallet_addEthereumChain first.`})}))}));function s(l,f){const h=(0,e.serializeError)(o(l),{shouldIncludeStack:!0}),p=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");p.searchParams.set("version",n.LIB_VERSION),p.searchParams.set("code",h.code.toString());const v=a(h.data,f);return v&&p.searchParams.set("method",v),p.searchParams.set("message",h.message),Object.assign(Object.assign({},h),{docUrl:p.href})}t.serializeError=s;function o(l){return typeof l=="string"?{message:l,code:t.standardErrorCodes.rpc.internal}:(0,r.isErrorResponse)(l)?Object.assign(Object.assign({},l),{message:l.errorMessage,code:l.errorCode,data:{method:l.method,result:l.result}}):l}function a(l,f){var h;const p=(h=l)===null||h===void 0?void 0:h.method;if(p)return p;if(f!==void 0)return typeof f=="string"?f:Array.isArray(f)?f.length>0?f[0].method:void 0:f.method}function c(l){var f;if(typeof l=="number")return l;if(u(l))return(f=l.code)!==null&&f!==void 0?f:l.errorCode}t.getErrorCode=c;function u(l){return typeof l=="object"&&l!==null&&(typeof l.code=="number"||typeof l.errorCode=="number")}})(ni);var _n={},Rh={exports:{}},sc={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(t,e){var r=ps,n=r.Buffer;function i(o,a){for(var c in o)a[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s);function s(o,a,c){return n(o,a,c)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,c)},s.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var u=n(o);return a!==void 0?typeof c=="string"?u.fill(a,c):u.fill(a):u.fill(0),u},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(sc,sc.exports);var ir=sc.exports,Ah=ir.Buffer;function _s(t,e){this._block=Ah.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}_s.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=Ah.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,s=this._len,o=0;o=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s};_s.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var wn=_s,cb=bt,Mh=wn,ub=ir.Buffer,lb=[1518500249,1859775393,-1894007588,-899497514],fb=new Array(80);function ii(){this.init(),this._w=fb,Mh.call(this,64,56)}cb(ii,Mh);ii.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function hb(t){return t<<5|t>>>27}function db(t){return t<<30|t>>>2}function pb(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}ii.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=e[a-3]^e[a-8]^e[a-14]^e[a-16];for(var c=0;c<80;++c){var u=~~(c/20),l=hb(r)+pb(u,n,i,s)+o+e[c]+lb[u]|0;o=s,s=i,i=db(n),n=r,r=l}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};ii.prototype._hash=function(){var t=ub.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var bb=ii,gb=bt,kh=wn,yb=ir.Buffer,vb=[1518500249,1859775393,-1894007588,-899497514],mb=new Array(80);function si(){this.init(),this._w=mb,kh.call(this,64,56)}gb(si,kh);si.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function _b(t){return t<<1|t>>>31}function wb(t){return t<<5|t>>>27}function Sb(t){return t<<30|t>>>2}function Eb(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}si.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=_b(e[a-3]^e[a-8]^e[a-14]^e[a-16]);for(var c=0;c<80;++c){var u=~~(c/20),l=wb(r)+Eb(u,n,i,s)+o+e[c]+vb[u]|0;o=s,s=i,i=Sb(n),n=r,r=l}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};si.prototype._hash=function(){var t=yb.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var Cb=si,xb=bt,Th=wn,Ib=ir.Buffer,Rb=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Ab=new Array(64);function oi(){this.init(),this._w=Ab,Th.call(this,64,56)}xb(oi,Th);oi.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Mb(t,e,r){return r^t&(e^r)}function kb(t,e,r){return t&e|r&(t|e)}function Tb(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function Ob(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function Nb(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function Lb(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}oi.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=this._f|0,c=this._g|0,u=this._h|0,l=0;l<16;++l)e[l]=t.readInt32BE(l*4);for(;l<64;++l)e[l]=Lb(e[l-2])+e[l-7]+Nb(e[l-15])+e[l-16]|0;for(var f=0;f<64;++f){var h=u+Ob(o)+Mb(o,a,c)+Rb[f]+e[f]|0,p=Tb(r)+kb(r,n,i)|0;u=c,c=a,a=o,o=s+h|0,s=i,i=n,n=r,r=h+p|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=u+this._h|0};oi.prototype._hash=function(){var t=Ib.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var Oh=oi,Pb=bt,$b=Oh,Db=wn,jb=ir.Buffer,Bb=new Array(64);function ws(){this.init(),this._w=Bb,Db.call(this,64,56)}Pb(ws,$b);ws.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};ws.prototype._hash=function(){var t=jb.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var Fb=ws,Wb=bt,Nh=wn,Hb=ir.Buffer,Gu=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Vb=new Array(160);function ai(){this.init(),this._w=Vb,Nh.call(this,128,112)}Wb(ai,Nh);ai.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ju(t,e,r){return r^t&(e^r)}function Qu(t,e,r){return t&e|r&(t|e)}function Zu(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function Yu(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function Ub(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function zb(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function qb(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function Gb(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function Ae(t,e){return t>>>0>>0?1:0}ai.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,o=this._eh|0,a=this._fh|0,c=this._gh|0,u=this._hh|0,l=this._al|0,f=this._bl|0,h=this._cl|0,p=this._dl|0,v=this._el|0,E=this._fl|0,_=this._gl|0,d=this._hl|0,y=0;y<32;y+=2)e[y]=t.readInt32BE(y*4),e[y+1]=t.readInt32BE(y*4+4);for(;y<160;y+=2){var m=e[y-30],x=e[y-15*2+1],C=Ub(m,x),T=zb(x,m);m=e[y-2*2],x=e[y-2*2+1];var j=qb(m,x),$=Gb(x,m),A=e[y-7*2],U=e[y-7*2+1],ce=e[y-16*2],Z=e[y-16*2+1],R=T+U|0,M=C+A+Ae(R,T)|0;R=R+$|0,M=M+j+Ae(R,$)|0,R=R+Z|0,M=M+ce+Ae(R,Z)|0,e[y]=M,e[y+1]=R}for(var N=0;N<160;N+=2){M=e[N],R=e[N+1];var L=Qu(r,n,i),B=Qu(l,f,h),D=Zu(r,l),H=Zu(l,r),Y=Yu(o,v),J=Yu(v,o),se=Gu[N],he=Gu[N+1],le=Ju(o,a,c),We=Ju(v,E,_),w=d+J|0,S=u+Y+Ae(w,d)|0;w=w+We|0,S=S+le+Ae(w,We)|0,w=w+he|0,S=S+se+Ae(w,he)|0,w=w+R|0,S=S+M+Ae(w,R)|0;var O=H+B|0,z=D+L+Ae(O,H)|0;u=c,d=_,c=a,_=E,a=o,E=v,v=p+w|0,o=s+S+Ae(v,p)|0,s=i,p=h,i=n,h=f,n=r,f=l,l=w+O|0,r=S+z+Ae(l,w)|0}this._al=this._al+l|0,this._bl=this._bl+f|0,this._cl=this._cl+h|0,this._dl=this._dl+p|0,this._el=this._el+v|0,this._fl=this._fl+E|0,this._gl=this._gl+_|0,this._hl=this._hl+d|0,this._ah=this._ah+r+Ae(this._al,l)|0,this._bh=this._bh+n+Ae(this._bl,f)|0,this._ch=this._ch+i+Ae(this._cl,h)|0,this._dh=this._dh+s+Ae(this._dl,p)|0,this._eh=this._eh+o+Ae(this._el,v)|0,this._fh=this._fh+a+Ae(this._fl,E)|0,this._gh=this._gh+c+Ae(this._gl,_)|0,this._hh=this._hh+u+Ae(this._hl,d)|0};ai.prototype._hash=function(){var t=Hb.allocUnsafe(64);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var Lh=ai,Jb=bt,Qb=Lh,Zb=wn,Yb=ir.Buffer,Kb=new Array(160);function Ss(){this.init(),this._w=Kb,Zb.call(this,128,112)}Jb(Ss,Qb);Ss.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Ss.prototype._hash=function(){var t=Yb.allocUnsafe(48);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var Xb=Ss,Rr=Rh.exports=function(e){e=e.toLowerCase();var r=Rr[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};Rr.sha=bb;Rr.sha1=Cb;Rr.sha224=Fb;Rr.sha256=Oh;Rr.sha384=Xb;Rr.sha512=Lh;var eg=Rh.exports,W={},tg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0},Ku=typeof Symbol<"u"&&Symbol,rg=tg,ng=function(){return typeof Ku!="function"||typeof Symbol!="function"||typeof Ku("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:rg()},Xu={foo:{}},ig=Object,sg=function(){return{__proto__:Xu}.foo===Xu.foo&&!({__proto__:null}instanceof ig)},og="Function.prototype.bind called on incompatible ",ag=Object.prototype.toString,cg=Math.max,ug="[object Function]",el=function(e,r){for(var n=[],i=0;i"u"||!Te?ne:Te(Uint8Array),mr={"%AggregateError%":typeof AggregateError>"u"?ne:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ne:ArrayBuffer,"%ArrayIteratorPrototype%":jr&&Te?Te([][Symbol.iterator]()):ne,"%AsyncFromSyncIteratorPrototype%":ne,"%AsyncFunction%":zr,"%AsyncGenerator%":zr,"%AsyncGeneratorFunction%":zr,"%AsyncIteratorPrototype%":zr,"%Atomics%":typeof Atomics>"u"?ne:Atomics,"%BigInt%":typeof BigInt>"u"?ne:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ne:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ne:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ne:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?ne:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ne:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ne:FinalizationRegistry,"%Function%":Ph,"%GeneratorFunction%":zr,"%Int8Array%":typeof Int8Array>"u"?ne:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ne:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ne:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":jr&&Te?Te(Te([][Symbol.iterator]())):ne,"%JSON%":typeof JSON=="object"?JSON:ne,"%Map%":typeof Map>"u"?ne:Map,"%MapIteratorPrototype%":typeof Map>"u"||!jr||!Te?ne:Te(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ne:Promise,"%Proxy%":typeof Proxy>"u"?ne:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?ne:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ne:Set,"%SetIteratorPrototype%":typeof Set>"u"||!jr||!Te?ne:Te(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ne:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":jr&&Te?Te(""[Symbol.iterator]()):ne,"%Symbol%":jr?Symbol:ne,"%SyntaxError%":rn,"%ThrowTypeError%":vg,"%TypedArray%":_g,"%TypeError%":Zr,"%Uint8Array%":typeof Uint8Array>"u"?ne:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ne:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ne:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ne:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?ne:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ne:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ne:WeakSet};if(Te)try{null.error}catch(t){var wg=Te(Te(t));mr["%Error.prototype%"]=wg}var Sg=function t(e){var r;if(e==="%AsyncFunction%")r=pa("async function () {}");else if(e==="%GeneratorFunction%")r=pa("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=pa("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Te&&(r=Te(i.prototype))}return mr[e]=r,r},tl={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ci=jc,es=yg,Eg=ci.call(Function.call,Array.prototype.concat),Cg=ci.call(Function.apply,Array.prototype.splice),rl=ci.call(Function.call,String.prototype.replace),ts=ci.call(Function.call,String.prototype.slice),xg=ci.call(Function.call,RegExp.prototype.exec),Ig=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Rg=/\\(\\)?/g,Ag=function(e){var r=ts(e,0,1),n=ts(e,-1);if(r==="%"&&n!=="%")throw new rn("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new rn("invalid intrinsic syntax, expected opening `%`");var i=[];return rl(e,Ig,function(s,o,a,c){i[i.length]=a?rl(c,Rg,"$1"):o||s}),i},Mg=function(e,r){var n=e,i;if(es(tl,n)&&(i=tl[n],n="%"+i[0]+"%"),es(mr,n)){var s=mr[n];if(s===zr&&(s=Sg(n)),typeof s>"u"&&!r)throw new Zr("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new rn("intrinsic "+e+" does not exist!")},Ar=function(e,r){if(typeof e!="string"||e.length===0)throw new Zr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Zr('"allowMissing" argument must be a boolean');if(xg(/^%?[^%]*%?$/,e)===null)throw new rn("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ag(e),i=n.length>0?n[0]:"",s=Mg("%"+i+"%",r),o=s.name,a=s.value,c=!1,u=s.alias;u&&(i=u[0],Cg(n,Eg([0,1],u)));for(var l=1,f=!0;l=n.length){var E=vr(a,h);f=!!E,f&&"get"in E&&!("originalValue"in E.get)?a=E.get:a=a[h]}else f=es(a,h),a=a[h];f&&!c&&(mr[o]=a)}}return a},$h={exports:{}},kg=Ar,oc=kg("%Object.defineProperty%",!0),ac=function(){if(oc)try{return oc({},"a",{value:1}),!0}catch{return!1}return!1};ac.hasArrayLengthDefineBug=function(){if(!ac())return null;try{return oc([],"length",{value:1}).length!==1}catch{return!0}};var Dh=ac,Tg=Ar,qi=Tg("%Object.getOwnPropertyDescriptor%",!0);if(qi)try{qi([],"length")}catch{qi=null}var jh=qi,Og=Dh(),Bc=Ar,Fn=Og&&Bc("%Object.defineProperty%",!0);if(Fn)try{Fn({},"a",{value:1})}catch{Fn=!1}var Ng=Bc("%SyntaxError%"),Br=Bc("%TypeError%"),nl=jh,Lg=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Br("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Br("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Br("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Br("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Br("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Br("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,c=!!nl&&nl(e,r);if(Fn)Fn(e,r,{configurable:o===null&&c?c.configurable:!o,enumerable:i===null&&c?c.enumerable:!i,value:n,writable:s===null&&c?c.writable:!s});else if(a||!i&&!s&&!o)e[r]=n;else throw new Ng("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Bh=Ar,il=Lg,Pg=Dh(),sl=jh,ol=Bh("%TypeError%"),$g=Bh("%Math.floor%"),Dg=function(e,r){if(typeof e!="function")throw new ol("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||$g(r)!==r)throw new ol("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in e&&sl){var o=sl(e,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(s=!1)}return(i||s||!n)&&(Pg?il(e,"length",r,!0,!0):il(e,"length",r)),e};(function(t){var e=jc,r=Ar,n=Dg,i=r("%TypeError%"),s=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),a=r("%Reflect.apply%",!0)||e.call(o,s),c=r("%Object.defineProperty%",!0),u=r("%Math.max%");if(c)try{c({},"a",{value:1})}catch{c=null}t.exports=function(h){if(typeof h!="function")throw new i("a function is required");var p=a(e,o,arguments);return n(p,1+u(0,h.length-(arguments.length-1)),!0)};var l=function(){return a(e,s,arguments)};c?c(t.exports,"apply",{value:l}):t.exports.apply=l})($h);var jg=$h.exports,Fh=Ar,Wh=jg,Bg=Wh(Fh("String.prototype.indexOf")),Fg=function(e,r){var n=Fh(e,!!r);return typeof n=="function"&&Bg(e,".prototype.")>-1?Wh(n):n},Fc=typeof Map=="function"&&Map.prototype,ga=Object.getOwnPropertyDescriptor&&Fc?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,rs=Fc&&ga&&typeof ga.get=="function"?ga.get:null,al=Fc&&Map.prototype.forEach,Wc=typeof Set=="function"&&Set.prototype,ya=Object.getOwnPropertyDescriptor&&Wc?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ns=Wc&&ya&&typeof ya.get=="function"?ya.get:null,cl=Wc&&Set.prototype.forEach,Wg=typeof WeakMap=="function"&&WeakMap.prototype,Wn=Wg?WeakMap.prototype.has:null,Hg=typeof WeakSet=="function"&&WeakSet.prototype,Hn=Hg?WeakSet.prototype.has:null,Vg=typeof WeakRef=="function"&&WeakRef.prototype,ul=Vg?WeakRef.prototype.deref:null,Ug=Boolean.prototype.valueOf,zg=Object.prototype.toString,qg=Function.prototype.toString,Gg=String.prototype.match,Hc=String.prototype.slice,Yt=String.prototype.replace,Jg=String.prototype.toUpperCase,ll=String.prototype.toLowerCase,Hh=RegExp.prototype.test,fl=Array.prototype.concat,xt=Array.prototype.join,Qg=Array.prototype.slice,hl=Math.floor,cc=typeof BigInt=="function"?BigInt.prototype.valueOf:null,va=Object.getOwnPropertySymbols,uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,nn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Fe=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===nn||"symbol")?Symbol.toStringTag:null,Vh=Object.prototype.propertyIsEnumerable,dl=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function pl(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Hh.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-hl(-t):hl(t);if(n!==t){var i=String(n),s=Hc.call(e,i.length+1);return Yt.call(i,r,"$&_")+"."+Yt.call(Yt.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Yt.call(e,r,"$&_")}var lc=Oc,bl=lc.custom,gl=zh(bl)?bl:null,Zg=function t(e,r,n,i){var s=r||{};if(Jt(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Jt(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=Jt(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Jt(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Jt(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Gh(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return a?pl(e,c):c}if(typeof e=="bigint"){var u=String(e)+"n";return a?pl(e,u):u}var l=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=l&&l>0&&typeof e=="object")return fc(e)?"[Array]":"[Object]";var f=py(s,n);if(typeof i>"u")i=[];else if(qh(i,e)>=0)return"[Circular]";function h(R,M,N){if(M&&(i=Qg.call(i),i.push(M)),N){var L={depth:s.depth};return Jt(s,"quoteStyle")&&(L.quoteStyle=s.quoteStyle),t(R,L,n+1,i)}return t(R,s,n+1,i)}if(typeof e=="function"&&!yl(e)){var p=sy(e),v=ki(e,h);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(v.length>0?" { "+xt.call(v,", ")+" }":"")}if(zh(e)){var E=nn?Yt.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):uc.call(e);return typeof e=="object"&&!nn?Ln(E):E}if(fy(e)){for(var _="<"+ll.call(String(e.nodeName)),d=e.attributes||[],y=0;y",_}if(fc(e)){if(e.length===0)return"[]";var m=ki(e,h);return f&&!dy(m)?"["+hc(m,f)+"]":"[ "+xt.call(m,", ")+" ]"}if(Xg(e)){var x=ki(e,h);return!("cause"in Error.prototype)&&"cause"in e&&!Vh.call(e,"cause")?"{ ["+String(e)+"] "+xt.call(fl.call("[cause]: "+h(e.cause),x),", ")+" }":x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+xt.call(x,", ")+" }"}if(typeof e=="object"&&o){if(gl&&typeof e[gl]=="function"&&lc)return lc(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(oy(e)){var C=[];return al&&al.call(e,function(R,M){C.push(h(M,e,!0)+" => "+h(R,e))}),vl("Map",rs.call(e),C,f)}if(uy(e)){var T=[];return cl&&cl.call(e,function(R){T.push(h(R,e))}),vl("Set",ns.call(e),T,f)}if(ay(e))return ma("WeakMap");if(ly(e))return ma("WeakSet");if(cy(e))return ma("WeakRef");if(ty(e))return Ln(h(Number(e)));if(ny(e))return Ln(h(cc.call(e)));if(ry(e))return Ln(Ug.call(e));if(ey(e))return Ln(h(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===F)return"{ [object globalThis] }";if(!Kg(e)&&!yl(e)){var j=ki(e,h),$=dl?dl(e)===Object.prototype:e instanceof Object||e.constructor===Object,A=e instanceof Object?"":"null prototype",U=!$&&Fe&&Object(e)===e&&Fe in e?Hc.call(sr(e),8,-1):A?"Object":"",ce=$||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",Z=ce+(U||A?"["+xt.call(fl.call([],U||[],A||[]),": ")+"] ":"");return j.length===0?Z+"{}":f?Z+"{"+hc(j,f)+"}":Z+"{ "+xt.call(j,", ")+" }"}return String(e)};function Uh(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function Yg(t){return Yt.call(String(t),/"/g,""")}function fc(t){return sr(t)==="[object Array]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function Kg(t){return sr(t)==="[object Date]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function yl(t){return sr(t)==="[object RegExp]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function Xg(t){return sr(t)==="[object Error]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function ey(t){return sr(t)==="[object String]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function ty(t){return sr(t)==="[object Number]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function ry(t){return sr(t)==="[object Boolean]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function zh(t){if(nn)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!uc)return!1;try{return uc.call(t),!0}catch{}return!1}function ny(t){if(!t||typeof t!="object"||!cc)return!1;try{return cc.call(t),!0}catch{}return!1}var iy=Object.prototype.hasOwnProperty||function(t){return t in this};function Jt(t,e){return iy.call(t,e)}function sr(t){return zg.call(t)}function sy(t){if(t.name)return t.name;var e=Gg.call(qg.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function qh(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Gh(Hc.call(t,0,e.maxStringLength),e)+n}var i=Yt.call(Yt.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,hy);return Uh(i,"single",e)}function hy(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Jg.call(e.toString(16))}function Ln(t){return"Object("+t+")"}function ma(t){return t+" { ? }"}function vl(t,e,r,n){var i=n?hc(r,n):xt.call(r,", ");return t+" ("+e+") {"+i+"}"}function dy(t){for(var e=0;e=0)return!1;return!0}function py(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=xt.call(Array(t.indent+1)," ");else return null;return{base:r,prev:xt.call(Array(e+1),r)}}function hc(t,e){if(t.length===0)return"";var r=` +`+e.prev+e.base;return r+xt.call(t,","+r)+` +`+e.prev}function ki(t,e){var r=fc(t),n=[];if(r){n.length=t.length;for(var i=0;i1;){var r=e.pop(),n=r.obj[r.prop];if(lr(n)){for(var i=[],s=0;s=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||s===My.RFC1738&&(u===40||u===41)){a+=o.charAt(c);continue}if(u<128){a=a+mt[u];continue}if(u<2048){a=a+(mt[192|u>>6]+mt[128|u&63]);continue}if(u<55296||u>=57344){a=a+(mt[224|u>>12]+mt[128|u>>6&63]+mt[128|u&63]);continue}c+=1,u=65536+((u&1023)<<10|o.charCodeAt(c)&1023),a+=mt[240|u>>18]+mt[128|u>>12&63]+mt[128|u>>6&63]+mt[128|u&63]}return a},Py=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i"u"&&(m=0)}if(typeof c=="function"?d=c(r,d):d instanceof Date?d=f(d):n==="comma"&&$t(d)&&(d=Gi.maybeMap(d,function(L){return L instanceof Date?f(L):L})),d===null){if(s)return a&&!v?a(r,Be.encoder,E,"key",h):r;d=""}if(Vy(d)||Gi.isBuffer(d)){if(a){var T=v?r:a(r,Be.encoder,E,"key",h);return[p(T)+"="+p(a(d,Be.encoder,E,"value",h))]}return[p(r)+"="+p(String(d))]}var j=[];if(typeof d>"u")return j;var $;if(n==="comma"&&$t(d))v&&a&&(d=Gi.maybeMap(d,a)),$=[{value:d.length>0?d.join(",")||null:void 0}];else if($t(c))$=c;else{var A=Object.keys(d);$=u?A.sort(u):A}for(var U=i&&$t(d)&&d.length===1?r+"[]":r,ce=0;ce<$.length;++ce){var Z=$[ce],R=typeof Z=="object"&&typeof Z.value<"u"?Z.value:d[Z];if(!(o&&R===null)){var M=$t(d)?typeof n=="function"?n(U,Z):U:U+(l?"."+Z:"["+Z+"]");_.set(e,m);var N=Zh();N.set(Sa,_),Yh(j,t(R,M,n,i,s,o,n==="comma"&&v&&$t(d)?null:a,c,u,l,f,h,p,v,E,N))}}return j},zy=function(e){if(!e)return Be;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||Be.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Vn.default;if(typeof e.format<"u"){if(!Fy.call(Vn.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Vn.formatters[n],s=Be.filter;return(typeof e.filter=="function"||$t(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Be.addQueryPrefix,allowDots:typeof e.allowDots>"u"?Be.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Be.charsetSentinel,delimiter:typeof e.delimiter>"u"?Be.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Be.encode,encoder:typeof e.encoder=="function"?e.encoder:Be.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Be.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Be.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Be.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Be.strictNullHandling}},qy=function(t,e){var r=t,n=zy(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):$t(n.filter)&&(s=n.filter,i=s);var o=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in ml?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var c=ml[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=c==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var l=Zh(),f=0;f0?v+p:""},sn=Qh,dc=Object.prototype.hasOwnProperty,Gy=Array.isArray,Me={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:sn.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Jy=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},Kh=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Qy="utf8=%26%2310003%3B",Zy="utf8=%E2%9C%93",Yy=function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=r.parameterLimit===1/0?void 0:r.parameterLimit,o=i.split(r.delimiter,s),a=-1,c,u=r.charset;if(r.charsetSentinel)for(c=0;c-1&&(v=Gy(v)?[v]:v),dc.call(n,p)?n[p]=sn.combine(n[p],v):n[p]=v}return n},Ky=function(t,e,r,n){for(var i=n?e:Kh(e,r),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,u=parseInt(c,10);!r.parseArrays&&c===""?o={0:i}:!isNaN(u)&&a!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(o=[],o[u]=i):c!=="__proto__"&&(o[c]=i)}i=o}return i},Xy=function(e,r,n,i){if(e){var s=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=n.depth>0&&o.exec(s),u=c?s.slice(0,c.index):s,l=[];if(u){if(!n.plainObjects&&dc.call(Object.prototype,u)&&!n.allowPrototypes)return;l.push(u)}for(var f=0;n.depth>0&&(c=a.exec(s))!==null&&f"u"?Me.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?Me.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Me.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Me.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Me.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Me.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Me.comma,decoder:typeof e.decoder=="function"?e.decoder:Me.decoder,delimiter:typeof e.delimiter=="string"||sn.isRegExp(e.delimiter)?e.delimiter:Me.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Me.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Me.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Me.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Me.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Me.strictNullHandling}},tv=function(t,e){var r=ev(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?Yy(t,r):t,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),o=0;on}t.OpaqueType=e,t.HexString=e(),t.AddressString=e(),t.BigIntString=e();function r(n){return Math.floor(n)}t.IntNumber=r,t.RegExpString=e(),function(n){n.CoinbaseWallet="CoinbaseWallet",n.MetaMask="MetaMask",n.Unselected=""}(t.ProviderType||(t.ProviderType={}))})(ui);var ov=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(W,"__esModule",{value:!0});W.isInIFrame=W.createQrUrl=W.getFavicon=W.range=W.isBigNumber=W.ensureParsedJSONObject=W.ensureBN=W.ensureRegExpString=W.ensureIntNumber=W.ensureBuffer=W.ensureAddressString=W.ensureEvenLengthHexString=W.ensureHexString=W.isHexString=W.prepend0x=W.strip0x=W.has0xPrefix=W.hexStringFromIntNumber=W.intNumberFromHexString=W.bigIntStringFromBN=W.hexStringFromBuffer=W.hexStringToUint8Array=W.uint8ArrayToHex=W.randomBytesHex=void 0;const Qt=ov(ds),av=sv,Mr=ni,st=ui,Xh=/^[0-9]*$/,ed=/^[a-f0-9]*$/;function cv(t){return td(crypto.getRandomValues(new Uint8Array(t)))}W.randomBytesHex=cv;function td(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}W.uint8ArrayToHex=td;function uv(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}W.hexStringToUint8Array=uv;function lv(t,e=!1){const r=t.toString("hex");return(0,st.HexString)(e?"0x"+r:r)}W.hexStringFromBuffer=lv;function fv(t){return(0,st.BigIntString)(t.toString(10))}W.bigIntStringFromBN=fv;function hv(t){return(0,st.IntNumber)(new Qt.default(fi(t,!1),16).toNumber())}W.intNumberFromHexString=hv;function dv(t){return(0,st.HexString)("0x"+new Qt.default(t).toString(16))}W.hexStringFromIntNumber=dv;function qc(t){return t.startsWith("0x")||t.startsWith("0X")}W.has0xPrefix=qc;function Es(t){return qc(t)?t.slice(2):t}W.strip0x=Es;function rd(t){return qc(t)?"0x"+t.slice(2):"0x"+t}W.prepend0x=rd;function li(t){if(typeof t!="string")return!1;const e=Es(t).toLowerCase();return ed.test(e)}W.isHexString=li;function nd(t,e=!1){if(typeof t=="string"){const r=Es(t).toLowerCase();if(ed.test(r))return(0,st.HexString)(e?"0x"+r:r)}throw Mr.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}W.ensureHexString=nd;function fi(t,e=!1){let r=nd(t,!1);return r.length%2===1&&(r=(0,st.HexString)("0"+r)),e?(0,st.HexString)("0x"+r):r}W.ensureEvenLengthHexString=fi;function pv(t){if(typeof t=="string"){const e=Es(t).toLowerCase();if(li(e)&&e.length===40)return(0,st.AddressString)(rd(e))}throw Mr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}W.ensureAddressString=pv;function bv(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string")if(li(t)){const e=fi(t,!1);return Buffer.from(e,"hex")}else return Buffer.from(t,"utf8");throw Mr.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}W.ensureBuffer=bv;function id(t){if(typeof t=="number"&&Number.isInteger(t))return(0,st.IntNumber)(t);if(typeof t=="string"){if(Xh.test(t))return(0,st.IntNumber)(Number(t));if(li(t))return(0,st.IntNumber)(new Qt.default(fi(t,!1),16).toNumber())}throw Mr.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}W.ensureIntNumber=id;function gv(t){if(t instanceof RegExp)return(0,st.RegExpString)(t.toString());throw Mr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}W.ensureRegExpString=gv;function yv(t){if(t!==null&&(Qt.default.isBN(t)||sd(t)))return new Qt.default(t.toString(10),10);if(typeof t=="number")return new Qt.default(id(t));if(typeof t=="string"){if(Xh.test(t))return new Qt.default(t,10);if(li(t))return new Qt.default(fi(t,!1),16)}throw Mr.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}W.ensureBN=yv;function vv(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Mr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}W.ensureParsedJSONObject=vv;function sd(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}W.isBigNumber=sd;function mv(t,e){return Array.from({length:e-t},(r,n)=>t+n)}W.range=mv;function _v(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}W.getFavicon=_v;function wv(t,e,r,n,i,s){const o=n?"parent-id":"id",a=(0,av.stringify)({[o]:t,secret:e,server:r,v:i,chainId:s});return`${r}/#/link?${a}`}W.createQrUrl=wv;function Sv(){try{return window.frameElement!==null}catch{return!1}}W.isInIFrame=Sv;Object.defineProperty(_n,"__esModule",{value:!0});_n.Session=void 0;const wl=eg,Sl=W,El="session:id",Cl="session:secret",xl="session:linked";class Gc{constructor(e,r,n,i){this._storage=e,this._id=r||(0,Sl.randomBytesHex)(16),this._secret=n||(0,Sl.randomBytesHex)(32),this._key=new wl.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(El),n=e.getItem(xl),i=e.getItem(Cl);return r&&i?new Gc(e,r,i,n==="1"):null}static hash(e){return new wl.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(El,this._id),this._storage.setItem(Cl,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(xl,this._linked?"1":"0")}}_n.Session=Gc;var pt={};Object.defineProperty(pt,"__esModule",{value:!0});pt.WalletSDKRelayAbstract=pt.APP_VERSION_KEY=pt.LOCAL_STORAGE_ADDRESSES_KEY=pt.WALLET_USER_NAME_KEY=void 0;const Il=ni;pt.WALLET_USER_NAME_KEY="walletUsername";pt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";pt.APP_VERSION_KEY="AppVersion";class Ev{async makeEthereumJSONRPCRequest(e,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Il.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Il.serializeError)(s,e.method);return i})}}pt.WalletSDKRelayAbstract=Ev;var pc={exports:{}},od=Nc.EventEmitter,Ea,Rl;function Cv(){if(Rl)return Ea;Rl=1;function t(v,E){var _=Object.keys(v);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(v);E&&(d=d.filter(function(y){return Object.getOwnPropertyDescriptor(v,y).enumerable})),_.push.apply(_,d)}return _}function e(v){for(var E=1;E0?this.tail.next=d:this.head=d,this.tail=d,++this.length}},{key:"unshift",value:function(_){var d={data:_,next:this.head};this.length===0&&(this.tail=d),this.head=d,++this.length}},{key:"shift",value:function(){if(this.length!==0){var _=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,_}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(_){if(this.length===0)return"";for(var d=this.head,y=""+d.data;d=d.next;)y+=_+d.data;return y}},{key:"concat",value:function(_){if(this.length===0)return u.alloc(0);for(var d=u.allocUnsafe(_>>>0),y=this.head,m=0;y;)p(y.data,d,m),m+=y.data.length,y=y.next;return d}},{key:"consume",value:function(_,d){var y;return _x.length?x.length:_;if(C===x.length?m+=x:m+=x.slice(0,_),_-=C,_===0){C===x.length?(++y,d.next?this.head=d.next:this.head=this.tail=null):(this.head=d,d.data=x.slice(C));break}++y}return this.length-=y,m}},{key:"_getBuffer",value:function(_){var d=u.allocUnsafe(_),y=this.head,m=1;for(y.data.copy(d),_-=y.data.length;y=y.next;){var x=y.data,C=_>x.length?x.length:_;if(x.copy(d,d.length-_,0,C),_-=C,_===0){C===x.length?(++m,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=x.slice(C));break}++m}return this.length-=m,d}},{key:h,value:function(_,d){return f(this,e(e({},d),{},{depth:0,customInspect:!1}))}}]),v}(),Ea}function xv(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(bc,this,t)):process.nextTick(bc,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Ji,r):(r._writableState.errorEmitted=!0,process.nextTick(Al,r,s)):process.nextTick(Al,r,s):e?(process.nextTick(Ji,r),e(s)):process.nextTick(Ji,r)}),this)}function Al(t,e){bc(t,e),Ji(t)}function Ji(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Iv(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function bc(t,e){t.emit("error",e)}function Rv(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}var ad={destroy:xv,undestroy:Iv,errorOrDestroy:Rv},kr={};function Av(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var cd={};function at(t,e,r){r||(r=Error);function n(s,o,a){return typeof e=="string"?e:e(s,o,a)}var i=function(s){Av(o,s);function o(a,c,u){return s.call(this,n(a,c,u))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=t,cd[t]=i}function Ml(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(n){return String(n)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function Mv(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function kv(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Tv(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}at("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);at("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&Mv(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(kv(t," argument"))i="The ".concat(t," ").concat(n," ").concat(Ml(e,"type"));else{var s=Tv(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(s," ").concat(n," ").concat(Ml(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);at("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");at("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});at("ERR_STREAM_PREMATURE_CLOSE","Premature close");at("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});at("ERR_MULTIPLE_CALLBACK","Callback called multiple times");at("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");at("ERR_STREAM_WRITE_AFTER_END","write after end");at("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);at("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);at("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");kr.codes=cd;var Ov=kr.codes.ERR_INVALID_OPT_VALUE;function Nv(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Lv(t,e,r,n){var i=Nv(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new Ov(s,i)}return Math.floor(i)}return t.objectMode?16:16*1024}var ud={getHighWaterMark:Lv},Pv=$v;function $v(t,e){if(Ca("noDeprecation"))return t;var r=!1;function n(){if(!r){if(Ca("throwDeprecation"))throw new Error(e);Ca("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function Ca(t){try{if(!F.localStorage)return!1}catch{return!1}var e=F.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}var xa,kl;function ld(){if(kl)return xa;kl=1,xa=$;function t(w){var S=this;this.next=null,this.entry=null,this.finish=function(){We(S,w)}}var e;$.WritableState=T;var r={deprecate:Pv},n=od,i=ps.Buffer,s=(typeof F<"u"?F:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(w){return i.from(w)}function a(w){return i.isBuffer(w)||w instanceof s}var c=ad,u=ud,l=u.getHighWaterMark,f=kr.codes,h=f.ERR_INVALID_ARG_TYPE,p=f.ERR_METHOD_NOT_IMPLEMENTED,v=f.ERR_MULTIPLE_CALLBACK,E=f.ERR_STREAM_CANNOT_PIPE,_=f.ERR_STREAM_DESTROYED,d=f.ERR_STREAM_NULL_VALUES,y=f.ERR_STREAM_WRITE_AFTER_END,m=f.ERR_UNKNOWN_ENCODING,x=c.errorOrDestroy;bt($,n);function C(){}function T(w,S,O){e=e||on(),w=w||{},typeof O!="boolean"&&(O=S instanceof e),this.objectMode=!!w.objectMode,O&&(this.objectMode=this.objectMode||!!w.writableObjectMode),this.highWaterMark=l(this,w,"writableHighWaterMark",O),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var z=w.decodeStrings===!1;this.decodeStrings=!z,this.defaultEncoding=w.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(te){L(S,te)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=w.emitClose!==!1,this.autoDestroy=!!w.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}T.prototype.getBuffer=function(){for(var S=this.bufferedRequest,O=[];S;)O.push(S),S=S.next;return O},function(){try{Object.defineProperty(T.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var j;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(j=Function.prototype[Symbol.hasInstance],Object.defineProperty($,Symbol.hasInstance,{value:function(S){return j.call(this,S)?!0:this!==$?!1:S&&S._writableState instanceof T}})):j=function(S){return S instanceof this};function $(w){e=e||on();var S=this instanceof e;if(!S&&!j.call($,this))return new $(w);this._writableState=new T(w,this,S),this.writable=!0,w&&(typeof w.write=="function"&&(this._write=w.write),typeof w.writev=="function"&&(this._writev=w.writev),typeof w.destroy=="function"&&(this._destroy=w.destroy),typeof w.final=="function"&&(this._final=w.final)),n.call(this)}$.prototype.pipe=function(){x(this,new E)};function A(w,S){var O=new y;x(w,O),process.nextTick(S,O)}function U(w,S,O,z){var te;return O===null?te=new d:typeof O!="string"&&!S.objectMode&&(te=new h("chunk",["string","Buffer"],O)),te?(x(w,te),process.nextTick(z,te),!1):!0}$.prototype.write=function(w,S,O){var z=this._writableState,te=!1,b=!z.objectMode&&a(w);return b&&!i.isBuffer(w)&&(w=o(w)),typeof S=="function"&&(O=S,S=null),b?S="buffer":S||(S=z.defaultEncoding),typeof O!="function"&&(O=C),z.ending?A(this,O):(b||U(this,z,w,O))&&(z.pendingcb++,te=Z(this,z,b,w,S,O)),te},$.prototype.cork=function(){this._writableState.corked++},$.prototype.uncork=function(){var w=this._writableState;w.corked&&(w.corked--,!w.writing&&!w.corked&&!w.bufferProcessing&&w.bufferedRequest&&H(this,w))},$.prototype.setDefaultEncoding=function(S){if(typeof S=="string"&&(S=S.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((S+"").toLowerCase())>-1))throw new m(S);return this._writableState.defaultEncoding=S,this},Object.defineProperty($.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ce(w,S,O){return!w.objectMode&&w.decodeStrings!==!1&&typeof S=="string"&&(S=i.from(S,O)),S}Object.defineProperty($.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Z(w,S,O,z,te,b){if(!O){var g=ce(S,z,te);z!==g&&(O=!0,te="buffer",z=g)}var k=S.objectMode?1:z.length;S.length+=k;var P=S.length>5===6?2:d>>4===14?3:d>>3===30?4:d>>6===2?-1:-2}function o(d,y,m){var x=y.length-1;if(x=0?(C>0&&(d.lastNeed=C-1),C):--x=0?(C>0&&(d.lastNeed=C-2),C):--x=0?(C>0&&(C===2?C=0:d.lastNeed=C-3),C):0))}function a(d,y,m){if((y[0]&192)!==128)return d.lastNeed=0,"�";if(d.lastNeed>1&&y.length>1){if((y[1]&192)!==128)return d.lastNeed=1,"�";if(d.lastNeed>2&&y.length>2&&(y[2]&192)!==128)return d.lastNeed=2,"�"}}function c(d){var y=this.lastTotal-this.lastNeed,m=a(this,d);if(m!==void 0)return m;if(this.lastNeed<=d.length)return d.copy(this.lastChar,y,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);d.copy(this.lastChar,y,0,d.length),this.lastNeed-=d.length}function u(d,y){var m=o(this,d,y);if(!this.lastNeed)return d.toString("utf8",y);this.lastTotal=m;var x=d.length-(m-this.lastNeed);return d.copy(this.lastChar,0,x),d.toString("utf8",y,x)}function l(d){var y=d&&d.length?this.write(d):"";return this.lastNeed?y+"�":y}function f(d,y){if((d.length-y)%2===0){var m=d.toString("utf16le",y);if(m){var x=m.charCodeAt(m.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=d[d.length-2],this.lastChar[1]=d[d.length-1],m.slice(0,-1)}return m}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=d[d.length-1],d.toString("utf16le",y,d.length-1)}function h(d){var y=d&&d.length?this.write(d):"";if(this.lastNeed){var m=this.lastTotal-this.lastNeed;return y+this.lastChar.toString("utf16le",0,m)}return y}function p(d,y){var m=(d.length-y)%3;return m===0?d.toString("base64",y):(this.lastNeed=3-m,this.lastTotal=3,m===1?this.lastChar[0]=d[d.length-1]:(this.lastChar[0]=d[d.length-2],this.lastChar[1]=d[d.length-1]),d.toString("base64",y,d.length-m))}function v(d){var y=d&&d.length?this.write(d):"";return this.lastNeed?y+this.lastChar.toString("base64",0,3-this.lastNeed):y}function E(d){return d.toString(this.encoding)}function _(d){return d&&d.length?this.write(d):""}return Ra}var Ll=kr.codes.ERR_STREAM_PREMATURE_CLOSE;function Dv(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(typeof g!="string"&&!K.objectMode&&Object.getPrototypeOf(g)!==n.prototype&&(g=s(g)),P)K.endEmitted?C(b,new d):ce(b,K,g,!0);else if(K.ended)C(b,new E);else{if(K.destroyed)return!1;K.reading=!1,K.decoder&&!k?(g=K.decoder.write(g),K.objectMode||g.length!==0?ce(b,K,g,!1):H(b,K)):ce(b,K,g,!1)}else P||(K.reading=!1,H(b,K))}return!K.ended&&(K.length=R?b=R:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++),b}function N(b,g){return b<=0||g.length===0&&g.ended?0:g.objectMode?1:b!==b?g.flowing&&g.length?g.buffer.head.data.length:g.length:(b>g.highWaterMark&&(g.highWaterMark=M(b)),b<=g.length?b:g.ended?g.length:(g.needReadable=!0,0))}A.prototype.read=function(b){c("read",b),b=parseInt(b,10);var g=this._readableState,k=b;if(b!==0&&(g.emittedReadable=!1),b===0&&g.needReadable&&((g.highWaterMark!==0?g.length>=g.highWaterMark:g.length>0)||g.ended))return c("read: emitReadable",g.length,g.ended),g.length===0&&g.ended?O(this):B(this),null;if(b=N(b,g),b===0&&g.ended)return g.length===0&&O(this),null;var P=g.needReadable;c("need readable",P),(g.length===0||g.length-b0?ge=S(b,g):ge=null,ge===null?(g.needReadable=g.length<=g.highWaterMark,b=0):(g.length-=b,g.awaitDrain=0),g.length===0&&(g.ended||(g.needReadable=!0),k!==b&&g.ended&&O(this)),ge!==null&&this.emit("data",ge),ge};function L(b,g){if(c("onEofChunk"),!g.ended){if(g.decoder){var k=g.decoder.end();k&&k.length&&(g.buffer.push(k),g.length+=g.objectMode?1:k.length)}g.ended=!0,g.sync?B(b):(g.needReadable=!1,g.emittedReadable||(g.emittedReadable=!0,D(b)))}}function B(b){var g=b._readableState;c("emitReadable",g.needReadable,g.emittedReadable),g.needReadable=!1,g.emittedReadable||(c("emitReadable",g.flowing),g.emittedReadable=!0,process.nextTick(D,b))}function D(b){var g=b._readableState;c("emitReadable_",g.destroyed,g.length,g.ended),!g.destroyed&&(g.length||g.ended)&&(b.emit("readable"),g.emittedReadable=!1),g.needReadable=!g.flowing&&!g.ended&&g.length<=g.highWaterMark,w(b)}function H(b,g){g.readingMore||(g.readingMore=!0,process.nextTick(Y,b,g))}function Y(b,g){for(;!g.reading&&!g.ended&&(g.length1&&te(P.pipes,b)!==-1)&&!Tn&&(c("false write response, pause",P.awaitDrain),P.awaitDrain++),k.pause())}function Pr(Nt){c("onerror",Nt),Ut(),b.removeListener("error",Pr),e(b,"error")===0&&C(b,Nt)}j(b,"error",Pr);function $r(){b.removeListener("finish",Dr),Ut()}b.once("close",$r);function Dr(){c("onfinish"),b.removeListener("close",$r),Ut()}b.once("finish",Dr);function Ut(){c("unpipe"),k.unpipe(b)}return b.emit("pipe",k),P.flowing||(c("pipe resume"),k.resume()),b};function J(b){return function(){var k=b._readableState;c("pipeOnDrain",k.awaitDrain),k.awaitDrain&&k.awaitDrain--,k.awaitDrain===0&&e(b,"data")&&(k.flowing=!0,w(b))}}A.prototype.unpipe=function(b){var g=this._readableState,k={hasUnpiped:!1};if(g.pipesCount===0)return this;if(g.pipesCount===1)return b&&b!==g.pipes?this:(b||(b=g.pipes),g.pipes=null,g.pipesCount=0,g.flowing=!1,b&&b.emit("unpipe",this,k),this);if(!b){var P=g.pipes,ge=g.pipesCount;g.pipes=null,g.pipesCount=0,g.flowing=!1;for(var K=0;K0,P.flowing!==!1&&this.resume()):b==="readable"&&!P.endEmitted&&!P.readableListening&&(P.readableListening=P.needReadable=!0,P.flowing=!1,P.emittedReadable=!1,c("on readable",P.length,P.reading),P.length?B(this):P.reading||process.nextTick(he,this)),k},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(b,g){var k=r.prototype.removeListener.call(this,b,g);return b==="readable"&&process.nextTick(se,this),k},A.prototype.removeAllListeners=function(b){var g=r.prototype.removeAllListeners.apply(this,arguments);return(b==="readable"||b===void 0)&&process.nextTick(se,this),g};function se(b){var g=b._readableState;g.readableListening=b.listenerCount("readable")>0,g.resumeScheduled&&!g.paused?g.flowing=!0:b.listenerCount("data")>0&&b.resume()}function he(b){c("readable nexttick read 0"),b.read(0)}A.prototype.resume=function(){var b=this._readableState;return b.flowing||(c("resume"),b.flowing=!b.readableListening,le(this,b)),b.paused=!1,this};function le(b,g){g.resumeScheduled||(g.resumeScheduled=!0,process.nextTick(We,b,g))}function We(b,g){c("resume",g.reading),g.reading||b.read(0),g.resumeScheduled=!1,b.emit("resume"),w(b),g.flowing&&!g.reading&&b.read(0)}A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function w(b){var g=b._readableState;for(c("flow",g.flowing);g.flowing&&b.read()!==null;);}A.prototype.wrap=function(b){var g=this,k=this._readableState,P=!1;b.on("end",function(){if(c("wrapped end"),k.decoder&&!k.ended){var fe=k.decoder.end();fe&&fe.length&&g.push(fe)}g.push(null)}),b.on("data",function(fe){if(c("wrapped data"),k.decoder&&(fe=k.decoder.write(fe)),!(k.objectMode&&fe==null)&&!(!k.objectMode&&(!fe||!fe.length))){var Ot=g.push(fe);Ot||(P=!0,b.pause())}});for(var ge in b)this[ge]===void 0&&typeof b[ge]=="function"&&(this[ge]=function(Ot){return function(){return b[Ot].apply(b,arguments)}}(ge));for(var K=0;K=g.length?(g.decoder?k=g.buffer.join(""):g.buffer.length===1?k=g.buffer.first():k=g.buffer.concat(g.length),g.buffer.clear()):k=g.buffer.consume(b,g.decoder),k}function O(b){var g=b._readableState;c("endReadable",g.endEmitted),g.endEmitted||(g.ended=!0,process.nextTick(z,g,b))}function z(b,g){if(c("endReadableNT",b.endEmitted,b.length),!b.endEmitted&&b.length===0&&(b.endEmitted=!0,g.readable=!1,g.emit("end"),b.autoDestroy)){var k=g._writableState;(!k||k.autoDestroy&&k.finished)&&g.destroy()}}typeof Symbol=="function"&&(A.from=function(b,g){return x===void 0&&(x=Wv()),x(A,b,g)});function te(b,g){for(var k=0,P=b.length;k0;return Xv(o,c,u,function(l){i||(i=l),l&&s.forEach(Fl),!c&&(s.forEach(Fl),n(i))})});return e.reduce(em)}var nm=rm;(function(t,e){e=t.exports=hd(),e.Stream=e,e.Readable=e,e.Writable=ld(),e.Duplex=on(),e.Transform=dd,e.PassThrough=Jv,e.finished=Jc,e.pipeline=nm})(pc,pc.exports);var gd=pc.exports;const{Transform:im}=gd;var sm=t=>class yd extends im{constructor(r,n,i,s,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=o,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new yd(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:om}=gd;var am=t=>class vd extends om{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new vd(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const cm=sm,um=am;var lm=function(t){const e=cm(t),r=um(t);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new e(1152,448,null,224,i);case"keccak256":return new e(1088,512,null,256,i);case"keccak384":return new e(832,768,null,384,i);case"keccak512":return new e(576,1024,null,512,i);case"sha3-224":return new e(1152,448,6,224,i);case"sha3-256":return new e(1088,512,6,256,i);case"sha3-384":return new e(832,768,6,384,i);case"sha3-512":return new e(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},md={};const Wl=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];md.p1600=function(t){for(let e=0;e<24;++e){const r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],o=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],u=t[7]^t[17]^t[27]^t[37]^t[47],l=t[8]^t[18]^t[28]^t[38]^t[48],f=t[9]^t[19]^t[29]^t[39]^t[49];let h=l^(i<<1|s>>>31),p=f^(s<<1|i>>>31);const v=t[0]^h,E=t[1]^p,_=t[10]^h,d=t[11]^p,y=t[20]^h,m=t[21]^p,x=t[30]^h,C=t[31]^p,T=t[40]^h,j=t[41]^p;h=r^(o<<1|a>>>31),p=n^(a<<1|o>>>31);const $=t[2]^h,A=t[3]^p,U=t[12]^h,ce=t[13]^p,Z=t[22]^h,R=t[23]^p,M=t[32]^h,N=t[33]^p,L=t[42]^h,B=t[43]^p;h=i^(c<<1|u>>>31),p=s^(u<<1|c>>>31);const D=t[4]^h,H=t[5]^p,Y=t[14]^h,J=t[15]^p,se=t[24]^h,he=t[25]^p,le=t[34]^h,We=t[35]^p,w=t[44]^h,S=t[45]^p;h=o^(l<<1|f>>>31),p=a^(f<<1|l>>>31);const O=t[6]^h,z=t[7]^p,te=t[16]^h,b=t[17]^p,g=t[26]^h,k=t[27]^p,P=t[36]^h,ge=t[37]^p,K=t[46]^h,fe=t[47]^p;h=c^(r<<1|n>>>31),p=u^(n<<1|r>>>31);const Ot=t[8]^h,or=t[9]^p,Tn=t[18]^h,Mi=t[19]^p,On=t[28]^h,Pr=t[29]^p,$r=t[38]^h,Dr=t[39]^p,Ut=t[48]^h,Nt=t[49]^p,vt=v,mo=E,_o=d<<4|_>>>28,wo=_<<4|d>>>28,So=y<<3|m>>>29,Eo=m<<3|y>>>29,Co=C<<9|x>>>23,xo=x<<9|C>>>23,Io=T<<18|j>>>14,Ro=j<<18|T>>>14,Ao=$<<1|A>>>31,Mo=A<<1|$>>>31,ko=ce<<12|U>>>20,To=U<<12|ce>>>20,Oo=Z<<10|R>>>22,No=R<<10|Z>>>22,Lo=N<<13|M>>>19,Po=M<<13|N>>>19,$o=L<<2|B>>>30,Do=B<<2|L>>>30,jo=H<<30|D>>>2,Bo=D<<30|H>>>2,Fo=Y<<6|J>>>26,Wo=J<<6|Y>>>26,Ho=he<<11|se>>>21,Vo=se<<11|he>>>21,Uo=le<<15|We>>>17,zo=We<<15|le>>>17,qo=S<<29|w>>>3,Go=w<<29|S>>>3,Jo=O<<28|z>>>4,Qo=z<<28|O>>>4,Zo=b<<23|te>>>9,Yo=te<<23|b>>>9,Ko=g<<25|k>>>7,Xo=k<<25|g>>>7,ea=P<<21|ge>>>11,ta=ge<<21|P>>>11,ra=fe<<24|K>>>8,na=K<<24|fe>>>8,ia=Ot<<27|or>>>5,sa=or<<27|Ot>>>5,oa=Tn<<20|Mi>>>12,aa=Mi<<20|Tn>>>12,ca=Pr<<7|On>>>25,ua=On<<7|Pr>>>25,la=$r<<8|Dr>>>24,fa=Dr<<8|$r>>>24,ha=Ut<<14|Nt>>>18,da=Nt<<14|Ut>>>18;t[0]=vt^~ko&Ho,t[1]=mo^~To&Vo,t[10]=Jo^~oa&So,t[11]=Qo^~aa&Eo,t[20]=Ao^~Fo&Ko,t[21]=Mo^~Wo&Xo,t[30]=ia^~_o&Oo,t[31]=sa^~wo&No,t[40]=jo^~Zo&ca,t[41]=Bo^~Yo&ua,t[2]=ko^~Ho&ea,t[3]=To^~Vo&ta,t[12]=oa^~So&Lo,t[13]=aa^~Eo&Po,t[22]=Fo^~Ko&la,t[23]=Wo^~Xo&fa,t[32]=_o^~Oo&Uo,t[33]=wo^~No&zo,t[42]=Zo^~ca&Co,t[43]=Yo^~ua&xo,t[4]=Ho^~ea&ha,t[5]=Vo^~ta&da,t[14]=So^~Lo&qo,t[15]=Eo^~Po&Go,t[24]=Ko^~la&Io,t[25]=Xo^~fa&Ro,t[34]=Oo^~Uo&ra,t[35]=No^~zo&na,t[44]=ca^~Co&$o,t[45]=ua^~xo&Do,t[6]=ea^~ha&vt,t[7]=ta^~da&mo,t[16]=Lo^~qo&Jo,t[17]=Po^~Go&Qo,t[26]=la^~Io&Ao,t[27]=fa^~Ro&Mo,t[36]=Uo^~ra&ia,t[37]=zo^~na&sa,t[46]=Co^~$o&jo,t[47]=xo^~Do&Bo,t[8]=ha^~vt&ko,t[9]=da^~mo&To,t[18]=qo^~Jo&oa,t[19]=Go^~Qo&aa,t[28]=Io^~Ao&Fo,t[29]=Ro^~Mo&Wo,t[38]=ra^~ia&_o,t[39]=na^~sa&wo,t[48]=$o^~jo&Zo,t[49]=Do^~Bo&Yo,t[0]^=Wl[e*2],t[1]^=Wl[e*2+1]}};const is=md;function En(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}En.prototype.initialize=function(t,e){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1};En.prototype.absorb=function(t){for(let e=0;e>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(is.p1600(this.state),this.count=0);return e};En.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var fm=En,hm=lm(fm);const dm=hm,pm=ds;function _d(t){return Buffer.allocUnsafe(t).fill(0)}function wd(t,e,r){const n=_d(e);return t=Is(t),r?t.length"u")throw new Error("Not an array?");if(r=Id(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(Et(t,e[s]));if(r==="dynamic"){var o=Et("uint256",e.length);i.unshift(o)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([Et("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,wr.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=Yr(t),r<1||r>32)throw new Error("Invalid bytes width: "+r);return wr.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=Yr(t),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=fr(e),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(t.startsWith("int")){if(r=Yr(t),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=fr(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(t.startsWith("ufixed")){if(r=Hl(t),n=fr(e),n<0)throw new Error("Supplied ufixed is negative");return Et("uint256",n.mul(new gr(2).pow(new gr(r[1]))))}else if(t.startsWith("fixed"))return r=Hl(t),Et("int256",fr(e).mul(new gr(2).pow(new gr(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function mm(t){return t==="string"||t==="bytes"||Id(t)==="dynamic"}function _m(t){return t.lastIndexOf("]")===t.length-1}function wm(t,e){var r=[],n=[],i=32*t.length;for(var s in t){var o=xd(t[s]),a=e[s],c=Et(o,a);mm(o)?(r.push(Et("uint256",i)),n.push(c),i+=c.length):r.push(c)}return Buffer.concat(r.concat(n))}function Rd(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s32)throw new Error("Invalid bytes width: "+r);i.push(wr.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=Yr(o),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=fr(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(o.startsWith("int")){if(r=Yr(o),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=fr(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return Buffer.concat(i)}function Sm(t,e){return wr.keccak(Rd(t,e))}var Em={rawEncode:wm,solidityPack:Rd,soliditySHA3:Sm};const ft=Cd,Un=Em,Ad={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Oa={encodeData(t,e,r,n=!0){const i=["bytes32"],s=[this.hashType(t,r)];if(n){const o=(a,c,u)=>{if(r[c]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":ft.keccak(this.encodeData(c,u,r,n))];if(u===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",ft.keccak(u)];if(c==="string")return typeof u=="string"&&(u=Buffer.from(u,"utf8")),["bytes32",ft.keccak(u)];if(c.lastIndexOf("]")===c.length-1){const l=c.slice(0,c.lastIndexOf("[")),f=u.map(h=>o(a,l,h));return["bytes32",ft.keccak(Un.rawEncode(f.map(([h])=>h),f.map(([,h])=>h)))]}return[c,u]};for(const a of r[t]){const[c,u]=o(a.name,a.type,e[a.name]);i.push(c),s.push(u)}}else for(const o of r[t]){let a=e[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=ft.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=ft.keccak(a),s.push(a);else if(r[o.type]!==void 0)i.push("bytes32"),a=ft.keccak(this.encodeData(o.type,a,r,n)),s.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(a)}}return Un.rawEncode(i,s)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return ft.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return ft.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in Ad.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),ft.keccak(Buffer.concat(n))}};var Cm={TYPED_MESSAGE_SCHEMA:Ad,TypedDataUtils:Oa,hashForSignTypedDataLegacy:function(t){return xm(t.data)},hashForSignTypedData_v3:function(t){return Oa.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return Oa.hash(t.data)}};function xm(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const r=t.map(function(s){return s.type==="bytes"?ft.toBuffer(s.value):s.value}),n=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return Un.soliditySHA3(["bytes32","bytes32"],[Un.soliditySHA3(new Array(t.length).fill("string"),i),Un.soliditySHA3(n,r)])}var an={};Object.defineProperty(an,"__esModule",{value:!0});an.filterFromParam=an.FilterPolyfill=void 0;const qr=ui,He=W,Im=5*60*1e3,hr={jsonrpc:"2.0",id:0};class Rm{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,qr.IntNumber)(1),this.provider=e}async newFilter(e){const r=Md(e),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.log(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,He.hexStringFromIntNumber)(n)}async newBlockFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,r),this.blockFilters.add(e),this.setFilterTimeout(e),(0,He.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,r),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,He.hexStringFromIntNumber)(e)}uninstallFilter(e){const r=(0,He.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(e){const r=(0,He.intNumberFromHexString)(e);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(Ni())}async getFilterLogs(e){const r=(0,He.intNumberFromHexString)(e),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},hr),{method:"eth_getLogs",params:[Vl(n)]})):Ni()}makeFilterId(){return(0,qr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((r,n)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(e){console.log(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const r=this.logFilters.get(e),n=this.cursors.get(e);if(!n||!r)return Ni();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>r.toBlock)return Li();console.log(`Fetching logs from ${n} to ${s} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},hr),{method:"eth_getLogs",params:[Vl(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(u=>(0,He.intNumberFromHexString)(u.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>n){const u=(0,qr.IntNumber)(c+1);console.log(`Moving cursor position for filter (${e}) from ${n} to ${u}`),this.cursors.set(e,u)}}return o}async getBlockFilterChanges(e){const r=this.cursors.get(e);if(!r)return Ni();const n=await this.getCurrentBlockHeight();if(r>n)return Li();console.log(`Fetching blocks from ${r} to ${n} for filter (${e})`);const i=(await Promise.all((0,He.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,qr.IntNumber)(o))))).filter(o=>!!o),s=(0,qr.IntNumber)(r+i.length);return console.log(`Moving cursor position for filter (${e}) from ${r} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},hr),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(Li())}async setInitialCursorPosition(e,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(e,i),i}setFilterTimeout(e){const r=this.timeouts.get(e);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)},Im);this.timeouts.set(e,n)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},hr),{method:"eth_blockNumber",params:[]}));return(0,He.intNumberFromHexString)((0,He.ensureHexString)(e))}async getBlockHashByNumber(e){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},hr),{method:"eth_getBlockByNumber",params:[(0,He.hexStringFromIntNumber)(e),!1]}));return r.result&&typeof r.result.hash=="string"?(0,He.ensureHexString)(r.result.hash):null}}an.FilterPolyfill=Rm;function Md(t){return{fromBlock:Ul(t.fromBlock),toBlock:Ul(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}an.filterFromParam=Md;function Vl(t){const e={fromBlock:zl(t.fromBlock),toBlock:zl(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function Ul(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,qr.IntNumber)(0);if((0,He.isHexString)(t))return(0,He.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function zl(t){return t==="latest"?t:(0,He.hexStringFromIntNumber)(t)}function Ni(){return Object.assign(Object.assign({},hr),{error:{code:-32e3,message:"filter not found"}})}function Li(){return Object.assign(Object.assign({},hr),{result:[]})}var kd={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(t.JSONRPCMethod||(t.JSONRPCMethod={}))})(kd);var Rs={},Td={},As={},Qc=Am;function Am(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,r=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return r=r%e,r++}}const ql=(t,e)=>function(){const r=e.promiseModule,n=new Array(arguments.length);for(let i=0;i{e.errorFirst?n.push(function(o,a){if(e.multiArgs){const c=new Array(arguments.length-1);for(let u=1;u{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const r=i=>{const s=o=>typeof o=="string"?i===o:o.test(i);return e.include?e.include.some(s):!e.exclude.some(s)};let n;typeof t=="function"?n=function(){return e.excludeMain?t.apply(this,arguments):ql(t,e).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(t));for(const i in t){const s=t[i];n[i]=typeof s=="function"&&r(i)?ql(s,e):s}return n},hi={},km=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hi,"__esModule",{value:!0});hi.BaseBlockTracker=void 0;const Tm=km(Ir),Om=1e3,Nm=(t,e)=>t+e,Gl=["sync","latest"];class Lm extends Tm.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*Om,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){Gl.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return Gl.map(e=>this.listenerCount(e)).reduce(Nm)}_newPotentialLatest(e){const r=this._currentBlock;r&&Jl(e)<=Jl(r)||this._setCurrentBlock(e)}_setCurrentBlock(e){const r=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:r,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}hi.BaseBlockTracker=Lm;function Jl(t){return Number.parseInt(t,16)}var Od={},Nd={},$e={};class Ld extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...o}=e,{path:a}=e,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function Pm(t){return ot(t)&&typeof t[Symbol.iterator]=="function"}function ot(t){return typeof t=="object"&&t!=null}function Ql(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function Re(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function $m(t){const{done:e,value:r}=t.next();return e?void 0:r}function Dm(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${Re(n)}\``}=t;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*gc(t,e,r,n){Pm(t)||(t=[t]);for(const i of t){const s=Dm(i,e,r,n);s&&(yield s)}}function*Zc(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:o=!1}=r,a={path:n,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&ot(e.schema)&&ot(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let c="valid";for(const u of e.validator(t,a))u.explanation=r.message,c="not_valid",yield[u,void 0];for(let[u,l,f]of e.entries(t,a)){const h=Zc(l,f,{path:u===void 0?n:[...n,u],branch:u===void 0?i:[...i,l],coerce:s,mask:o,message:r.message});for(const p of h)p[0]?(c=p[0].refinement!=null?"not_refined":"not_valid",yield[p[0],void 0]):s&&(l=p[1],u===void 0?t=l:t instanceof Map?t.set(u,l):t instanceof Set?t.add(l):ot(t)&&(l!==void 0||u in t)&&(t[u]=l))}if(c!=="not_valid")for(const u of e.refiner(t,a))u.explanation=r.message,c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,t])}class Ce{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(c,u)=>{const l=i(c,u);return gc(l,u,this,c)}:this.validator=()=>[],s?this.refiner=(c,u)=>{const l=s(c,u);return gc(l,u,this,c)}:this.refiner=()=>[]}assert(e,r){return Pd(e,this,r)}create(e,r){return $d(e,this,r)}is(e){return Yc(e,this)}mask(e,r){return Dd(e,this,r)}validate(e,r={}){return Cn(e,this,r)}}function Pd(t,e,r){const n=Cn(t,e,{message:r});if(n[0])throw n[0]}function $d(t,e,r){const n=Cn(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Dd(t,e,r){const n=Cn(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Yc(t,e){return!Cn(t,e)[0]}function Cn(t,e,r={}){const n=Zc(t,e,r),i=$m(n);return i[0]?[new Ld(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function jm(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?Xc(n):di(n)}function Je(t,e){return new Ce({type:t,schema:null,validator:e})}function Bm(t,e){return new Ce({...t,refiner:(r,n)=>r===void 0||t.refiner(r,n),validator(r,n){return r===void 0?!0:(e(r,n),t.validator(r,n))}})}function Fm(t){return new Ce({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function Wm(t){let e;return new Ce({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator(r,n){return e??(e=t()),e.validator(r,n)},coercer(r,n){return e??(e=t()),e.coercer(r,n)},refiner(r,n){return e??(e=t()),e.refiner(r,n)}})}function Hm(t,e){const{schema:r}=t,n={...r};for(const i of e)delete n[i];switch(t.type){case"type":return Xc(n);default:return di(n)}}function Vm(t){const e=t instanceof Ce?{...t.schema}:{...t};for(const r in e)e[r]=jd(e[r]);return di(e)}function Um(t,e){const{schema:r}=t,n={};for(const i of e)n[i]=r[i];return di(n)}function zm(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Je(t,e)}function qm(){return Je("any",()=>!0)}function Gm(t){return new Ce({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${Re(e)}`}})}function Jm(){return Je("bigint",t=>typeof t=="bigint")}function Qm(){return Je("boolean",t=>typeof t=="boolean")}function Zm(){return Je("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${Re(t)}`)}function Ym(t){const e={},r=t.map(n=>Re(n)).join();for(const n of t)e[n]=n;return new Ce({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${Re(n)}`}})}function Km(){return Je("func",t=>typeof t=="function"||`Expected a function, but received: ${Re(t)}`)}function Xm(t){return Je("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${Re(e)}`)}function e1(){return Je("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${Re(t)}`)}function t1(t){return new Ce({type:"intersection",schema:null,*entries(e,r){for(const n of t)yield*n.entries(e,r)},*validator(e,r){for(const n of t)yield*n.validator(e,r)},*refiner(e,r){for(const n of t)yield*n.refiner(e,r)}})}function r1(t){const e=Re(t),r=typeof t;return new Ce({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${Re(n)}`}})}function n1(t,e){return new Ce({type:"map",schema:null,*entries(r){if(t&&e&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,t],yield[n,i,e]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${Re(r)}`}})}function Kc(){return Je("never",()=>!1)}function i1(t){return new Ce({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function s1(){return Je("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${Re(t)}`)}function di(t){const e=t?Object.keys(t):[],r=Kc();return new Ce({type:"object",schema:t||null,*entries(n){if(t&&ot(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return ot(n)||`Expected an object, but received: ${Re(n)}`},coercer(n){return ot(n)?{...n}:n}})}function jd(t){return new Ce({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function o1(t,e){return new Ce({type:"record",schema:null,*entries(r){if(ot(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return ot(r)||`Expected an object, but received: ${Re(r)}`}})}function a1(){return Je("regexp",t=>t instanceof RegExp)}function c1(t){return new Ce({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const r of e)yield[r,r,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${Re(e)}`}})}function Bd(){return Je("string",t=>typeof t=="string"||`Expected a string, but received: ${Re(t)}`)}function u1(t){const e=Kc();return new Ce({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;ir.type).join(" | ");return new Ce({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...o]=Zc(r,s,n),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${Re(r)}`,...i]}})}function Fd(){return Je("unknown",()=>!0)}function eu(t,e,r){return new Ce({...t,coercer:(n,i)=>Yc(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}function f1(t,e,r={}){return eu(t,Fd(),n=>{const i=typeof e=="function"?e():e;if(n===void 0)return i;if(!r.strict&&Ql(n)&&Ql(i)){const s={...n};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return n})}function h1(t){return eu(t,Bd(),e=>e.trim())}function d1(t){return Tr(t,"empty",e=>{const r=Wd(e);return r===0||`Expected an empty ${t.type} but received one with a size of \`${r}\``})}function Wd(t){return t instanceof Map||t instanceof Set?t.size:t.length}function p1(t,e,r={}){const{exclusive:n}=r;return Tr(t,"max",i=>n?in?i>e:i>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${i}\``)}function g1(t){return Tr(t,"nonempty",e=>Wd(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function y1(t,e){return Tr(t,"pattern",r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`)}function v1(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return Tr(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return e<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return e<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}})}function Tr(t,e,r){return new Ce({...t,*refiner(n,i){yield*t.refiner(n,i);const s=r(n,i),o=gc(s,i,t,n);for(const a of o)yield{...a,refinement:e}}})}const m1=Object.freeze(Object.defineProperty({__proto__:null,Struct:Ce,StructError:Ld,any:qm,array:Gm,assert:Pd,assign:jm,bigint:Jm,boolean:Qm,coerce:eu,create:$d,date:Zm,defaulted:f1,define:Je,deprecated:Bm,dynamic:Fm,empty:d1,enums:Ym,func:Km,instance:Xm,integer:e1,intersection:t1,is:Yc,lazy:Wm,literal:r1,map:n1,mask:Dd,max:p1,min:b1,never:Kc,nonempty:g1,nullable:i1,number:s1,object:di,omit:Hm,optional:jd,partial:Vm,pattern:y1,pick:Um,record:o1,refine:Tr,regexp:a1,set:c1,size:v1,string:Bd,struct:zm,trimmed:h1,tuple:u1,type:Xc,union:l1,unknown:Fd,validate:Cn},Symbol.toStringTag,{value:"Module"})),Or=xr(m1);Object.defineProperty($e,"__esModule",{value:!0});$e.assertExhaustive=$e.assertStruct=$e.assert=$e.AssertionError=void 0;const _1=Or;function w1(t){return typeof t=="object"&&t!==null&&"message"in t}function S1(t){var e,r;return typeof((r=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.name)=="string"}function E1(t){const e=w1(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function Hd(t,e){return S1(t)?new t({message:e}):t({message:e})}class tu extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}$e.AssertionError=tu;function C1(t,e="Assertion failed.",r=tu){if(!t)throw e instanceof Error?e:Hd(r,e)}$e.assert=C1;function x1(t,e,r="Assertion failed",n=tu){try{(0,_1.assert)(t,e)}catch(i){throw Hd(n,`${r}: ${E1(i)}.`)}}$e.assertStruct=x1;function I1(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}$e.assertExhaustive=I1;var pi={};Object.defineProperty(pi,"__esModule",{value:!0});pi.base64=void 0;const R1=Or,A1=$e,M1=(t,e={})=>{var r,n;const i=(r=e.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=e.characterSet)!==null&&n!==void 0?n:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,A1.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,R1.pattern)(t,a)};pi.base64=M1;var oe={},bi={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=Or,r=$e;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function n(u){return(0,e.is)(u,t.HexStruct)}t.isHexString=n;function i(u){return(0,e.is)(u,t.StrictHexStruct)}t.isStrictHexString=i;function s(u){(0,r.assert)(n(u),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function o(u){(0,r.assert)(i(u),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=o;function a(u){return u.startsWith("0x")?u:u.startsWith("0X")?`0x${u.substring(2)}`:`0x${u}`}t.add0x=a;function c(u){return u.startsWith("0x")||u.startsWith("0X")?u.substring(2):u}t.remove0x=c})(bi);Object.defineProperty(oe,"__esModule",{value:!0});oe.createDataView=oe.concatBytes=oe.valueToBytes=oe.stringToBytes=oe.numberToBytes=oe.signedBigIntToBytes=oe.bigIntToBytes=oe.hexToBytes=oe.bytesToString=oe.bytesToNumber=oe.bytesToSignedBigInt=oe.bytesToBigInt=oe.bytesToHex=oe.assertIsBytes=oe.isBytes=void 0;const Ze=$e,yc=bi,Zl=48,Yl=58,Kl=87;function k1(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const T1=k1();function ru(t){return t instanceof Uint8Array}oe.isBytes=ru;function xn(t){(0,Ze.assert)(ru(t),"Value must be a Uint8Array.")}oe.assertIsBytes=xn;function Vd(t){if(xn(t),t.length===0)return"0x";const e=T1(),r=new Array(t.length);for(let n=0;n=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return Ms(e)}oe.bigIntToBytes=zd;function P1(t,e){(0,Ze.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(e*8+-1))}function $1(t,e){(0,Ze.assert)(typeof t=="bigint","Value must be a bigint."),(0,Ze.assert)(typeof e=="number","Byte length must be a number."),(0,Ze.assert)(e>0,"Byte length must be greater than 0."),(0,Ze.assert)(P1(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let i=0;i>=BigInt(8);return n.reverse()}oe.signedBigIntToBytes=$1;function qd(t){(0,Ze.assert)(typeof t=="number","Value must be a number."),(0,Ze.assert)(t>=0,"Value must be a non-negative number."),(0,Ze.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return Ms(e)}oe.numberToBytes=qd;function Gd(t){return(0,Ze.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}oe.stringToBytes=Gd;function Jd(t){if(typeof t=="bigint")return zd(t);if(typeof t=="number")return qd(t);if(typeof t=="string")return t.startsWith("0x")?Ms(t):Gd(t);if(ru(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}oe.valueToBytes=Jd;function D1(t){const e=new Array(t.length);let r=0;for(let i=0;ie.call(r,n,i,this))}get(e){return Ve(this,ut,"f").get(e)}has(e){return Ve(this,ut,"f").has(e)}keys(){return Ve(this,ut,"f").keys()}values(){return Ve(this,ut,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,r])=>`${String(e)} => ${String(r)}`).join(", ")} `:""}}`}}cn.FrozenMap=nu;class iu{constructor(e){_t.set(this,void 0),Yd(this,_t,new Set(e),"f"),Object.freeze(this)}get size(){return Ve(this,_t,"f").size}[(_t=new WeakMap,Symbol.iterator)](){return Ve(this,_t,"f")[Symbol.iterator]()}entries(){return Ve(this,_t,"f").entries()}forEach(e,r){return Ve(this,_t,"f").forEach((n,i,s)=>e.call(r,n,i,this))}has(e){return Ve(this,_t,"f").has(e)}keys(){return Ve(this,_t,"f").keys()}values(){return Ve(this,_t,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}cn.FrozenSet=iu;Object.freeze(nu);Object.freeze(nu.prototype);Object.freeze(iu);Object.freeze(iu.prototype);var Kd={},su={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(u){return Array.isArray(u)&&u.length>0}t.isNonEmptyArray=e;function r(u){return u==null}t.isNullOrUndefined=r;function n(u){return!!u&&typeof u=="object"&&!Array.isArray(u)}t.isObject=n;const i=(u,l)=>Object.hasOwnProperty.call(u,l);t.hasProperty=i,function(u){u[u.Null=4]="Null",u[u.Comma=1]="Comma",u[u.Wrapper=1]="Wrapper",u[u.True=4]="True",u[u.False=5]="False",u[u.Quote=1]="Quote",u[u.Colon=1]="Colon",u[u.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(u){if(typeof u!="object"||u===null)return!1;try{let l=u;for(;Object.getPrototypeOf(l)!==null;)l=Object.getPrototypeOf(l);return Object.getPrototypeOf(u)===l}catch{return!1}}t.isPlainObject=s;function o(u){return u.charCodeAt(0)<=127}t.isASCII=o;function a(u){var l;return u.split("").reduce((h,p)=>o(p)?h+1:h+2,0)+((l=u.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&l!==void 0?l:[]).length}t.calculateStringSize=a;function c(u){return u.toString().length}t.calculateNumberSize=c})(su);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;const e=Or,r=$e,n=su;t.JsonStruct=(0,e.define)("Json",C=>{const[T]=x(C,!0);return T?!0:"Expected a valid JSON-serializable value"});function i(C){return(0,e.is)(C,t.JsonStruct)}t.isValidJson=i,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function s(C){return(0,e.is)(C,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=s;function o(C,T){(0,r.assertStruct)(C,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",T)}t.assertIsJsonRpcNotification=o;function a(C){return(0,e.is)(C,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=a;function c(C,T){(0,r.assertStruct)(C,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",T)}t.assertIsJsonRpcRequest=c,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function u(C){return(0,e.is)(C,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=u;function l(C,T){(0,r.assertStruct)(C,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",T)}t.assertIsPendingJsonRpcResponse=l;function f(C){return(0,e.is)(C,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=f;function h(C,T){(0,r.assertStruct)(C,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",T)}t.assertIsJsonRpcResponse=h;function p(C){return(0,e.is)(C,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=p;function v(C,T){(0,r.assertStruct)(C,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",T)}t.assertIsJsonRpcSuccess=v;function E(C){return(0,e.is)(C,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=E;function _(C,T){(0,r.assertStruct)(C,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",T)}t.assertIsJsonRpcFailure=_;function d(C){return(0,e.is)(C,t.JsonRpcErrorStruct)}t.isJsonRpcError=d;function y(C,T){(0,r.assertStruct)(C,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",T)}t.assertIsJsonRpcError=y;function m(C){const{permitEmptyString:T,permitFractions:j,permitNull:$}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},C);return U=>!!(typeof U=="number"&&(j||Number.isInteger(U))||typeof U=="string"&&(T||U.length>0)||$&&U===null)}t.getJsonRpcIdValidator=m;function x(C,T=!1){const j=new Set;function $(A,U){if(A===void 0)return[!1,0];if(A===null)return[!0,U?0:n.JsonSize.Null];const ce=typeof A;try{if(ce==="function")return[!1,0];if(ce==="string"||A instanceof String)return[!0,U?0:(0,n.calculateStringSize)(A)+n.JsonSize.Quote*2];if(ce==="boolean"||A instanceof Boolean)return U?[!0,0]:[!0,A==!0?n.JsonSize.True:n.JsonSize.False];if(ce==="number"||A instanceof Number)return U?[!0,0]:[!0,(0,n.calculateNumberSize)(A)];if(A instanceof Date)return U?[!0,0]:[!0,isNaN(A.getDate())?n.JsonSize.Null:n.JsonSize.Date+n.JsonSize.Quote*2]}catch{return[!1,0]}if(!(0,n.isPlainObject)(A)&&!Array.isArray(A))return[!1,0];if(j.has(A))return[!1,0];j.add(A);try{return[!0,Object.entries(A).reduce((Z,[R,M],N,L)=>{let[B,D]=$(M,U);if(!B)throw new Error("JSON validation did not pass. Validation process stopped.");if(j.delete(A),U)return 0;const H=Array.isArray(A)?0:R.length+n.JsonSize.Comma+n.JsonSize.Colon*2,Y=N0)return o(l);if(h==="number"&&isFinite(l))return f.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function o(l){if(l=String(l),!(l.length>100)){var f=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(f){var h=parseFloat(f[1]),p=(f[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return h*s;case"weeks":case"week":case"w":return h*i;case"days":case"day":case"d":return h*n;case"hours":case"hour":case"hrs":case"hr":case"h":return h*r;case"minutes":case"minute":case"mins":case"min":case"m":return h*e;case"seconds":case"second":case"secs":case"sec":case"s":return h*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(l){var f=Math.abs(l);return f>=n?Math.round(l/n)+"d":f>=r?Math.round(l/r)+"h":f>=e?Math.round(l/e)+"m":f>=t?Math.round(l/t)+"s":l+"ms"}function c(l){var f=Math.abs(l);return f>=n?u(l,f,n,"day"):f>=r?u(l,f,r,"hour"):f>=e?u(l,f,e,"minute"):f>=t?u(l,f,t,"second"):l+" ms"}function u(l,f,h,p){var v=f>=h*1.5;return Math.round(l/h)+" "+p+(v?"s":"")}return Na}function Z1(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=Q1(),r.destroy=u,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h{if(T==="%%")return"%";x++;const $=r.formatters[j];if(typeof $=="function"){const A=_[x];T=$.call(d,A),_.splice(x,1),x--}return T}),r.formatArgs.call(d,_),(d.log||r.log).apply(d,_)}return E.namespace=l,E.useColors=r.useColors(),E.color=r.selectColor(l),E.extend=n,E.destroy=r.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(p!==r.namespaces&&(p=r.namespaces,v=r.enabled(l)),v),set:_=>{h=_}}),typeof r.init=="function"&&r.init(E),E}function n(l,f){const h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f;const h=(typeof l=="string"?l:"").split(/[\s,]+/),p=h.length;for(f=0;f"-"+f)].join(",");return r.enable(""),l}function o(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;c.splice(1,0,u,"color: inherit");let l=0,f=0;c[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(l++,h==="%c"&&(f=l))}),c.splice(f,0,u)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function s(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c={}.DEBUG),c}function o(){try{return localStorage}catch{}}t.exports=Y1(e);const{formatters:a}=t.exports;a.j=function(c){try{return JSON.stringify(c)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(vc,vc.exports);var K1=vc.exports,X1=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(un,"__esModule",{value:!0});un.createModuleLogger=un.createProjectLogger=void 0;const e_=X1(K1),t_=(0,e_.default)("metamask");function r_(t){return t_.extend(t)}un.createProjectLogger=r_;function n_(t,e){return t.extend(e)}un.createModuleLogger=n_;var At={};Object.defineProperty(At,"__esModule",{value:!0});At.hexToBigInt=At.hexToNumber=At.bigIntToHex=At.numberToHex=void 0;const Kr=$e,Kn=bi,i_=t=>((0,Kr.assert)(typeof t=="number","Value must be a number."),(0,Kr.assert)(t>=0,"Value must be a non-negative number."),(0,Kr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Kn.add0x)(t.toString(16)));At.numberToHex=i_;const s_=t=>((0,Kr.assert)(typeof t=="bigint","Value must be a bigint."),(0,Kr.assert)(t>=0,"Value must be a non-negative bigint."),(0,Kn.add0x)(t.toString(16)));At.bigIntToHex=s_;const o_=t=>{(0,Kn.assertIsHexString)(t);const e=parseInt(t,16);return(0,Kr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};At.hexToNumber=o_;const a_=t=>((0,Kn.assertIsHexString)(t),BigInt((0,Kn.add0x)(t)));At.hexToBigInt=a_;var Xd={};Object.defineProperty(Xd,"__esModule",{value:!0});var ep={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,r=(s,o)=>{if(!e(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function n(s,o){return r(s,"count"),s*o}t.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}t.timeSince=i})(ep);var tp={},mc={exports:{}};const c_="2.0.0",rp=256,u_=Number.MAX_SAFE_INTEGER||9007199254740991,l_=16,f_=rp-6,h_=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Os={MAX_LENGTH:rp,MAX_SAFE_COMPONENT_LENGTH:l_,MAX_SAFE_BUILD_LENGTH:f_,MAX_SAFE_INTEGER:u_,RELEASE_TYPES:h_,SEMVER_SPEC_VERSION:c_,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const d_=typeof process=="object"&&process.env&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var Ns=d_;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Os,s=Ns;e=t.exports={};const o=e.re=[],a=e.safeRe=[],c=e.src=[],u=e.t={};let l=0;const f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[f,n]],p=E=>{for(const[_,d]of h)E=E.split(`${_}*`).join(`${_}{0,${d}}`).split(`${_}+`).join(`${_}{1,${d}}`);return E},v=(E,_,d)=>{const y=p(_),m=l++;s(E,m,_),u[E]=m,c[m]=_,o[m]=new RegExp(_,d?"g":void 0),a[m]=new RegExp(y,d?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","\\d+"),v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),v("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),v("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),v("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),v("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),v("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),v("BUILDIDENTIFIER",`${f}+`),v("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),v("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),v("FULL",`^${c[u.FULLPLAIN]}$`),v("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),v("LOOSE",`^${c[u.LOOSEPLAIN]}$`),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),v("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),v("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),v("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),v("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),v("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),v("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),v("COERCERTL",c[u.COERCE],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",v("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),v("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),v("LONECARET","(?:\\^)"),v("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",v("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),v("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),v("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),v("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),v("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),v("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(mc,mc.exports);var gi=mc.exports;const p_=Object.freeze({loose:!0}),b_=Object.freeze({}),g_=t=>t?typeof t!="object"?p_:t:b_;var ou=g_;const tf=/^[0-9]+$/,np=(t,e)=>{const r=tf.test(t),n=tf.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:tnp(e,t);var ip={compareIdentifiers:np,rcompareIdentifiers:y_};const Pi=Ns,{MAX_LENGTH:rf,MAX_SAFE_INTEGER:$i}=Os,{safeRe:nf,t:sf}=gi,v_=ou,{compareIdentifiers:Fr}=ip;let m_=class St{constructor(e,r){if(r=v_(r),e instanceof St){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>rf)throw new TypeError(`version is longer than ${rf} characters`);Pi("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=e.trim().match(r.loose?nf[sf.LOOSE]:nf[sf.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>$i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>$i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>$i||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<$i)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Pi("SemVer.compare",this.version,this.options,e),!(e instanceof St)){if(typeof e=="string"&&e===this.version)return 0;e=new St(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof St||(e=new St(e,this.options)),Fr(this.major,e.major)||Fr(this.minor,e.minor)||Fr(this.patch,e.patch)}comparePre(e){if(e instanceof St||(e=new St(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=e.prerelease[r];if(Pi("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Fr(n,i)}while(++r)}compareBuild(e){e instanceof St||(e=new St(e,this.options));let r=0;do{const n=this.build[r],i=e.build[r];if(Pi("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Fr(n,i)}while(++r)}inc(e,r,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Fr(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var qe=m_;const of=qe,__=(t,e,r=!1)=>{if(t instanceof of)return t;try{return new of(t,e)}catch(n){if(!r)return null;throw n}};var In=__;const w_=In,S_=(t,e)=>{const r=w_(t,e);return r?r.version:null};var E_=S_;const C_=In,x_=(t,e)=>{const r=C_(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};var I_=x_;const af=qe,R_=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new af(t instanceof af?t.version:t,r).inc(e,n,i).version}catch{return null}};var A_=R_;const cf=In,M_=(t,e)=>{const r=cf(t,null,!0),n=cf(e,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const l=c?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};var k_=M_;const T_=qe,O_=(t,e)=>new T_(t,e).major;var N_=O_;const L_=qe,P_=(t,e)=>new L_(t,e).minor;var $_=P_;const D_=qe,j_=(t,e)=>new D_(t,e).patch;var B_=j_;const F_=In,W_=(t,e)=>{const r=F_(t,e);return r&&r.prerelease.length?r.prerelease:null};var H_=W_;const uf=qe,V_=(t,e,r)=>new uf(t,r).compare(new uf(e,r));var gt=V_;const U_=gt,z_=(t,e,r)=>U_(e,t,r);var q_=z_;const G_=gt,J_=(t,e)=>G_(t,e,!0);var Q_=J_;const lf=qe,Z_=(t,e,r)=>{const n=new lf(t,r),i=new lf(e,r);return n.compare(i)||n.compareBuild(i)};var au=Z_;const Y_=au,K_=(t,e)=>t.sort((r,n)=>Y_(r,n,e));var X_=K_;const ew=au,tw=(t,e)=>t.sort((r,n)=>ew(n,r,e));var rw=tw;const nw=gt,iw=(t,e,r)=>nw(t,e,r)>0;var Ls=iw;const sw=gt,ow=(t,e,r)=>sw(t,e,r)<0;var cu=ow;const aw=gt,cw=(t,e,r)=>aw(t,e,r)===0;var sp=cw;const uw=gt,lw=(t,e,r)=>uw(t,e,r)!==0;var op=lw;const fw=gt,hw=(t,e,r)=>fw(t,e,r)>=0;var uu=hw;const dw=gt,pw=(t,e,r)=>dw(t,e,r)<=0;var lu=pw;const bw=sp,gw=op,yw=Ls,vw=uu,mw=cu,_w=lu,ww=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return bw(t,r,n);case"!=":return gw(t,r,n);case">":return yw(t,r,n);case">=":return vw(t,r,n);case"<":return mw(t,r,n);case"<=":return _w(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};var ap=ww;const Sw=qe,Ew=In,{safeRe:Di,t:ji}=gi,Cw=(t,e)=>{if(t instanceof Sw)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(Di[ji.COERCE]);else{let n;for(;(n=Di[ji.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),Di[ji.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;Di[ji.COERCERTL].lastIndex=-1}return r===null?null:Ew(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)};var xw=Cw,La,ff;function Iw(){return ff||(ff=1,La=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),La}var Rw=ae;ae.Node=Sr;ae.create=ae;function ae(t){var e=this;if(e instanceof ae||(e=new ae),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r1)r=e;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=t(r,n.value,i),n=n.next;return r};ae.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=t(r,n.value,i),n=n.prev;return r};ae.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};ae.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};ae.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new ae;if(ethis.length&&(e=this.length);for(var n=0,i=this.head;i!==null&&nthis.length&&(e=this.length);for(var n=this.length,i=this.tail;i!==null&&n>e;n--)i=i.prev;for(;i!==null&&n>t;n--,i=i.prev)r.push(i.value);return r};ae.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,i=this.head;i!==null&&n1;class Ow{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[dr]=e.max||1/0;const r=e.length||Pa;if(this[Wr]=typeof r!="function"?Pa:r,this[zn]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[yr]=e.maxAge||0,this[Lt]=e.dispose,this[hf]=e.noDisposeOnSet||!1,this[cp]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[dr]=e||1/0,Pn(this)}get max(){return this[dr]}set allowStale(e){this[zn]=!!e}get allowStale(){return this[zn]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[yr]=e,Pn(this)}get maxAge(){return this[yr]}set lengthCalculator(e){typeof e!="function"&&(e=Pa),e!==this[Wr]&&(this[Wr]=e,this[Dt]=0,this[ke].forEach(r=>{r.length=this[Wr](r.value,r.key),this[Dt]+=r.length})),Pn(this)}get lengthCalculator(){return this[Wr]}get length(){return this[Dt]}get itemCount(){return this[ke].length}rforEach(e,r){r=r||this;for(let n=this[ke].tail;n!==null;){const i=n.prev;df(this,e,n,r),n=i}}forEach(e,r){r=r||this;for(let n=this[ke].head;n!==null;){const i=n.next;df(this,e,n,r),n=i}}keys(){return this[ke].toArray().map(e=>e.key)}values(){return this[ke].toArray().map(e=>e.value)}reset(){this[Lt]&&this[ke]&&this[ke].length&&this[ke].forEach(e=>this[Lt](e.key,e.value)),this[ht]=new Map,this[ke]=new Tw,this[Dt]=0}dump(){return this[ke].map(e=>ss(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[ke]}set(e,r,n){if(n=n||this[yr],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const i=n?Date.now():0,s=this[Wr](r,e);if(this[ht].has(e)){if(s>this[dr])return Xr(this,this[ht].get(e)),!1;const c=this[ht].get(e).value;return this[Lt]&&(this[hf]||this[Lt](e,c.value)),c.now=i,c.maxAge=n,c.value=r,this[Dt]+=s-c.length,c.length=s,this.get(e),Pn(this),!0}const o=new Nw(e,r,s,i,n);return o.length>this[dr]?(this[Lt]&&this[Lt](e,r),!1):(this[Dt]+=o.length,this[ke].unshift(o),this[ht].set(e,this[ke].head),Pn(this),!0)}has(e){if(!this[ht].has(e))return!1;const r=this[ht].get(e).value;return!ss(this,r)}get(e){return $a(this,e,!0)}peek(e){return $a(this,e,!1)}pop(){const e=this[ke].tail;return e?(Xr(this,e),e.value):null}del(e){Xr(this,this[ht].get(e))}load(e){this.reset();const r=Date.now();for(let n=e.length-1;n>=0;n--){const i=e[n],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-r;o>0&&this.set(i.k,i.v,o)}}}prune(){this[ht].forEach((e,r)=>$a(this,r,!1))}}const $a=(t,e,r)=>{const n=t[ht].get(e);if(n){const i=n.value;if(ss(t,i)){if(Xr(t,n),!t[zn])return}else r&&(t[cp]&&(n.value.now=Date.now()),t[ke].unshiftNode(n));return i.value}},ss=(t,e)=>{if(!e||!e.maxAge&&!t[yr])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[yr]&&r>t[yr]},Pn=t=>{if(t[Dt]>t[dr])for(let e=t[ke].tail;t[Dt]>t[dr]&&e!==null;){const r=e.prev;Xr(t,e),e=r}},Xr=(t,e)=>{if(e){const r=e.value;t[Lt]&&t[Lt](r.key,r.value),t[Dt]-=r.length,t[ht].delete(r.key),t[ke].removeNode(e)}};class Nw{constructor(e,r,n,i,s){this.key=e,this.value=r,this.length=n,this.now=i,this.maxAge=s||0}}const df=(t,e,r,n)=>{let i=r.value;ss(t,i)&&(Xr(t,r),t[zn]||(i=void 0)),i&&e.call(n,i.value,i.key,t)};var Lw=Ow,Da,pf;function yt(){if(pf)return Da;pf=1;class t{constructor(M,N){if(N=n(N),M instanceof t)return M.loose===!!N.loose&&M.includePrerelease===!!N.includePrerelease?M:new t(M.raw,N);if(M instanceof i)return this.raw=M.value,this.set=[[M]],this.format(),this;if(this.options=N,this.loose=!!N.loose,this.includePrerelease=!!N.includePrerelease,this.raw=M.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(L=>this.parseRange(L.trim())).filter(L=>L.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const L=this.set[0];if(this.set=this.set.filter(B=>!v(B[0])),this.set.length===0)this.set=[L];else if(this.set.length>1){for(const B of this.set)if(B.length===1&&E(B[0])){this.set=[B];break}}}this.format()}format(){return this.range=this.set.map(M=>M.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(M){const L=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+M,B=r.get(L);if(B)return B;const D=this.options.loose,H=D?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];M=M.replace(H,ce(this.options.includePrerelease)),s("hyphen replace",M),M=M.replace(a[c.COMPARATORTRIM],u),s("comparator trim",M),M=M.replace(a[c.TILDETRIM],l),s("tilde trim",M),M=M.replace(a[c.CARETTRIM],f),s("caret trim",M);let Y=M.split(" ").map(le=>d(le,this.options)).join(" ").split(/\s+/).map(le=>U(le,this.options));D&&(Y=Y.filter(le=>(s("loose invalid filter",le,this.options),!!le.match(a[c.COMPARATORLOOSE])))),s("range list",Y);const J=new Map,se=Y.map(le=>new i(le,this.options));for(const le of se){if(v(le))return[le];J.set(le.value,le)}J.size>1&&J.has("")&&J.delete("");const he=[...J.values()];return r.set(L,he),he}intersects(M,N){if(!(M instanceof t))throw new TypeError("a Range is required");return this.set.some(L=>_(L,N)&&M.set.some(B=>_(B,N)&&L.every(D=>B.every(H=>D.intersects(H,N)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new o(M,this.options)}catch{return!1}for(let N=0;NR.value==="<0.0.0-0",E=R=>R.value==="",_=(R,M)=>{let N=!0;const L=R.slice();let B=L.pop();for(;N&&L.length;)N=L.every(D=>B.intersects(D,M)),B=L.pop();return N},d=(R,M)=>(s("comp",R,M),R=C(R,M),s("caret",R),R=m(R,M),s("tildes",R),R=j(R,M),s("xrange",R),R=A(R,M),s("stars",R),R),y=R=>!R||R.toLowerCase()==="x"||R==="*",m=(R,M)=>R.trim().split(/\s+/).map(N=>x(N,M)).join(" "),x=(R,M)=>{const N=M.loose?a[c.TILDELOOSE]:a[c.TILDE];return R.replace(N,(L,B,D,H,Y)=>{s("tilde",R,L,B,D,H,Y);let J;return y(B)?J="":y(D)?J=`>=${B}.0.0 <${+B+1}.0.0-0`:y(H)?J=`>=${B}.${D}.0 <${B}.${+D+1}.0-0`:Y?(s("replaceTilde pr",Y),J=`>=${B}.${D}.${H}-${Y} <${B}.${+D+1}.0-0`):J=`>=${B}.${D}.${H} <${B}.${+D+1}.0-0`,s("tilde return",J),J})},C=(R,M)=>R.trim().split(/\s+/).map(N=>T(N,M)).join(" "),T=(R,M)=>{s("caret",R,M);const N=M.loose?a[c.CARETLOOSE]:a[c.CARET],L=M.includePrerelease?"-0":"";return R.replace(N,(B,D,H,Y,J)=>{s("caret",R,B,D,H,Y,J);let se;return y(D)?se="":y(H)?se=`>=${D}.0.0${L} <${+D+1}.0.0-0`:y(Y)?D==="0"?se=`>=${D}.${H}.0${L} <${D}.${+H+1}.0-0`:se=`>=${D}.${H}.0${L} <${+D+1}.0.0-0`:J?(s("replaceCaret pr",J),D==="0"?H==="0"?se=`>=${D}.${H}.${Y}-${J} <${D}.${H}.${+Y+1}-0`:se=`>=${D}.${H}.${Y}-${J} <${D}.${+H+1}.0-0`:se=`>=${D}.${H}.${Y}-${J} <${+D+1}.0.0-0`):(s("no pr"),D==="0"?H==="0"?se=`>=${D}.${H}.${Y}${L} <${D}.${H}.${+Y+1}-0`:se=`>=${D}.${H}.${Y}${L} <${D}.${+H+1}.0-0`:se=`>=${D}.${H}.${Y} <${+D+1}.0.0-0`),s("caret return",se),se})},j=(R,M)=>(s("replaceXRanges",R,M),R.split(/\s+/).map(N=>$(N,M)).join(" ")),$=(R,M)=>{R=R.trim();const N=M.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return R.replace(N,(L,B,D,H,Y,J)=>{s("xRange",R,L,B,D,H,Y,J);const se=y(D),he=se||y(H),le=he||y(Y),We=le;return B==="="&&We&&(B=""),J=M.includePrerelease?"-0":"",se?B===">"||B==="<"?L="<0.0.0-0":L="*":B&&We?(he&&(H=0),Y=0,B===">"?(B=">=",he?(D=+D+1,H=0,Y=0):(H=+H+1,Y=0)):B==="<="&&(B="<",he?D=+D+1:H=+H+1),B==="<"&&(J="-0"),L=`${B+D}.${H}.${Y}${J}`):he?L=`>=${D}.0.0${J} <${+D+1}.0.0-0`:le&&(L=`>=${D}.${H}.0${J} <${D}.${+H+1}.0-0`),s("xRange return",L),L})},A=(R,M)=>(s("replaceStars",R,M),R.trim().replace(a[c.STAR],"")),U=(R,M)=>(s("replaceGTE0",R,M),R.trim().replace(a[M.includePrerelease?c.GTE0PRE:c.GTE0],"")),ce=R=>(M,N,L,B,D,H,Y,J,se,he,le,We,w)=>(y(L)?N="":y(B)?N=`>=${L}.0.0${R?"-0":""}`:y(D)?N=`>=${L}.${B}.0${R?"-0":""}`:H?N=`>=${N}`:N=`>=${N}${R?"-0":""}`,y(se)?J="":y(he)?J=`<${+se+1}.0.0-0`:y(le)?J=`<${se}.${+he+1}.0-0`:We?J=`<=${se}.${he}.${le}-${We}`:R?J=`<${se}.${he}.${+le+1}-0`:J=`<=${J}`,`${N} ${J}`.trim()),Z=(R,M,N)=>{for(let L=0;L0){const B=R[L].semver;if(B.major===M.major&&B.minor===M.minor&&B.patch===M.patch)return!0}return!1}return!0};return Da}var ja,bf;function Ps(){if(bf)return ja;bf=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(l,f){if(f=r(f),l instanceof e){if(l.loose===!!f.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),o("comparator",l,f),this.options=f,this.loose=!!f.loose,this.parse(l),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(l){const f=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],h=l.match(f);if(!h)throw new TypeError(`Invalid comparator: ${l}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=""),h[2]?this.semver=new a(h[2],this.options.loose):this.semver=t}toString(){return this.value}test(l){if(o("Comparator.test",l,this.options.loose),this.semver===t||l===t)return!0;if(typeof l=="string")try{l=new a(l,this.options)}catch{return!1}return s(l,this.operator,this.semver,this.options)}intersects(l,f){if(!(l instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(l.value,f).test(this.value):l.operator===""?l.value===""?!0:new c(this.value,f).test(l.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||s(this.semver,"<",l.semver,f)&&this.operator.startsWith(">")&&l.operator.startsWith("<")||s(this.semver,">",l.semver,f)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}ja=e;const r=ou,{safeRe:n,t:i}=gi,s=ap,o=Ns,a=qe,c=yt();return ja}const Pw=yt(),$w=(t,e,r)=>{try{e=new Pw(e,r)}catch{return!1}return e.test(t)};var $s=$w;const Dw=yt(),jw=(t,e)=>new Dw(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Bw=jw;const Fw=qe,Ww=yt(),Hw=(t,e,r)=>{let n=null,i=null,s=null;try{s=new Ww(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Fw(n,r))}),n};var Vw=Hw;const Uw=qe,zw=yt(),qw=(t,e,r)=>{let n=null,i=null,s=null;try{s=new zw(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Uw(n,r))}),n};var Gw=qw;const Ba=qe,Jw=yt(),gf=Ls,Qw=(t,e)=>{t=new Jw(t,e);let r=new Ba("0.0.0");if(t.test(r)||(r=new Ba("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{const a=new Ba(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||gf(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||gf(r,s))&&(r=s)}return r&&t.test(r)?r:null};var Zw=Qw;const Yw=yt(),Kw=(t,e)=>{try{return new Yw(t,e).range||"*"}catch{return null}};var Xw=Kw;const eS=qe,up=Ps(),{ANY:tS}=up,rS=yt(),nS=$s,yf=Ls,vf=cu,iS=lu,sS=uu,oS=(t,e,r,n)=>{t=new eS(t,n),e=new rS(e,n);let i,s,o,a,c;switch(r){case">":i=yf,s=iS,o=vf,a=">",c=">=";break;case"<":i=vf,s=sS,o=yf,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(nS(t,e,n))return!1;for(let u=0;u{p.semver===tS&&(p=new up(">=0.0.0")),f=f||p,h=h||p,i(p.semver,f.semver,n)?f=p:o(p.semver,h.semver,n)&&(h=p)}),f.operator===a||f.operator===c||(!h.operator||h.operator===a)&&s(t,h.semver))return!1;if(h.operator===c&&o(t,h.semver))return!1}return!0};var fu=oS;const aS=fu,cS=(t,e,r)=>aS(t,e,">",r);var uS=cS;const lS=fu,fS=(t,e,r)=>lS(t,e,"<",r);var hS=fS;const mf=yt(),dS=(t,e,r)=>(t=new mf(t,r),e=new mf(e,r),t.intersects(e,r));var pS=dS;const bS=$s,gS=gt;var yS=(t,e,r)=>{const n=[];let i=null,s=null;const o=t.sort((l,f)=>gS(l,f,r));for(const l of o)bS(l,e,r)?(s=l,i||(i=l)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const a=[];for(const[l,f]of n)l===f?a.push(l):!f&&l===o[0]?a.push("*"):f?l===o[0]?a.push(`<=${f}`):a.push(`${l} - ${f}`):a.push(`>=${l}`);const c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length{if(t===e)return!0;t=new _f(t,r),e=new _f(e,r);let n=!1;e:for(const i of t.set){for(const s of e.set){const o=_S(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},mS=[new hu(">=0.0.0-0")],wf=[new hu(">=0.0.0")],_S=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Fa){if(e.length===1&&e[0].semver===Fa)return!0;r.includePrerelease?t=mS:t=wf}if(e.length===1&&e[0].semver===Fa){if(r.includePrerelease)return!0;e=wf}const n=new Set;let i,s;for(const p of t)p.operator===">"||p.operator===">="?i=Sf(i,p,r):p.operator==="<"||p.operator==="<="?s=Ef(s,p,r):n.add(p.semver);if(n.size>1)return null;let o;if(i&&s){if(o=du(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const p of n){if(i&&!$n(p,String(i),r)||s&&!$n(p,String(s),r))return null;for(const v of e)if(!$n(p,String(v),r))return!1;return!0}let a,c,u,l,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(const p of e){if(l=l||p.operator===">"||p.operator===">=",u=u||p.operator==="<"||p.operator==="<=",i){if(h&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===h.major&&p.semver.minor===h.minor&&p.semver.patch===h.patch&&(h=!1),p.operator===">"||p.operator===">="){if(a=Sf(i,p,r),a===p&&a!==i)return!1}else if(i.operator===">="&&!$n(i.semver,String(p),r))return!1}if(s){if(f&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch&&(f=!1),p.operator==="<"||p.operator==="<="){if(c=Ef(s,p,r),c===p&&c!==s)return!1}else if(s.operator==="<="&&!$n(s.semver,String(p),r))return!1}if(!p.operator&&(s||i)&&o!==0)return!1}return!(i&&u&&!s&&o!==0||s&&l&&!i&&o!==0||h||f)},Sf=(t,e,r)=>{if(!t)return e;const n=du(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Ef=(t,e,r)=>{if(!t)return e;const n=du(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};var wS=vS;const Wa=gi,Cf=Os,SS=qe,xf=ip,ES=In,CS=E_,xS=I_,IS=A_,RS=k_,AS=N_,MS=$_,kS=B_,TS=H_,OS=gt,NS=q_,LS=Q_,PS=au,$S=X_,DS=rw,jS=Ls,BS=cu,FS=sp,WS=op,HS=uu,VS=lu,US=ap,zS=xw,qS=Ps(),GS=yt(),JS=$s,QS=Bw,ZS=Vw,YS=Gw,KS=Zw,XS=Xw,e2=fu,t2=uS,r2=hS,n2=pS,i2=yS,s2=wS;var o2={parse:ES,valid:CS,clean:xS,inc:IS,diff:RS,major:AS,minor:MS,patch:kS,prerelease:TS,compare:OS,rcompare:NS,compareLoose:LS,compareBuild:PS,sort:$S,rsort:DS,gt:jS,lt:BS,eq:FS,neq:WS,gte:HS,lte:VS,cmp:US,coerce:zS,Comparator:qS,Range:GS,satisfies:JS,toComparators:QS,maxSatisfying:ZS,minSatisfying:YS,minVersion:KS,validRange:XS,outside:e2,gtr:t2,ltr:r2,intersects:n2,simplifyRange:i2,subset:s2,SemVer:SS,re:Wa.re,src:Wa.src,tokens:Wa.t,SEMVER_SPEC_VERSION:Cf.SEMVER_SPEC_VERSION,RELEASE_TYPES:Cf.RELEASE_TYPES,compareIdentifiers:xf.compareIdentifiers,rcompareIdentifiers:xf.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=o2,r=Or,n=$e;t.VersionStruct=(0,r.refine)((0,r.string)(),"Version",f=>(0,e.valid)(f)===null?`Expected SemVer version, got "${f}"`:!0),t.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",f=>(0,e.validRange)(f)===null?`Expected SemVer range, got "${f}"`:!0);function i(f){return(0,r.is)(f,t.VersionStruct)}t.isValidSemVerVersion=i;function s(f){return(0,r.is)(f,t.VersionRangeStruct)}t.isValidSemVerRange=s;function o(f){(0,n.assertStruct)(f,t.VersionStruct)}t.assertIsSemVerVersion=o;function a(f){(0,n.assertStruct)(f,t.VersionRangeStruct)}t.assertIsSemVerRange=a;function c(f,h){return(0,e.gt)(f,h)}t.gtVersion=c;function u(f,h){return(0,e.gtr)(f,h)}t.gtRange=u;function l(f,h){return(0,e.satisfies)(f,h,{includePrerelease:!0})}t.satisfiesVersionRange=l})(tp);(function(t){var e=F&&F.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=F&&F.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r($e,t),r(pi,t),r(oe,t),r(ks,t),r(Rt,t),r(cn,t),r(bi,t),r(Kd,t),r(un,t),r(su,t),r(At,t),r(Xd,t),r(ep,t),r(tp,t)})(Nd);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=Nd;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(Od);var lp=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(As,"__esModule",{value:!0});As.PollingBlockTracker=void 0;const a2=lp(Qc),c2=lp(Mm),u2=hi,If=Od,Rf=(0,If.createModuleLogger)(If.projectLogger,"polling-block-tracker"),l2=(0,a2.default)(),f2=1e3;class h2 extends u2.BaseBlockTracker{constructor(e={}){var r;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:(r=e.blockResetDuration)!==null&&r!==void 0?r:e.pollingInterval}),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*f2,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const r=Af(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block: +${(e=r.stack)!==null&&e!==void 0?e:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=Af(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:l2(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),Rf("Making request",e);const r=await(0,c2.default)(n=>this._provider.sendAsync(e,n))();if(Rf("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block: +${r.error.message}`);return r.result}}As.PollingBlockTracker=h2;function Af(t,e){return new Promise(r=>{const n=setTimeout(r,t);n.unref&&e&&n.unref()})}var Ds={},d2=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ds,"__esModule",{value:!0});Ds.SubscribeBlockTracker=void 0;const p2=d2(Qc),b2=hi,g2=(0,p2.default)();class y2 extends b2.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:g2(),method:e,params:r,jsonrpc:"2.0"},(s,o)=>{s?i(s):n(o.result)})})}_handleSubData(e,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}Ds.SubscribeBlockTracker=y2;var fp={};Object.defineProperty(fp,"__esModule",{value:!0});(function(t){var e=F&&F.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=F&&F.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(As,t),r(Ds,t),r(fp,t)})(Td);var pu={},js={},yi={};Object.defineProperty(yi,"__esModule",{value:!0});yi.getUniqueId=void 0;const hp=4294967295;let Ha=Math.floor(Math.random()*hp);function v2(){return Ha=(Ha+1)%hp,Ha}yi.getUniqueId=v2;Object.defineProperty(js,"__esModule",{value:!0});js.createIdRemapMiddleware=void 0;const m2=yi;function _2(){return(t,e,r,n)=>{const i=t.id,s=m2.getUniqueId();t.id=s,e.id=s,r(o=>{t.id=i,e.id=i,o()})}}js.createIdRemapMiddleware=_2;var Bs={};Object.defineProperty(Bs,"__esModule",{value:!0});Bs.createAsyncMiddleware=void 0;function w2(t){return async(e,r,n,i)=>{let s;const o=new Promise(l=>{s=l});let a=null,c=!1;const u=async()=>{c=!0,n(l=>{a=l,s()}),await o};try{await t(e,r,u),c?(await o,a(null)):i(null)}catch(l){a?a(l):i(l)}}}Bs.createAsyncMiddleware=w2;var Fs={};Object.defineProperty(Fs,"__esModule",{value:!0});Fs.createScaffoldMiddleware=void 0;function S2(t){return(e,r,n,i)=>{const s=t[e.method];return s===void 0?n():typeof s=="function"?s(e,r,n,i):(r.result=s,i())}}Fs.createScaffoldMiddleware=S2;var vi={},E2=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vi,"__esModule",{value:!0});vi.JsonRpcEngine=void 0;const C2=E2(Ir),et=Pc;class Pt extends C2.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?r?this._handleBatch(e,r):this._handleBatch(e):r?this._handle(e,r):this._promiseHandle(e)}asMiddleware(){return async(e,r,n,i)=>{try{const[s,o,a]=await Pt._runAllMiddleware(e,r,this._middleware);return o?(await Pt._runReturnHandlers(a),i(s)):n(async c=>{try{await Pt._runReturnHandlers(a)}catch(u){return c(u)}return c()})}catch(s){return i(s)}}}async _handleBatch(e,r){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(e){return new Promise(r=>{this._handle(e,(n,i)=>{r(i)})})}async _handle(e,r){if(!e||Array.isArray(e)||typeof e!="object"){const o=new et.EthereumRpcError(et.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof e.method!="string"){const o=new et.EthereumRpcError(et.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return r(o,{id:e.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},e),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(o){s=o}return s&&(delete i.result,i.error||(i.error=et.serializeError(s))),r(s,i)}async _processRequest(e,r){const[n,i,s]=await Pt._runAllMiddleware(e,r,this._middleware);if(Pt._checkForCompletion(e,r,i),await Pt._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(e,r,n){const i=[];let s=null,o=!1;for(const a of n)if([s,o]=await Pt._runMiddleware(e,r,a,i),o)break;return[s,o,i.reverse()]}static _runMiddleware(e,r,n,i){return new Promise(s=>{const o=c=>{const u=c||r.error;u&&(r.error=et.serializeError(u)),s([u,!0])},a=c=>{r.error?o(r.error):(c&&(typeof c!="function"&&o(new et.EthereumRpcError(et.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof c}" for request: +${Va(e)}`,{request:e})),i.push(c)),s([null,!1]))};try{n(e,r,a,o)}catch(c){o(c)}})}static async _runReturnHandlers(e){for(const r of e)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(e,r,n){if(!("result"in r)&&!("error"in r))throw new et.EthereumRpcError(et.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request: +${Va(e)}`,{request:e});if(!n)throw new et.EthereumRpcError(et.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request: +${Va(e)}`,{request:e})}}vi.JsonRpcEngine=Pt;function Va(t){return JSON.stringify(t,null,2)}var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.mergeMiddleware=void 0;const x2=vi;function I2(t){const e=new x2.JsonRpcEngine;return t.forEach(r=>e.push(r)),e.asMiddleware()}Ws.mergeMiddleware=I2;(function(t){var e=F&&F.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=F&&F.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(js,t),r(Bs,t),r(Fs,t),r(yi,t),r(vi,t),r(Ws,t)})(pu);var dp={},bu={};const gu=xr(D0);var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});var Mf=gu,R2=function(){function t(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return t.prototype.acquire=function(){var e=this,r=this.isLocked(),n=new Promise(function(i){return e._queue.push(i)});return r||this._dispatch(),n},t.prototype.runExclusive=function(e){return Mf.__awaiter(this,void 0,void 0,function(){var r,n,i;return Mf.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,e(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},t.prototype._dispatch=function(){var e=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},r([this._value--,this._currentReleaser])}},t}();Hs.default=R2;Object.defineProperty(bu,"__esModule",{value:!0});var kf=gu,A2=Hs,M2=function(){function t(){this._semaphore=new A2.default(1)}return t.prototype.acquire=function(){return kf.__awaiter(this,void 0,void 0,function(){var e,r;return kf.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=n.sent(),r=e[1],[2,r]}})})},t.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();bu.default=M2;var Vs={};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.withTimeout=void 0;var Bi=gu;function k2(t,e,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return Bi.__awaiter(n,void 0,void 0,function(){var o,a,c;return Bi.__generator(this,function(u){switch(u.label){case 0:return o=!1,setTimeout(function(){o=!0,s(r)},e),[4,t.acquire()];case 1:return a=u.sent(),o?(c=Array.isArray(a)?a[1]:a,c()):i(a),[2]}})})})},runExclusive:function(i){return Bi.__awaiter(this,void 0,void 0,function(){var s,o;return Bi.__generator(this,function(a){switch(a.label){case 0:s=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return o=a.sent(),Array.isArray(o)?(s=o[1],[4,i(o[0])]):[3,4];case 3:return[2,a.sent()];case 4:return s=o,[4,i()];case 5:return[2,a.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){t.release()},isLocked:function(){return t.isLocked()}}}Vs.withTimeout=k2;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=t.Semaphore=t.Mutex=void 0;var e=bu;Object.defineProperty(t,"Mutex",{enumerable:!0,get:function(){return e.default}});var r=Hs;Object.defineProperty(t,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Vs;Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(dp);var T2=N2,O2=Object.prototype.hasOwnProperty;function N2(){for(var t={},e=0;efunction(...i){const s=e.promiseModule;return new s((o,a)=>{e.multiArgs?i.push((...u)=>{e.errorFirst?u[0]?a(u):(u.shift(),o(u)):o(u)}):e.errorFirst?i.push((u,l)=>{u?a(u):o(l)}):i.push(o),Reflect.apply(t,this===r?n:this,i)})},Of=new WeakMap;var j2=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);const n=(o,a)=>{let c=Of.get(o);if(c||(c={},Of.set(o,c)),a in c)return c[a];const u=v=>typeof v=="string"||typeof a=="symbol"?a===v:v.test(a),l=Reflect.getOwnPropertyDescriptor(o,a),f=l===void 0||l.writable||l.configurable,p=(e.include?e.include.some(u):!e.exclude.some(u))&&f;return c[a]=p,p},i=new WeakMap,s=new Proxy(t,{apply(o,a,c){const u=i.get(o);if(u)return Reflect.apply(u,a,c);const l=e.excludeMain?o:Tf(o,e,s,o);return i.set(o,l),Reflect.apply(l,a,c)},get(o,a){const c=o[a];if(!n(o,a)||c===Function.prototype[a])return c;const u=i.get(c);if(u)return u;if(typeof c=="function"){const l=Tf(c,e,s,o);return i.set(c,l),l}return c}});return s};const B2=Ir.default;let F2=class extends B2{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(r=>this.emit("update",r))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};var yu=F2;const W2=yu;let H2=class extends W2{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}};var V2=H2,_i={minBlockRef:U2,maxBlockRef:z2,sortBlockRefs:vu,bnToHex:q2,blockRefIsNumber:G2,hexToInt:os,incrementHexInt:J2,intToHex:pp,unsafeRandomBytes:Q2};function U2(...t){return vu(t)[0]}function z2(...t){const e=vu(t);return e[e.length-1]}function vu(t){return t.sort((e,r)=>e==="latest"||r==="earliest"?1:r==="latest"||e==="earliest"?-1:os(e)-os(r))}function q2(t){return"0x"+t.toString(16)}function G2(t){return t&&!["earliest","latest","pending"].includes(t)}function os(t){return t==null?t:Number.parseInt(t,16)}function J2(t){if(t==null)return t;const e=os(t);return pp(e+1)}function pp(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function Q2(t){let e="0x";for(let r=0;rn.toLowerCase()))}async initialize({currentBlock:e}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=e),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=eE(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:e,newBlock:r}){const n=r;let i;e?i=X2(e):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),a=(await this._fetchLogs(s)).filter(c=>this.matchLog(c));this.addResults(a)}async _fetchLogs(e){return await Y2(n=>this.ethQuery.getLogs(e,n))()}matchLog(e){if(Fi(this.params.fromBlock)>=Fi(e.blockNumber)||tE(this.params.toBlock)&&Fi(this.params.toBlock)<=Fi(e.blockNumber))return!1;const r=e.address&&e.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let o=e.topics[s];if(!o)return!1;o=o.toLowerCase();let a=Array.isArray(i)?i:[i];return a.includes(null)?!0:(a=a.map(l=>l.toLowerCase()),a.includes(o))})}};var nE=rE,mu=iE;async function iE({provider:t,fromBlock:e,toBlock:r}){e||(e=r);const n=Lf(e),s=Lf(r)-n+1,o=Array(s).fill().map((c,u)=>n+u).map(sE);return await Promise.all(o.map(c=>aE(t,"eth_getBlockByNumber",[c,!1])))}function Lf(t){return t==null?t:Number.parseInt(t,16)}function sE(t){return t==null?t:"0x"+t.toString(16)}function oE(t,e){return new Promise((r,n)=>{t.sendAsync(e,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function aE(t,e,r){for(let n=0;n<3;n++)try{return await oE(t,{id:1,jsonrpc:"2.0",method:e,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}throw new Error(`Block not found for params: ${JSON.stringify(r)}`)}const cE=yu,uE=mu,{incrementHexInt:lE}=_i;let fE=class extends cE{constructor({provider:e,params:r}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:r}){const n=r,i=lE(e),o=(await uE({provider:this.provider,fromBlock:i,toBlock:n})).map(a=>a.hash);this.addResults(o)}};var hE=fE;const dE=yu,pE=mu,{incrementHexInt:bE}=_i;let gE=class extends dE{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const r=e,n=bE(e),i=await pE({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const o of i)s.push(...o.transactions);this.addResults(s)}};var yE=gE;const vE=dp.Mutex,{createAsyncMiddleware:mE,createScaffoldMiddleware:_E}=pu,wE=nE,SE=hE,EE=yE,{intToHex:bp,hexToInt:Ua}=_i;var CE=xE;function xE({blockTracker:t,provider:e}){let r=0,n={};const i=new vE,s=IE({mutex:i}),o=_E({eth_newFilter:s(za(c)),eth_newBlockFilter:s(za(u)),eth_newPendingTransactionFilter:s(za(l)),eth_uninstallFilter:s(Qi(p)),eth_getFilterChanges:s(Qi(f)),eth_getFilterLogs:s(Qi(h))}),a=async({oldBlock:y,newBlock:m})=>{if(n.length===0)return;const x=await i.acquire();try{await Promise.all(Hr(n).map(async C=>{try{await C.update({oldBlock:y,newBlock:m})}catch(T){console.error(T)}}))}catch(C){console.error(C)}x()};return o.newLogFilter=c,o.newBlockFilter=u,o.newPendingTransactionFilter=l,o.uninstallFilter=p,o.getFilterChanges=f,o.getFilterLogs=h,o.destroy=()=>{_()},o;async function c(y){const m=new wE({provider:e,params:y});return await v(m),m}async function u(){const y=new SE({provider:e});return await v(y),y}async function l(){const y=new EE({provider:e});return await v(y),y}async function f(y){const m=Ua(y),x=n[m];if(!x)throw new Error(`No filter for index "${m}"`);return x.getChangesAndClear()}async function h(y){const m=Ua(y),x=n[m];if(!x)throw new Error(`No filter for index "${m}"`);let C=[];return x.type==="log"&&(C=x.getAllResults()),C}async function p(y){const m=Ua(y),C=!!n[m];return C&&await E(m),C}async function v(y){const m=Hr(n).length,x=await t.getLatestBlock();await y.initialize({currentBlock:x}),r++,n[r]=y,y.id=r,y.idHex=bp(r);const C=Hr(n).length;return d({prevFilterCount:m,newFilterCount:C}),r}async function E(y){const m=Hr(n).length;delete n[y];const x=Hr(n).length;d({prevFilterCount:m,newFilterCount:x})}async function _(){const y=Hr(n).length;n={},d({prevFilterCount:y,newFilterCount:0})}function d({prevFilterCount:y,newFilterCount:m}){if(y===0&&m>0){t.on("sync",a);return}if(y>0&&m===0){t.removeListener("sync",a);return}}}function za(t){return Qi(async(...e)=>{const r=await t(...e);return bp(r.id)})}function Qi(t){return mE(async(e,r)=>{const n=await t.apply(null,e.params);r.result=n})}function IE({mutex:t}){return e=>async(r,n,i,s)=>{(await t.acquire())(),e(r,n,i,s)}}function Hr(t,e){const r=[];for(let n in t)r.push(t[n]);return r}const RE=Ir.default,{createAsyncMiddleware:Pf,createScaffoldMiddleware:AE}=pu,ME=CE,{unsafeRandomBytes:kE,incrementHexInt:TE}=_i,OE=mu;var NE=LE;function LE({blockTracker:t,provider:e}){const r={},n=ME({blockTracker:t,provider:e});let i=!1;const s=new RE,o=AE({eth_subscribe:Pf(a),eth_unsubscribe:Pf(c)});return o.destroy=l,{events:s,middleware:o};async function a(f,h){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const p=f.params[0],v=kE(16);let E;switch(p){case"newHeads":E=_({subId:v});break;case"logs":const y=f.params[1],m=await n.newLogFilter(y);E=d({subId:v,filter:m});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${p}"`)}r[v]=E,h.result=v;return;function _({subId:y}){const m={type:p,destroy:async()=>{t.removeListener("sync",m.update)},update:async({oldBlock:x,newBlock:C})=>{const T=C,j=TE(x);(await OE({provider:e,fromBlock:j,toBlock:T})).map(PE).filter(U=>U!==null).forEach(U=>{u(y,U)})}};return t.on("sync",m.update),m}function d({subId:y,filter:m}){return m.on("update",C=>u(y,C)),{type:p,destroy:async()=>await n.uninstallFilter(m.idHex)}}}async function c(f,h){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const p=f.params[0],v=r[p];if(!v){h.result=!1;return}delete r[p],await v.destroy(),h.result=!0}function u(f,h){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:f,result:h}})}function l(){s.removeAllListeners();for(const f in r)r[f].destroy(),delete r[f];i=!0}}function PE(t){return t==null?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(Rs,"__esModule",{value:!0});Rs.SubscriptionManager=void 0;const $E=Td,DE=NE,$f=()=>{};class jE{constructor(e){const r=new $E.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=DE({blockTracker:r,provider:e});this.events=n,this.subscriptionMiddleware=i}async handleRequest(e){const r={};return await this.subscriptionMiddleware(e,r,$f,$f),r}destroy(){this.subscriptionMiddleware.destroy()}}Rs.SubscriptionManager=jE;var _u=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(tn,"__esModule",{value:!0});tn.CoinbaseWalletProvider=void 0;const BE=_u(Ir),FE=_u(ds),qa=vn,de=ni,Df=_n,jf=pt,Ga=ms,WE=be,X=W,Ja=_u(Cm),HE=an,ue=kd,VE=Rs,Bf="DefaultChainId",Ff="DefaultJsonRpcUrl";class UE extends BE.default{constructor(e){var r,n;super(),this._filterPolyfill=new HE.FilterPolyfill(this),this._subscriptionManager=new VE.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=e.qrUrl;const i=this.getChainId(),s=(0,X.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(jf.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(c=>(0,X.ensureAddressString)(c)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",a=>{var c;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"){if(a.data.data.action==="dappChainSwitched"){const u=a.data.data.chainId,l=(c=a.data.data.jsonRpcUrl)!==null&&c!==void 0?c:this.jsonRpcUrl;this.updateProviderInfo(l,Number(u))}a.data.data.action==="addressChanged"&&this._setAddresses([a.data.data.address])}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,X.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(Ff))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(Ff,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,r){this.jsonRpcUrl=e;const n=this.getChainId();this._storage.setItem(Bf,r.toString(10)),((0,X.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,s,o){return!!(await(await this.initializeRelay()).watchAsset(e,r,n,i,s,o==null?void 0:o.toString()).promise).result}async addEthereumChain(e,r,n,i,s,o){var a,c;if((0,X.ensureIntNumber)(e)===this.getChainId())return!1;const u=await this.initializeRelay(),l=u.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!l&&await u.requestEthereumAccounts().promise;const f=await u.addEthereumChain(e.toString(),r,s,n,i,o).promise;return((a=f.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],e),((c=f.result)===null||c===void 0?void 0:c.isApproved)===!0}async switchEthereumChain(e){const n=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,WE.isErrorResponse)(n)&&n.errorCode)throw n.errorCode===de.standardErrorCodes.provider.unsupportedChain?de.standardErrors.provider.unsupportedChain(e):de.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode});const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,r){this.initializeRelay().then(n=>n.setAppInfo(e,r))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(qa.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?Df.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send(ue.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(e,r){try{const n=this._send(e,r);if(n instanceof Promise)return n.catch(i=>{throw(0,de.serializeError)(i,e)})}catch(n){throw(0,de.serializeError)(n,e)}}_send(e,r){if(typeof e=="string"){const i=e,s=Array.isArray(r)?r:r!==void 0?[r]:[],o={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(o).then(a=>a.result)}if(typeof r=="function"){const i=e,s=r;return this._sendAsync(i,s)}if(Array.isArray(e))return e.map(s=>this._sendRequest(s));const n=e;return this._sendRequest(n)}async sendAsync(e,r){try{return this._sendAsync(e,r).catch(n=>{throw(0,de.serializeError)(n,e)})}catch(n){return Promise.reject((0,de.serializeError)(n,e))}}async _sendAsync(e,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(e)){const i=r;this._sendMultipleRequestsAsync(e).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(e).then(i=>n(null,i)).catch(i=>n(i,null))}async request(e){try{return this._request(e).catch(r=>{throw(0,de.serializeError)(r,e.method)})}catch(r){return Promise.reject((0,de.serializeError)(r,e.method))}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw de.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw de.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw de.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(e){var r;const i=await(await this.initializeRelay()).scanQRCode((0,X.ensureRegExpString)(e)).promise;if(typeof i.result!="string")throw(0,de.serializeError)((r=i.errorMessage)!==null&&r!==void 0?r:"result was not a string",Ga.Web3Method.scanQRCode);return i.result}async genericRequest(e,r){var n;const s=await(await this.initializeRelay()).genericRequest(e,r).promise;if(typeof s.result!="string")throw(0,de.serializeError)((n=s.errorMessage)!==null&&n!==void 0?n:"result was not a string",Ga.Web3Method.generic);return s.result}async selectProvider(e){var r;const i=await(await this.initializeRelay()).selectProvider(e).promise;if(typeof i.result!="string")throw(0,de.serializeError)((r=i.errorMessage)!==null&&r!==void 0?r:"result was not a string",Ga.Web3Method.selectProvider);return i.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const r={jsonrpc:"2.0",id:e.id},{method:n}=e;if(r.result=this._handleSynchronousMethods(e),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(e,r){if(!Array.isArray(e))throw new Error("addresses is not an array");const n=e.map(i=>(0,X.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(jf.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(e){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i});const s=this._handleAsynchronousFilterMethods(e);if(s!==void 0){s.then(a=>r(Object.assign(Object.assign({},a),{id:e.id}))).catch(a=>n(a));return}const o=this._handleSubscriptionMethods(e);if(o!==void 0){o.then(a=>r({jsonrpc:"2.0",id:e.id,result:a.result})).catch(a=>n(a));return}}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case ue.JSONRPCMethod.eth_accounts:return this._eth_accounts();case ue.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case ue.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case ue.JSONRPCMethod.net_version:return this._net_version();case ue.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case ue.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case ue.JSONRPCMethod.eth_sign:return this._eth_sign(n);case ue.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(n);case ue.JSONRPCMethod.personal_sign:return this._personal_sign(n);case ue.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(n);case ue.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(n);case ue.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(n);case ue.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(n);case ue.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(n);case ue.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case ue.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(n);case ue.JSONRPCMethod.eth_signTypedData_v4:case ue.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(n);case ue.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(n);case ue.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(n);case ue.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(n);case ue.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(e){const{method:r}=e,n=e.params||[];switch(r){case ue.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case ue.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case ue.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case ue.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case ue.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(e){switch(e.method){case ue.JSONRPCMethod.eth_subscribe:case ue.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const r=(0,X.ensureAddressString)(e);return this._addresses.map(i=>(0,X.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){var r;if(!this._isKnownAddress(e))throw(r=this.diagnostic)===null||r===void 0||r.log(qa.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const r=e.from?(0,X.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,X.ensureAddressString)(e.to):null,i=e.value!=null?(0,X.ensureBN)(e.value):new FE.default(0),s=e.data?(0,X.ensureBuffer)(e.data):Buffer.alloc(0),o=e.nonce!=null?(0,X.ensureIntNumber)(e.nonce):null,a=e.gasPrice!=null?(0,X.ensureBN)(e.gasPrice):null,c=e.maxFeePerGas!=null?(0,X.ensureBN)(e.maxFeePerGas):null,u=e.maxPriorityFeePerGas!=null?(0,X.ensureBN)(e.maxPriorityFeePerGas):null,l=e.gas!=null?(0,X.ensureBN)(e.gas):null,f=this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:c,maxPriorityFeePerGas:u,gasLimit:l,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw de.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw de.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumMessage(e,r,n,i).promise).result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?de.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,r,n){return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,r,n).promise).result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,X.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(Bf);if(!e)return(0,X.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(e,10);return(0,X.ensureIntNumber)(r)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(qa.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?Df.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{r=await(await this.initializeRelay()).requestEthereumAccounts().promise}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?de.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const r=(0,X.ensureAddressString)(e[0]),n=(0,X.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,X.ensureBuffer)(e[0]),n=(0,X.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,X.ensureBuffer)(e[0]),n=(0,X.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,X.ensureBuffer)(e[0]),n=(0,X.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumTransaction(r).promise).result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?de.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,X.ensureBuffer)(e[0]);return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise).result}}async _eth_sendTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise).result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?de.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,X.ensureParsedJSONObject)(e[0]),n=(0,X.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=Ja.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const r=(0,X.ensureAddressString)(e[0]),n=(0,X.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=Ja.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const r=(0,X.ensureAddressString)(e[0]),n=(0,X.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=Ja.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(e){const r=e[0],n=e[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(e){var r,n,i,s;const o=e[0];if(((r=o.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||o.chainName.trim()==="")throw de.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw de.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(n=o.rpcUrls)!==null&&n!==void 0?n:[],(i=o.blockExplorerUrls)!==null&&i!==void 0?i:[],o.chainName,(s=o.iconUrls)!==null&&s!==void 0?s:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const r=Array.isArray(e)?e[0]:e;if(!r.type)throw de.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw de.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw de.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw de.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:o,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,a,o,n)}}_eth_uninstallFilter(e){const r=(0,X.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(e){const r=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){const r=(0,X.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(e){const r=(0,X.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}tn.CoinbaseWalletProvider=UE;var Us={},zs={},wi,G,gp,yp,pr,Wf,vp,_c,mp,Xn={},_p=[],zE=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qs=Array.isArray;function jt(t,e){for(var r in e)t[r]=e[r];return t}function wp(t){var e=t.parentNode;e&&e.removeChild(t)}function wc(t,e,r){var n,i,s,o={};for(s in e)s=="key"?n=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?wi.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return qn(t,o,n,i,null)}function qn(t,e,r,n,i){var s={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++gp,__i:-1,__u:0};return i==null&&G.vnode!=null&&G.vnode(s),s}function qE(){return{current:null}}function Si(t){return t.children}function Gn(t,e){this.props=t,this.context=e}function ln(t,e){if(e==null)return t.__?ln(t.__,t.__i+1):null;for(var r;ee&&pr.sort(_c));as.__r=0}function Ep(t,e,r,n,i,s,o,a,c,u,l){var f,h,p,v,E,_=n&&n.__k||_p,d=e.length;for(r.__d=c,GE(r,e,_),c=r.__d,f=0;f0?qn(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=t,i.__b=t.__b+1,a=JE(i,r,o=n+f,l),i.__i=a,s=null,a!==-1&&(l--,(s=r[a])&&(s.__u|=131072)),s==null||s.__v===null?(a==-1&&f--,typeof i.type!="function"&&(i.__u|=65536)):a!==o&&(a===o+1?f++:a>o?l>c-o?f+=a-o:f--:f=a(c!=null&&!(131072&c.__u)?1:0))for(;o>=0||a=0){if((c=e[o])&&!(131072&c.__u)&&i==c.key&&s===c.type)return o;o--}if(a2&&(a.children=arguments.length>3?wi.call(arguments,2):r),qn(t.type,a,n||t.key,i||t.ref,null)}function KE(t,e){var r={__c:e="__cC"+mp++,__:t,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,s;return this.getChildContext||(i=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(a){a.__e=!0,Sc(a)})},this.sub=function(o){i.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),a&&a.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}wi=_p.slice,G={__e:function(t,e,r,n){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),o=i.__d),o)return i.__E=i}catch(a){t=a}throw t}},gp=0,yp=function(t){return t!=null&&t.constructor==null},Gn.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=jt({},this.state),typeof t=="function"&&(t=t(jt({},r),this.props)),t&&jt(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),Sc(this))},Gn.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Sc(this))},Gn.prototype.render=Si,pr=[],vp=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_c=function(t,e){return t.__v.__b-e.__v.__b},as.__r=0,mp=0;const XE=Object.freeze(Object.defineProperty({__proto__:null,Component:Gn,Fragment:Si,cloneElement:YE,createContext:KE,createElement:wc,createRef:qE,h:wc,hydrate:Ap,get isValidElement(){return yp},get options(){return G},render:Rp,toChildArray:xp},Symbol.toStringTag,{value:"Module"})),Ke=xr(XE);function fn(t){return typeof t=="function"}var zf=!1,rt={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){var e=new Error;""+e.stack}zf=t},get useDeprecatedSynchronousErrorHandling(){return zf}};function Gr(t){setTimeout(function(){throw t},0)}var cs={closed:!0,next:function(t){},error:function(t){if(rt.useDeprecatedSynchronousErrorHandling)throw t;Gr(t)},complete:function(){}},Ue=function(){return Array.isArray||function(t){return t&&typeof t.length=="number"}}();function Eu(t){return t!==null&&typeof t=="object"}var e3=function(){function t(e){return Error.call(this),this.message=e?e.length+` errors occurred during unsubscription: +`+e.map(function(r,n){return n+1+") "+r.toString()}).join(` + `):"",this.name="UnsubscriptionError",this.errors=e,this}return t.prototype=Object.create(Error.prototype),t}(),Jn=e3,_e=function(){function t(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var r=this,n=r._parentOrParents,i=r._ctorUnsubscribe,s=r._unsubscribe,o=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(n!==null)for(var a=0;a1){this.connection=null;return}var i=this.connection,s=r._connection;this.connection=null,s&&(!i||s===i)&&s.unsubscribe()},e}(V),Op=function(t){I(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subjectFactory=n,i._refCount=0,i._isComplete=!1,i}return e.prototype._subscribe=function(r){return this.getSubject().subscribe(r)},e.prototype.getSubject=function(){var r=this._subject;return(!r||r.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var r=this._connection;return r||(this._isComplete=!1,r=this._connection=new _e,r.add(this.source.subscribe(new o3(this.getSubject(),this))),r.closed&&(this._connection=null,r=_e.EMPTY)),r},e.prototype.refCount=function(){return xu()(this)},e}(ee),s3=function(){var t=Op.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),o3=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.connectable=n,i}return e.prototype._error=function(r){this._unsubscribe(),t.prototype._error.call(this,r)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var r=this.connectable;if(r){this.connectable=null;var n=r._connection;r._refCount=0,r._subject=null,r._connection=null,n&&n.unsubscribe()}},e}(Tp);function a3(t,e,r,n){return function(i){return i.lift(new c3(t,e,r,n))}}var c3=function(){function t(e,r,n,i){this.keySelector=e,this.elementSelector=r,this.durationSelector=n,this.subjectSelector=i}return t.prototype.call=function(e,r){return r.subscribe(new u3(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),u3=function(t){I(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.keySelector=n,a.elementSelector=i,a.durationSelector=s,a.subjectSelector=o,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a}return e.prototype._next=function(r){var n;try{n=this.keySelector(r)}catch(i){this.error(i);return}this._group(r,n)},e.prototype._group=function(r,n){var i=this.groups;i||(i=this.groups=new Map);var s=i.get(n),o;if(this.elementSelector)try{o=this.elementSelector(r)}catch(u){this.error(u)}else o=r;if(!s){s=this.subjectSelector?this.subjectSelector():new Ne,i.set(n,s);var a=new xc(n,s,this);if(this.destination.next(a),this.durationSelector){var c=void 0;try{c=this.durationSelector(new xc(n,s))}catch(u){this.error(u);return}this.add(c.subscribe(new l3(n,s,this)))}}s.closed||s.next(o)},e.prototype._error=function(r){var n=this.groups;n&&(n.forEach(function(i,s){i.error(r)}),n.clear()),this.destination.error(r)},e.prototype._complete=function(){var r=this.groups;r&&(r.forEach(function(n,i){n.complete()}),r.clear()),this.destination.complete()},e.prototype.removeGroup=function(r){this.groups.delete(r)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,this.count===0&&t.prototype.unsubscribe.call(this))},e}(V),l3=function(t){I(e,t);function e(r,n,i){var s=t.call(this,n)||this;return s.key=r,s.group=n,s.parent=i,s}return e.prototype._next=function(r){this.complete()},e.prototype._unsubscribe=function(){var r=this,n=r.parent,i=r.key;this.key=this.parent=null,n&&n.removeGroup(i)},e}(V),xc=function(t){I(e,t);function e(r,n,i){var s=t.call(this)||this;return s.key=r,s.groupSubject=n,s.refCountSubscription=i,s}return e.prototype._subscribe=function(r){var n=new _e,i=this,s=i.refCountSubscription,o=i.groupSubject;return s&&!s.closed&&n.add(new f3(s)),n.add(o.subscribe(r)),n},e}(ee),f3=function(t){I(e,t);function e(r){var n=t.call(this)||this;return n.parent=r,r.count++,n}return e.prototype.unsubscribe=function(){var r=this.parent;!r.closed&&!this.closed&&(t.prototype.unsubscribe.call(this),r.count-=1,r.count===0&&r.attemptedToUnsubscribe&&r.unsubscribe())},e}(_e),Np=function(t){I(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return n&&!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Zt;return this._value},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(Ne),h3=function(t){I(e,t);function e(r,n){return t.call(this)||this}return e.prototype.schedule=function(r,n){return this},e}(_e),Ei=function(t){I(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),this.closed)return this;this.state=r;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=this.id||this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),setInterval(r.flush.bind(r,this),i)},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&this.delay===i&&this.pending===!1)return n;clearInterval(n)},e.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(r,n){var i=!1,s=void 0;try{this.work(r)}catch(o){i=!0,s=!!o&&o||new Error(o)}if(i)return this.unsubscribe(),s},e.prototype._unsubscribe=function(){var r=this.id,n=this.scheduler,i=n.actions,s=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,s!==-1&&i.splice(s,1),r!=null&&(this.id=this.recycleAsyncId(n,r,null)),this.delay=null},e}(h3),d3=function(t){I(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.schedule=function(r,n){return n===void 0&&(n=0),n>0?t.prototype.schedule.call(this,r,n):(this.delay=n,this.state=r,this.scheduler.flush(this),this)},e.prototype.execute=function(r,n){return n>0||this.closed?t.prototype.execute.call(this,r,n):this._execute(r,n)},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0?t.prototype.requestAsyncId.call(this,r,n,i):r.flush(this)},e}(Ei),Ic=function(){function t(e,r){r===void 0&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.SchedulerAction(this,e).schedule(n,r)},t.now=function(){return Date.now()},t}(),Ci=function(t){I(e,t);function e(r,n){n===void 0&&(n=Ic.now);var i=t.call(this,r,function(){return e.delegate&&e.delegate!==i?e.delegate.now():n()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return e.prototype.schedule=function(r,n,i){return n===void 0&&(n=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,n,i):t.prototype.schedule.call(this,r,n,i)},e.prototype.flush=function(r){var n=this.actions;if(this.active){n.push(r);return}var i;this.active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this.active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(Ic),p3=function(t){I(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ci),Lp=new p3(d3),Pp=Lp,hn=new ee(function(t){return t.complete()});function An(t){return t?b3(t):hn}function b3(t){return new ee(function(e){return t.schedule(function(){return e.complete()})})}function Ye(t){return t&&typeof t.schedule=="function"}var $p=function(t){return function(e){for(var r=0,n=t.length;rthis._bufferSize&&n.shift()}t.prototype.next.call(this,r)},e.prototype.nextTimeWindow=function(r){this.isStopped||(this._events.push(new _3(this._getNow(),r)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){var n=this._infiniteTimeWindow,i=n?this._events:this._trimBufferThenGetEvents(),s=this.scheduler,o=i.length,a;if(this.closed)throw new Zt;if(this.isStopped||this.hasError?a=_e.EMPTY:(this.observers.push(r),a=new kp(this,r)),s&&r.add(r=new Dp(r,s)),n)for(var c=0;cn&&(a=Math.max(a,o-n)),a>0&&s.splice(0,a),s},e}(Ne),_3=function(){function t(e,r){this.time=e,this.value=r}return t}(),Mn=function(t){I(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.value=null,r.hasNext=!1,r.hasCompleted=!1,r}return e.prototype._subscribe=function(r){return this.hasError?(r.error(this.thrownError),_e.EMPTY):this.hasCompleted&&this.hasNext?(r.next(this.value),r.complete(),_e.EMPTY):t.prototype._subscribe.call(this,r)},e.prototype.next=function(r){this.hasCompleted||(this.value=r,this.hasNext=!0)},e.prototype.error=function(r){this.hasCompleted||t.prototype.error.call(this,r)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(Ne),w3=1,S3=function(){return Promise.resolve()}(),Ac={};function Zf(t){return t in Ac?(delete Ac[t],!0):!1}var Yf={setImmediate:function(t){var e=w3++;return Ac[e]=!0,S3.then(function(){return Zf(e)&&t()}),e},clearImmediate:function(t){Zf(t)}},E3=function(t){I(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=Yf.setImmediate(r.flush.bind(r,null))))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(Yf.clearImmediate(n),r.scheduled=void 0)},e}(Ei),C3=function(t){I(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,s=-1,o=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++s0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=requestAnimationFrame(function(){return r.flush(null)})))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(cancelAnimationFrame(n),r.scheduled=void 0)},e}(Ei),I3=function(t){I(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,s=-1,o=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++sn.index?1:-1:r.delay>n.delay?1:-1},e}(Ei);function Ct(){}function M3(t){return!!t&&(t instanceof ee||typeof t.lift=="function"&&typeof t.subscribe=="function")}var k3=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),dn=k3,T3=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}(),Ii=T3,O3=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}(),Hp=O3;function ct(t,e){return function(n){if(typeof t!="function")throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new N3(t,e))}}var N3=function(){function t(e,r){this.project=e,this.thisArg=r}return t.prototype.call=function(e,r){return r.subscribe(new L3(e,this.project,this.thisArg))},t}(),L3=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.project=n,s.count=0,s.thisArg=i||s,s}return e.prototype._next=function(r){var n;try{n=this.project.call(this.thisArg,r,this.count++)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(V);function Vp(t,e,r){if(e)if(Ye(e))r=e;else return function(){for(var n=[],i=0;i0?this._next(r.shift()):this.active===0&&this.hasCompleted&&this.destination.complete()},e}(Se),X3=Er;function ku(t){return t===void 0&&(t=Number.POSITIVE_INFINITY),Er(tr,t)}function Jp(){return ku(1)}function ti(){for(var t=[],e=0;e1?i.next(Array.prototype.slice.call(arguments)):i.next(o)}Zp(t,e,s,i,r)})}function Zp(t,e,r,n,i){var s;if(n4(t)){var o=t;t.addEventListener(e,r,i),s=function(){return o.removeEventListener(e,r,i)}}else if(r4(t)){var a=t;t.on(e,r),s=function(){return a.off(e,r)}}else if(t4(t)){var c=t;t.addListener(e,r),s=function(){return c.removeListener(e,r)}}else if(t&&t.length)for(var u=0,l=t.length;u=0}function a4(t,e){return t===void 0&&(t=0),e===void 0&&(e=ze),(!pn(t)||t<0)&&(t=0),(!e||typeof e.schedule!="function")&&(e=ze),new ee(function(r){return r.add(e.schedule(c4,t,{subscriber:r,counter:0,period:t})),r})}function c4(t){var e=t.subscriber,r=t.counter,n=t.period;e.next(r),this.schedule({subscriber:e,counter:r+1,period:n},n)}function Kp(){for(var t=[],e=0;e1&&typeof t[t.length-1]=="number"&&(r=t.pop())):typeof i=="number"&&(r=t.pop()),n===null&&t.length===1&&t[0]instanceof ee?t[0]:ku(r)(xi(t,n))}var Xp=new ee(Ct);function u4(){return Xp}function Mc(){for(var t=[],e=0;e=e){n.complete();break}if(n.next(s++),n.closed)break}while(!0)})}function v4(t){var e=t.start,r=t.index,n=t.count,i=t.subscriber;if(r>=n){i.complete();return}i.next(e),!i.closed&&(t.index=r+1,t.start=e+1,this.schedule(t))}function r0(t,e,r){t===void 0&&(t=0);var n=-1;return pn(e)?n=Number(e)<1&&1||Number(e):Ye(e)&&(r=e),Ye(r)||(r=ze),new ee(function(i){var s=pn(t)?t:+t-r.now();return r.schedule(m4,s,{index:0,period:n,subscriber:i})})}function m4(t){var e=t.index,r=t.period,n=t.subscriber;if(n.next(e),!n.closed){if(r===-1)return n.complete();t.index=e+1,this.schedule(t,r)}}function _4(t,e){return new ee(function(r){var n;try{n=t()}catch(a){r.error(a);return}var i;try{i=e(n)}catch(a){r.error(a);return}var s=i?Vt(i):hn,o=s.subscribe(r);return function(){o.unsubscribe(),n&&n.unsubscribe()}})}function n0(){for(var t=[],e=0;ethis.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),C4=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.parent=n,s.observable=i,s.stillUnsubscribed=!0,s.buffer=[],s.isComplete=!1,s}return e.prototype[rr]=function(){return this},e.prototype.next=function(){var r=this.buffer;return r.length===0&&this.isComplete?{value:null,done:!0}:{value:r.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return this.buffer.length===0&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(r){this.buffer.push(r),this.parent.checkIterators()},e.prototype.subscribe=function(){return Ee(this.observable,new we(this))},e}(Se);const x4=Object.freeze(Object.defineProperty({__proto__:null,ArgumentOutOfRangeError:dn,AsyncSubject:Mn,BehaviorSubject:Np,ConnectableObservable:Op,EMPTY:hn,EmptyError:Ii,GroupedObservable:xc,NEVER:Xp,Notification:Bt,get NotificationKind(){return Rc},ObjectUnsubscribedError:Zt,Observable:ee,ReplaySubject:Au,Scheduler:Ic,Subject:Ne,Subscriber:V,Subscription:_e,TimeoutError:Hp,UnsubscriptionError:Jn,VirtualAction:Wp,VirtualTimeScheduler:A3,animationFrame:R3,animationFrameScheduler:Fp,asap:Zi,asapScheduler:jp,async:ze,asyncScheduler:Bp,bindCallback:Vp,bindNodeCallback:Up,combineLatest:U3,concat:ti,config:rt,defer:Tu,empty:An,forkJoin:e4,from:Vt,fromEvent:Qp,fromEventPattern:Yp,generate:i4,identity:tr,iif:o4,interval:a4,isObservable:M3,merge:Kp,never:u4,noop:Ct,observable:Rn,of:Gs,onErrorResumeNext:Mc,pairs:l4,partition:p4,pipe:Cc,queue:Pp,queueScheduler:Lp,race:t0,range:y4,scheduled:Gp,throwError:Ru,timer:r0,using:_4,zip:n0},Symbol.toStringTag,{value:"Module"})),Js=xr(x4);var Qs={};function s0(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e=r.__.length&&r.__.push({__V:Yi}),r.__[t]}function a0(t){return bn=1,c0(l0,t)}function c0(t,e,r){var n=Lr(Ht++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):l0(void 0,e),function(a){var c=n.__N?n.__N[0]:n.__[0],u=n.t(c,a);c!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=pe,!pe.u)){var i=function(a,c,u){if(!n.__c.__H)return!0;var l=n.__c.__H.__.filter(function(h){return h.__c});if(l.every(function(h){return!h.__N}))return!s||s.call(this,a,c,u);var f=!1;return l.forEach(function(h){if(h.__N){var p=h.__[0];h.__=h.__N,h.__N=void 0,p!==h.__[0]&&(f=!0)}}),!(!f&&n.__c.props===a)&&(!s||s.call(this,a,c,u))};pe.u=!0;var s=pe.shouldComponentUpdate,o=pe.componentWillUpdate;pe.componentWillUpdate=function(a,c,u){if(this.__e){var l=s;s=void 0,i(a,c,u),s=l}o&&o.call(this,a,c,u)},pe.shouldComponentUpdate=i}return n.__N||n.__}function R4(t,e){var r=Lr(Ht++,3);!G.__s&&Nu(r.__H,e)&&(r.__=t,r.i=e,pe.__H.__h.push(r))}function u0(t,e){var r=Lr(Ht++,4);!G.__s&&Nu(r.__H,e)&&(r.__=t,r.i=e,pe.__h.push(r))}function A4(t){return bn=5,Ou(function(){return{current:t}},[])}function M4(t,e,r){bn=6,u0(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},r==null?r:r.concat(t))}function Ou(t,e){var r=Lr(Ht++,7);return Nu(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function k4(t,e){return bn=8,Ou(function(){return t},e)}function T4(t){var e=pe.context[t.__c],r=Lr(Ht++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(pe)),e.props.value):t.__}function O4(t,e){G.useDebugValue&&G.useDebugValue(e?e(t):t)}function N4(t){var e=Lr(Ht++,10),r=a0();return e.__=t,pe.componentDidCatch||(pe.componentDidCatch=function(n,i){e.__&&e.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function L4(){var t=Lr(Ht++,11);if(!t.__){for(var e=pe.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__}function P4(){for(var t;t=o0.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Ki),t.__H.__h.forEach(kc),t.__H.__h=[]}catch(e){t.__H.__h=[],G.__e(e,t.__v)}}G.__b=function(t){pe=null,rh&&rh(t)},G.__r=function(t){nh&&nh(t),Ht=0;var e=(pe=t.__c).__H;e&&(Qa===pe?(e.__h=[],pe.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Yi,r.__N=r.i=void 0})):(e.__h.forEach(Ki),e.__h.forEach(kc),e.__h=[],Ht=0)),Qa=pe},G.diffed=function(t){ih&&ih(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(o0.push(e)!==1&&th===G.requestAnimationFrame||((th=G.requestAnimationFrame)||$4)(P4)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Yi&&(r.__=r.__V),r.i=void 0,r.__V=Yi})),Qa=pe=null},G.__c=function(t,e){e.some(function(r){try{r.__h.forEach(Ki),r.__h=r.__h.filter(function(n){return!n.__||kc(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],G.__e(n,r.__v)}}),sh&&sh(t,e)},G.unmount=function(t){oh&&oh(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Ki(n)}catch(i){e=i}}),r.__H=void 0,e&&G.__e(e,r.__v))};var ah=typeof requestAnimationFrame=="function";function $4(t){var e,r=function(){clearTimeout(n),ah&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);ah&&(e=requestAnimationFrame(r))}function Ki(t){var e=pe,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),pe=e}function kc(t){var e=pe;t.__c=t.__(),pe=e}function Nu(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function l0(t,e){return typeof e=="function"?e(t):e}const D4=Object.freeze(Object.defineProperty({__proto__:null,useCallback:k4,useContext:T4,useDebugValue:O4,useEffect:R4,useErrorBoundary:N4,useId:L4,useImperativeHandle:M4,useLayoutEffect:u0,useMemo:Ou,useReducer:c0,useRef:A4,useState:a0},Symbol.toStringTag,{value:"Module"})),Ri=xr(D4);var Mt={},Ys={};Object.defineProperty(Ys,"__esModule",{value:!0});Ys.CloseIcon=void 0;const ch=Ke;function j4(t){return(0,ch.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,ch.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}Ys.CloseIcon=j4;var Lu={};Object.defineProperty(Lu,"__esModule",{value:!0});Lu.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";var Pu={};Object.defineProperty(Pu,"__esModule",{value:!0});Pu.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg==";var Ks={};Object.defineProperty(Ks,"__esModule",{value:!0});Ks.QRCodeIcon=void 0;const wt=Ke;function B4(t){return(0,wt.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,wt.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,wt.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,wt.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,wt.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,wt.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,wt.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,wt.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,wt.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,wt.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))}Ks.QRCodeIcon=B4;var $u={};Object.defineProperty($u,"__esModule",{value:!0});const F4=` + + + + + +`;$u.default=F4;var Du={};Object.defineProperty(Du,"__esModule",{value:!0});Du.default=` + + + + + + +`;var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.StatusDotIcon=void 0;const uh=Ke;function W4(t){return(0,uh.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,uh.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))}Xs.StatusDotIcon=W4;var eo={};function f0(t){this.mode=Qe.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}f0.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=kt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=ve.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var s=0;s>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=ve.getBCHTypeInfo(r),i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,s=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var c=!1;s>>i&1)==1);var u=ve.getMask(e,n,o-a);u&&(c=!c),this.modules[n][o-a]=c,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};kt.PAD0=236;kt.PAD1=17;kt.createData=function(t,e,r){for(var n=It.getRSBlocks(t,e),i=new h0,s=0;sa*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+a*8+")");for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(kt.PAD0,8),i.getLengthInBits()>=a*8));)i.put(kt.PAD1,8);return kt.createBytes(i,n)};kt.createBytes=function(t,e){for(var r=0,n=0,i=0,s=new Array(e.length),o=new Array(e.length),a=0;a=0?p.get(v):0}}for(var E=0,l=0;l=0;)e^=ve.G15<=0;)e^=ve.G18<>>=1;return e},getPatternPosition:function(t){return ve.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case zt.PATTERN000:return(e+r)%2==0;case zt.PATTERN001:return e%2==0;case zt.PATTERN010:return r%3==0;case zt.PATTERN011:return(e+r)%3==0;case zt.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case zt.PATTERN101:return e*r%2+e*r%3==0;case zt.PATTERN110:return(e*r%2+e*r%3)%2==0;case zt.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new en([1],0),r=0;r5&&(r+=3+s-5)}for(var n=0;n=256;)t-=255;return Oe.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Pe=0;Pe<8;Pe++)Oe.EXP_TABLE[Pe]=1<>>7-t%8&1)==1},put:function(t,e){for(var r=0;r>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Za=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function d0(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(c){switch(c){case"L":return Kt.L;case"M":return Kt.M;case"Q":return Kt.Q;case"H":return Kt.H;default:throw new Error("Unknwon error correction level: "+c)}}function n(c,u){for(var l=i(c),f=1,h=0,p=0,v=Za.length;p<=v;p++){var E=Za[p];if(!E)throw new Error("Content too long: expected "+h+" but got "+l);switch(u){case"L":h=E[0];break;case"M":h=E[1];break;case"Q":h=E[2];break;case"H":h=E[3];break;default:throw new Error("Unknwon error correction level: "+u)}if(l<=h)break;f++}if(f>Za.length)throw new Error("Content too long");return f}function i(c){var u=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return u.length+(u.length!=c?3:0)}var s=this.options.content,o=n(s,this.options.ecl),a=r(this.options.ecl);this.qrcode=new kt(o,a),this.qrcode.addData(s),this.qrcode.make()}d0.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var n=typeof e.pretty<"u"?!!e.pretty:!0,i=n?" ":"",s=n?`\r +`:"",o=e.width,a=e.height,c=r.length,u=o/(c+2*e.padding),l=a/(c+2*e.padding),f=typeof e.join<"u"?!!e.join:!1,h=typeof e.swap<"u"?!!e.swap:!1,p=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,v=typeof e.predefined<"u"?!!e.predefined:!1,E=v?i+''+s:"",_=i+''+s,d="",y="",m=0;m'+s:d+=i+''+s}}f&&(d=i+'');let ce="";if(this.options.image!==void 0&&this.options.image.svg){const R=o*this.options.image.width/100,M=a*this.options.image.height/100,N=o/2-R/2,L=a/2-M/2;ce+=``,ce+=this.options.image.svg+s,ce+=""}var Z="";switch(t.container){case"svg":p&&(Z+=''+s),Z+=''+s,Z+=E+_+d,Z+=ce,Z+="";break;case"svg-viewbox":p&&(Z+=''+s),Z+=''+s,Z+=E+_+d,Z+=ce,Z+="";break;case"g":Z+=''+s,Z+=E+_+d,Z+=ce,Z+="";break;default:Z+=(E+_+d+ce).replace(/^\s+/,"");break}return Z};var H4=d0,V4=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(eo,"__esModule",{value:!0});eo.QRCode=void 0;const U4=Ke,lh=Ri,z4=V4(H4),q4=t=>{const[e,r]=(0,lh.useState)("");return(0,lh.useEffect)(()=>{var n,i;const s=new z4.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(n=t.width)!==null&&n!==void 0?n:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),o=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)}),e?(0,U4.h)("img",{src:e,alt:"QR Code"}):null};eo.QRCode=q4;var to={},ju={};Object.defineProperty(ju,"__esModule",{value:!0});ju.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var G4=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(to,"__esModule",{value:!0});to.Spinner=void 0;const Vi=Ke,J4=G4(ju),Q4=t=>{var e;const r=(e=t.size)!==null&&e!==void 0?e:64,n=t.color||"#000";return(0,Vi.h)("div",{class:"-cbwsdk-spinner"},(0,Vi.h)("style",null,J4.default),(0,Vi.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,Vi.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};to.Spinner=Q4;var Bu={};Object.defineProperty(Bu,"__esModule",{value:!0});Bu.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var kn=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.CoinbaseAppSteps=Mt.CoinbaseWalletSteps=Mt.ConnectItem=Mt.ConnectContent=void 0;const it=kn(Zs),q=Ke,fh=Ri,Z4=W,Y4=mn,K4=Ys,X4=kn(Lu),e5=kn(Pu),p0=Ks,t5=kn($u),r5=kn(Du),n5=Xs,i5=eo,s5=to,o5=kn(Bu),hh={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:e5.default,steps:g0},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:X4.default,steps:y0}},a5=t=>{switch(t){case"coinbase-app":return t5.default;case"coinbase-wallet-app":default:return r5.default}},Tc=t=>t==="light"?"#FFFFFF":"#0A0B0D";function c5(t){const{theme:e}=t,[r,n]=(0,fh.useState)("coinbase-wallet-app"),i=(0,fh.useCallback)(u=>{n(u)},[]),s=(0,Z4.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),o=hh[r];if(!r)return null;const a=o.steps,c=r==="coinbase-app";return(0,q.h)("div",{"data-testid":"connect-content",class:(0,it.default)("-cbwsdk-connect-content",e)},(0,q.h)("style",null,o5.default),(0,q.h)("div",{class:"-cbwsdk-connect-content-header"},(0,q.h)("h2",{class:(0,it.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with one of our mobile apps"),t.onCancel&&(0,q.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,q.h)(K4.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,q.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,q.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,q.h)("div",null,Object.entries(hh).map(([u,l])=>(0,q.h)(b0,{key:u,title:l.title,description:l.description,icon:l.icon,selected:r===u,onClick:()=>i(u),theme:e}))),c&&(0,q.h)("div",{class:(0,it.default)("-cbwsdk-connect-content-update-app",e)},"Don’t see a ",(0,q.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,q.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,q.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,q.h)(i5.QRCode,{content:s,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:a5(r),width:25,height:25}}),(0,q.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Y4.LIB_VERSION}),(0,q.h)("input",{type:"hidden",value:s})),(0,q.h)(a,{theme:e}),!t.isConnected&&(0,q.h)("div",{"data-testid":"connecting-spinner",class:(0,it.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,q.h)(s5.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,q.h)("p",null,"Connecting...")))))}Mt.ConnectContent=c5;function b0({title:t,description:e,icon:r,selected:n,theme:i,onClick:s}){return(0,q.h)("div",{onClick:s,class:(0,it.default)("-cbwsdk-connect-item",i,{selected:n})},(0,q.h)("div",null,(0,q.h)("img",{src:r,alt:t})),(0,q.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,q.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,q.h)("p",{class:"-cbwsdk-connect-item-description"},e)))}Mt.ConnectItem=b0;function g0({theme:t}){return(0,q.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,q.h)("li",{class:(0,it.default)("-cbwsdk-wallet-steps-item",t)},(0,q.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,q.h)("li",{class:(0,it.default)("-cbwsdk-wallet-steps-item",t)},(0,q.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,q.h)("span",null,"Tap ",(0,q.h)("strong",null,"Scan")," "),(0,q.h)("span",{class:(0,it.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,q.h)(p0.QRCodeIcon,{fill:Tc(t)})))))}Mt.CoinbaseWalletSteps=g0;function y0({theme:t}){return(0,q.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,q.h)("li",{class:(0,it.default)("-cbwsdk-wallet-steps-item",t)},(0,q.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,q.h)("li",{class:(0,it.default)("-cbwsdk-wallet-steps-item",t)},(0,q.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,q.h)("span",null,"Tap ",(0,q.h)("strong",null,"More")),(0,q.h)("span",{class:(0,it.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,q.h)(n5.StatusDotIcon,{fill:Tc(t)})),(0,q.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,q.h)("strong",null,"Scan")),(0,q.h)("span",{class:(0,it.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,q.h)(p0.QRCodeIcon,{fill:Tc(t)})))))}Mt.CoinbaseAppSteps=y0;var ro={},no={};Object.defineProperty(no,"__esModule",{value:!0});no.ArrowLeftIcon=void 0;const dh=Ke;function u5(t){return(0,dh.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,dh.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}no.ArrowLeftIcon=u5;var io={};Object.defineProperty(io,"__esModule",{value:!0});io.LaptopIcon=void 0;const Ya=Ke;function l5(t){return(0,Ya.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ya.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Ya.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}io.LaptopIcon=l5;var so={};Object.defineProperty(so,"__esModule",{value:!0});so.SafeIcon=void 0;const ph=Ke;function f5(t){return(0,ph.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,ph.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}so.SafeIcon=f5;var Fu={};Object.defineProperty(Fu,"__esModule",{value:!0});Fu.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var v0=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ro,"__esModule",{value:!0});ro.TryExtensionContent=void 0;const ar=v0(Zs),xe=Ke,Ka=Ri,h5=no,d5=io,p5=so,b5=v0(Fu);function g5({theme:t}){const[e,r]=(0,Ka.useState)(!1),n=(0,Ka.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Ka.useCallback)(()=>{e?window.location.reload():(n(),r(!0))},[n,e]);return(0,xe.h)("div",{class:(0,ar.default)("-cbwsdk-try-extension",t)},(0,xe.h)("style",null,b5.default),(0,xe.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,xe.h)("h3",{class:(0,ar.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,xe.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,xe.h)("button",{class:(0,ar.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,xe.h)("div",null,!e&&(0,xe.h)(h5.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,xe.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,xe.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,xe.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,xe.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,xe.h)("span",{class:(0,ar.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,xe.h)(d5.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,xe.h)("div",{class:(0,ar.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,xe.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,xe.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,xe.h)("span",{class:(0,ar.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,xe.h)(p5.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,xe.h)("div",{class:(0,ar.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}ro.TryExtensionContent=g5;var Wu={};Object.defineProperty(Wu,"__esModule",{value:!0});Wu.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var m0=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qs,"__esModule",{value:!0});Qs.ConnectDialog=void 0;const Xa=m0(Zs),cr=Ke,ec=Ri,y5=Mt,v5=ro,m5=m0(Wu),_5=t=>{const{isOpen:e,darkMode:r}=t,[n,i]=(0,ec.useState)(!e),[s,o]=(0,ec.useState)(!e);(0,ec.useEffect)(()=>{const c=[window.setTimeout(()=>{o(!e)},10)];return e?i(!1):c.push(window.setTimeout(()=>{i(!0)},360)),()=>{c.forEach(window.clearTimeout)}},[t.isOpen]);const a=r?"dark":"light";return(0,cr.h)("div",{class:(0,Xa.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,cr.h)("style",null,m5.default),(0,cr.h)("div",{class:(0,Xa.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,cr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,cr.h)("div",{class:(0,Xa.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,cr.h)(y5.ConnectContent,{theme:a,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,cr.h)(v5.TryExtensionContent,{theme:a}))))};Qs.ConnectDialog=_5;Object.defineProperty(zs,"__esModule",{value:!0});zs.LinkFlow=void 0;const tc=Ke,bh=Js,w5=Qs;class S5{constructor(e){this.extensionUI$=new bh.BehaviorSubject({}),this.subscriptions=new bh.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection,this.connected$=e.connected$,this.chainId$=e.chainId$}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe(r=>{this.isConnected!==r&&(this.isConnected=r,this.render())})),this.subscriptions.add(this.chainId$.subscribe(r=>{this.chainId!==r&&(this.chainId=r,this.render())}))}detach(){var e;this.root&&(this.subscriptions.unsubscribe(),(0,tc.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;const e=this.extensionUI$.subscribe(()=>{this.root&&(0,tc.render)((0,tc.h)(w5.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)});this.subscriptions.add(e)}}zs.LinkFlow=S5;var _0={},Hu={};Object.defineProperty(Hu,"__esModule",{value:!0});Hu.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(t){var e=F&&F.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e(Zs),n=Ke,i=Ri,s=e(Hu),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";function a(f){switch(f){case"coinbase-app":return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+";case"coinbase-wallet-app":default:return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}}class c{constructor(h){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=h.darkMode}attach(h){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",h.appendChild(this.root),this.render()}presentItem(h){const p=this.nextItemKey++;return this.items.set(p,h),this.render(),()=>{this.items.delete(p),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([h,p])=>(0,n.h)(t.SnackbarInstance,Object.assign({},p,{key:h}))))),this.root)}}t.Snackbar=c;const u=f=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},f.children));t.SnackbarContainer=u;const l=({autoExpand:f,message:h,menuItems:p,appSrc:v})=>{const[E,_]=(0,i.useState)(!0),[d,y]=(0,i.useState)(f??!1);(0,i.useEffect)(()=>{const x=[window.setTimeout(()=>{_(!1)},1),window.setTimeout(()=>{y(!0)},1e4)];return()=>{x.forEach(window.clearTimeout)}});const m=()=>{y(!d)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",E&&"-cbwsdk-snackbar-instance-hidden",d&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:m},(0,n.h)("img",{src:a(v),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},h),(0,n.h)("div",{class:"-gear-container"},!d&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:o,class:"-gear-icon",title:"Expand"}))),p&&p.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},p.map((x,C)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",x.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:x.onClick,key:C},(0,n.h)("svg",{width:x.svgWidth,height:x.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":x.defaultFillRule,"clip-rule":x.defaultClipRule,d:x.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",x.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},x.info)))))};t.SnackbarInstance=l})(_0);var oo={},Vu={};Object.defineProperty(Vu,"__esModule",{value:!0});Vu.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var E5=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(oo,"__esModule",{value:!0});oo.injectCssReset=void 0;const C5=E5(Vu);function x5(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(C5.default)),document.documentElement.appendChild(t)}oo.injectCssReset=x5;Object.defineProperty(Us,"__esModule",{value:!0});Us.WalletSDKUI=void 0;const I5=zs,R5=_0,A5=oo;class M5{constructor(e){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new R5.Snackbar({darkMode:e.darkMode}),this.linkFlow=new I5.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,connected$:e.connected$,chainId$:e.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,A5.injectCssReset)()}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(e){}watchAsset(e){}switchEthereumChain(e){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(e){}signEthereumTransaction(e){}submitEthereumTransaction(e){}ethereumAddressFromSignedMessage(e){}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}setAppSrc(e){this.appSrc=e}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(e){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}}Us.WalletSDKUI=M5;var ao={},co={};Object.defineProperty(co,"__esModule",{value:!0});var Jr;(function(t){t.typeOfFunction="function",t.boolTrue=!0})(Jr||(Jr={}));function w0(t,e,r){if(!r||typeof r.value!==Jr.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:Jr.boolTrue,get:function(){var n=r.value.bind(this);return Object.defineProperty(this,e,{value:n,configurable:Jr.boolTrue,writable:Jr.boolTrue}),n}}}co.bind=w0;co.default=w0;function S0(t){return function(r){return r.lift(new k5(t))}}var k5=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new T5(e,this.durationSelector))},t}(),T5=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return e.prototype._next=function(r){if(this.value=r,this.hasValue=!0,!this.throttled){var n=void 0;try{var i=this.durationSelector;n=i(r)}catch(o){return this.destination.error(o)}var s=Ee(n,new we(this));!s||s.closed?this.clearThrottle():this.add(this.throttled=s)}},e.prototype.clearThrottle=function(){var r=this,n=r.value,i=r.hasValue,s=r.throttled;s&&(this.remove(s),this.throttled=void 0,s.unsubscribe()),i&&(this.value=void 0,this.hasValue=!1,this.destination.next(n))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(Se);function O5(t,e){return e===void 0&&(e=ze),S0(function(){return r0(t,e)})}function N5(t){return function(r){return r.lift(new L5(t))}}var L5=function(){function t(e){this.closingNotifier=e}return t.prototype.call=function(e,r){return r.subscribe(new P5(e,this.closingNotifier))},t}(),P5=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.buffer=[],i.add(Ee(n,new we(i))),i}return e.prototype._next=function(r){this.buffer.push(r)},e.prototype.notifyNext=function(){var r=this.buffer;this.buffer=[],this.destination.next(r)},e}(Se);function $5(t,e){return e===void 0&&(e=null),function(n){return n.lift(new D5(t,e))}}var D5=function(){function t(e,r){this.bufferSize=e,this.startBufferEvery=r,!r||e===r?this.subscriberClass=j5:this.subscriberClass=B5}return t.prototype.call=function(e,r){return r.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},t}(),j5=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.bufferSize=n,i.buffer=[],i}return e.prototype._next=function(r){var n=this.buffer;n.push(r),n.length==this.bufferSize&&(this.destination.next(n),this.buffer=[])},e.prototype._complete=function(){var r=this.buffer;r.length>0&&this.destination.next(r),t.prototype._complete.call(this)},e}(V),B5=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.bufferSize=n,s.startBufferEvery=i,s.buffers=[],s.count=0,s}return e.prototype._next=function(r){var n=this,i=n.bufferSize,s=n.startBufferEvery,o=n.buffers,a=n.count;this.count++,a%s===0&&o.push([]);for(var c=o.length;c--;){var u=o[c];u.push(r),u.length===i&&(o.splice(c,1),this.destination.next(u))}},e.prototype._complete=function(){for(var r=this,n=r.buffers,i=r.destination;n.length>0;){var s=n.shift();s.length>0&&i.next(s)}t.prototype._complete.call(this)},e}(V);function F5(t){var e=arguments.length,r=ze;Ye(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],e--);var n=null;e>=2&&(n=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(o){return o.lift(new W5(t,n,i,r))}}var W5=function(){function t(e,r,n,i){this.bufferTimeSpan=e,this.bufferCreationInterval=r,this.maxBufferSize=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new V5(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),H5=function(){function t(){this.buffer=[]}return t}(),V5=function(t){I(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;a.bufferTimeSpan=n,a.bufferCreationInterval=i,a.maxBufferSize=s,a.scheduler=o,a.contexts=[];var c=a.openContext();if(a.timespanOnly=i==null||i<0,a.timespanOnly){var u={subscriber:a,context:c,bufferTimeSpan:n};a.add(c.closeAction=o.schedule(gh,n,u))}else{var l={subscriber:a,context:c},f={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:a,scheduler:o};a.add(c.closeAction=o.schedule(E0,n,l)),a.add(o.schedule(U5,i,f))}return a}return e.prototype._next=function(r){for(var n=this.contexts,i=n.length,s,o=0;o0;){var s=n.shift();i.next(s.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(r){this.closeContext(r);var n=r.closeAction;if(n.unsubscribe(),this.remove(n),!this.closed&&this.timespanOnly){r=this.openContext();var i=this.bufferTimeSpan,s={subscriber:this,context:r,bufferTimeSpan:i};this.add(r.closeAction=this.scheduler.schedule(gh,i,s))}},e.prototype.openContext=function(){var r=new H5;return this.contexts.push(r),r},e.prototype.closeContext=function(r){this.destination.next(r.buffer);var n=this.contexts,i=n?n.indexOf(r):-1;i>=0&&n.splice(n.indexOf(r),1)},e}(V);function gh(t){var e=t.subscriber,r=t.context;r&&e.closeContext(r),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function U5(t){var e=t.bufferCreationInterval,r=t.bufferTimeSpan,n=t.subscriber,i=t.scheduler,s=n.openContext(),o=this;n.closed||(n.add(s.closeAction=i.schedule(E0,r,{subscriber:n,context:s})),o.schedule(t,e))}function E0(t){var e=t.subscriber,r=t.context;e.closeContext(r)}function z5(t,e){return function(n){return n.lift(new q5(t,e))}}var q5=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new G5(e,this.openings,this.closingSelector))},t}(),G5=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.closingSelector=i,s.contexts=[],s.add(Wt(s,n)),s}return e.prototype._next=function(r){for(var n=this.contexts,i=n.length,s=0;s0;){var i=n.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,r)},e.prototype._complete=function(){for(var r=this.contexts;r.length>0;){var n=r.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(r,n){r?this.closeBuffer(r):this.openBuffer(n)},e.prototype.notifyComplete=function(r){this.closeBuffer(r.context)},e.prototype.openBuffer=function(r){try{var n=this.closingSelector,i=n.call(this,r);i&&this.trySubscribe(i)}catch(s){this._error(s)}},e.prototype.closeBuffer=function(r){var n=this.contexts;if(n&&r){var i=r.buffer,s=r.subscription;this.destination.next(i),n.splice(n.indexOf(r),1),this.remove(s),s.unsubscribe()}},e.prototype.trySubscribe=function(r){var n=this.contexts,i=[],s=new _e,o={buffer:i,subscription:s};n.push(o);var a=Wt(this,r,o);!a||a.closed?this.closeBuffer(o):(a.context=o,this.add(a),s.add(a))},e}(Nr);function J5(t){return function(e){return e.lift(new Q5(t))}}var Q5=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new Z5(e,this.closingSelector))},t}(),Z5=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.closingSelector=n,i.subscribing=!1,i.openBuffer(),i}return e.prototype._next=function(r){this.buffer.push(r)},e.prototype._complete=function(){var r=this.buffer;r&&this.destination.next(r),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var r=this.closingSubscription;r&&(this.remove(r),r.unsubscribe());var n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];var i;try{var s=this.closingSelector;i=s()}catch(o){return this.error(o)}r=new _e,this.closingSubscription=r,this.add(r),this.subscribing=!0,r.add(Ee(i,new we(this))),this.subscribing=!1},e}(Se);function Y5(t){return function(r){var n=new K5(t),i=r.lift(n);return n.caught=i}}var K5=function(){function t(e){this.selector=e}return t.prototype.call=function(e,r){return r.subscribe(new X5(e,this.selector,this.caught))},t}(),X5=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.selector=n,s.caught=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=void 0;try{n=this.selector(r,this.caught)}catch(o){t.prototype.error.call(this,o);return}this._unsubscribeAndRecycle();var i=new we(this);this.add(i);var s=Ee(n,i);s!==i&&this.add(s)}},e}(Se);function eC(t){return function(e){return e.lift(new Mu(t))}}function tC(){for(var t=[],e=0;e0&&i[0].time-s.now()<=0;)i.shift().notification.observe(o);if(i.length>0){var a=Math.max(0,i[0].time-s.now());this.schedule(r,a)}else this.unsubscribe(),n.active=!1},e.prototype._schedule=function(r){this.active=!0;var n=this.destination;n.add(r.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:r}))},e.prototype.scheduleNotification=function(r){if(this.errored!==!0){var n=this.scheduler,i=new mC(n.now()+this.delay,r);this.queue.push(i),this.active===!1&&this._schedule(n)}},e.prototype._next=function(r){this.scheduleNotification(Bt.createNext(r))},e.prototype._error=function(r){this.errored=!0,this.queue=[],this.destination.error(r),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(Bt.createComplete()),this.unsubscribe()},e}(V),mC=function(){function t(e,r){this.time=e,this.notification=r}return t}();function _C(t,e){return e?function(r){return new SC(r,e).lift(new yh(t))}:function(r){return r.lift(new yh(t))}}var yh=function(){function t(e){this.delayDurationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new wC(e,this.delayDurationSelector))},t}(),wC=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.delayDurationSelector=n,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return e.prototype.notifyNext=function(r,n,i,s,o){this.destination.next(r),this.removeSubscription(o),this.tryComplete()},e.prototype.notifyError=function(r,n){this._error(r)},e.prototype.notifyComplete=function(r){var n=this.removeSubscription(r);n&&this.destination.next(n),this.tryComplete()},e.prototype._next=function(r){var n=this.index++;try{var i=this.delayDurationSelector(r,n);i&&this.tryDelay(i,r)}catch(s){this.destination.error(s)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(r){r.unsubscribe();var n=this.delayNotifierSubscriptions.indexOf(r);return n!==-1&&this.delayNotifierSubscriptions.splice(n,1),r.outerValue},e.prototype.tryDelay=function(r,n){var i=Wt(this,r,n);if(i&&!i.closed){var s=this.destination;s.add(i),this.delayNotifierSubscriptions.push(i)}},e.prototype.tryComplete=function(){this.completed&&this.delayNotifierSubscriptions.length===0&&this.destination.complete()},e}(Nr),SC=function(t){I(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subscriptionDelay=n,i}return e.prototype._subscribe=function(r){this.subscriptionDelay.subscribe(new EC(r,this.source))},e}(ee),EC=function(t){I(e,t);function e(r,n){var i=t.call(this)||this;return i.parent=r,i.source=n,i.sourceSubscribed=!1,i}return e.prototype._next=function(r){this.subscribeToSource()},e.prototype._error=function(r){this.unsubscribe(),this.parent.error(r)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(V);function CC(){return function(e){return e.lift(new xC)}}var xC=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new IC(e))},t}(),IC=function(t){I(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){r.observe(this.destination)},e}(V);function RC(t,e){return function(r){return r.lift(new AC(t,e))}}var AC=function(){function t(e,r){this.keySelector=e,this.flushes=r}return t.prototype.call=function(e,r){return r.subscribe(new MC(e,this.keySelector,this.flushes))},t}(),MC=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.keySelector=n,s.values=new Set,i&&s.add(Ee(i,new we(s))),s}return e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(r){this._error(r)},e.prototype._next=function(r){this.keySelector?this._useKeySelector(r):this._finalizeNext(r,r)},e.prototype._useKeySelector=function(r){var n,i=this.destination;try{n=this.keySelector(r)}catch(s){i.error(s);return}this._finalizeNext(n,r)},e.prototype._finalizeNext=function(r,n){var i=this.values;i.has(r)||(i.add(r),this.destination.next(n))},e}(Se);function I0(t,e){return function(r){return r.lift(new kC(t,e))}}var kC=function(){function t(e,r){this.compare=e,this.keySelector=r}return t.prototype.call=function(e,r){return r.subscribe(new TC(e,this.compare,this.keySelector))},t}(),TC=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.keySelector=i,s.hasKey=!1,typeof n=="function"&&(s.compare=n),s}return e.prototype.compare=function(r,n){return r===n},e.prototype._next=function(r){var n;try{var i=this.keySelector;n=i?i(r):r}catch(a){return this.destination.error(a)}var s=!1;if(this.hasKey)try{var o=this.compare;s=o(this.key,n)}catch(a){return this.destination.error(a)}else this.hasKey=!0;s||(this.key=n,this.destination.next(r))},e}(V);function OC(t,e){return I0(function(r,n){return e?e(r[t],n[t]):r[t]===n[t]})}function uo(t){return t===void 0&&(t=PC),function(e){return e.lift(new NC(t))}}var NC=function(){function t(e){this.errorFactory=e}return t.prototype.call=function(e,r){return r.subscribe(new LC(e,this.errorFactory))},t}(),LC=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.errorFactory=n,i.hasValue=!1,i}return e.prototype._next=function(r){this.hasValue=!0,this.destination.next(r)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var r=void 0;try{r=this.errorFactory()}catch(n){r=n}this.destination.error(r)},e}(V);function PC(){return new Ii}function Uu(t){return function(e){return t===0?An():e.lift(new $C(t))}}var $C=function(){function t(e){if(this.total=e,this.total<0)throw new dn}return t.prototype.call=function(e,r){return r.subscribe(new DC(e,this.total))},t}(),DC=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.count=0,i}return e.prototype._next=function(r){var n=this.total,i=++this.count;i<=n&&(this.destination.next(r),i===n&&(this.destination.complete(),this.unsubscribe()))},e}(V);function jC(t,e){if(t<0)throw new dn;var r=arguments.length>=2;return function(n){return n.pipe(nr(function(i,s){return s===t}),Uu(1),r?Ai(e):uo(function(){return new dn}))}}function BC(){for(var t=[],e=0;e0&&this._next(r.shift()),this.hasCompleted&&this.active===0&&this.destination.complete()},e}(Se);function YC(t){return function(e){return e.lift(new KC(t))}}var KC=function(){function t(e){this.callback=e}return t.prototype.call=function(e,r){return r.subscribe(new XC(e,this.callback))},t}(),XC=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.add(new _e(n)),i}return e}(V);function ex(t,e){if(typeof t!="function")throw new TypeError("predicate is not a function");return function(r){return r.lift(new A0(t,r,!1,e))}}var A0=function(){function t(e,r,n,i){this.predicate=e,this.source=r,this.yieldIndex=n,this.thisArg=i}return t.prototype.call=function(e,r){return r.subscribe(new tx(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),tx=function(t){I(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.predicate=n,a.source=i,a.yieldIndex=s,a.thisArg=o,a.index=0,a}return e.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete(),this.unsubscribe()},e.prototype._next=function(r){var n=this,i=n.predicate,s=n.thisArg,o=this.index++;try{var a=i.call(s||this,r,o,this.source);a&&this.notifyComplete(this.yieldIndex?o:r)}catch(c){this.destination.error(c)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(V);function rx(t,e){return function(r){return r.lift(new A0(t,r,!0,e))}}function nx(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?nr(function(i,s){return t(i,s,n)}):tr,Uu(1),r?Ai(e):uo(function(){return new Ii}))}}function ix(){return function(e){return e.lift(new sx)}}var sx=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new ox(e))},t}(),ox=function(t){I(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._next=function(r){},e}(V);function ax(){return function(t){return t.lift(new cx)}}var cx=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new ux(e))},t}(),ux=function(t){I(e,t);function e(r){return t.call(this,r)||this}return e.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete()},e.prototype._next=function(r){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(V);function ls(t){return function(r){return t===0?An():r.lift(new lx(t))}}var lx=function(){function t(e){if(this.total=e,this.total<0)throw new dn}return t.prototype.call=function(e,r){return r.subscribe(new fx(e,this.total))},t}(),fx=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.ring=new Array,i.count=0,i}return e.prototype._next=function(r){var n=this.ring,i=this.total,s=this.count++;if(n.length0)for(var i=this.count>=this.total?this.total:this.count,s=this.ring,o=0;o=2;return function(n){return n.pipe(t?nr(function(i,s){return t(i,s,n)}):tr,ls(1),r?Ai(e):uo(function(){return new Ii}))}}function dx(t){return function(e){return e.lift(new px(t))}}var px=function(){function t(e){this.value=e}return t.prototype.call=function(e,r){return r.subscribe(new bx(e,this.value))},t}(),bx=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.value=n,i}return e.prototype._next=function(r){this.destination.next(this.value)},e}(V);function gx(){return function(e){return e.lift(new yx)}}var yx=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new vx(e))},t}(),vx=function(t){I(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){this.destination.next(Bt.createNext(r))},e.prototype._error=function(r){var n=this.destination;n.next(Bt.createError(r)),n.complete()},e.prototype._complete=function(){var r=this.destination;r.next(Bt.createComplete()),r.complete()},e}(V);function fs(t,e){var r=!1;return arguments.length>=2&&(r=!0),function(i){return i.lift(new mx(t,e,r))}}var mx=function(){function t(e,r,n){n===void 0&&(n=!1),this.accumulator=e,this.seed=r,this.hasSeed=n}return t.prototype.call=function(e,r){return r.subscribe(new _x(e,this.accumulator,this.seed,this.hasSeed))},t}(),_x=function(t){I(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.accumulator=n,o._seed=i,o.hasSeed=s,o.index=0,o}return Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(r){this.hasSeed=!0,this._seed=r},enumerable:!0,configurable:!0}),e.prototype._next=function(r){if(!this.hasSeed)this.seed=r,this.destination.next(r);else return this._tryNext(r)},e.prototype._tryNext=function(r){var n=this.index++,i;try{i=this.accumulator(this.seed,r,n)}catch(s){this.destination.error(s)}this.seed=i,this.destination.next(i)},e}(V);function lo(t,e){return arguments.length>=2?function(n){return Cc(fs(t,e),ls(1),Ai(e))(n)}:function(n){return Cc(fs(function(i,s,o){return t(i,s,o+1)}),ls(1))(n)}}function wx(t){var e=typeof t=="function"?function(r,n){return t(r,n)>0?r:n}:function(r,n){return r>n?r:n};return lo(e)}function Sx(){for(var t=[],e=0;e0?this._next(r.shift()):this.active===0&&this.hasCompleted&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete())},e}(Se);function Rx(t){var e=typeof t=="function"?function(r,n){return t(r,n)<0?r:n}:function(r,n){return r-1&&(this.count=i-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(V);function zx(t){return function(e){return e.lift(new qx(t))}}var qx=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){return r.subscribe(new Gx(e,this.notifier,r))},t}(),Gx=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.notifier=n,s.source=i,s.sourceIsBeingSubscribedTo=!0,s}return e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(this.sourceIsBeingSubscribedTo===!1)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var r=this,n=r.notifications,i=r.retriesSubscription;n&&(n.unsubscribe(),this.notifications=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var r=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=r,this},e.prototype.subscribeToRetries=function(){this.notifications=new Ne;var r;try{var n=this.notifier;r=n(this.notifications)}catch{return t.prototype.complete.call(this)}this.retries=r,this.retriesSubscription=Ee(r,new we(this))},e}(Se);function Jx(t){return t===void 0&&(t=-1),function(e){return e.lift(new Qx(t,e))}}var Qx=function(){function t(e,r){this.count=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new Zx(e,this.count,this.source))},t}(),Zx=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.count=n,s.source=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=this,i=n.source,s=n.count;if(s===0)return t.prototype.error.call(this,r);s>-1&&(this.count=s-1),i.subscribe(this._unsubscribeAndRecycle())}},e}(V);function Yx(t){return function(e){return e.lift(new Kx(t,e))}}var Kx=function(){function t(e,r){this.notifier=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new Xx(e,this.notifier,this.source))},t}(),Xx=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.notifier=n,s.source=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=this.errors,i=this.retries,s=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{n=new Ne;try{var o=this.notifier;i=o(n)}catch(a){return t.prototype.error.call(this,a)}s=Ee(i,new we(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=s,n.next(r)}},e.prototype._unsubscribe=function(){var r=this,n=r.errors,i=r.retriesSubscription;n&&(n.unsubscribe(),this.errors=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var r=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=r,this.source.subscribe(this)},e}(Se);function eI(t){return function(e){return e.lift(new tI(t))}}var tI=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){var n=new rI(e),i=r.subscribe(n);return i.add(Ee(this.notifier,new we(n))),i},t}(),rI=function(t){I(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.hasValue=!1,r}return e.prototype._next=function(r){this.value=r,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(Se);function nI(t,e){return e===void 0&&(e=ze),function(r){return r.lift(new iI(t,e))}}var iI=function(){function t(e,r){this.period=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new sI(e,this.period,this.scheduler))},t}(),sI=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.period=n,s.scheduler=i,s.hasValue=!1,s.add(i.schedule(oI,n,{subscriber:s,period:n})),s}return e.prototype._next=function(r){this.lastValue=r,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(V);function oI(t){var e=t.subscriber,r=t.period;e.notifyNext(),this.schedule(t,r)}function aI(t,e){return function(r){return r.lift(new cI(t,e))}}var cI=function(){function t(e,r){this.compareTo=e,this.comparator=r}return t.prototype.call=function(e,r){return r.subscribe(new uI(e,this.compareTo,this.comparator))},t}(),uI=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.compareTo=n,s.comparator=i,s._a=[],s._b=[],s._oneComplete=!1,s.destination.add(n.subscribe(new lI(r,s))),s}return e.prototype._next=function(r){this._oneComplete&&this._b.length===0?this.emit(!1):(this._a.push(r),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var r=this,n=r._a,i=r._b,s=r.comparator;n.length>0&&i.length>0;){var o=n.shift(),a=i.shift(),c=!1;try{c=s?s(o,a):o===a}catch(u){this.destination.error(u)}c||this.emit(!1)}},e.prototype.emit=function(r){var n=this.destination;n.next(r),n.complete()},e.prototype.nextB=function(r){this._oneComplete&&this._a.length===0?this.emit(!1):(this._b.push(r),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0},e}(V),lI=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.parent=n,i}return e.prototype._next=function(r){this.parent.nextB(r)},e.prototype._error=function(r){this.parent.error(r),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(V);function fI(){return new Ne}function hI(){return function(t){return xu()(Cr(fI)(t))}}function dI(t,e,r){var n;return t&&typeof t=="object"?n=t:n={bufferSize:t,windowTime:e,refCount:!1,scheduler:r},function(i){return i.lift(pI(n))}}function pI(t){var e=t.bufferSize,r=e===void 0?Number.POSITIVE_INFINITY:e,n=t.windowTime,i=n===void 0?Number.POSITIVE_INFINITY:n,s=t.refCount,o=t.scheduler,a,c=0,u,l=!1,f=!1;return function(p){c++;var v;!a||l?(l=!1,a=new Au(r,i,o),v=a.subscribe(this),u=p.subscribe({next:function(E){a.next(E)},error:function(E){l=!0,a.error(E)},complete:function(){f=!0,u=void 0,a.complete()}}),f&&(u=void 0)):v=a.subscribe(this),this.add(function(){c--,v.unsubscribe(),v=void 0,u&&!f&&s&&c===0&&(u.unsubscribe(),u=void 0,a=void 0)})}}function bI(t){return function(e){return e.lift(new gI(t,e))}}var gI=function(){function t(e,r){this.predicate=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new yI(e,this.predicate,this.source))},t}(),yI=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.source=i,s.seenValue=!1,s.index=0,s}return e.prototype.applySingleValue=function(r){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=r)},e.prototype._next=function(r){var n=this.index++;this.predicate?this.tryNext(r,n):this.applySingleValue(r)},e.prototype.tryNext=function(r,n){try{this.predicate(r,n,this.source)&&this.applySingleValue(r)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){var r=this.destination;this.index>0?(r.next(this.seenValue?this.singleValue:void 0),r.complete()):r.error(new Ii)},e}(V);function vI(t){return function(e){return e.lift(new mI(t))}}var mI=function(){function t(e){this.total=e}return t.prototype.call=function(e,r){return r.subscribe(new _I(e,this.total))},t}(),_I=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.count=0,i}return e.prototype._next=function(r){++this.count>this.total&&this.destination.next(r)},e}(V);function wI(t){return function(e){return e.lift(new SI(t))}}var SI=function(){function t(e){if(this._skipCount=e,this._skipCount<0)throw new dn}return t.prototype.call=function(e,r){return this._skipCount===0?r.subscribe(new V(e)):r.subscribe(new EI(e,this._skipCount))},t}(),EI=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i._skipCount=n,i._count=0,i._ring=new Array(n),i}return e.prototype._next=function(r){var n=this._skipCount,i=this._count++;if(i0?this.startWindowEvery:this.windowSize,i=this.destination,s=this.windowSize,o=this.windows,a=o.length,c=0;c=0&&u%n===0&&!this.closed&&o.shift().complete(),++this.count%n===0&&!this.closed){var l=new Ne;o.push(l),i.next(l)}},e.prototype._error=function(r){var n=this.windows;if(n)for(;n.length>0&&!this.closed;)n.shift().error(r);this.destination.error(r)},e.prototype._complete=function(){var r=this.windows;if(r)for(;r.length>0&&!this.closed;)r.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(V);function bR(t){var e=ze,r=null,n=Number.POSITIVE_INFINITY;return Ye(arguments[3])&&(e=arguments[3]),Ye(arguments[2])?e=arguments[2]:pn(arguments[2])&&(n=Number(arguments[2])),Ye(arguments[1])?e=arguments[1]:pn(arguments[1])&&(r=Number(arguments[1])),function(s){return s.lift(new gR(t,r,n,e))}}var gR=function(){function t(e,r,n,i){this.windowTimeSpan=e,this.windowCreationInterval=r,this.maxWindowSize=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new vR(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),yR=function(t){I(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._numberOfNextedValues=0,r}return e.prototype.next=function(r){this._numberOfNextedValues++,t.prototype.next.call(this,r)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(Ne),vR=function(t){I(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;a.destination=r,a.windowTimeSpan=n,a.windowCreationInterval=i,a.maxWindowSize=s,a.scheduler=o,a.windows=[];var c=a.openWindow();if(i!==null&&i>=0){var u={subscriber:a,window:c,context:null},l={windowTimeSpan:n,windowCreationInterval:i,subscriber:a,scheduler:o};a.add(o.schedule(T0,n,u)),a.add(o.schedule(_R,i,l))}else{var f={subscriber:a,window:c,windowTimeSpan:n};a.add(o.schedule(mR,n,f))}return a}return e.prototype._next=function(r){for(var n=this.windows,i=n.length,s=0;s=this.maxWindowSize&&this.closeWindow(o))}},e.prototype._error=function(r){for(var n=this.windows;n.length>0;)n.shift().error(r);this.destination.error(r)},e.prototype._complete=function(){for(var r=this.windows;r.length>0;){var n=r.shift();n.closed||n.complete()}this.destination.complete()},e.prototype.openWindow=function(){var r=new yR;this.windows.push(r);var n=this.destination;return n.next(r),r},e.prototype.closeWindow=function(r){r.complete();var n=this.windows;n.splice(n.indexOf(r),1)},e}(V);function mR(t){var e=t.subscriber,r=t.windowTimeSpan,n=t.window;n&&e.closeWindow(n),t.window=e.openWindow(),this.schedule(t,r)}function _R(t){var e=t.windowTimeSpan,r=t.subscriber,n=t.scheduler,i=t.windowCreationInterval,s=r.openWindow(),o=this,a={action:o,subscription:null},c={subscriber:r,window:s,context:a};a.subscription=n.schedule(T0,e,c),o.add(a.subscription),o.schedule(t,i)}function T0(t){var e=t.subscriber,r=t.window,n=t.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),e.closeWindow(r)}function wR(t,e){return function(r){return r.lift(new SR(t,e))}}var SR=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new ER(e,this.openings,this.closingSelector))},t}(),ER=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.openings=n,s.closingSelector=i,s.contexts=[],s.add(s.openSubscription=Wt(s,n,n)),s}return e.prototype._next=function(r){var n=this.contexts;if(n)for(var i=n.length,s=0;s0){var o=s.indexOf(i);o!==-1&&s.splice(o,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(r){if(this.toRespond.length===0){var n=[r].concat(this.values);this.project?this._tryProject(n):this.destination.next(n)}},e.prototype._tryProject=function(r){var n;try{n=this.project.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(Nr);function kR(){for(var t=[],e=0;e{let a;try{this.webSocket=a=new this.WebSocketClass(this.url)}catch(c){o.error(c);return}this.connectionStateSubject.next(n.CONNECTING),a.onclose=c=>{this.clearWebSocket(),o.error(new Error(`websocket error ${c.code}: ${c.reason}`)),this.connectionStateSubject.next(n.DISCONNECTED)},a.onopen=c=>{o.next(),o.complete(),this.connectionStateSubject.next(n.CONNECTED)},a.onmessage=c=>{this.incomingDataSubject.next(c.data)}}).pipe((0,r.take)(1))}disconnect(){const{webSocket:o}=this;if(o){this.clearWebSocket(),this.connectionStateSubject.next(n.DISCONNECTED);try{o.close()}catch{}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,r.flatMap)(o=>{let a;try{a=JSON.parse(o)}catch{return(0,e.empty)()}return(0,e.of)(a)}))}sendData(o){const{webSocket:a}=this;if(!a)throw new Error("websocket is not connected");a.send(o)}clearWebSocket(){const{webSocket:o}=this;o&&(this.webSocket=null,o.onclose=null,o.onerror=null,o.onmessage=null,o.onopen=null)}}t.RxWebSocket=i})(O0);var ho={};Object.defineProperty(ho,"__esModule",{value:!0});ho.isServerMessageFail=void 0;function jR(t){return t&&t.type==="Fail"&&typeof t.id=="number"&&typeof t.sessionId=="string"&&typeof t.error=="string"}ho.isServerMessageFail=jR;Object.defineProperty(fo,"__esModule",{value:!0});fo.WalletSDKConnection=void 0;const lt=Js,ie=zu,Dn=_n,Vr=ui,jn=nt,Bn=vn,Ui=O0,rc=ho,mh=1e4,BR=6e4;class FR{constructor(e,r,n,i,s=WebSocket){this.sessionId=e,this.sessionKey=r,this.diagnostic=i,this.subscriptions=new lt.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Vr.IntNumber)(1),this.connectedSubject=new lt.BehaviorSubject(!1),this.linkedSubject=new lt.BehaviorSubject(!1),this.sessionConfigSubject=new lt.ReplaySubject(1);const o=new Ui.RxWebSocket(n+"/rpc",s);this.ws=o,this.subscriptions.add(o.connectionState$.pipe((0,ie.tap)(a=>{var c;return(c=this.diagnostic)===null||c===void 0?void 0:c.log(Bn.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:Dn.Session.hash(e)})}),(0,ie.skip)(1),(0,ie.filter)(a=>a===Ui.ConnectionState.DISCONNECTED&&!this.destroyed),(0,ie.delay)(5e3),(0,ie.filter)(a=>!this.destroyed),(0,ie.flatMap)(a=>o.connect()),(0,ie.retry)()).subscribe()),this.subscriptions.add(o.connectionState$.pipe((0,ie.skip)(2),(0,ie.switchMap)(a=>(0,lt.iif)(()=>a===Ui.ConnectionState.CONNECTED,this.authenticate().pipe((0,ie.tap)(c=>this.sendIsLinked()),(0,ie.tap)(c=>this.sendGetSessionConfig()),(0,ie.map)(c=>!0)),(0,lt.of)(!1))),(0,ie.distinctUntilChanged)(),(0,ie.catchError)(a=>(0,lt.of)(!1))).subscribe(a=>this.connectedSubject.next(a))),this.subscriptions.add(o.connectionState$.pipe((0,ie.skip)(1),(0,ie.switchMap)(a=>(0,lt.iif)(()=>a===Ui.ConnectionState.CONNECTED,(0,lt.timer)(0,mh)))).subscribe(a=>a===0?this.updateLastHeartbeat():this.heartbeat())),this.subscriptions.add(o.incomingData$.pipe((0,ie.filter)(a=>a==="h")).subscribe(a=>this.updateLastHeartbeat())),this.subscriptions.add(o.incomingJSONData$.pipe((0,ie.filter)(a=>["IsLinkedOK","Linked"].includes(a.type))).subscribe(a=>{var c;const u=a;(c=this.diagnostic)===null||c===void 0||c.log(Bn.EVENTS.LINKED,{sessionIdHash:Dn.Session.hash(e),linked:u.linked,type:a.type,onlineGuests:u.onlineGuests}),this.linkedSubject.next(u.linked||u.onlineGuests>0)})),this.subscriptions.add(o.incomingJSONData$.pipe((0,ie.filter)(a=>["GetSessionConfigOK","SessionConfigUpdated"].includes(a.type))).subscribe(a=>{var c;const u=a;(c=this.diagnostic)===null||c===void 0||c.log(Bn.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Dn.Session.hash(e),metadata_keys:u&&u.metadata?Object.keys(u.metadata):void 0}),this.sessionConfigSubject.next({webhookId:u.webhookId,webhookUrl:u.webhookUrl,metadata:u.metadata})}))}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(Bn.EVENTS.STARTED_CONNECTING,{sessionIdHash:Dn.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var e;this.subscriptions.unsubscribe(),this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(Bn.EVENTS.DISCONNECTED,{sessionIdHash:Dn.Session.hash(this.sessionId)}),this.destroyed=!0}get isDestroyed(){return this.destroyed}get connected$(){return this.connectedSubject.asObservable()}get onceConnected$(){return this.connected$.pipe((0,ie.filter)(e=>e),(0,ie.take)(1),(0,ie.map)(()=>{}))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,ie.filter)(e=>e),(0,ie.take)(1),(0,ie.map)(()=>{}))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,ie.filter)(e=>{if(e.type!=="Event")return!1;const r=e;return typeof r.sessionId=="string"&&typeof r.eventId=="string"&&typeof r.event=="string"&&typeof r.data=="string"}),(0,ie.map)(e=>e))}setSessionMetadata(e,r){const n=(0,jn.ClientMessageSetSessionConfig)({id:(0,Vr.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[e]:r}});return this.onceConnected$.pipe((0,ie.flatMap)(i=>this.makeRequest(n)),(0,ie.map)(i=>{if((0,rc.isServerMessageFail)(i))throw new Error(i.error||"failed to set session metadata")}))}publishEvent(e,r,n=!1){const i=(0,jn.ClientMessagePublishEvent)({id:(0,Vr.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:r,callWebhook:n});return this.onceLinked$.pipe((0,ie.flatMap)(s=>this.makeRequest(i)),(0,ie.map)(s=>{if((0,rc.isServerMessageFail)(s))throw new Error(s.error||"failed to publish event");return s.eventId}))}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>mh*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}makeRequest(e,r=BR){const n=e.id;try{this.sendData(e)}catch(i){return(0,lt.throwError)(i)}return this.ws.incomingJSONData$.pipe((0,ie.timeoutWith)(r,(0,lt.throwError)(new Error(`request ${n} timed out`))),(0,ie.filter)(i=>i.id===n),(0,ie.take)(1))}authenticate(){const e=(0,jn.ClientMessageHostSession)({id:(0,Vr.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,ie.map)(r=>{if((0,rc.isServerMessageFail)(r))throw new Error(r.error||"failed to authentcate")}))}sendIsLinked(){const e=(0,jn.ClientMessageIsLinked)({id:(0,Vr.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}sendGetSessionConfig(){const e=(0,jn.ClientMessageGetSessionConfig)({id:(0,Vr.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}}fo.WalletSDKConnection=FR;var gn={};Object.defineProperty(gn,"__esModule",{value:!0});gn.decrypt=gn.encrypt=void 0;const hs=W;async function WR(t,e){if(e.length!==64)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",(0,hs.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},n,i.encode(t)),o=16,a=s.slice(s.byteLength-o),c=s.slice(0,s.byteLength-o),u=new Uint8Array(a),l=new Uint8Array(c),f=new Uint8Array([...r,...u,...l]);return(0,hs.uint8ArrayToHex)(f)}gn.encrypt=WR;function HR(t,e){if(e.length!==64)throw Error("secret must be 256 bits");return new Promise((r,n)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,hs.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,hs.hexStringToUint8Array)(t),o=s.slice(0,12),a=s.slice(12,28),c=s.slice(28),u=new Uint8Array([...c,...a]),l={name:"AES-GCM",iv:new Uint8Array(o)};try{const f=await window.crypto.subtle.decrypt(l,i,u),h=new TextDecoder;r(h.decode(f))}catch(f){n(f)}})()})}gn.decrypt=HR;var po={},bo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMessageType=void 0,function(e){e.SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"}(t.RelayMessageType||(t.RelayMessageType={}))})(bo);Object.defineProperty(po,"__esModule",{value:!0});po.Web3RequestCanceledMessage=void 0;const VR=bo;function UR(t){return{type:VR.RelayMessageType.WEB3_REQUEST_CANCELED,id:t}}po.Web3RequestCanceledMessage=UR;var go={};Object.defineProperty(go,"__esModule",{value:!0});go.Web3RequestMessage=void 0;const zR=bo;function qR(t){return Object.assign({type:zR.RelayMessageType.WEB3_REQUEST},t)}go.Web3RequestMessage=qR;var yn={};Object.defineProperty(yn,"__esModule",{value:!0});yn.isWeb3ResponseMessage=yn.Web3ResponseMessage=void 0;const N0=bo;function GR(t){return Object.assign({type:N0.RelayMessageType.WEB3_RESPONSE},t)}yn.Web3ResponseMessage=GR;function JR(t){return t&&t.type===N0.RelayMessageType.WEB3_RESPONSE}yn.isWeb3ResponseMessage=JR;var QR=F&&F.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ZR=F&&F.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),L0=F&&F.__decorate||function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},YR=F&&F.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&QR(e,t,r);return ZR(e,t),e},KR=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ao,"__esModule",{value:!0});ao.WalletSDKRelay=void 0;const P0=KR(co),ur=Js,Ie=zu,je=vn,XR=fo,Ur=ni,e6=ui,ye=W,qt=YR(gn),Gt=_n,zi=pt,Le=ms,t6=po,r6=go,tt=be,Ge=yn;class dt extends zi.WalletSDKRelayAbstract{constructor(e){var r;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new ur.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new ur.Subscription,this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:n,ui:i,connection:s}=this.subscribe();if(this._session=n,this.connection=s,this.relayEventManager=e.relayEventManager,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this.diagnostic={log:e.eventListener.onEvent}:this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(r=e.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe(i=>{this.dappDefaultChain!==i&&(this.dappDefaultChain=i)}));const e=Gt.Session.load(this.storage)||new Gt.Session(this.storage).save(),r=new XR.WalletSDKConnection(e.id,e.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(r.sessionConfig$.subscribe({next:i=>{this.onSessionConfigChanged(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(je.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(r.incomingEvent$.pipe((0,Ie.filter)(i=>i.event==="Web3Response")).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(r.linked$.pipe((0,Ie.skip)(1),(0,Ie.tap)(i=>{var s;this.isLinked=i;const o=this.storage.getItem(zi.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this.session.linked=i),this.isUnlinkedErrorState=!1,o){const a=o.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";if(a[0]!==""&&!i&&this.session.linked&&!c){this.isUnlinkedErrorState=!0;const u=this.getSessionIdHash();(s=this.diagnostic)===null||s===void 0||s.log(je.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:u})}}})).subscribe()),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>!!i.metadata&&i.metadata.__destroyed==="1")).subscribe(()=>{var i;const s=r.isDestroyed;return(i=this.diagnostic)===null||i===void 0||i.log(je.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:s,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>i.metadata&&i.metadata.WalletUsername!==void 0)).pipe((0,Ie.mergeMap)(i=>qt.decrypt(i.metadata.WalletUsername,e.secret))).subscribe({next:i=>{this.storage.setItem(zi.WALLET_USER_NAME_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(je.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>i.metadata&&i.metadata.AppVersion!==void 0)).pipe((0,Ie.mergeMap)(i=>qt.decrypt(i.metadata.AppVersion,e.secret))).subscribe({next:i=>{this.storage.setItem(zi.APP_VERSION_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(je.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>i.metadata&&i.metadata.ChainId!==void 0&&i.metadata.JsonRpcUrl!==void 0)).pipe((0,Ie.mergeMap)(i=>(0,ur.zip)(qt.decrypt(i.metadata.ChainId,e.secret),qt.decrypt(i.metadata.JsonRpcUrl,e.secret)))).pipe((0,Ie.distinctUntilChanged)()).subscribe({next:([i,s])=>{this.chainCallback&&this.chainCallback(i,s)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(je.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>i.metadata&&i.metadata.EthereumAddress!==void 0)).pipe((0,Ie.mergeMap)(i=>qt.decrypt(i.metadata.EthereumAddress,e.secret))).subscribe({next:i=>{this.accountsCallback&&this.accountsCallback([i]),dt.accountRequestCallbackIds.size>0&&(Array.from(dt.accountRequestCallbackIds.values()).forEach(s=>{const o=(0,Ge.Web3ResponseMessage)({id:s,response:(0,tt.RequestEthereumAccountsResponse)([i])});this.invokeCallback(Object.assign(Object.assign({},o),{id:s}))}),dt.accountRequestCallbackIds.clear())},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(je.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>i.metadata&&i.metadata.AppSrc!==void 0)).pipe((0,Ie.mergeMap)(i=>qt.decrypt(i.metadata.AppSrc,e.secret))).subscribe({next:i=>{this.ui.setAppSrc(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(je.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));const n=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:e,connected$:r.connected$,chainId$:this.dappDefaultChainSubject});return r.connect(),{session:e,ui:n,connection:r}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,Ie.timeout)(1e3),(0,Ie.catchError)(e=>(0,ur.of)(null))).subscribe(e=>{var r,n,i;const s=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch{(r=this.diagnostic)===null||r===void 0||r.log(je.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}(n=this.diagnostic)===null||n===void 0||n.log(je.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const o=Gt.Session.load(this.storage);if((o==null?void 0:o.id)===this._session.id?this.storage.clear():o&&((i=this.diagnostic)===null||i===void 0||i.log(je.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Gt.Session.hash(o.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new ur.Subscription;const{session:a,ui:c,connection:u}=this.subscribe();this._session=a,this.connection=u,this.ui=c,s&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()},e=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(je.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:Le.Web3Method.signEthereumMessage,params:{message:(0,ye.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:Le.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,ye.hexStringFromBuffer)(e,!0),signature:(0,ye.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:Le.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,ye.bigIntStringFromBN)(e.weiValue),data:(0,ye.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,ye.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,ye.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,ye.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,ye.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:Le.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,ye.bigIntStringFromBN)(e.weiValue),data:(0,ye.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,ye.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,ye.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,ye.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,ye.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:Le.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,ye.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:Le.Web3Method.scanQRCode,params:{regExp:e}})}getQRCodeUrl(){return(0,ye.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,r){return this.sendRequest({method:Le.Web3Method.generic,params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,ye.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,o),r==null||r()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,c=>{if(r==null||r(),c.errorMessage)return a(new Error(c.errorMessage));o(c)}),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChainSubject.next(e)}publishWeb3RequestEvent(e,r){var n;const i=(0,r6.Web3RequestMessage)({id:e,request:r}),s=Gt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(je.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Gt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",i,!0).subscribe({next:o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(je.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Gt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})},error:o=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:o.message}}))}}))}publishWeb3RequestCanceledEvent(e){const r=(0,t6.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",r,!1).subscribe())}publishEvent(e,r,n){const i=this.session.secret;return new ur.Observable(s=>{qt.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin})),i).then(o=>{s.next(o),s.complete()})}).pipe((0,Ie.mergeMap)(s=>this.connection.publishEvent(e,s,n)))}handleIncomingEvent(e){try{this.subscriptions.add((0,ur.from)(qt.decrypt(e.data,this.session.secret)).pipe((0,Ie.map)(r=>JSON.parse(r))).subscribe({next:r=>{const n=(0,Ge.isWeb3ResponseMessage)(r)?r:null;n&&this.handleWeb3ResponseMessage(n)},error:()=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(je.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch{return}}handleWeb3ResponseMessage(e){var r;const{response:n}=e;if((r=this.diagnostic)===null||r===void 0||r.log(je.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),(0,tt.isRequestEthereumAccountsResponse)(n)){dt.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),dt.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n,i){var s;const o=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Ur.standardErrorMessage)(i);this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:e,response:{method:r,errorMessage:o,errorCode:i}}))}invokeCallback(e){const r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:Le.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,ye.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,s)};return{promise:new Promise((s,o)=>{var a;this.relayEventManager.callbacks.set(r,u=>{if(this.ui.hideRequestEthereumAccounts(),u.errorMessage)return o(new Error(u.errorMessage));s(u)});const c=((a=window==null?void 0:window.navigator)===null||a===void 0?void 0:a.userAgent)||null;if(c&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(c)){let u;try{(0,ye.isInIFrame)()&&window.top?u=window.top.location:u=window.location}catch{u=window.location}u.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(u.href)}`;return}if(this.ui.inlineAccountsResponse()){const u=l=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:r,response:(0,tt.RequestEthereumAccountsResponse)(l)}))};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:u})}else{const u=Ur.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(u)})}dt.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,e)}),cancel:n}}selectProvider(e){const r={method:Le.Web3Method.selectProvider,params:{providerOptions:e}},n=(0,ye.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},s=new Promise((o,a)=>{this.relayEventManager.callbacks.set(n,l=>{if(l.errorMessage)return a(new Error(l.errorMessage));o(l)});const c=l=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:n,response:(0,tt.SelectProviderResponse)(e6.ProviderType.Unselected)}))},u=l=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:n,response:(0,tt.SelectProviderResponse)(l)}))};this.ui.selectProvider&&this.ui.selectProvider({onApprove:u,onCancel:c,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,r,n,i,s,o){const a={method:Le.Web3Method.watchAsset,params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:o}};let c=null;const u=(0,ye.randomBytesHex)(8),l=h=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,h),c==null||c()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload}));const f=new Promise((h,p)=>{this.relayEventManager.callbacks.set(u,_=>{if(c==null||c(),_.errorMessage)return p(new Error(_.errorMessage));h(_)});const v=_=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:u,response:(0,tt.WatchAssetReponse)(!1)}))},E=()=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:u,response:(0,tt.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:E,onCancel:v,type:e,address:r,symbol:n,decimals:i,image:s,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,a)});return{cancel:l,promise:f}}addEthereumChain(e,r,n,i,s,o){const a={method:Le.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:o}};let c=null;const u=(0,ye.randomBytesHex)(8),l=h=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,h),c==null||c()};return this.ui.inlineAddEthereumChain(e)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload})),{promise:new Promise((h,p)=>{this.relayEventManager.callbacks.set(u,_=>{if(c==null||c(),_.errorMessage)return p(new Error(_.errorMessage));h(_)});const v=_=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:u,response:(0,tt.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},E=_=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:u,response:(0,tt.AddEthereumChainResponse)({isApproved:!0,rpcUrl:_})}))};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:v,onApprove:E,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(e)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,a)}),cancel:l}}switchEthereumChain(e,r){const n={method:Le.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:r})},i=(0,ye.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,a)};return{promise:new Promise((a,c)=>{this.relayEventManager.callbacks.set(i,f=>{if((0,tt.isErrorResponse)(f)&&f.errorCode)return c(Ur.standardErrors.provider.custom({code:f.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(f.errorMessage)return c(new Error(f.errorMessage));a(f)});const u=f=>{var h;if(f){const p=(h=(0,Ur.getErrorCode)(f))!==null&&h!==void 0?h:Ur.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,Le.Web3Method.switchEthereumChain,f instanceof Error?f:Ur.standardErrors.provider.unsupportedChain(e),p)}else this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:i,response:(0,tt.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},l=f=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:i,response:(0,tt.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:f})}))};this.ui.switchEthereumChain({onCancel:u,onApprove:l,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return Gt.Session.hash(this._session.id)}sendRequestStandalone(e,r){const n=s=>{this.handleErrorResponse(e,r.method,s)},i=s=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:e,response:s}))};switch(r.method){case Le.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case Le.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case Le.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case Le.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}onSessionConfigChanged(e){}}dt.accountRequestCallbackIds=new Set;L0([P0.default],dt.prototype,"resetAndReload",null);L0([P0.default],dt.prototype,"handleIncomingEvent",null);ao.WalletSDKRelay=dt;var yo={};Object.defineProperty(yo,"__esModule",{value:!0});yo.WalletSDKRelayEventManager=void 0;const n6=W;class i6{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,n6.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}yo.WalletSDKRelayEventManager=i6;Object.defineProperty(Qn,"__esModule",{value:!0});Qn.CoinbaseWalletSDK=void 0;const s6=bs,o6=gs,a6=ys,c6=tn,u6=Us,l6=ao,f6=yo,h6=W,$0=mn;class vo{constructor(e){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=e.linkAPIUrl||o6.LINK_API_URL;let o;if(e.uiConstructor?o=e.uiConstructor:o=u=>new u6.WalletSDKUI(u),typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this._diagnosticLogger={log:e.eventListener.onEvent}:this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=(i=e.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const a=new URL(s),c=`${a.protocol}//${a.host}`;this._storage=new a6.ScopedLocalStorage(`-walletlink:${c}`),this._storage.setItem("version",vo.VERSION),!(this.walletExtension||this.coinbaseBrowser)&&(this._relayEventManager=new f6.WalletSDKRelayEventManager,this._relay=new l6.WalletSDKRelay({linkAPIUrl:s,version:$0.LIB_VERSION,darkMode:!!e.darkMode,uiConstructor:o,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(e.appName,e.appLogoUrl),!e.headlessMode&&this._relay.attachUI())}makeWeb3Provider(e="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||s.setConnectDisabled(!0),new c6.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,r){var n;this._appName=e||"DApp",this._appLogoUrl=r||(0,h6.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const r=this.walletExtension;r?r.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,r;return(r=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(e,r=240){return(0,s6.walletLogo)(e,r)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,r;try{const n=(e=window.ethereum)!==null&&e!==void 0?e:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}}Qn.CoinbaseWalletSDK=vo;vo.VERSION=$0.LIB_VERSION;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=Qn,r=tn;var n=Qn;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=tn;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(Lc);const d6=j0(Lc),C6=B0({__proto__:null,default:d6},[Lc]);export{C6 as i}; diff --git a/assets/index-7c92980a.js b/assets/index-7c92980a.js deleted file mode 100644 index a798dc16..00000000 --- a/assets/index-7c92980a.js +++ /dev/null @@ -1,6 +0,0 @@ -import{am as oe}from"./index-d66ad66e.js";const se=Symbol(),Pt=Object.getPrototypeOf,Ft=new WeakMap,ue=i=>i&&(Ft.has(i)?Ft.get(i):Pt(i)===Object.prototype||Pt(i)===Array.prototype),ce=i=>ue(i)&&i[se]||null,Nt=(i,c=!0)=>{Ft.set(i,c)},At=i=>typeof i=="object"&&i!==null,J=new WeakMap,pt=new WeakSet,ae=(i=Object.is,c=(y,I)=>new Proxy(y,I),l=y=>At(y)&&!pt.has(y)&&(Array.isArray(y)||!(Symbol.iterator in y))&&!(y instanceof WeakMap)&&!(y instanceof WeakSet)&&!(y instanceof Error)&&!(y instanceof Number)&&!(y instanceof Date)&&!(y instanceof String)&&!(y instanceof RegExp)&&!(y instanceof ArrayBuffer),h=y=>{switch(y.status){case"fulfilled":return y.value;case"rejected":throw y.reason;default:throw y}},p=new WeakMap,d=(y,I,B=h)=>{const L=p.get(y);if((L==null?void 0:L[0])===I)return L[1];const U=Array.isArray(y)?[]:Object.create(Object.getPrototypeOf(y));return Nt(U,!0),p.set(y,[I,U]),Reflect.ownKeys(y).forEach(P=>{if(Object.getOwnPropertyDescriptor(U,P))return;const T=Reflect.get(y,P),G={value:T,enumerable:!0,configurable:!0};if(pt.has(T))Nt(T,!1);else if(T instanceof Promise)delete G.value,G.get=()=>B(T);else if(J.has(T)){const[O,ct]=J.get(T);G.value=d(O,ct(),B)}Object.defineProperty(U,P,G)}),U},f=new WeakMap,s=[1,1],E=y=>{if(!At(y))throw new Error("object required");const I=f.get(y);if(I)return I;let B=s[0];const L=new Set,U=(x,m=++s[0])=>{B!==m&&(B=m,L.forEach(w=>w(x,m)))};let P=s[1];const T=(x=++s[1])=>(P!==x&&!L.size&&(P=x,O.forEach(([m])=>{const w=m[1](x);w>B&&(B=w)})),B),G=x=>(m,w)=>{const D=[...m];D[1]=[x,...D[1]],U(D,w)},O=new Map,ct=(x,m)=>{if(L.size){const w=m[3](G(x));O.set(x,[m,w])}else O.set(x,[m])},at=x=>{var m;const w=O.get(x);w&&(O.delete(x),(m=w[1])==null||m.call(w))},gt=x=>(L.add(x),L.size===1&&O.forEach(([w,D],H)=>{const Y=w[3](G(H));O.set(H,[w,Y])}),()=>{L.delete(x),L.size===0&&O.forEach(([w,D],H)=>{D&&(D(),O.set(H,[w]))})}),k=Array.isArray(y)?[]:Object.create(Object.getPrototypeOf(y)),Q=c(k,{deleteProperty(x,m){const w=Reflect.get(x,m);at(m);const D=Reflect.deleteProperty(x,m);return D&&U(["delete",[m],w]),D},set(x,m,w,D){const H=Reflect.has(x,m),Y=Reflect.get(x,m,D);if(H&&(i(Y,w)||f.has(w)&&i(Y,f.get(w))))return!0;at(m),At(w)&&(w=ce(w)||w);let Z=w;if(w instanceof Promise)w.then($=>{w.status="fulfilled",w.value=$,U(["resolve",[m],$])}).catch($=>{w.status="rejected",w.reason=$,U(["reject",[m],$])});else{!J.has(w)&&l(w)&&(Z=E(w));const $=!pt.has(Z)&&J.get(Z);$&&ct(m,$)}return Reflect.set(x,m,Z,D),U(["set",[m],w,Y]),!0}});f.set(y,Q);const Et=[k,T,d,gt];return J.set(Q,Et),Reflect.ownKeys(y).forEach(x=>{const m=Object.getOwnPropertyDescriptor(y,x);"value"in m&&(Q[x]=y[x],delete m.value,delete m.writable),Object.defineProperty(k,x,m)}),Q})=>[E,J,pt,i,c,l,h,p,d,f,s],[le]=ae();function X(i={}){return le(i)}function rt(i,c,l){const h=J.get(i);let p;const d=[],f=h[3];let s=!1;const y=f(I=>{if(d.push(I),l){c(d.splice(0));return}p||(p=Promise.resolve().then(()=>{p=void 0,s&&c(d.splice(0))}))});return s=!0,()=>{s=!1,y()}}function fe(i,c){const l=J.get(i),[h,p,d]=l;return d(h,p(),c)}var zt={},wt={};wt.byteLength=de;wt.toByteArray=we;wt.fromByteArray=Ee;var z=[],N=[],he=typeof Uint8Array<"u"?Uint8Array:Array,Ut="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var ot=0,pe=Ut.length;ot0)throw new Error("Invalid string. Length must be a multiple of 4");var l=i.indexOf("=");l===-1&&(l=c);var h=l===c?0:4-l%4;return[l,h]}function de(i){var c=Gt(i),l=c[0],h=c[1];return(l+h)*3/4-h}function ye(i,c,l){return(c+l)*3/4-l}function we(i){var c,l=Gt(i),h=l[0],p=l[1],d=new he(ye(i,h,p)),f=0,s=p>0?h-4:h,E;for(E=0;E>16&255,d[f++]=c>>8&255,d[f++]=c&255;return p===2&&(c=N[i.charCodeAt(E)]<<2|N[i.charCodeAt(E+1)]>>4,d[f++]=c&255),p===1&&(c=N[i.charCodeAt(E)]<<10|N[i.charCodeAt(E+1)]<<4|N[i.charCodeAt(E+2)]>>2,d[f++]=c>>8&255,d[f++]=c&255),d}function ge(i){return z[i>>18&63]+z[i>>12&63]+z[i>>6&63]+z[i&63]}function me(i,c,l){for(var h,p=[],d=c;ds?s:f+d));return h===1?(c=i[l-1],p.push(z[c>>2]+z[c<<4&63]+"==")):h===2&&(c=(i[l-2]<<8)+i[l-1],p.push(z[c>>10]+z[c>>4&63]+z[c<<2&63]+"=")),p.join("")}var Lt={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */Lt.read=function(i,c,l,h,p){var d,f,s=p*8-h-1,E=(1<>1,I=-7,B=l?p-1:0,L=l?-1:1,U=i[c+B];for(B+=L,d=U&(1<<-I)-1,U>>=-I,I+=s;I>0;d=d*256+i[c+B],B+=L,I-=8);for(f=d&(1<<-I)-1,d>>=-I,I+=h;I>0;f=f*256+i[c+B],B+=L,I-=8);if(d===0)d=1-y;else{if(d===E)return f?NaN:(U?-1:1)*(1/0);f=f+Math.pow(2,h),d=d-y}return(U?-1:1)*f*Math.pow(2,d-h)};Lt.write=function(i,c,l,h,p,d){var f,s,E,y=d*8-p-1,I=(1<>1,L=p===23?Math.pow(2,-24)-Math.pow(2,-77):0,U=h?0:d-1,P=h?1:-1,T=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(s=isNaN(c)?1:0,f=I):(f=Math.floor(Math.log(c)/Math.LN2),c*(E=Math.pow(2,-f))<1&&(f--,E*=2),f+B>=1?c+=L/E:c+=L*Math.pow(2,1-B),c*E>=2&&(f++,E/=2),f+B>=I?(s=0,f=I):f+B>=1?(s=(c*E-1)*Math.pow(2,p),f=f+B):(s=c*Math.pow(2,B-1)*Math.pow(2,p),f=0));p>=8;i[l+U]=s&255,U+=P,s/=256,p-=8);for(f=f<0;i[l+U]=f&255,U+=P,f/=256,y-=8);i[l+U-P]|=T*128};/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */(function(i){const c=wt,l=Lt,h=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;i.Buffer=s,i.SlowBuffer=ct,i.INSPECT_MAX_BYTES=50;const p=2147483647;i.kMaxLength=p,s.TYPED_ARRAY_SUPPORT=d(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function d(){try{const r=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(r,t),r.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function f(r){if(r>p)throw new RangeError('The value "'+r+'" is invalid for option "size"');const t=new Uint8Array(r);return Object.setPrototypeOf(t,s.prototype),t}function s(r,t,e){if(typeof r=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return B(r)}return E(r,t,e)}s.poolSize=8192;function E(r,t,e){if(typeof r=="string")return L(r,t);if(ArrayBuffer.isView(r))return P(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(v(r,ArrayBuffer)||r&&v(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(v(r,SharedArrayBuffer)||r&&v(r.buffer,SharedArrayBuffer)))return T(r,t,e);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return s.from(n,t,e);const o=G(r);if(o)return o;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return s.from(r[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}s.from=function(r,t,e){return E(r,t,e)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function y(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function I(r,t,e){return y(r),r<=0?f(r):t!==void 0?typeof e=="string"?f(r).fill(t,e):f(r).fill(t):f(r)}s.alloc=function(r,t,e){return I(r,t,e)};function B(r){return y(r),f(r<0?0:O(r)|0)}s.allocUnsafe=function(r){return B(r)},s.allocUnsafeSlow=function(r){return B(r)};function L(r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!s.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const e=at(r,t)|0;let n=f(e);const o=n.write(r,t);return o!==e&&(n=n.slice(0,o)),n}function U(r){const t=r.length<0?0:O(r.length)|0,e=f(t);for(let n=0;n=p)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p.toString(16)+" bytes");return r|0}function ct(r){return+r!=r&&(r=0),s.alloc(+r)}s.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==s.prototype},s.compare=function(t,e){if(v(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),v(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,o=e.length;for(let u=0,a=Math.min(n,o);uo.length?(s.isBuffer(a)||(a=s.from(a)),a.copy(o,u)):Uint8Array.prototype.set.call(o,a,u);else if(s.isBuffer(a))a.copy(o,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=a.length}return o};function at(r,t){if(s.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||v(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);const e=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&e===0)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return It(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Wt(r).length;default:if(o)return n?-1:It(r).length;t=(""+t).toLowerCase(),o=!0}}s.byteLength=at;function gt(r,t,e){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return Jt(this,t,e);case"utf8":case"utf-8":return Y(this,t,e);case"ascii":return Yt(this,t,e);case"latin1":case"binary":return qt(this,t,e);case"base64":return H(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xt(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function k(r,t,e){const n=r[t];r[t]=r[e],r[e]=n}s.prototype.swap16=function(){const t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;ee&&(t+=" ... "),""},h&&(s.prototype[h]=s.prototype.inspect),s.prototype.compare=function(t,e,n,o,u){if(v(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),o===void 0&&(o=0),u===void 0&&(u=this.length),e<0||n>t.length||o<0||u>this.length)throw new RangeError("out of range index");if(o>=u&&e>=n)return 0;if(o>=u)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,u>>>=0,this===t)return 0;let a=u-o,g=n-e;const F=Math.min(a,g),b=this.slice(o,u),C=t.slice(e,n);for(let A=0;A2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,Bt(e)&&(e=o?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(o)return-1;e=r.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof t=="string"&&(t=s.from(t,n)),s.isBuffer(t))return t.length===0?-1:Q(r,t,e,n,o);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Q(r,[t],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Q(r,t,e,n,o){let u=1,a=r.length,g=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;u=2,a/=2,g/=2,e/=2}function F(C,A){return u===1?C[A]:C.readUInt16BE(A*u)}let b;if(o){let C=-1;for(b=e;ba&&(e=a-g),b=e;b>=0;b--){let C=!0;for(let A=0;Ao&&(n=o)):n=o;const u=t.length;n>u/2&&(n=u/2);let a;for(a=0;a>>0,isFinite(n)?(n=n>>>0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const u=this.length-e;if((n===void 0||n>u)&&(n=u),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");let a=!1;for(;;)switch(o){case"hex":return Et(this,t,e,n);case"utf8":case"utf-8":return x(this,t,e,n);case"ascii":case"latin1":case"binary":return m(this,t,e,n);case"base64":return w(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function H(r,t,e){return t===0&&e===r.length?c.fromByteArray(r):c.fromByteArray(r.slice(t,e))}function Y(r,t,e){e=Math.min(r.length,e);const n=[];let o=t;for(;o239?4:u>223?3:u>191?2:1;if(o+g<=e){let F,b,C,A;switch(g){case 1:u<128&&(a=u);break;case 2:F=r[o+1],(F&192)===128&&(A=(u&31)<<6|F&63,A>127&&(a=A));break;case 3:F=r[o+1],b=r[o+2],(F&192)===128&&(b&192)===128&&(A=(u&15)<<12|(F&63)<<6|b&63,A>2047&&(A<55296||A>57343)&&(a=A));break;case 4:F=r[o+1],b=r[o+2],C=r[o+3],(F&192)===128&&(b&192)===128&&(C&192)===128&&(A=(u&15)<<18|(F&63)<<12|(b&63)<<6|C&63,A>65535&&A<1114112&&(a=A))}}a===null?(a=65533,g=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=g}return $(n)}const Z=4096;function $(r){const t=r.length;if(t<=Z)return String.fromCharCode.apply(String,r);let e="",n=0;for(;nn)&&(e=n);let o="";for(let u=t;un&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),ee)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||R(t,e,this.length);let o=this[t],u=1,a=0;for(;++a>>0,e=e>>>0,n||R(t,e,this.length);let o=this[t+--e],u=1;for(;e>0&&(u*=256);)o+=this[t+--e]*u;return o},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t=t>>>0,e||R(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||R(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||R(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||R(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readBigUInt64LE=q(function(t){t=t>>>0,it(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&<(t,this.length-8);const o=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,u=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(o)+(BigInt(u)<>>0,it(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&<(t,this.length-8);const o=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],u=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(o)<>>0,e=e>>>0,n||R(t,e,this.length);let o=this[t],u=1,a=0;for(;++a=u&&(o-=Math.pow(2,8*e)),o},s.prototype.readIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||R(t,e,this.length);let o=e,u=1,a=this[t+--o];for(;o>0&&(u*=256);)a+=this[t+--o]*u;return u*=128,a>=u&&(a-=Math.pow(2,8*e)),a},s.prototype.readInt8=function(t,e){return t=t>>>0,e||R(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},s.prototype.readInt16LE=function(t,e){t=t>>>0,e||R(t,2,this.length);const n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(t,e){t=t>>>0,e||R(t,2,this.length);const n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(t,e){return t=t>>>0,e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t=t>>>0,e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readBigInt64LE=q(function(t){t=t>>>0,it(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&<(t,this.length-8);const o=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(o)<>>0,it(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&<(t,this.length-8);const o=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(o)<>>0,e||R(t,4,this.length),l.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t=t>>>0,e||R(t,4,this.length),l.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||R(t,8,this.length),l.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||R(t,8,this.length),l.read(this,t,!1,52,8)};function W(r,t,e,n,o,u){if(!s.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||tr.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,n,o){if(t=+t,e=e>>>0,n=n>>>0,!o){const g=Math.pow(2,8*n)-1;W(this,t,e,n,g,0)}let u=1,a=0;for(this[e]=t&255;++a>>0,n=n>>>0,!o){const g=Math.pow(2,8*n)-1;W(this,t,e,n,g,0)}let u=n-1,a=1;for(this[e+u]=t&255;--u>=0&&(a*=256);)this[e+u]=t/a&255;return e+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,n){return t=+t,e=e>>>0,n||W(this,t,e,1,255,0),this[e]=t&255,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||W(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||W(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||W(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||W(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function Rt(r,t,e,n,o){_t(t,n,o,r,e,7);let u=Number(t&BigInt(4294967295));r[e++]=u,u=u>>8,r[e++]=u,u=u>>8,r[e++]=u,u=u>>8,r[e++]=u;let a=Number(t>>BigInt(32)&BigInt(4294967295));return r[e++]=a,a=a>>8,r[e++]=a,a=a>>8,r[e++]=a,a=a>>8,r[e++]=a,e}function St(r,t,e,n,o){_t(t,n,o,r,e,7);let u=Number(t&BigInt(4294967295));r[e+7]=u,u=u>>8,r[e+6]=u,u=u>>8,r[e+5]=u,u=u>>8,r[e+4]=u;let a=Number(t>>BigInt(32)&BigInt(4294967295));return r[e+3]=a,a=a>>8,r[e+2]=a,a=a>>8,r[e+1]=a,a=a>>8,r[e]=a,e+8}s.prototype.writeBigUInt64LE=q(function(t,e=0){return Rt(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=q(function(t,e=0){return St(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(t,e,n,o){if(t=+t,e=e>>>0,!o){const F=Math.pow(2,8*n-1);W(this,t,e,n,F-1,-F)}let u=0,a=1,g=0;for(this[e]=t&255;++u>0)-g&255;return e+n},s.prototype.writeIntBE=function(t,e,n,o){if(t=+t,e=e>>>0,!o){const F=Math.pow(2,8*n-1);W(this,t,e,n,F-1,-F)}let u=n-1,a=1,g=0;for(this[e+u]=t&255;--u>=0&&(a*=256);)t<0&&g===0&&this[e+u+1]!==0&&(g=1),this[e+u]=(t/a>>0)-g&255;return e+n},s.prototype.writeInt8=function(t,e,n){return t=+t,e=e>>>0,n||W(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1},s.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||W(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||W(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2},s.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||W(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||W(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4},s.prototype.writeBigInt64LE=q(function(t,e=0){return Rt(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=q(function(t,e=0){return St(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Mt(r,t,e,n,o,u){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Tt(r,t,e,n,o){return t=+t,e=e>>>0,o||Mt(r,t,e,4),l.write(r,t,e,n,23,4),e+4}s.prototype.writeFloatLE=function(t,e,n){return Tt(this,t,e,!0,n)},s.prototype.writeFloatBE=function(t,e,n){return Tt(this,t,e,!1,n)};function Ot(r,t,e,n,o){return t=+t,e=e>>>0,o||Mt(r,t,e,8),l.write(r,t,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(t,e,n){return Ot(this,t,e,!0,n)},s.prototype.writeDoubleBE=function(t,e,n){return Ot(this,t,e,!1,n)},s.prototype.copy=function(t,e,n,o){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!o&&o!==0&&(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let u;if(typeof t=="number")for(u=e;u2**32?o=Dt(String(e)):typeof e=="bigint"&&(o=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(o=Dt(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);function Dt(r){let t="",e=r.length;const n=r[0]==="-"?1:0;for(;e>=n+4;e-=3)t=`_${r.slice(e-3,e)}${t}`;return`${r.slice(0,e)}${t}`}function Qt(r,t,e){it(t,"offset"),(r[t]===void 0||r[t+e]===void 0)&<(t,r.length-(e+1))}function _t(r,t,e,n,o,u){if(r>e||r3?t===0||t===BigInt(0)?g=`>= 0${a} and < 2${a} ** ${(u+1)*8}${a}`:g=`>= -(2${a} ** ${(u+1)*8-1}${a}) and < 2 ** ${(u+1)*8-1}${a}`:g=`>= ${t}${a} and <= ${e}${a}`,new nt.ERR_OUT_OF_RANGE("value",g,r)}Qt(n,o,u)}function it(r,t){if(typeof r!="number")throw new nt.ERR_INVALID_ARG_TYPE(t,"number",r)}function lt(r,t,e){throw Math.floor(r)!==r?(it(r,e),new nt.ERR_OUT_OF_RANGE(e||"offset","an integer",r)):t<0?new nt.ERR_BUFFER_OUT_OF_BOUNDS:new nt.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${t}`,r)}const Zt=/[^+/0-9A-Za-z-_]/g;function te(r){if(r=r.split("=")[0],r=r.trim().replace(Zt,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function It(r,t){t=t||1/0;let e;const n=r.length;let o=null;const u=[];for(let a=0;a55295&&e<57344){if(!o){if(e>56319){(t-=3)>-1&&u.push(239,191,189);continue}else if(a+1===n){(t-=3)>-1&&u.push(239,191,189);continue}o=e;continue}if(e<56320){(t-=3)>-1&&u.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(t-=3)>-1&&u.push(239,191,189);if(o=null,e<128){if((t-=1)<0)break;u.push(e)}else if(e<2048){if((t-=2)<0)break;u.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;u.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;u.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return u}function ee(r){const t=[];for(let e=0;e>8,o=e%256,u.push(o),u.push(n);return u}function Wt(r){return c.toByteArray(te(r))}function ht(r,t,e,n){let o;for(o=0;o=t.length||o>=r.length);++o)t[o+e]=r[o];return o}function v(r,t){return r instanceof t||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===t.name}function Bt(r){return r!==r}const ne=function(){const r="0123456789abcdef",t=new Array(256);for(let e=0;e<16;++e){const n=e*16;for(let o=0;o<16;++o)t[n+o]=r[e]+r[o]}return t}();function q(r){return typeof BigInt>"u"?ie:r}function ie(){throw new Error("BigInt not supported")}})(zt);const S=X({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Ht={state:S,subscribe(i){return rt(S,()=>i(S))},push(i,c){i!==S.view&&(S.view=i,c&&(S.data=c),S.history.push(i))},reset(i){S.view=i,S.history=[i]},replace(i){S.history.length>1&&(S.history[S.history.length-1]=i,S.view=i)},goBack(){if(S.history.length>1){S.history.pop();const[i]=S.history.slice(-1);S.view=i}},setData(i){S.data=i}},_={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return _.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const i=navigator.userAgent.toLowerCase();return _.isMobile()&&(i.includes("iphone")||i.includes("ipad"))},isHttpUrl(i){return i.startsWith("http://")||i.startsWith("https://")},isArray(i){return Array.isArray(i)&&i.length>0},formatNativeUrl(i,c,l){if(_.isHttpUrl(i))return this.formatUniversalUrl(i,c,l);let h=i;h.includes("://")||(h=i.replaceAll("/","").replaceAll(":",""),h=`${h}://`),h.endsWith("/")||(h=`${h}/`),this.setWalletConnectDeepLink(h,l);const p=encodeURIComponent(c);return`${h}wc?uri=${p}`},formatUniversalUrl(i,c,l){if(!_.isHttpUrl(i))return this.formatNativeUrl(i,c,l);let h=i;h.endsWith("/")||(h=`${h}/`),this.setWalletConnectDeepLink(h,l);const p=encodeURIComponent(c);return`${h}wc?uri=${p}`},async wait(i){return new Promise(c=>{setTimeout(c,i)})},openHref(i,c){window.open(i,c,"noreferrer noopener")},setWalletConnectDeepLink(i,c){try{localStorage.setItem(_.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:i,name:c}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(i){try{const[c]=i.split("?");localStorage.setItem(_.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:c,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(_.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(_.WCM_VERSION,"2.5.9")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var i;const c=(i=Ht.state.data)==null?void 0:i.Wallet;if(!c)throw new Error('Missing "Wallet" view data');return c}},xe=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),M=X({enabled:xe,userSessionId:"",events:[],connectedWalletId:void 0}),Ie={state:M,subscribe(i){return rt(M.events,()=>i(fe(M.events[M.events.length-1])))},initialize(){M.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(M.userSessionId=crypto.randomUUID())},setConnectedWalletId(i){M.connectedWalletId=i},click(i){if(M.enabled){const c={type:"CLICK",name:i.name,userSessionId:M.userSessionId,timestamp:Date.now(),data:i};M.events.push(c)}},track(i){if(M.enabled){const c={type:"TRACK",name:i.name,userSessionId:M.userSessionId,timestamp:Date.now(),data:i};M.events.push(c)}},view(i){if(M.enabled){const c={type:"VIEW",name:i.name,userSessionId:M.userSessionId,timestamp:Date.now(),data:i};M.events.push(c)}}},V=X({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),j={state:V,subscribe(i){return rt(V,()=>i(V))},setChains(i){V.chains=i},setWalletConnectUri(i){V.walletConnectUri=i},setIsCustomDesktop(i){V.isCustomDesktop=i},setIsCustomMobile(i){V.isCustomMobile=i},setIsDataLoaded(i){V.isDataLoaded=i},setIsUiLoaded(i){V.isUiLoaded=i},setIsAuth(i){V.isAuth=i}},dt=X({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),ut={state:dt,subscribe(i){return rt(dt,()=>i(dt))},setConfig(i){var c,l;Ie.initialize(),j.setChains(i.chains),j.setIsAuth(!!i.enableAuthMode),j.setIsCustomMobile(!!((c=i.mobileWallets)!=null&&c.length)),j.setIsCustomDesktop(!!((l=i.desktopWallets)!=null&&l.length)),_.setModalVersionInStorage(),Object.assign(dt,i)}},Ct="https://explorer-api.walletconnect.com";async function yt(i,c){const l=new URL(i,Ct);return l.searchParams.append("projectId",ut.state.projectId),Object.entries(c).forEach(([h,p])=>{p&&l.searchParams.append(h,String(p))}),(await fetch(l)).json()}const tt={async getDesktopListings(i){return yt("/w3m/v1/getDesktopListings",i)},async getMobileListings(i){return yt("/w3m/v1/getMobileListings",i)},async getInjectedListings(i){return yt("/w3m/v1/getInjectedListings",i)},async getAllListings(i){return yt("/w3m/v1/getAllListings",i)},getWalletImageUrl(i){return`${Ct}/w3m/v1/getWalletImage/${i}?projectId=${ut.state.projectId}`},getAssetImageUrl(i){return`${Ct}/w3m/v1/getAssetImage/${i}?projectId=${ut.state.projectId}`}};var Be=Object.defineProperty,kt=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,jt=(i,c,l)=>c in i?Be(i,c,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[c]=l,be=(i,c)=>{for(var l in c||(c={}))Ae.call(c,l)&&jt(i,l,c[l]);if(kt)for(var l of kt(c))Ue.call(c,l)&&jt(i,l,c[l]);return i};const $t=_.isMobile(),K=X({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),De={state:K,async getRecomendedWallets(){const{explorerRecommendedWalletIds:i,explorerExcludedWalletIds:c}=ut.state;if(i==="NONE"||c==="ALL"&&!i)return K.recomendedWallets;if(_.isArray(i)){const l={recommendedIds:i.join(",")},{listings:h}=await tt.getAllListings(l),p=Object.values(h);p.sort((d,f)=>{const s=i.indexOf(d.id),E=i.indexOf(f.id);return s-E}),K.recomendedWallets=p}else{const{chains:l,isAuth:h}=j.state,p=l==null?void 0:l.join(","),d=_.isArray(c),f={page:1,sdks:h?"auth_v1":void 0,entries:_.RECOMMENDED_WALLET_AMOUNT,chains:p,version:2,excludedIds:d?c.join(","):void 0},{listings:s}=$t?await tt.getMobileListings(f):await tt.getDesktopListings(f);K.recomendedWallets=Object.values(s)}return K.recomendedWallets},async getWallets(i){const c=be({},i),{explorerRecommendedWalletIds:l,explorerExcludedWalletIds:h}=ut.state,{recomendedWallets:p}=K;if(h==="ALL")return K.wallets;p.length?c.excludedIds=p.map(B=>B.id).join(","):_.isArray(l)&&(c.excludedIds=l.join(",")),_.isArray(h)&&(c.excludedIds=[c.excludedIds,h].filter(Boolean).join(",")),j.state.isAuth&&(c.sdks="auth_v1");const{page:d,search:f}=i,{listings:s,total:E}=$t?await tt.getMobileListings(c):await tt.getDesktopListings(c),y=Object.values(s),I=f?"search":"wallets";return K[I]={listings:[...K[I].listings,...y],total:E,page:d??1},{listings:y,total:E}},getWalletImageUrl(i){return tt.getWalletImageUrl(i)},getAssetImageUrl(i){return tt.getAssetImageUrl(i)},resetSearch(){K.search={listings:[],total:0,page:1}}},st=X({open:!1}),bt={state:st,subscribe(i){return rt(st,()=>i(st))},async open(i){return new Promise(c=>{const{isUiLoaded:l,isDataLoaded:h}=j.state;if(j.setWalletConnectUri(i==null?void 0:i.uri),j.setChains(i==null?void 0:i.chains),Ht.reset("ConnectWallet"),l&&h)st.open=!0,c();else{const p=setInterval(()=>{const d=j.state;d.isUiLoaded&&d.isDataLoaded&&(clearInterval(p),st.open=!0,c())},200)}})},close(){st.open=!1}};var Fe=Object.defineProperty,vt=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable,Vt=(i,c,l)=>c in i?Fe(i,c,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[c]=l,Re=(i,c)=>{for(var l in c||(c={}))Ce.call(c,l)&&Vt(i,l,c[l]);if(vt)for(var l of vt(c))Le.call(c,l)&&Vt(i,l,c[l]);return i};function Se(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const ft=X({themeMode:Se()?"dark":"light"}),Kt={state:ft,subscribe(i){return rt(ft,()=>i(ft))},setThemeConfig(i){const{themeMode:c,themeVariables:l}=i;c&&(ft.themeMode=c),l&&(ft.themeVariables=Re({},l))}},et=X({open:!1,message:"",variant:"success"}),_e={state:et,subscribe(i){return rt(et,()=>i(et))},openToast(i,c){et.open=!0,et.message=i,et.variant=c},closeToast(){et.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=zt.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}),window.global||(window.global=window));class Me{constructor(c){this.openModal=bt.open,this.closeModal=bt.close,this.subscribeModal=bt.subscribe,this.setTheme=Kt.setThemeConfig,Kt.setThemeConfig(c),ut.setConfig(c),this.initUi()}async initUi(){if(typeof window<"u"){await oe(()=>import("./index-99fac179.js"),["./index-99fac179.js","./index-d66ad66e.js","./index-f4824932.css"],import.meta.url);const c=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",c),j.setIsUiLoaded(!0)}}}const We=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Me},Symbol.toStringTag,{value:"Module"}));export{Ie as $,ut as C,De as G,Ht as N,bt as Q,Kt as X,_e as Y,We as a,j as c,_ as i}; diff --git a/assets/index-cc134824.js b/assets/index-cc134824.js new file mode 100644 index 00000000..34f41eb5 --- /dev/null +++ b/assets/index-cc134824.js @@ -0,0 +1,6 @@ +var Cr={},G={};G.byteLength=Lr;G.toByteArray=Mr;G.fromByteArray=Dr;var S=[],R=[],Sr=typeof Uint8Array<"u"?Uint8Array:Array,H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var b=0,_r=H.length;b<_r;++b)S[b]=H[b],R[H.charCodeAt(b)]=b;R["-".charCodeAt(0)]=62;R["_".charCodeAt(0)]=63;function ur(p){var f=p.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var l=p.indexOf("=");l===-1&&(l=f);var x=l===f?0:4-l%4;return[l,x]}function Lr(p){var f=ur(p),l=f[0],x=f[1];return(l+x)*3/4-x}function Nr(p,f,l){return(f+l)*3/4-l}function Mr(p){var f,l=ur(p),x=l[0],y=l[1],a=new Sr(Nr(p,x,y)),c=0,o=y>0?x-4:x,B;for(B=0;B>16&255,a[c++]=f>>8&255,a[c++]=f&255;return y===2&&(f=R[p.charCodeAt(B)]<<2|R[p.charCodeAt(B+1)]>>4,a[c++]=f&255),y===1&&(f=R[p.charCodeAt(B)]<<10|R[p.charCodeAt(B+1)]<<4|R[p.charCodeAt(B+2)]>>2,a[c++]=f>>8&255,a[c++]=f&255),a}function kr(p){return S[p>>18&63]+S[p>>12&63]+S[p>>6&63]+S[p&63]}function br(p,f,l){for(var x,y=[],a=f;ao?o:c+a));return x===1?(f=p[l-1],y.push(S[f>>2]+S[f<<4&63]+"==")):x===2&&(f=(p[l-2]<<8)+p[l-1],y.push(S[f>>10]+S[f>>4&63]+S[f<<2&63]+"=")),y.join("")}var V={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */V.read=function(p,f,l,x,y){var a,c,o=y*8-x-1,B=(1<>1,I=-7,F=l?y-1:0,_=l?-1:1,A=p[f+F];for(F+=_,a=A&(1<<-I)-1,A>>=-I,I+=o;I>0;a=a*256+p[f+F],F+=_,I-=8);for(c=a&(1<<-I)-1,a>>=-I,I+=x;I>0;c=c*256+p[f+F],F+=_,I-=8);if(a===0)a=1-T;else{if(a===B)return c?NaN:(A?-1:1)*(1/0);c=c+Math.pow(2,x),a=a-T}return(A?-1:1)*c*Math.pow(2,a-x)};V.write=function(p,f,l,x,y,a){var c,o,B,T=a*8-y-1,I=(1<>1,_=y===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=x?0:a-1,D=x?1:-1,$=f<0||f===0&&1/f<0?1:0;for(f=Math.abs(f),isNaN(f)||f===1/0?(o=isNaN(f)?1:0,c=I):(c=Math.floor(Math.log(f)/Math.LN2),f*(B=Math.pow(2,-c))<1&&(c--,B*=2),c+F>=1?f+=_/B:f+=_*Math.pow(2,1-F),f*B>=2&&(c++,B/=2),c+F>=I?(o=0,c=I):c+F>=1?(o=(f*B-1)*Math.pow(2,y),c=c+F):(o=f*Math.pow(2,F-1)*Math.pow(2,y),c=0));y>=8;p[l+A]=o&255,A+=D,o/=256,y-=8);for(c=c<0;p[l+A]=c&255,A+=D,c/=256,T-=8);p[l+A-D]|=$*128};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */(function(p){const f=G,l=V,x=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;p.Buffer=o,p.SlowBuffer=fr,p.INSPECT_MAX_BYTES=50;const y=2147483647;p.kMaxLength=y,o.TYPED_ARRAY_SUPPORT=a(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{const i=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(i,r),i.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function c(i){if(i>y)throw new RangeError('The value "'+i+'" is invalid for option "size"');const r=new Uint8Array(i);return Object.setPrototypeOf(r,o.prototype),r}function o(i,r,t){if(typeof i=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return F(i)}return B(i,r,t)}o.poolSize=8192;function B(i,r,t){if(typeof i=="string")return _(i,r);if(ArrayBuffer.isView(i))return D(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(C(i,ArrayBuffer)||i&&C(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(C(i,SharedArrayBuffer)||i&&C(i.buffer,SharedArrayBuffer)))return $(i,r,t);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const n=i.valueOf&&i.valueOf();if(n!=null&&n!==i)return o.from(n,r,t);const e=hr(i);if(e)return e;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return o.from(i[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}o.from=function(i,r,t){return B(i,r,t)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function T(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function I(i,r,t){return T(i),i<=0?c(i):r!==void 0?typeof t=="string"?c(i).fill(r,t):c(i).fill(r):c(i)}o.alloc=function(i,r,t){return I(i,r,t)};function F(i){return T(i),c(i<0?0:Y(i)|0)}o.allocUnsafe=function(i){return F(i)},o.allocUnsafeSlow=function(i){return F(i)};function _(i,r){if((typeof r!="string"||r==="")&&(r="utf8"),!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r);const t=X(i,r)|0;let n=c(t);const e=n.write(i,r);return e!==t&&(n=n.slice(0,e)),n}function A(i){const r=i.length<0?0:Y(i.length)|0,t=c(r);for(let n=0;n=y)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y.toString(16)+" bytes");return i|0}function fr(i){return+i!=i&&(i=0),o.alloc(+i)}o.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==o.prototype},o.compare=function(r,t){if(C(r,Uint8Array)&&(r=o.from(r,r.offset,r.byteLength)),C(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(r)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;let n=r.length,e=t.length;for(let u=0,h=Math.min(n,e);ue.length?(o.isBuffer(h)||(h=o.from(h)),h.copy(e,u)):Uint8Array.prototype.set.call(e,h,u);else if(o.isBuffer(h))h.copy(e,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=h.length}return e};function X(i,r){if(o.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||C(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);const t=i.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;let e=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return j(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return or(i).length;default:if(e)return n?-1:j(i).length;r=(""+r).toLowerCase(),e=!0}}o.byteLength=X;function cr(i,r,t){let n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return dr(this,r,t);case"utf8":case"utf-8":return K(this,r,t);case"ascii":return Br(this,r,t);case"latin1":case"binary":return Er(this,r,t);case"base64":return wr(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gr(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),n=!0}}o.prototype._isBuffer=!0;function N(i,r,t){const n=i[r];i[r]=i[t],i[t]=n}o.prototype.swap16=function(){const r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(r+=" ... "),""},x&&(o.prototype[x]=o.prototype.inspect),o.prototype.compare=function(r,t,n,e,u){if(C(r,Uint8Array)&&(r=o.from(r,r.offset,r.byteLength)),!o.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),e===void 0&&(e=0),u===void 0&&(u=this.length),t<0||n>r.length||e<0||u>this.length)throw new RangeError("out of range index");if(e>=u&&t>=n)return 0;if(e>=u)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,e>>>=0,u>>>=0,this===r)return 0;let h=u-e,s=n-t;const d=Math.min(h,s),E=this.slice(e,u),g=r.slice(t,n);for(let w=0;w2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,q(t)&&(t=e?0:i.length-1),t<0&&(t=i.length+t),t>=i.length){if(e)return-1;t=i.length-1}else if(t<0)if(e)t=0;else return-1;if(typeof r=="string"&&(r=o.from(r,n)),o.isBuffer(r))return r.length===0?-1:z(i,r,t,n,e);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?e?Uint8Array.prototype.indexOf.call(i,r,t):Uint8Array.prototype.lastIndexOf.call(i,r,t):z(i,[r],t,n,e);throw new TypeError("val must be string, number or Buffer")}function z(i,r,t,n,e){let u=1,h=i.length,s=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(i.length<2||r.length<2)return-1;u=2,h/=2,s/=2,t/=2}function d(g,w){return u===1?g[w]:g.readUInt16BE(w*u)}let E;if(e){let g=-1;for(E=t;Eh&&(t=h-s),E=t;E>=0;E--){let g=!0;for(let w=0;we&&(n=e)):n=e;const u=r.length;n>u/2&&(n=u/2);let h;for(h=0;h>>0,isFinite(n)?(n=n>>>0,e===void 0&&(e="utf8")):(e=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const u=this.length-t;if((n===void 0||n>u)&&(n=u),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");let h=!1;for(;;)switch(e){case"hex":return pr(this,r,t,n);case"utf8":case"utf-8":return sr(this,r,t,n);case"ascii":case"latin1":case"binary":return lr(this,r,t,n);case"base64":return ar(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return yr(this,r,t,n);default:if(h)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),h=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function wr(i,r,t){return r===0&&t===i.length?f.fromByteArray(i):f.fromByteArray(i.slice(r,t))}function K(i,r,t){t=Math.min(i.length,t);const n=[];let e=r;for(;e239?4:u>223?3:u>191?2:1;if(e+s<=t){let d,E,g,w;switch(s){case 1:u<128&&(h=u);break;case 2:d=i[e+1],(d&192)===128&&(w=(u&31)<<6|d&63,w>127&&(h=w));break;case 3:d=i[e+1],E=i[e+2],(d&192)===128&&(E&192)===128&&(w=(u&15)<<12|(d&63)<<6|E&63,w>2047&&(w<55296||w>57343)&&(h=w));break;case 4:d=i[e+1],E=i[e+2],g=i[e+3],(d&192)===128&&(E&192)===128&&(g&192)===128&&(w=(u&15)<<18|(d&63)<<12|(E&63)<<6|g&63,w>65535&&w<1114112&&(h=w))}}h===null?(h=65533,s=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|h&1023),n.push(h),e+=s}return xr(n)}const Z=4096;function xr(i){const r=i.length;if(r<=Z)return String.fromCharCode.apply(String,i);let t="",n=0;for(;nn)&&(t=n);let e="";for(let u=r;un&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),tt)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||m(r,t,this.length);let e=this[r],u=1,h=0;for(;++h>>0,t=t>>>0,n||m(r,t,this.length);let e=this[r+--t],u=1;for(;t>0&&(u*=256);)e+=this[r+--t]*u;return e},o.prototype.readUint8=o.prototype.readUInt8=function(r,t){return r=r>>>0,t||m(r,1,this.length),this[r]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||m(r,2,this.length),this[r]|this[r+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||m(r,2,this.length),this[r]<<8|this[r+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||m(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||m(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},o.prototype.readBigUInt64LE=L(function(r){r=r>>>0,k(r,"offset");const t=this[r],n=this[r+7];(t===void 0||n===void 0)&&P(r,this.length-8);const e=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,u=this[++r]+this[++r]*2**8+this[++r]*2**16+n*2**24;return BigInt(e)+(BigInt(u)<>>0,k(r,"offset");const t=this[r],n=this[r+7];(t===void 0||n===void 0)&&P(r,this.length-8);const e=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],u=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n;return(BigInt(e)<>>0,t=t>>>0,n||m(r,t,this.length);let e=this[r],u=1,h=0;for(;++h=u&&(e-=Math.pow(2,8*t)),e},o.prototype.readIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||m(r,t,this.length);let e=t,u=1,h=this[r+--e];for(;e>0&&(u*=256);)h+=this[r+--e]*u;return u*=128,h>=u&&(h-=Math.pow(2,8*t)),h},o.prototype.readInt8=function(r,t){return r=r>>>0,t||m(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},o.prototype.readInt16LE=function(r,t){r=r>>>0,t||m(r,2,this.length);const n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n},o.prototype.readInt16BE=function(r,t){r=r>>>0,t||m(r,2,this.length);const n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n},o.prototype.readInt32LE=function(r,t){return r=r>>>0,t||m(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},o.prototype.readInt32BE=function(r,t){return r=r>>>0,t||m(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},o.prototype.readBigInt64LE=L(function(r){r=r>>>0,k(r,"offset");const t=this[r],n=this[r+7];(t===void 0||n===void 0)&&P(r,this.length-8);const e=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(n<<24);return(BigInt(e)<>>0,k(r,"offset");const t=this[r],n=this[r+7];(t===void 0||n===void 0)&&P(r,this.length-8);const e=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(e)<>>0,t||m(r,4,this.length),l.read(this,r,!0,23,4)},o.prototype.readFloatBE=function(r,t){return r=r>>>0,t||m(r,4,this.length),l.read(this,r,!1,23,4)},o.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||m(r,8,this.length),l.read(this,r,!0,52,8)},o.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||m(r,8,this.length),l.read(this,r,!1,52,8)};function U(i,r,t,n,e,u){if(!o.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>e||ri.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(r,t,n,e){if(r=+r,t=t>>>0,n=n>>>0,!e){const s=Math.pow(2,8*n)-1;U(this,r,t,n,s,0)}let u=1,h=0;for(this[t]=r&255;++h>>0,n=n>>>0,!e){const s=Math.pow(2,8*n)-1;U(this,r,t,n,s,0)}let u=n-1,h=1;for(this[t+u]=r&255;--u>=0&&(h*=256);)this[t+u]=r/h&255;return t+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,1,255,0),this[t]=r&255,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function Q(i,r,t,n,e){er(r,n,e,i,t,7);let u=Number(r&BigInt(4294967295));i[t++]=u,u=u>>8,i[t++]=u,u=u>>8,i[t++]=u,u=u>>8,i[t++]=u;let h=Number(r>>BigInt(32)&BigInt(4294967295));return i[t++]=h,h=h>>8,i[t++]=h,h=h>>8,i[t++]=h,h=h>>8,i[t++]=h,t}function v(i,r,t,n,e){er(r,n,e,i,t,7);let u=Number(r&BigInt(4294967295));i[t+7]=u,u=u>>8,i[t+6]=u,u=u>>8,i[t+5]=u,u=u>>8,i[t+4]=u;let h=Number(r>>BigInt(32)&BigInt(4294967295));return i[t+3]=h,h=h>>8,i[t+2]=h,h=h>>8,i[t+1]=h,h=h>>8,i[t]=h,t+8}o.prototype.writeBigUInt64LE=L(function(r,t=0){return Q(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=L(function(r,t=0){return v(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(r,t,n,e){if(r=+r,t=t>>>0,!e){const d=Math.pow(2,8*n-1);U(this,r,t,n,d-1,-d)}let u=0,h=1,s=0;for(this[t]=r&255;++u>0)-s&255;return t+n},o.prototype.writeIntBE=function(r,t,n,e){if(r=+r,t=t>>>0,!e){const d=Math.pow(2,8*n-1);U(this,r,t,n,d-1,-d)}let u=n-1,h=1,s=0;for(this[t+u]=r&255;--u>=0&&(h*=256);)r<0&&s===0&&this[t+u+1]!==0&&(s=1),this[t+u]=(r/h>>0)-s&255;return t+n},o.prototype.writeInt8=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1},o.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2},o.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2},o.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4},o.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4},o.prototype.writeBigInt64LE=L(function(r,t=0){return Q(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=L(function(r,t=0){return v(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function rr(i,r,t,n,e,u){if(t+n>i.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function tr(i,r,t,n,e){return r=+r,t=t>>>0,e||rr(i,r,t,4),l.write(i,r,t,n,23,4),t+4}o.prototype.writeFloatLE=function(r,t,n){return tr(this,r,t,!0,n)},o.prototype.writeFloatBE=function(r,t,n){return tr(this,r,t,!1,n)};function ir(i,r,t,n,e){return r=+r,t=t>>>0,e||rr(i,r,t,8),l.write(i,r,t,n,52,8),t+8}o.prototype.writeDoubleLE=function(r,t,n){return ir(this,r,t,!0,n)},o.prototype.writeDoubleBE=function(r,t,n){return ir(this,r,t,!1,n)},o.prototype.copy=function(r,t,n,e){if(!o.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!e&&e!==0&&(e=this.length),t>=r.length&&(t=r.length),t||(t=0),e>0&&e=this.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),r.length-t>>0,n=n===void 0?this.length:n>>>0,r||(r=0);let u;if(typeof r=="number")for(u=t;u2**32?e=nr(String(t)):typeof t=="bigint"&&(e=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(e=nr(e)),e+="n"),n+=` It must be ${r}. Received ${e}`,n},RangeError);function nr(i){let r="",t=i.length;const n=i[0]==="-"?1:0;for(;t>=n+4;t-=3)r=`_${i.slice(t-3,t)}${r}`;return`${i.slice(0,t)}${r}`}function mr(i,r,t){k(r,"offset"),(i[r]===void 0||i[r+t]===void 0)&&P(r,i.length-(t+1))}function er(i,r,t,n,e,u){if(i>t||i3?r===0||r===BigInt(0)?s=`>= 0${h} and < 2${h} ** ${(u+1)*8}${h}`:s=`>= -(2${h} ** ${(u+1)*8-1}${h}) and < 2 ** ${(u+1)*8-1}${h}`:s=`>= ${r}${h} and <= ${t}${h}`,new M.ERR_OUT_OF_RANGE("value",s,i)}mr(n,e,u)}function k(i,r){if(typeof i!="number")throw new M.ERR_INVALID_ARG_TYPE(r,"number",i)}function P(i,r,t){throw Math.floor(i)!==i?(k(i,t),new M.ERR_OUT_OF_RANGE(t||"offset","an integer",i)):r<0?new M.ERR_BUFFER_OUT_OF_BOUNDS:new M.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${r}`,i)}const Ir=/[^+/0-9A-Za-z-_]/g;function Fr(i){if(i=i.split("=")[0],i=i.trim().replace(Ir,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function j(i,r){r=r||1/0;let t;const n=i.length;let e=null;const u=[];for(let h=0;h55295&&t<57344){if(!e){if(t>56319){(r-=3)>-1&&u.push(239,191,189);continue}else if(h+1===n){(r-=3)>-1&&u.push(239,191,189);continue}e=t;continue}if(t<56320){(r-=3)>-1&&u.push(239,191,189),e=t;continue}t=(e-55296<<10|t-56320)+65536}else e&&(r-=3)>-1&&u.push(239,191,189);if(e=null,t<128){if((r-=1)<0)break;u.push(t)}else if(t<2048){if((r-=2)<0)break;u.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;u.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;u.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return u}function Ar(i){const r=[];for(let t=0;t>8,e=t%256,u.push(e),u.push(n);return u}function or(i){return f.toByteArray(Fr(i))}function O(i,r,t,n){let e;for(e=0;e=r.length||e>=i.length);++e)r[e+t]=i[e];return e}function C(i,r){return i instanceof r||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===r.name}function q(i){return i!==i}const Rr=function(){const i="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){const n=t*16;for(let e=0;e<16;++e)r[n+e]=i[t]+i[e]}return r}();function L(i){return typeof BigInt>"u"?Tr:i}function Tr(){throw new Error("BigInt not supported")}})(Cr);export{Cr as b}; diff --git a/assets/index-d66ad66e.js b/assets/index-da732aeb.js similarity index 55% rename from assets/index-d66ad66e.js rename to assets/index-da732aeb.js index 6dd83bd9..61010ed2 100644 --- a/assets/index-d66ad66e.js +++ b/assets/index-da732aeb.js @@ -1,4 +1,4 @@ -function eH(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var ul=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ks(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ZI(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var e7={exports:{}},rg={},t7={exports:{}},Qe={};/** +function IH(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var ul=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ps(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function u7(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var f7={exports:{}},cg={},d7={exports:{}},Je={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function eH(t,e){for(var r=0;r>>1,A=k[$];if(0>>1;$i(R,L))Ui(W,R)?(k[$]=W,k[U]=L,$=U):(k[$]=R,k[V]=L,$=V);else if(Ui(W,L))k[$]=W,k[U]=L,$=U;else break e}}return M}function i(k,M){var L=k.sortIndex-M.sortIndex;return L!==0?L:k.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],l=[],u=1,f=null,d=3,h=!1,p=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(k){for(var M=r(l);M!==null;){if(M.callback===null)n(l);else if(M.startTime<=k)n(l),M.sortIndex=M.expirationTime,e(c,M);else break;M=r(l)}}function S(k){if(v=!1,g(k),!p)if(r(c)!==null)p=!0,O(P);else{var M=r(l);M!==null&&N(S,M.startTime-k)}}function P(k,M){p=!1,v&&(v=!1,y(I),I=-1),h=!0;var L=d;try{for(g(M),f=r(c);f!==null&&(!(f.expirationTime>M)||k&&!H());){var $=f.callback;if(typeof $=="function"){f.callback=null,d=f.priorityLevel;var A=$(f.expirationTime<=M);M=t.unstable_now(),typeof A=="function"?f.callback=A:f===r(c)&&n(c),g(M)}else n(c);f=r(c)}if(f!==null)var D=!0;else{var V=r(l);V!==null&&N(S,V.startTime-M),D=!1}return D}finally{f=null,d=L,h=!1}}var T=!1,w=null,I=-1,B=5,j=-1;function H(){return!(t.unstable_now()-jk||125$?(k.sortIndex=L,e(l,k),r(c)===null&&k===r(l)&&(v?(y(I),I=-1):v=!0,N(S,L-$))):(k.sortIndex=A,e(c,k),p||h||(p=!0,O(P))),k},t.unstable_shouldYield=H,t.unstable_wrapCallback=function(k){var M=d;return function(){var L=d;d=M;try{return k.apply(this,arguments)}finally{d=L}}}})(h7);d7.exports=h7;var CH=d7.exports;/** + */(function(t){function e(k,$){var L=k.length;k.push($);e:for(;0>>1,A=k[M];if(0>>1;Mi(R,L))Ui(W,R)?(k[M]=W,k[U]=L,M=U):(k[M]=R,k[V]=L,M=V);else if(Ui(W,L))k[M]=W,k[U]=L,M=U;else break e}}return $}function i(k,$){var L=k.sortIndex-$.sortIndex;return L!==0?L:k.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],l=[],u=1,f=null,d=3,h=!1,p=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(k){for(var $=r(l);$!==null;){if($.callback===null)n(l);else if($.startTime<=k)n(l),$.sortIndex=$.expirationTime,e(c,$);else break;$=r(l)}}function S(k){if(v=!1,g(k),!p)if(r(c)!==null)p=!0,O(P);else{var $=r(l);$!==null&&N(S,$.startTime-k)}}function P(k,$){p=!1,v&&(v=!1,y(I),I=-1),h=!0;var L=d;try{for(g($),f=r(c);f!==null&&(!(f.expirationTime>$)||k&&!H());){var M=f.callback;if(typeof M=="function"){f.callback=null,d=f.priorityLevel;var A=M(f.expirationTime<=$);$=t.unstable_now(),typeof A=="function"?f.callback=A:f===r(c)&&n(c),g($)}else n(c);f=r(c)}if(f!==null)var D=!0;else{var V=r(l);V!==null&&N(S,V.startTime-$),D=!1}return D}finally{f=null,d=L,h=!1}}var T=!1,w=null,I=-1,F=5,j=-1;function H(){return!(t.unstable_now()-jk||125M?(k.sortIndex=L,e(l,k),r(c)===null&&k===r(l)&&(v?(y(I),I=-1):v=!0,N(S,L-M))):(k.sortIndex=A,e(c,k),p||h||(p=!0,O(P))),k},t.unstable_shouldYield=H,t.unstable_wrapCallback=function(k){var $=d;return function(){var L=d;d=$;try{return k.apply(this,arguments)}finally{d=L}}}})(S7);C7.exports=S7;var ZH=C7.exports;/** * @license React * react-dom.production.min.js * @@ -30,24 +30,24 @@ function eH(t,e){for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),SE=Object.prototype.hasOwnProperty,SH=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Lk={},Bk={};function kH(t){return SE.call(Bk,t)?!0:SE.call(Lk,t)?!1:SH.test(t)?Bk[t]=!0:(Lk[t]=!0,!1)}function AH(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function _H(t,e,r,n){if(e===null||typeof e>"u"||AH(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function jn(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var nn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){nn[t]=new jn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];nn[e]=new jn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){nn[t]=new jn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){nn[t]=new jn(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){nn[t]=new jn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){nn[t]=new jn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){nn[t]=new jn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){nn[t]=new jn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){nn[t]=new jn(t,5,!1,t.toLowerCase(),null,!1,!1)});var e6=/[\-:]([a-z])/g;function t6(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(e6,t6);nn[e]=new jn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(e6,t6);nn[e]=new jn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(e6,t6);nn[e]=new jn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){nn[t]=new jn(t,1,!1,t.toLowerCase(),null,!1,!1)});nn.xlinkHref=new jn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){nn[t]=new jn(t,1,!1,t.toLowerCase(),null,!0,!0)});function r6(t,e,r,n){var i=nn.hasOwnProperty(e)?nn[e]:null;(i!==null?i.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),OE=Object.prototype.hasOwnProperty,eq=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Gk={},Kk={};function tq(t){return OE.call(Kk,t)?!0:OE.call(Gk,t)?!1:eq.test(t)?Kk[t]=!0:(Gk[t]=!0,!1)}function rq(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function nq(t,e,r,n){if(e===null||typeof e>"u"||rq(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Un(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var nn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){nn[t]=new Un(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];nn[e]=new Un(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){nn[t]=new Un(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){nn[t]=new Un(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){nn[t]=new Un(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){nn[t]=new Un(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){nn[t]=new Un(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){nn[t]=new Un(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){nn[t]=new Un(t,5,!1,t.toLowerCase(),null,!1,!1)});var c6=/[\-:]([a-z])/g;function l6(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(c6,l6);nn[e]=new Un(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(c6,l6);nn[e]=new Un(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(c6,l6);nn[e]=new Un(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){nn[t]=new Un(t,1,!1,t.toLowerCase(),null,!1,!1)});nn.xlinkHref=new Un("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){nn[t]=new Un(t,1,!1,t.toLowerCase(),null,!0,!0)});function u6(t,e,r,n){var i=nn.hasOwnProperty(e)?nn[e]:null;(i!==null?i.type!==0:n||!(2a||i[o]!==s[a]){var c=` -`+i[o].replace(" at new "," at ");return t.displayName&&c.includes("")&&(c=c.replace("",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{xw=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?ch(t):""}function PH(t){switch(t.tag){case 5:return ch(t.type);case 16:return ch("Lazy");case 13:return ch("Suspense");case 19:return ch("SuspenseList");case 0:case 2:case 15:return t=Cw(t.type,!1),t;case 11:return t=Cw(t.type.render,!1),t;case 1:return t=Cw(t.type,!0),t;default:return""}}function PE(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case $u:return"Fragment";case Mu:return"Portal";case kE:return"Profiler";case n6:return"StrictMode";case AE:return"Suspense";case _E:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case y7:return(t.displayName||"Context")+".Consumer";case m7:return(t._context.displayName||"Context")+".Provider";case i6:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case s6:return e=t.displayName||null,e!==null?e:PE(t.type)||"Memo";case Ta:e=t._payload,t=t._init;try{return PE(t(e))}catch{}}return null}function TH(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return PE(e);case 8:return e===n6?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function oc(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function b7(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function IH(t){var e=b7(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function fp(t){t._valueTracker||(t._valueTracker=IH(t))}function w7(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=b7(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function nm(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function TE(t,e){var r=e.checked;return ur({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function jk(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=oc(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function E7(t,e){e=e.checked,e!=null&&r6(t,"checked",e,!1)}function IE(t,e){E7(t,e);var r=oc(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?OE(t,e.type,r):e.hasOwnProperty("defaultValue")&&OE(t,e.type,oc(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Uk(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function OE(t,e,r){(e!=="number"||nm(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var lh=Array.isArray;function tf(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=dp.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function r0(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var gh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},OH=["Webkit","ms","Moz","O"];Object.keys(gh).forEach(function(t){OH.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),gh[e]=gh[t]})});function k7(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||gh.hasOwnProperty(t)&&gh[t]?(""+e).trim():e+"px"}function A7(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=k7(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var RH=ur({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function $E(t,e){if(e){if(RH[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(oe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(oe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(oe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(oe(62))}}function NE(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var DE=null;function o6(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var LE=null,rf=null,nf=null;function Hk(t){if(t=w1(t)){if(typeof LE!="function")throw Error(oe(280));var e=t.stateNode;e&&(e=ag(e),LE(t.stateNode,t.type,e))}}function _7(t){rf?nf?nf.push(t):nf=[t]:rf=t}function P7(){if(rf){var t=rf,e=nf;if(nf=rf=null,Hk(t),e)for(t=0;t>>=0,t===0?32:31-(WH(t)/HH|0)|0}var hp=64,pp=4194304;function uh(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function am(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=uh(a):(s&=o,s!==0&&(n=uh(s)))}else o=r&~i,o!==0?n=uh(o):s!==0&&(n=uh(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function g1(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-ms(e),t[e]=r}function KH(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=wh),Zk=String.fromCharCode(32),eA=!1;function K7(t,e){switch(t){case"keyup":return xq.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Q7(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Nu=!1;function Sq(t,e){switch(t){case"compositionend":return Q7(e);case"keypress":return e.which!==32?null:(eA=!0,Zk);case"textInput":return t=e.data,t===Zk&&eA?null:t;default:return null}}function kq(t,e){if(Nu)return t==="compositionend"||!p6&&K7(t,e)?(t=V7(),pv=f6=Ba=null,Nu=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=iA(r)}}function Z7(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Z7(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function eO(){for(var t=window,e=nm();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=nm(t.document)}return e}function v6(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function $q(t){var e=eO(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&Z7(r.ownerDocument.documentElement,r)){if(n!==null&&v6(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=sA(r,s);var o=sA(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Du=null,WE=null,xh=null,HE=!1;function oA(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;HE||Du==null||Du!==nm(n)||(n=Du,"selectionStart"in n&&v6(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),xh&&c0(xh,n)||(xh=n,n=um(WE,"onSelect"),0Fu||(t.current=YE[Fu],YE[Fu]=null,Fu--)}function gt(t,e){Fu++,YE[Fu]=t.current,t.current=e}var ac={},Cn=_c(ac),Jn=_c(!1),Pl=ac;function Cf(t,e){var r=t.type.contextTypes;if(!r)return ac;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Xn(t){return t=t.childContextTypes,t!=null}function dm(){Ht(Jn),Ht(Cn)}function hA(t,e,r){if(Cn.current!==ac)throw Error(oe(168));gt(Cn,e),gt(Jn,r)}function lO(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(oe(108,TH(t)||"Unknown",i));return ur({},r,n)}function hm(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ac,Pl=Cn.current,gt(Cn,t),gt(Jn,Jn.current),!0}function pA(t,e,r){var n=t.stateNode;if(!n)throw Error(oe(169));r?(t=lO(t,e,Pl),n.__reactInternalMemoizedMergedChildContext=t,Ht(Jn),Ht(Cn),gt(Cn,t)):Ht(Jn),gt(Jn,r)}var Ao=null,cg=!1,Lw=!1;function uO(t){Ao===null?Ao=[t]:Ao.push(t)}function Vq(t){cg=!0,uO(t)}function Pc(){if(!Lw&&Ao!==null){Lw=!0;var t=0,e=ct;try{var r=Ao;for(ct=1;t>=o,i-=o,Oo=1<<32-ms(e)+i|r<I?(B=w,w=null):B=w.sibling;var j=d(y,w,g[I],S);if(j===null){w===null&&(w=B);break}t&&w&&j.alternate===null&&e(y,w),m=s(j,m,I),T===null?P=j:T.sibling=j,T=j,w=B}if(I===g.length)return r(y,w),er&&Zc(y,I),P;if(w===null){for(;II?(B=w,w=null):B=w.sibling;var H=d(y,w,j.value,S);if(H===null){w===null&&(w=B);break}t&&w&&H.alternate===null&&e(y,w),m=s(H,m,I),T===null?P=H:T.sibling=H,T=H,w=B}if(j.done)return r(y,w),er&&Zc(y,I),P;if(w===null){for(;!j.done;I++,j=g.next())j=f(y,j.value,S),j!==null&&(m=s(j,m,I),T===null?P=j:T.sibling=j,T=j);return er&&Zc(y,I),P}for(w=n(y,w);!j.done;I++,j=g.next())j=h(w,y,I,j.value,S),j!==null&&(t&&j.alternate!==null&&w.delete(j.key===null?I:j.key),m=s(j,m,I),T===null?P=j:T.sibling=j,T=j);return t&&w.forEach(function(K){return e(y,K)}),er&&Zc(y,I),P}function b(y,m,g,S){if(typeof g=="object"&&g!==null&&g.type===$u&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case up:e:{for(var P=g.key,T=m;T!==null;){if(T.key===P){if(P=g.type,P===$u){if(T.tag===7){r(y,T.sibling),m=i(T,g.props.children),m.return=y,y=m;break e}}else if(T.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Ta&&EA(P)===T.type){r(y,T.sibling),m=i(T,g.props),m.ref=jd(y,T,g),m.return=y,y=m;break e}r(y,T);break}else e(y,T);T=T.sibling}g.type===$u?(m=bl(g.props.children,y.mode,S,g.key),m.return=y,y=m):(S=xv(g.type,g.key,g.props,null,y.mode,S),S.ref=jd(y,m,g),S.return=y,y=S)}return o(y);case Mu:e:{for(T=g.key;m!==null;){if(m.key===T)if(m.tag===4&&m.stateNode.containerInfo===g.containerInfo&&m.stateNode.implementation===g.implementation){r(y,m.sibling),m=i(m,g.children||[]),m.return=y,y=m;break e}else{r(y,m);break}else e(y,m);m=m.sibling}m=qw(g,y.mode,S),m.return=y,y=m}return o(y);case Ta:return T=g._init,b(y,m,T(g._payload),S)}if(lh(g))return p(y,m,g,S);if(Nd(g))return v(y,m,g,S);Ep(y,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,m!==null&&m.tag===6?(r(y,m.sibling),m=i(m,g),m.return=y,y=m):(r(y,m),m=Hw(g,y.mode,S),m.return=y,y=m),o(y)):r(y,m)}return b}var kf=gO(!0),bO=gO(!1),E1={},Zs=_c(E1),d0=_c(E1),h0=_c(E1);function hl(t){if(t===E1)throw Error(oe(174));return t}function S6(t,e){switch(gt(h0,e),gt(d0,t),gt(Zs,E1),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:ME(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=ME(e,t)}Ht(Zs),gt(Zs,e)}function Af(){Ht(Zs),Ht(d0),Ht(h0)}function wO(t){hl(h0.current);var e=hl(Zs.current),r=ME(e,t.type);e!==r&&(gt(d0,t),gt(Zs,r))}function k6(t){d0.current===t&&(Ht(Zs),Ht(d0))}var sr=_c(0);function bm(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Bw=[];function A6(){for(var t=0;tr?r:4,t(!0);var n=Fw.transition;Fw.transition={};try{t(!1),e()}finally{ct=r,Fw.transition=n}}function DO(){return ji().memoizedState}function Yq(t,e,r){var n=Xa(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},LO(t))BO(e,r);else if(r=pO(t,e,r,n),r!==null){var i=$n();ys(r,t,n,i),FO(r,e,n)}}function Jq(t,e,r){var n=Xa(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(LO(t))BO(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,ws(a,o)){var c=e.interleaved;c===null?(i.next=i,x6(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=pO(t,e,i,n),r!==null&&(i=$n(),ys(r,t,n,i),FO(r,e,n))}}function LO(t){var e=t.alternate;return t===cr||e!==null&&e===cr}function BO(t,e){Ch=wm=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function FO(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,c6(t,r)}}var Em={readContext:Fi,useCallback:un,useContext:un,useEffect:un,useImperativeHandle:un,useInsertionEffect:un,useLayoutEffect:un,useMemo:un,useReducer:un,useRef:un,useState:un,useDebugValue:un,useDeferredValue:un,useTransition:un,useMutableSource:un,useSyncExternalStore:un,useId:un,unstable_isNewReconciler:!1},Xq={readContext:Fi,useCallback:function(t,e){return Bs().memoizedState=[t,e===void 0?null:e],t},useContext:Fi,useEffect:CA,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,gv(4194308,4,OO.bind(null,e,t),r)},useLayoutEffect:function(t,e){return gv(4194308,4,t,e)},useInsertionEffect:function(t,e){return gv(4,2,t,e)},useMemo:function(t,e){var r=Bs();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Bs();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=Yq.bind(null,cr,t),[n.memoizedState,t]},useRef:function(t){var e=Bs();return t={current:t},e.memoizedState=t},useState:xA,useDebugValue:O6,useDeferredValue:function(t){return Bs().memoizedState=t},useTransition:function(){var t=xA(!1),e=t[0];return t=Qq.bind(null,t[1]),Bs().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=cr,i=Bs();if(er){if(r===void 0)throw Error(oe(407));r=r()}else{if(r=e(),Gr===null)throw Error(oe(349));Il&30||CO(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,CA(kO.bind(null,n,s,t),[t]),n.flags|=2048,m0(9,SO.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=Bs(),e=Gr.identifierPrefix;if(er){var r=Ro,n=Oo;r=(n&~(1<<32-ms(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=p0++,0")&&(c=c.replace("",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{Tw=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?fh(t):""}function iq(t){switch(t.tag){case 5:return fh(t.type);case 16:return fh("Lazy");case 13:return fh("Suspense");case 19:return fh("SuspenseList");case 0:case 2:case 15:return t=Iw(t.type,!1),t;case 11:return t=Iw(t.type.render,!1),t;case 1:return t=Iw(t.type,!0),t;default:return""}}function NE(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Du:return"Fragment";case Nu:return"Portal";case RE:return"Profiler";case f6:return"StrictMode";case $E:return"Suspense";case ME:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case P7:return(t.displayName||"Context")+".Consumer";case _7:return(t._context.displayName||"Context")+".Provider";case d6:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case h6:return e=t.displayName||null,e!==null?e:NE(t.type)||"Memo";case Ia:e=t._payload,t=t._init;try{return NE(t(e))}catch{}}return null}function sq(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return NE(e);case 8:return e===f6?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ac(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function I7(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function oq(t){var e=I7(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function mp(t){t._valueTracker||(t._valueTracker=oq(t))}function O7(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=I7(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function cm(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function DE(t,e){var r=e.checked;return ur({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Yk(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=ac(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function R7(t,e){e=e.checked,e!=null&&u6(t,"checked",e,!1)}function LE(t,e){R7(t,e);var r=ac(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?FE(t,e.type,r):e.hasOwnProperty("defaultValue")&&FE(t,e.type,ac(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Jk(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function FE(t,e,r){(e!=="number"||cm(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var dh=Array.isArray;function nf(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=yp.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function s0(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var xh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},aq=["Webkit","ms","Moz","O"];Object.keys(xh).forEach(function(t){aq.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),xh[e]=xh[t]})});function D7(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||xh.hasOwnProperty(t)&&xh[t]?(""+e).trim():e+"px"}function L7(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=D7(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var cq=ur({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function UE(t,e){if(e){if(cq[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(oe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(oe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(oe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(oe(62))}}function zE(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var WE=null;function p6(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var HE=null,sf=null,of=null;function eA(t){if(t=C1(t)){if(typeof HE!="function")throw Error(oe(280));var e=t.stateNode;e&&(e=hg(e),HE(t.stateNode,t.type,e))}}function F7(t){sf?of?of.push(t):of=[t]:sf=t}function B7(){if(sf){var t=sf,e=of;if(of=sf=null,eA(t),e)for(t=0;t>>=0,t===0?32:31-(bq(t)/wq|0)|0}var gp=64,bp=4194304;function hh(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function dm(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=hh(a):(s&=o,s!==0&&(n=hh(s)))}else o=r&~i,o!==0?n=hh(o):s!==0&&(n=hh(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function E1(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-bs(e),t[e]=r}function Sq(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=Sh),lA=String.fromCharCode(32),uA=!1;function sO(t,e){switch(t){case"keyup":return Xq.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oO(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Lu=!1;function eV(t,e){switch(t){case"compositionend":return oO(e);case"keypress":return e.which!==32?null:(uA=!0,lA);case"textInput":return t=e.data,t===lA&&uA?null:t;default:return null}}function tV(t,e){if(Lu)return t==="compositionend"||!x6&&sO(t,e)?(t=nO(),bv=b6=Ba=null,Lu=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=pA(r)}}function uO(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?uO(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function fO(){for(var t=window,e=cm();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=cm(t.document)}return e}function C6(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function uV(t){var e=fO(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&uO(r.ownerDocument.documentElement,r)){if(n!==null&&C6(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=vA(r,s);var o=vA(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Fu=null,YE=null,Ah=null,JE=!1;function mA(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;JE||Fu==null||Fu!==cm(n)||(n=Fu,"selectionStart"in n&&C6(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Ah&&f0(Ah,n)||(Ah=n,n=vm(YE,"onSelect"),0Uu||(t.current=nx[Uu],nx[Uu]=null,Uu--)}function gt(t,e){Uu++,nx[Uu]=t.current,t.current=e}var cc={},Cn=_c(cc),Xn=_c(!1),Tl=cc;function kf(t,e){var r=t.type.contextTypes;if(!r)return cc;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Zn(t){return t=t.childContextTypes,t!=null}function ym(){Ht(Xn),Ht(Cn)}function CA(t,e,r){if(Cn.current!==cc)throw Error(oe(168));gt(Cn,e),gt(Xn,r)}function wO(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(oe(108,sq(t)||"Unknown",i));return ur({},r,n)}function gm(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||cc,Tl=Cn.current,gt(Cn,t),gt(Xn,Xn.current),!0}function SA(t,e,r){var n=t.stateNode;if(!n)throw Error(oe(169));r?(t=wO(t,e,Tl),n.__reactInternalMemoizedMergedChildContext=t,Ht(Xn),Ht(Cn),gt(Cn,t)):Ht(Xn),gt(Xn,r)}var _o=null,pg=!1,Hw=!1;function EO(t){_o===null?_o=[t]:_o.push(t)}function xV(t){pg=!0,EO(t)}function Pc(){if(!Hw&&_o!==null){Hw=!0;var t=0,e=ct;try{var r=_o;for(ct=1;t>=o,i-=o,Ro=1<<32-bs(e)+i|r<I?(F=w,w=null):F=w.sibling;var j=d(y,w,g[I],S);if(j===null){w===null&&(w=F);break}t&&w&&j.alternate===null&&e(y,w),m=s(j,m,I),T===null?P=j:T.sibling=j,T=j,w=F}if(I===g.length)return r(y,w),er&&Zc(y,I),P;if(w===null){for(;II?(F=w,w=null):F=w.sibling;var H=d(y,w,j.value,S);if(H===null){w===null&&(w=F);break}t&&w&&H.alternate===null&&e(y,w),m=s(H,m,I),T===null?P=H:T.sibling=H,T=H,w=F}if(j.done)return r(y,w),er&&Zc(y,I),P;if(w===null){for(;!j.done;I++,j=g.next())j=f(y,j.value,S),j!==null&&(m=s(j,m,I),T===null?P=j:T.sibling=j,T=j);return er&&Zc(y,I),P}for(w=n(y,w);!j.done;I++,j=g.next())j=h(w,y,I,j.value,S),j!==null&&(t&&j.alternate!==null&&w.delete(j.key===null?I:j.key),m=s(j,m,I),T===null?P=j:T.sibling=j,T=j);return t&&w.forEach(function(K){return e(y,K)}),er&&Zc(y,I),P}function b(y,m,g,S){if(typeof g=="object"&&g!==null&&g.type===Du&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case vp:e:{for(var P=g.key,T=m;T!==null;){if(T.key===P){if(P=g.type,P===Du){if(T.tag===7){r(y,T.sibling),m=i(T,g.props.children),m.return=y,y=m;break e}}else if(T.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Ia&&OA(P)===T.type){r(y,T.sibling),m=i(T,g.props),m.ref=Wd(y,T,g),m.return=y,y=m;break e}r(y,T);break}else e(y,T);T=T.sibling}g.type===Du?(m=bl(g.props.children,y.mode,S,g.key),m.return=y,y=m):(S=_v(g.type,g.key,g.props,null,y.mode,S),S.ref=Wd(y,m,g),S.return=y,y=S)}return o(y);case Nu:e:{for(T=g.key;m!==null;){if(m.key===T)if(m.tag===4&&m.stateNode.containerInfo===g.containerInfo&&m.stateNode.implementation===g.implementation){r(y,m.sibling),m=i(m,g.children||[]),m.return=y,y=m;break e}else{r(y,m);break}else e(y,m);m=m.sibling}m=Xw(g,y.mode,S),m.return=y,y=m}return o(y);case Ia:return T=g._init,b(y,m,T(g._payload),S)}if(dh(g))return p(y,m,g,S);if(Fd(g))return v(y,m,g,S);Ap(y,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,m!==null&&m.tag===6?(r(y,m.sibling),m=i(m,g),m.return=y,y=m):(r(y,m),m=Jw(g,y.mode,S),m.return=y,y=m),o(y)):r(y,m)}return b}var _f=TO(!0),IO=TO(!1),S1={},eo=_c(S1),v0=_c(S1),m0=_c(S1);function hl(t){if(t===S1)throw Error(oe(174));return t}function R6(t,e){switch(gt(m0,e),gt(v0,t),gt(eo,S1),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:jE(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=jE(e,t)}Ht(eo),gt(eo,e)}function Pf(){Ht(eo),Ht(v0),Ht(m0)}function OO(t){hl(m0.current);var e=hl(eo.current),r=jE(e,t.type);e!==r&&(gt(v0,t),gt(eo,r))}function $6(t){v0.current===t&&(Ht(eo),Ht(v0))}var sr=_c(0);function Sm(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var qw=[];function M6(){for(var t=0;tr?r:4,t(!0);var n=Vw.transition;Vw.transition={};try{t(!1),e()}finally{ct=r,Vw.transition=n}}function GO(){return Ui().memoizedState}function AV(t,e,r){var n=Za(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},KO(t))QO(e,r);else if(r=kO(t,e,r,n),r!==null){var i=Mn();ws(r,t,n,i),YO(r,e,n)}}function _V(t,e,r){var n=Za(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(KO(t))QO(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,Cs(a,o)){var c=e.interleaved;c===null?(i.next=i,I6(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=kO(t,e,i,n),r!==null&&(i=Mn(),ws(r,t,n,i),YO(r,e,n))}}function KO(t){var e=t.alternate;return t===cr||e!==null&&e===cr}function QO(t,e){_h=km=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function YO(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,m6(t,r)}}var Am={readContext:ji,useCallback:un,useContext:un,useEffect:un,useImperativeHandle:un,useInsertionEffect:un,useLayoutEffect:un,useMemo:un,useReducer:un,useRef:un,useState:un,useDebugValue:un,useDeferredValue:un,useTransition:un,useMutableSource:un,useSyncExternalStore:un,useId:un,unstable_isNewReconciler:!1},PV={readContext:ji,useCallback:function(t,e){return js().memoizedState=[t,e===void 0?null:e],t},useContext:ji,useEffect:$A,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,Cv(4194308,4,zO.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Cv(4194308,4,t,e)},useInsertionEffect:function(t,e){return Cv(4,2,t,e)},useMemo:function(t,e){var r=js();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=js();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=AV.bind(null,cr,t),[n.memoizedState,t]},useRef:function(t){var e=js();return t={current:t},e.memoizedState=t},useState:RA,useDebugValue:B6,useDeferredValue:function(t){return js().memoizedState=t},useTransition:function(){var t=RA(!1),e=t[0];return t=kV.bind(null,t[1]),js().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=cr,i=js();if(er){if(r===void 0)throw Error(oe(407));r=r()}else{if(r=e(),Kr===null)throw Error(oe(349));Ol&30||MO(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,$A(DO.bind(null,n,s,t),[t]),n.flags|=2048,b0(9,NO.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=js(),e=Kr.identifierPrefix;if(er){var r=$o,n=Ro;r=(n&~(1<<32-bs(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=y0++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[qs]=e,t[f0]=n,KO(t,e,!1,!1),e.stateNode=t;e:{switch(o=NE(r,n),r){case"dialog":jt("cancel",t),jt("close",t),i=n;break;case"iframe":case"object":case"embed":jt("load",t),i=n;break;case"video":case"audio":for(i=0;iPf&&(e.flags|=128,n=!0,Ud(s,!1),e.lanes=4194304)}else{if(!n)if(t=bm(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Ud(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!er)return fn(e),null}else 2*wr()-s.renderingStartTime>Pf&&r!==1073741824&&(e.flags|=128,n=!0,Ud(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=wr(),e.sibling=null,r=sr.current,gt(sr,n?r&1|2:r&1),e):(fn(e),null);case 22:case 23:return L6(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?ai&1073741824&&(fn(e),e.subtreeFlags&6&&(e.flags|=8192)):fn(e),null;case 24:return null;case 25:return null}throw Error(oe(156,e.tag))}function oV(t,e){switch(y6(e),e.tag){case 1:return Xn(e.type)&&dm(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Af(),Ht(Jn),Ht(Cn),A6(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return k6(e),null;case 13:if(Ht(sr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(oe(340));Sf()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ht(sr),null;case 4:return Af(),null;case 10:return E6(e.type._context),null;case 22:case 23:return L6(),null;case 24:return null;default:return null}}var Cp=!1,vn=!1,aV=typeof WeakSet=="function"?WeakSet:Set,fe=null;function Wu(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){hr(t,e,n)}else r.current=null}function cx(t,e,r){try{r()}catch(n){hr(t,e,n)}}var RA=!1;function cV(t,e){if(qE=cm,t=eO(),v6(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,c=-1,l=0,u=0,f=t,d=null;t:for(;;){for(var h;f!==r||i!==0&&f.nodeType!==3||(a=o+i),f!==s||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===t)break t;if(d===r&&++l===i&&(a=o),d===s&&++u===n&&(c=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(VE={focusedElem:t,selectionRange:r},cm=!1,fe=e;fe!==null;)if(e=fe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,fe=t;else for(;fe!==null;){e=fe;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var v=p.memoizedProps,b=p.memoizedState,y=e.stateNode,m=y.getSnapshotBeforeUpdate(e.elementType===e.type?v:as(e.type,v),b);y.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var g=e.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(S){hr(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,fe=t;break}fe=e.return}return p=RA,RA=!1,p}function Sh(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&cx(e,r,s)}i=i.next}while(i!==n)}}function fg(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function lx(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function JO(t){var e=t.alternate;e!==null&&(t.alternate=null,JO(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[qs],delete e[f0],delete e[QE],delete e[Hq],delete e[qq])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function XO(t){return t.tag===5||t.tag===3||t.tag===4}function MA(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||XO(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function ux(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=fm));else if(n!==4&&(t=t.child,t!==null))for(ux(t,e,r),t=t.sibling;t!==null;)ux(t,e,r),t=t.sibling}function fx(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(fx(t,e,r),t=t.sibling;t!==null;)fx(t,e,r),t=t.sibling}var Yr=null,ls=!1;function Ea(t,e,r){for(r=r.child;r!==null;)ZO(t,e,r),r=r.sibling}function ZO(t,e,r){if(Xs&&typeof Xs.onCommitFiberUnmount=="function")try{Xs.onCommitFiberUnmount(ng,r)}catch{}switch(r.tag){case 5:vn||Wu(r,e);case 6:var n=Yr,i=ls;Yr=null,Ea(t,e,r),Yr=n,ls=i,Yr!==null&&(ls?(t=Yr,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Yr.removeChild(r.stateNode));break;case 18:Yr!==null&&(ls?(t=Yr,r=r.stateNode,t.nodeType===8?Dw(t.parentNode,r):t.nodeType===1&&Dw(t,r),o0(t)):Dw(Yr,r.stateNode));break;case 4:n=Yr,i=ls,Yr=r.stateNode.containerInfo,ls=!0,Ea(t,e,r),Yr=n,ls=i;break;case 0:case 11:case 14:case 15:if(!vn&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&cx(r,e,o),i=i.next}while(i!==n)}Ea(t,e,r);break;case 1:if(!vn&&(Wu(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){hr(r,e,a)}Ea(t,e,r);break;case 21:Ea(t,e,r);break;case 22:r.mode&1?(vn=(n=vn)||r.memoizedState!==null,Ea(t,e,r),vn=n):Ea(t,e,r);break;default:Ea(t,e,r)}}function $A(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new aV),e.forEach(function(n){var i=yV.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Xi(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=wr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*uV(n/1960))-n,10t?16:t,Fa===null)var n=!1;else{if(t=Fa,Fa=null,Sm=0,rt&6)throw Error(oe(331));var i=rt;for(rt|=4,fe=t.current;fe!==null;){var s=fe,o=s.child;if(fe.flags&16){var a=s.deletions;if(a!==null){for(var c=0;cwr()-N6?gl(t,0):$6|=r),Zn(t,e)}function aR(t,e){e===0&&(t.mode&1?(e=pp,pp<<=1,!(pp&130023424)&&(pp=4194304)):e=1);var r=$n();t=Uo(t,e),t!==null&&(g1(t,e,r),Zn(t,r))}function mV(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),aR(t,r)}function yV(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(oe(314))}n!==null&&n.delete(e),aR(t,r)}var cR;cR=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Jn.current)Kn=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Kn=!1,iV(t,e,r);Kn=!!(t.flags&131072)}else Kn=!1,er&&e.flags&1048576&&fO(e,vm,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;bv(t,e),t=e.pendingProps;var i=Cf(e,Cn.current);of(e,r),i=P6(null,e,n,t,i,r);var s=T6();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Xn(n)?(s=!0,hm(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,C6(e),i.updater=lg,e.stateNode=i,i._reactInternals=e,tx(e,n,t,r),e=ix(null,e,n,!0,s,r)):(e.tag=0,er&&s&&m6(e),On(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(bv(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=bV(n),t=as(n,t),i){case 0:e=nx(null,e,n,t,r);break e;case 1:e=TA(null,e,n,t,r);break e;case 11:e=_A(null,e,n,t,r);break e;case 14:e=PA(null,e,n,as(n.type,t),r);break e}throw Error(oe(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:as(n,i),nx(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:as(n,i),TA(t,e,n,i,r);case 3:e:{if(qO(e),t===null)throw Error(oe(387));n=e.pendingProps,s=e.memoizedState,i=s.element,vO(t,e),gm(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=_f(Error(oe(423)),e),e=IA(t,e,n,r,i);break e}else if(n!==i){i=_f(Error(oe(424)),e),e=IA(t,e,n,r,i);break e}else for(hi=Qa(e.stateNode.containerInfo.firstChild),pi=e,er=!0,us=null,r=bO(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Sf(),n===i){e=zo(t,e,r);break e}On(t,e,n,r)}e=e.child}return e;case 5:return wO(e),t===null&&XE(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,GE(n,i)?o=null:s!==null&&GE(n,s)&&(e.flags|=32),HO(t,e),On(t,e,o,r),e.child;case 6:return t===null&&XE(e),null;case 13:return VO(t,e,r);case 4:return S6(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=kf(e,null,n,r):On(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:as(n,i),_A(t,e,n,i,r);case 7:return On(t,e,e.pendingProps,r),e.child;case 8:return On(t,e,e.pendingProps.children,r),e.child;case 12:return On(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,gt(mm,n._currentValue),n._currentValue=o,s!==null)if(ws(s.value,o)){if(s.children===i.children&&!Jn.current){e=zo(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===n){if(s.tag===1){c=No(-1,r&-r),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var u=l.pending;u===null?c.next=c:(c.next=u.next,u.next=c),l.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),ZE(s.return,r,e),a.lanes|=r;break}c=c.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(oe(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),ZE(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}On(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,of(e,r),i=Fi(i),n=n(i),e.flags|=1,On(t,e,n,r),e.child;case 14:return n=e.type,i=as(n,e.pendingProps),i=as(n.type,i),PA(t,e,n,i,r);case 15:return zO(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:as(n,i),bv(t,e),e.tag=1,Xn(n)?(t=!0,hm(e)):t=!1,of(e,r),yO(e,n,i),tx(e,n,i,r),ix(null,e,n,!0,t,r);case 19:return GO(t,e,r);case 22:return WO(t,e,r)}throw Error(oe(156,e.tag))};function lR(t,e){return N7(t,e)}function gV(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ni(t,e,r,n){return new gV(t,e,r,n)}function F6(t){return t=t.prototype,!(!t||!t.isReactComponent)}function bV(t){if(typeof t=="function")return F6(t)?1:0;if(t!=null){if(t=t.$$typeof,t===i6)return 11;if(t===s6)return 14}return 2}function Za(t,e){var r=t.alternate;return r===null?(r=Ni(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function xv(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")F6(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case $u:return bl(r.children,i,s,e);case n6:o=8,i|=8;break;case kE:return t=Ni(12,r,e,i|2),t.elementType=kE,t.lanes=s,t;case AE:return t=Ni(13,r,e,i),t.elementType=AE,t.lanes=s,t;case _E:return t=Ni(19,r,e,i),t.elementType=_E,t.lanes=s,t;case g7:return hg(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case m7:o=10;break e;case y7:o=9;break e;case i6:o=11;break e;case s6:o=14;break e;case Ta:o=16,n=null;break e}throw Error(oe(130,t==null?t:typeof t,""))}return e=Ni(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function bl(t,e,r,n){return t=Ni(7,t,n,e),t.lanes=r,t}function hg(t,e,r,n){return t=Ni(22,t,n,e),t.elementType=g7,t.lanes=r,t.stateNode={isHidden:!1},t}function Hw(t,e,r){return t=Ni(6,t,null,e),t.lanes=r,t}function qw(t,e,r){return e=Ni(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function wV(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=kw(0),this.expirationTimes=kw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kw(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function j6(t,e,r,n,i,s,o,a,c){return t=new wV(t,e,r,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Ni(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},C6(s),t}function EV(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hR)}catch(t){console.error(t)}}hR(),f7.exports=Ei;var As=f7.exports;const AV=ks(As);var zA=As;CE.createRoot=zA.createRoot,CE.hydrateRoot=zA.hydrateRoot;var H6={exports:{}};const _V={},PV=Object.freeze(Object.defineProperty({__proto__:null,default:_V},Symbol.toStringTag,{value:"Module"})),pR=ZI(PV);H6.exports;(function(t){(function(e,r){function n(F,E){if(!F)throw new Error(E||"Assertion failed")}function i(F,E){F.super_=E;var _=function(){};_.prototype=E.prototype,F.prototype=new _,F.prototype.constructor=F}function s(F,E,_){if(s.isBN(F))return F;this.negative=0,this.words=null,this.length=0,this.red=null,F!==null&&((E==="le"||E==="be")&&(_=E,E=10),this._init(F||0,E||10,_||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=pR.Buffer}catch{}s.isBN=function(E){return E instanceof s?!0:E!==null&&typeof E=="object"&&E.constructor.wordSize===s.wordSize&&Array.isArray(E.words)},s.max=function(E,_){return E.cmp(_)>0?E:_},s.min=function(E,_){return E.cmp(_)<0?E:_},s.prototype._init=function(E,_,O){if(typeof E=="number")return this._initNumber(E,_,O);if(typeof E=="object")return this._initArray(E,_,O);_==="hex"&&(_=16),n(_===(_|0)&&_>=2&&_<=36),E=E.toString().replace(/\s+/g,"");var N=0;E[0]==="-"&&(N++,this.negative=1),N=0;N-=3)M=E[N]|E[N-1]<<8|E[N-2]<<16,this.words[k]|=M<>>26-L&67108863,L+=24,L>=26&&(L-=26,k++);else if(O==="le")for(N=0,k=0;N>>26-L&67108863,L+=24,L>=26&&(L-=26,k++);return this._strip()};function a(F,E){var _=F.charCodeAt(E);if(_>=48&&_<=57)return _-48;if(_>=65&&_<=70)return _-55;if(_>=97&&_<=102)return _-87;n(!1,"Invalid character in "+F)}function c(F,E,_){var O=a(F,_);return _-1>=E&&(O|=a(F,_-1)<<4),O}s.prototype._parseHex=function(E,_,O){this.length=Math.ceil((E.length-_)/6),this.words=new Array(this.length);for(var N=0;N=_;N-=2)L=c(E,_,N)<=18?(k-=18,M+=1,this.words[M]|=L>>>26):k+=8;else{var $=E.length-_;for(N=$%2===0?_+1:_;N=18?(k-=18,M+=1,this.words[M]|=L>>>26):k+=8}this._strip()};function l(F,E,_,O){for(var N=0,k=0,M=Math.min(F.length,_),L=E;L=49?k=$-49+10:$>=17?k=$-17+10:k=$,n($>=0&&k1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{s.prototype.inspect=f}else s.prototype.inspect=f;function f(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[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];s.prototype.toString=function(E,_){E=E||10,_=_|0||1;var O;if(E===16||E==="hex"){O="";for(var N=0,k=0,M=0;M>>24-N&16777215,N+=2,N>=26&&(N-=26,M--),k!==0||M!==this.length-1?O=d[6-$.length]+$+O:O=$+O}for(k!==0&&(O=k.toString(16)+O);O.length%_!==0;)O="0"+O;return this.negative!==0&&(O="-"+O),O}if(E===(E|0)&&E>=2&&E<=36){var A=h[E],D=p[E];O="";var V=this.clone();for(V.negative=0;!V.isZero();){var R=V.modrn(D).toString(E);V=V.idivn(D),V.isZero()?O=R+O:O=d[A-R.length]+R+O}for(this.isZero()&&(O="0"+O);O.length%_!==0;)O="0"+O;return this.negative!==0&&(O="-"+O),O}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var E=this.words[0];return this.length===2?E+=this.words[1]*67108864:this.length===3&&this.words[2]===1?E+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-E:E},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(E,_){return this.toArrayLike(o,E,_)}),s.prototype.toArray=function(E,_){return this.toArrayLike(Array,E,_)};var v=function(E,_){return E.allocUnsafe?E.allocUnsafe(_):new E(_)};s.prototype.toArrayLike=function(E,_,O){this._strip();var N=this.byteLength(),k=O||Math.max(1,N);n(N<=k,"byte array longer than desired length"),n(k>0,"Requested array length <= 0");var M=v(E,k),L=_==="le"?"LE":"BE";return this["_toArrayLike"+L](M,N),M},s.prototype._toArrayLikeLE=function(E,_){for(var O=0,N=0,k=0,M=0;k>8&255),O>16&255),M===6?(O>24&255),N=0,M=0):(N=L>>>24,M+=2)}if(O=0&&(E[O--]=L>>8&255),O>=0&&(E[O--]=L>>16&255),M===6?(O>=0&&(E[O--]=L>>24&255),N=0,M=0):(N=L>>>24,M+=2)}if(O>=0)for(E[O--]=N;O>=0;)E[O--]=0},Math.clz32?s.prototype._countBits=function(E){return 32-Math.clz32(E)}:s.prototype._countBits=function(E){var _=E,O=0;return _>=4096&&(O+=13,_>>>=13),_>=64&&(O+=7,_>>>=7),_>=8&&(O+=4,_>>>=4),_>=2&&(O+=2,_>>>=2),O+_},s.prototype._zeroBits=function(E){if(E===0)return 26;var _=E,O=0;return _&8191||(O+=13,_>>>=13),_&127||(O+=7,_>>>=7),_&15||(O+=4,_>>>=4),_&3||(O+=2,_>>>=2),_&1||O++,O},s.prototype.bitLength=function(){var E=this.words[this.length-1],_=this._countBits(E);return(this.length-1)*26+_};function b(F){for(var E=new Array(F.bitLength()),_=0;_>>N&1}return E}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var E=0,_=0;_E.length?this.clone().ior(E):E.clone().ior(this)},s.prototype.uor=function(E){return this.length>E.length?this.clone().iuor(E):E.clone().iuor(this)},s.prototype.iuand=function(E){var _;this.length>E.length?_=E:_=this;for(var O=0;O<_.length;O++)this.words[O]=this.words[O]&E.words[O];return this.length=_.length,this._strip()},s.prototype.iand=function(E){return n((this.negative|E.negative)===0),this.iuand(E)},s.prototype.and=function(E){return this.length>E.length?this.clone().iand(E):E.clone().iand(this)},s.prototype.uand=function(E){return this.length>E.length?this.clone().iuand(E):E.clone().iuand(this)},s.prototype.iuxor=function(E){var _,O;this.length>E.length?(_=this,O=E):(_=E,O=this);for(var N=0;NE.length?this.clone().ixor(E):E.clone().ixor(this)},s.prototype.uxor=function(E){return this.length>E.length?this.clone().iuxor(E):E.clone().iuxor(this)},s.prototype.inotn=function(E){n(typeof E=="number"&&E>=0);var _=Math.ceil(E/26)|0,O=E%26;this._expand(_),O>0&&_--;for(var N=0;N<_;N++)this.words[N]=~this.words[N]&67108863;return O>0&&(this.words[N]=~this.words[N]&67108863>>26-O),this._strip()},s.prototype.notn=function(E){return this.clone().inotn(E)},s.prototype.setn=function(E,_){n(typeof E=="number"&&E>=0);var O=E/26|0,N=E%26;return this._expand(O+1),_?this.words[O]=this.words[O]|1<E.length?(O=this,N=E):(O=E,N=this);for(var k=0,M=0;M>>26;for(;k!==0&&M>>26;if(this.length=O.length,k!==0)this.words[this.length]=k,this.length++;else if(O!==this)for(;ME.length?this.clone().iadd(E):E.clone().iadd(this)},s.prototype.isub=function(E){if(E.negative!==0){E.negative=0;var _=this.iadd(E);return E.negative=1,_._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(E),this.negative=1,this._normSign();var O=this.cmp(E);if(O===0)return this.negative=0,this.length=1,this.words[0]=0,this;var N,k;O>0?(N=this,k=E):(N=E,k=this);for(var M=0,L=0;L>26,this.words[L]=_&67108863;for(;M!==0&&L>26,this.words[L]=_&67108863;if(M===0&&L>>26,V=$&67108863,R=Math.min(A,E.length-1),U=Math.max(0,A-F.length+1);U<=R;U++){var W=A-U|0;N=F.words[W]|0,k=E.words[U]|0,M=N*k+V,D+=M/67108864|0,V=M&67108863}_.words[A]=V|0,$=D|0}return $!==0?_.words[A]=$|0:_.length--,_._strip()}var m=function(E,_,O){var N=E.words,k=_.words,M=O.words,L=0,$,A,D,V=N[0]|0,R=V&8191,U=V>>>13,W=N[1]|0,q=W&8191,Y=W>>>13,X=N[2]|0,Q=X&8191,Z=X>>>13,ae=N[3]|0,se=ae&8191,ue=ae>>>13,ot=N[4]|0,Pe=ot&8191,Ae=ot>>>13,at=N[5]|0,xe=at&8191,be=at>>>13,Kt=N[6]|0,Te=Kt&8191,Ie=Kt>>>13,Qt=N[7]|0,Oe=Qt&8191,Re=Qt>>>13,Yt=N[8]|0,Me=Yt&8191,$e=Yt>>>13,Jt=N[9]|0,Ne=Jt&8191,De=Jt>>>13,Xt=k[0]|0,Le=Xt&8191,Et=Xt>>>13,jc=k[1]|0,xt=jc&8191,Ct=jc>>>13,Uc=k[2]|0,St=Uc&8191,kt=Uc>>>13,zc=k[3]|0,At=zc&8191,_t=zc>>>13,Wc=k[4]|0,Pt=Wc&8191,Tt=Wc>>>13,Hc=k[5]|0,It=Hc&8191,Ot=Hc>>>13,qc=k[6]|0,Rt=qc&8191,Mt=qc>>>13,Vc=k[7]|0,$t=Vc&8191,Nt=Vc>>>13,Gc=k[8]|0,Dt=Gc&8191,Lt=Gc>>>13,Kc=k[9]|0,Bt=Kc&8191,Ft=Kc>>>13;O.negative=E.negative^_.negative,O.length=19,$=Math.imul(R,Le),A=Math.imul(R,Et),A=A+Math.imul(U,Le)|0,D=Math.imul(U,Et);var ma=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(ma>>>26)|0,ma&=67108863,$=Math.imul(q,Le),A=Math.imul(q,Et),A=A+Math.imul(Y,Le)|0,D=Math.imul(Y,Et),$=$+Math.imul(R,xt)|0,A=A+Math.imul(R,Ct)|0,A=A+Math.imul(U,xt)|0,D=D+Math.imul(U,Ct)|0;var ya=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(ya>>>26)|0,ya&=67108863,$=Math.imul(Q,Le),A=Math.imul(Q,Et),A=A+Math.imul(Z,Le)|0,D=Math.imul(Z,Et),$=$+Math.imul(q,xt)|0,A=A+Math.imul(q,Ct)|0,A=A+Math.imul(Y,xt)|0,D=D+Math.imul(Y,Ct)|0,$=$+Math.imul(R,St)|0,A=A+Math.imul(R,kt)|0,A=A+Math.imul(U,St)|0,D=D+Math.imul(U,kt)|0;var ga=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(ga>>>26)|0,ga&=67108863,$=Math.imul(se,Le),A=Math.imul(se,Et),A=A+Math.imul(ue,Le)|0,D=Math.imul(ue,Et),$=$+Math.imul(Q,xt)|0,A=A+Math.imul(Q,Ct)|0,A=A+Math.imul(Z,xt)|0,D=D+Math.imul(Z,Ct)|0,$=$+Math.imul(q,St)|0,A=A+Math.imul(q,kt)|0,A=A+Math.imul(Y,St)|0,D=D+Math.imul(Y,kt)|0,$=$+Math.imul(R,At)|0,A=A+Math.imul(R,_t)|0,A=A+Math.imul(U,At)|0,D=D+Math.imul(U,_t)|0;var ba=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(ba>>>26)|0,ba&=67108863,$=Math.imul(Pe,Le),A=Math.imul(Pe,Et),A=A+Math.imul(Ae,Le)|0,D=Math.imul(Ae,Et),$=$+Math.imul(se,xt)|0,A=A+Math.imul(se,Ct)|0,A=A+Math.imul(ue,xt)|0,D=D+Math.imul(ue,Ct)|0,$=$+Math.imul(Q,St)|0,A=A+Math.imul(Q,kt)|0,A=A+Math.imul(Z,St)|0,D=D+Math.imul(Z,kt)|0,$=$+Math.imul(q,At)|0,A=A+Math.imul(q,_t)|0,A=A+Math.imul(Y,At)|0,D=D+Math.imul(Y,_t)|0,$=$+Math.imul(R,Pt)|0,A=A+Math.imul(R,Tt)|0,A=A+Math.imul(U,Pt)|0,D=D+Math.imul(U,Tt)|0;var wa=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(wa>>>26)|0,wa&=67108863,$=Math.imul(xe,Le),A=Math.imul(xe,Et),A=A+Math.imul(be,Le)|0,D=Math.imul(be,Et),$=$+Math.imul(Pe,xt)|0,A=A+Math.imul(Pe,Ct)|0,A=A+Math.imul(Ae,xt)|0,D=D+Math.imul(Ae,Ct)|0,$=$+Math.imul(se,St)|0,A=A+Math.imul(se,kt)|0,A=A+Math.imul(ue,St)|0,D=D+Math.imul(ue,kt)|0,$=$+Math.imul(Q,At)|0,A=A+Math.imul(Q,_t)|0,A=A+Math.imul(Z,At)|0,D=D+Math.imul(Z,_t)|0,$=$+Math.imul(q,Pt)|0,A=A+Math.imul(q,Tt)|0,A=A+Math.imul(Y,Pt)|0,D=D+Math.imul(Y,Tt)|0,$=$+Math.imul(R,It)|0,A=A+Math.imul(R,Ot)|0,A=A+Math.imul(U,It)|0,D=D+Math.imul(U,Ot)|0;var ow=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(ow>>>26)|0,ow&=67108863,$=Math.imul(Te,Le),A=Math.imul(Te,Et),A=A+Math.imul(Ie,Le)|0,D=Math.imul(Ie,Et),$=$+Math.imul(xe,xt)|0,A=A+Math.imul(xe,Ct)|0,A=A+Math.imul(be,xt)|0,D=D+Math.imul(be,Ct)|0,$=$+Math.imul(Pe,St)|0,A=A+Math.imul(Pe,kt)|0,A=A+Math.imul(Ae,St)|0,D=D+Math.imul(Ae,kt)|0,$=$+Math.imul(se,At)|0,A=A+Math.imul(se,_t)|0,A=A+Math.imul(ue,At)|0,D=D+Math.imul(ue,_t)|0,$=$+Math.imul(Q,Pt)|0,A=A+Math.imul(Q,Tt)|0,A=A+Math.imul(Z,Pt)|0,D=D+Math.imul(Z,Tt)|0,$=$+Math.imul(q,It)|0,A=A+Math.imul(q,Ot)|0,A=A+Math.imul(Y,It)|0,D=D+Math.imul(Y,Ot)|0,$=$+Math.imul(R,Rt)|0,A=A+Math.imul(R,Mt)|0,A=A+Math.imul(U,Rt)|0,D=D+Math.imul(U,Mt)|0;var aw=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(aw>>>26)|0,aw&=67108863,$=Math.imul(Oe,Le),A=Math.imul(Oe,Et),A=A+Math.imul(Re,Le)|0,D=Math.imul(Re,Et),$=$+Math.imul(Te,xt)|0,A=A+Math.imul(Te,Ct)|0,A=A+Math.imul(Ie,xt)|0,D=D+Math.imul(Ie,Ct)|0,$=$+Math.imul(xe,St)|0,A=A+Math.imul(xe,kt)|0,A=A+Math.imul(be,St)|0,D=D+Math.imul(be,kt)|0,$=$+Math.imul(Pe,At)|0,A=A+Math.imul(Pe,_t)|0,A=A+Math.imul(Ae,At)|0,D=D+Math.imul(Ae,_t)|0,$=$+Math.imul(se,Pt)|0,A=A+Math.imul(se,Tt)|0,A=A+Math.imul(ue,Pt)|0,D=D+Math.imul(ue,Tt)|0,$=$+Math.imul(Q,It)|0,A=A+Math.imul(Q,Ot)|0,A=A+Math.imul(Z,It)|0,D=D+Math.imul(Z,Ot)|0,$=$+Math.imul(q,Rt)|0,A=A+Math.imul(q,Mt)|0,A=A+Math.imul(Y,Rt)|0,D=D+Math.imul(Y,Mt)|0,$=$+Math.imul(R,$t)|0,A=A+Math.imul(R,Nt)|0,A=A+Math.imul(U,$t)|0,D=D+Math.imul(U,Nt)|0;var cw=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(cw>>>26)|0,cw&=67108863,$=Math.imul(Me,Le),A=Math.imul(Me,Et),A=A+Math.imul($e,Le)|0,D=Math.imul($e,Et),$=$+Math.imul(Oe,xt)|0,A=A+Math.imul(Oe,Ct)|0,A=A+Math.imul(Re,xt)|0,D=D+Math.imul(Re,Ct)|0,$=$+Math.imul(Te,St)|0,A=A+Math.imul(Te,kt)|0,A=A+Math.imul(Ie,St)|0,D=D+Math.imul(Ie,kt)|0,$=$+Math.imul(xe,At)|0,A=A+Math.imul(xe,_t)|0,A=A+Math.imul(be,At)|0,D=D+Math.imul(be,_t)|0,$=$+Math.imul(Pe,Pt)|0,A=A+Math.imul(Pe,Tt)|0,A=A+Math.imul(Ae,Pt)|0,D=D+Math.imul(Ae,Tt)|0,$=$+Math.imul(se,It)|0,A=A+Math.imul(se,Ot)|0,A=A+Math.imul(ue,It)|0,D=D+Math.imul(ue,Ot)|0,$=$+Math.imul(Q,Rt)|0,A=A+Math.imul(Q,Mt)|0,A=A+Math.imul(Z,Rt)|0,D=D+Math.imul(Z,Mt)|0,$=$+Math.imul(q,$t)|0,A=A+Math.imul(q,Nt)|0,A=A+Math.imul(Y,$t)|0,D=D+Math.imul(Y,Nt)|0,$=$+Math.imul(R,Dt)|0,A=A+Math.imul(R,Lt)|0,A=A+Math.imul(U,Dt)|0,D=D+Math.imul(U,Lt)|0;var lw=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(lw>>>26)|0,lw&=67108863,$=Math.imul(Ne,Le),A=Math.imul(Ne,Et),A=A+Math.imul(De,Le)|0,D=Math.imul(De,Et),$=$+Math.imul(Me,xt)|0,A=A+Math.imul(Me,Ct)|0,A=A+Math.imul($e,xt)|0,D=D+Math.imul($e,Ct)|0,$=$+Math.imul(Oe,St)|0,A=A+Math.imul(Oe,kt)|0,A=A+Math.imul(Re,St)|0,D=D+Math.imul(Re,kt)|0,$=$+Math.imul(Te,At)|0,A=A+Math.imul(Te,_t)|0,A=A+Math.imul(Ie,At)|0,D=D+Math.imul(Ie,_t)|0,$=$+Math.imul(xe,Pt)|0,A=A+Math.imul(xe,Tt)|0,A=A+Math.imul(be,Pt)|0,D=D+Math.imul(be,Tt)|0,$=$+Math.imul(Pe,It)|0,A=A+Math.imul(Pe,Ot)|0,A=A+Math.imul(Ae,It)|0,D=D+Math.imul(Ae,Ot)|0,$=$+Math.imul(se,Rt)|0,A=A+Math.imul(se,Mt)|0,A=A+Math.imul(ue,Rt)|0,D=D+Math.imul(ue,Mt)|0,$=$+Math.imul(Q,$t)|0,A=A+Math.imul(Q,Nt)|0,A=A+Math.imul(Z,$t)|0,D=D+Math.imul(Z,Nt)|0,$=$+Math.imul(q,Dt)|0,A=A+Math.imul(q,Lt)|0,A=A+Math.imul(Y,Dt)|0,D=D+Math.imul(Y,Lt)|0,$=$+Math.imul(R,Bt)|0,A=A+Math.imul(R,Ft)|0,A=A+Math.imul(U,Bt)|0,D=D+Math.imul(U,Ft)|0;var uw=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(uw>>>26)|0,uw&=67108863,$=Math.imul(Ne,xt),A=Math.imul(Ne,Ct),A=A+Math.imul(De,xt)|0,D=Math.imul(De,Ct),$=$+Math.imul(Me,St)|0,A=A+Math.imul(Me,kt)|0,A=A+Math.imul($e,St)|0,D=D+Math.imul($e,kt)|0,$=$+Math.imul(Oe,At)|0,A=A+Math.imul(Oe,_t)|0,A=A+Math.imul(Re,At)|0,D=D+Math.imul(Re,_t)|0,$=$+Math.imul(Te,Pt)|0,A=A+Math.imul(Te,Tt)|0,A=A+Math.imul(Ie,Pt)|0,D=D+Math.imul(Ie,Tt)|0,$=$+Math.imul(xe,It)|0,A=A+Math.imul(xe,Ot)|0,A=A+Math.imul(be,It)|0,D=D+Math.imul(be,Ot)|0,$=$+Math.imul(Pe,Rt)|0,A=A+Math.imul(Pe,Mt)|0,A=A+Math.imul(Ae,Rt)|0,D=D+Math.imul(Ae,Mt)|0,$=$+Math.imul(se,$t)|0,A=A+Math.imul(se,Nt)|0,A=A+Math.imul(ue,$t)|0,D=D+Math.imul(ue,Nt)|0,$=$+Math.imul(Q,Dt)|0,A=A+Math.imul(Q,Lt)|0,A=A+Math.imul(Z,Dt)|0,D=D+Math.imul(Z,Lt)|0,$=$+Math.imul(q,Bt)|0,A=A+Math.imul(q,Ft)|0,A=A+Math.imul(Y,Bt)|0,D=D+Math.imul(Y,Ft)|0;var fw=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(fw>>>26)|0,fw&=67108863,$=Math.imul(Ne,St),A=Math.imul(Ne,kt),A=A+Math.imul(De,St)|0,D=Math.imul(De,kt),$=$+Math.imul(Me,At)|0,A=A+Math.imul(Me,_t)|0,A=A+Math.imul($e,At)|0,D=D+Math.imul($e,_t)|0,$=$+Math.imul(Oe,Pt)|0,A=A+Math.imul(Oe,Tt)|0,A=A+Math.imul(Re,Pt)|0,D=D+Math.imul(Re,Tt)|0,$=$+Math.imul(Te,It)|0,A=A+Math.imul(Te,Ot)|0,A=A+Math.imul(Ie,It)|0,D=D+Math.imul(Ie,Ot)|0,$=$+Math.imul(xe,Rt)|0,A=A+Math.imul(xe,Mt)|0,A=A+Math.imul(be,Rt)|0,D=D+Math.imul(be,Mt)|0,$=$+Math.imul(Pe,$t)|0,A=A+Math.imul(Pe,Nt)|0,A=A+Math.imul(Ae,$t)|0,D=D+Math.imul(Ae,Nt)|0,$=$+Math.imul(se,Dt)|0,A=A+Math.imul(se,Lt)|0,A=A+Math.imul(ue,Dt)|0,D=D+Math.imul(ue,Lt)|0,$=$+Math.imul(Q,Bt)|0,A=A+Math.imul(Q,Ft)|0,A=A+Math.imul(Z,Bt)|0,D=D+Math.imul(Z,Ft)|0;var dw=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(dw>>>26)|0,dw&=67108863,$=Math.imul(Ne,At),A=Math.imul(Ne,_t),A=A+Math.imul(De,At)|0,D=Math.imul(De,_t),$=$+Math.imul(Me,Pt)|0,A=A+Math.imul(Me,Tt)|0,A=A+Math.imul($e,Pt)|0,D=D+Math.imul($e,Tt)|0,$=$+Math.imul(Oe,It)|0,A=A+Math.imul(Oe,Ot)|0,A=A+Math.imul(Re,It)|0,D=D+Math.imul(Re,Ot)|0,$=$+Math.imul(Te,Rt)|0,A=A+Math.imul(Te,Mt)|0,A=A+Math.imul(Ie,Rt)|0,D=D+Math.imul(Ie,Mt)|0,$=$+Math.imul(xe,$t)|0,A=A+Math.imul(xe,Nt)|0,A=A+Math.imul(be,$t)|0,D=D+Math.imul(be,Nt)|0,$=$+Math.imul(Pe,Dt)|0,A=A+Math.imul(Pe,Lt)|0,A=A+Math.imul(Ae,Dt)|0,D=D+Math.imul(Ae,Lt)|0,$=$+Math.imul(se,Bt)|0,A=A+Math.imul(se,Ft)|0,A=A+Math.imul(ue,Bt)|0,D=D+Math.imul(ue,Ft)|0;var hw=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(hw>>>26)|0,hw&=67108863,$=Math.imul(Ne,Pt),A=Math.imul(Ne,Tt),A=A+Math.imul(De,Pt)|0,D=Math.imul(De,Tt),$=$+Math.imul(Me,It)|0,A=A+Math.imul(Me,Ot)|0,A=A+Math.imul($e,It)|0,D=D+Math.imul($e,Ot)|0,$=$+Math.imul(Oe,Rt)|0,A=A+Math.imul(Oe,Mt)|0,A=A+Math.imul(Re,Rt)|0,D=D+Math.imul(Re,Mt)|0,$=$+Math.imul(Te,$t)|0,A=A+Math.imul(Te,Nt)|0,A=A+Math.imul(Ie,$t)|0,D=D+Math.imul(Ie,Nt)|0,$=$+Math.imul(xe,Dt)|0,A=A+Math.imul(xe,Lt)|0,A=A+Math.imul(be,Dt)|0,D=D+Math.imul(be,Lt)|0,$=$+Math.imul(Pe,Bt)|0,A=A+Math.imul(Pe,Ft)|0,A=A+Math.imul(Ae,Bt)|0,D=D+Math.imul(Ae,Ft)|0;var pw=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(pw>>>26)|0,pw&=67108863,$=Math.imul(Ne,It),A=Math.imul(Ne,Ot),A=A+Math.imul(De,It)|0,D=Math.imul(De,Ot),$=$+Math.imul(Me,Rt)|0,A=A+Math.imul(Me,Mt)|0,A=A+Math.imul($e,Rt)|0,D=D+Math.imul($e,Mt)|0,$=$+Math.imul(Oe,$t)|0,A=A+Math.imul(Oe,Nt)|0,A=A+Math.imul(Re,$t)|0,D=D+Math.imul(Re,Nt)|0,$=$+Math.imul(Te,Dt)|0,A=A+Math.imul(Te,Lt)|0,A=A+Math.imul(Ie,Dt)|0,D=D+Math.imul(Ie,Lt)|0,$=$+Math.imul(xe,Bt)|0,A=A+Math.imul(xe,Ft)|0,A=A+Math.imul(be,Bt)|0,D=D+Math.imul(be,Ft)|0;var vw=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(vw>>>26)|0,vw&=67108863,$=Math.imul(Ne,Rt),A=Math.imul(Ne,Mt),A=A+Math.imul(De,Rt)|0,D=Math.imul(De,Mt),$=$+Math.imul(Me,$t)|0,A=A+Math.imul(Me,Nt)|0,A=A+Math.imul($e,$t)|0,D=D+Math.imul($e,Nt)|0,$=$+Math.imul(Oe,Dt)|0,A=A+Math.imul(Oe,Lt)|0,A=A+Math.imul(Re,Dt)|0,D=D+Math.imul(Re,Lt)|0,$=$+Math.imul(Te,Bt)|0,A=A+Math.imul(Te,Ft)|0,A=A+Math.imul(Ie,Bt)|0,D=D+Math.imul(Ie,Ft)|0;var mw=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(mw>>>26)|0,mw&=67108863,$=Math.imul(Ne,$t),A=Math.imul(Ne,Nt),A=A+Math.imul(De,$t)|0,D=Math.imul(De,Nt),$=$+Math.imul(Me,Dt)|0,A=A+Math.imul(Me,Lt)|0,A=A+Math.imul($e,Dt)|0,D=D+Math.imul($e,Lt)|0,$=$+Math.imul(Oe,Bt)|0,A=A+Math.imul(Oe,Ft)|0,A=A+Math.imul(Re,Bt)|0,D=D+Math.imul(Re,Ft)|0;var yw=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(yw>>>26)|0,yw&=67108863,$=Math.imul(Ne,Dt),A=Math.imul(Ne,Lt),A=A+Math.imul(De,Dt)|0,D=Math.imul(De,Lt),$=$+Math.imul(Me,Bt)|0,A=A+Math.imul(Me,Ft)|0,A=A+Math.imul($e,Bt)|0,D=D+Math.imul($e,Ft)|0;var gw=(L+$|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(gw>>>26)|0,gw&=67108863,$=Math.imul(Ne,Bt),A=Math.imul(Ne,Ft),A=A+Math.imul(De,Bt)|0,D=Math.imul(De,Ft);var bw=(L+$|0)+((A&8191)<<13)|0;return L=(D+(A>>>13)|0)+(bw>>>26)|0,bw&=67108863,M[0]=ma,M[1]=ya,M[2]=ga,M[3]=ba,M[4]=wa,M[5]=ow,M[6]=aw,M[7]=cw,M[8]=lw,M[9]=uw,M[10]=fw,M[11]=dw,M[12]=hw,M[13]=pw,M[14]=vw,M[15]=mw,M[16]=yw,M[17]=gw,M[18]=bw,L!==0&&(M[19]=L,O.length++),O};Math.imul||(m=y);function g(F,E,_){_.negative=E.negative^F.negative,_.length=F.length+E.length;for(var O=0,N=0,k=0;k<_.length-1;k++){var M=N;N=0;for(var L=O&67108863,$=Math.min(k,E.length-1),A=Math.max(0,k-F.length+1);A<=$;A++){var D=k-A,V=F.words[D]|0,R=E.words[A]|0,U=V*R,W=U&67108863;M=M+(U/67108864|0)|0,W=W+L|0,L=W&67108863,M=M+(W>>>26)|0,N+=M>>>26,M&=67108863}_.words[k]=L,O=M,M=N}return O!==0?_.words[k]=O:_.length--,_._strip()}function S(F,E,_){return g(F,E,_)}s.prototype.mulTo=function(E,_){var O,N=this.length+E.length;return this.length===10&&E.length===10?O=m(this,E,_):N<63?O=y(this,E,_):N<1024?O=g(this,E,_):O=S(this,E,_),O},s.prototype.mul=function(E){var _=new s(null);return _.words=new Array(this.length+E.length),this.mulTo(E,_)},s.prototype.mulf=function(E){var _=new s(null);return _.words=new Array(this.length+E.length),S(this,E,_)},s.prototype.imul=function(E){return this.clone().mulTo(E,this)},s.prototype.imuln=function(E){var _=E<0;_&&(E=-E),n(typeof E=="number"),n(E<67108864);for(var O=0,N=0;N>=26,O+=k/67108864|0,O+=M>>>26,this.words[N]=M&67108863}return O!==0&&(this.words[N]=O,this.length++),_?this.ineg():this},s.prototype.muln=function(E){return this.clone().imuln(E)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(E){var _=b(E);if(_.length===0)return new s(1);for(var O=this,N=0;N<_.length&&_[N]===0;N++,O=O.sqr());if(++N<_.length)for(var k=O.sqr();N<_.length;N++,k=k.sqr())_[N]!==0&&(O=O.mul(k));return O},s.prototype.iushln=function(E){n(typeof E=="number"&&E>=0);var _=E%26,O=(E-_)/26,N=67108863>>>26-_<<26-_,k;if(_!==0){var M=0;for(k=0;k>>26-_}M&&(this.words[k]=M,this.length++)}if(O!==0){for(k=this.length-1;k>=0;k--)this.words[k+O]=this.words[k];for(k=0;k=0);var N;_?N=(_-_%26)/26:N=0;var k=E%26,M=Math.min((E-k)/26,this.length),L=67108863^67108863>>>k<M)for(this.length-=M,A=0;A=0&&(D!==0||A>=N);A--){var V=this.words[A]|0;this.words[A]=D<<26-k|V>>>k,D=V&L}return $&&D!==0&&($.words[$.length++]=D),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(E,_,O){return n(this.negative===0),this.iushrn(E,_,O)},s.prototype.shln=function(E){return this.clone().ishln(E)},s.prototype.ushln=function(E){return this.clone().iushln(E)},s.prototype.shrn=function(E){return this.clone().ishrn(E)},s.prototype.ushrn=function(E){return this.clone().iushrn(E)},s.prototype.testn=function(E){n(typeof E=="number"&&E>=0);var _=E%26,O=(E-_)/26,N=1<<_;if(this.length<=O)return!1;var k=this.words[O];return!!(k&N)},s.prototype.imaskn=function(E){n(typeof E=="number"&&E>=0);var _=E%26,O=(E-_)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=O)return this;if(_!==0&&O++,this.length=Math.min(O,this.length),_!==0){var N=67108863^67108863>>>_<<_;this.words[this.length-1]&=N}return this._strip()},s.prototype.maskn=function(E){return this.clone().imaskn(E)},s.prototype.iaddn=function(E){return n(typeof E=="number"),n(E<67108864),E<0?this.isubn(-E):this.negative!==0?this.length===1&&(this.words[0]|0)<=E?(this.words[0]=E-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(E),this.negative=1,this):this._iaddn(E)},s.prototype._iaddn=function(E){this.words[0]+=E;for(var _=0;_=67108864;_++)this.words[_]-=67108864,_===this.length-1?this.words[_+1]=1:this.words[_+1]++;return this.length=Math.max(this.length,_+1),this},s.prototype.isubn=function(E){if(n(typeof E=="number"),n(E<67108864),E<0)return this.iaddn(-E);if(this.negative!==0)return this.negative=0,this.iaddn(E),this.negative=1,this;if(this.words[0]-=E,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var _=0;_>26)-($/67108864|0),this.words[k+O]=M&67108863}for(;k>26,this.words[k+O]=M&67108863;if(L===0)return this._strip();for(n(L===-1),L=0,k=0;k>26,this.words[k]=M&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(E,_){var O=this.length-E.length,N=this.clone(),k=E,M=k.words[k.length-1]|0,L=this._countBits(M);O=26-L,O!==0&&(k=k.ushln(O),N.iushln(O),M=k.words[k.length-1]|0);var $=N.length-k.length,A;if(_!=="mod"){A=new s(null),A.length=$+1,A.words=new Array(A.length);for(var D=0;D=0;R--){var U=(N.words[k.length+R]|0)*67108864+(N.words[k.length+R-1]|0);for(U=Math.min(U/M|0,67108863),N._ishlnsubmul(k,U,R);N.negative!==0;)U--,N.negative=0,N._ishlnsubmul(k,1,R),N.isZero()||(N.negative^=1);A&&(A.words[R]=U)}return A&&A._strip(),N._strip(),_!=="div"&&O!==0&&N.iushrn(O),{div:A||null,mod:N}},s.prototype.divmod=function(E,_,O){if(n(!E.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var N,k,M;return this.negative!==0&&E.negative===0?(M=this.neg().divmod(E,_),_!=="mod"&&(N=M.div.neg()),_!=="div"&&(k=M.mod.neg(),O&&k.negative!==0&&k.iadd(E)),{div:N,mod:k}):this.negative===0&&E.negative!==0?(M=this.divmod(E.neg(),_),_!=="mod"&&(N=M.div.neg()),{div:N,mod:M.mod}):this.negative&E.negative?(M=this.neg().divmod(E.neg(),_),_!=="div"&&(k=M.mod.neg(),O&&k.negative!==0&&k.isub(E)),{div:M.div,mod:k}):E.length>this.length||this.cmp(E)<0?{div:new s(0),mod:this}:E.length===1?_==="div"?{div:this.divn(E.words[0]),mod:null}:_==="mod"?{div:null,mod:new s(this.modrn(E.words[0]))}:{div:this.divn(E.words[0]),mod:new s(this.modrn(E.words[0]))}:this._wordDiv(E,_)},s.prototype.div=function(E){return this.divmod(E,"div",!1).div},s.prototype.mod=function(E){return this.divmod(E,"mod",!1).mod},s.prototype.umod=function(E){return this.divmod(E,"mod",!0).mod},s.prototype.divRound=function(E){var _=this.divmod(E);if(_.mod.isZero())return _.div;var O=_.div.negative!==0?_.mod.isub(E):_.mod,N=E.ushrn(1),k=E.andln(1),M=O.cmp(N);return M<0||k===1&&M===0?_.div:_.div.negative!==0?_.div.isubn(1):_.div.iaddn(1)},s.prototype.modrn=function(E){var _=E<0;_&&(E=-E),n(E<=67108863);for(var O=(1<<26)%E,N=0,k=this.length-1;k>=0;k--)N=(O*N+(this.words[k]|0))%E;return _?-N:N},s.prototype.modn=function(E){return this.modrn(E)},s.prototype.idivn=function(E){var _=E<0;_&&(E=-E),n(E<=67108863);for(var O=0,N=this.length-1;N>=0;N--){var k=(this.words[N]|0)+O*67108864;this.words[N]=k/E|0,O=k%E}return this._strip(),_?this.ineg():this},s.prototype.divn=function(E){return this.clone().idivn(E)},s.prototype.egcd=function(E){n(E.negative===0),n(!E.isZero());var _=this,O=E.clone();_.negative!==0?_=_.umod(E):_=_.clone();for(var N=new s(1),k=new s(0),M=new s(0),L=new s(1),$=0;_.isEven()&&O.isEven();)_.iushrn(1),O.iushrn(1),++$;for(var A=O.clone(),D=_.clone();!_.isZero();){for(var V=0,R=1;!(_.words[0]&R)&&V<26;++V,R<<=1);if(V>0)for(_.iushrn(V);V-- >0;)(N.isOdd()||k.isOdd())&&(N.iadd(A),k.isub(D)),N.iushrn(1),k.iushrn(1);for(var U=0,W=1;!(O.words[0]&W)&&U<26;++U,W<<=1);if(U>0)for(O.iushrn(U);U-- >0;)(M.isOdd()||L.isOdd())&&(M.iadd(A),L.isub(D)),M.iushrn(1),L.iushrn(1);_.cmp(O)>=0?(_.isub(O),N.isub(M),k.isub(L)):(O.isub(_),M.isub(N),L.isub(k))}return{a:M,b:L,gcd:O.iushln($)}},s.prototype._invmp=function(E){n(E.negative===0),n(!E.isZero());var _=this,O=E.clone();_.negative!==0?_=_.umod(E):_=_.clone();for(var N=new s(1),k=new s(0),M=O.clone();_.cmpn(1)>0&&O.cmpn(1)>0;){for(var L=0,$=1;!(_.words[0]&$)&&L<26;++L,$<<=1);if(L>0)for(_.iushrn(L);L-- >0;)N.isOdd()&&N.iadd(M),N.iushrn(1);for(var A=0,D=1;!(O.words[0]&D)&&A<26;++A,D<<=1);if(A>0)for(O.iushrn(A);A-- >0;)k.isOdd()&&k.iadd(M),k.iushrn(1);_.cmp(O)>=0?(_.isub(O),N.isub(k)):(O.isub(_),k.isub(N))}var V;return _.cmpn(1)===0?V=N:V=k,V.cmpn(0)<0&&V.iadd(E),V},s.prototype.gcd=function(E){if(this.isZero())return E.abs();if(E.isZero())return this.abs();var _=this.clone(),O=E.clone();_.negative=0,O.negative=0;for(var N=0;_.isEven()&&O.isEven();N++)_.iushrn(1),O.iushrn(1);do{for(;_.isEven();)_.iushrn(1);for(;O.isEven();)O.iushrn(1);var k=_.cmp(O);if(k<0){var M=_;_=O,O=M}else if(k===0||O.cmpn(1)===0)break;_.isub(O)}while(!0);return O.iushln(N)},s.prototype.invm=function(E){return this.egcd(E).a.umod(E)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(E){return this.words[0]&E},s.prototype.bincn=function(E){n(typeof E=="number");var _=E%26,O=(E-_)/26,N=1<<_;if(this.length<=O)return this._expand(O+1),this.words[O]|=N,this;for(var k=N,M=O;k!==0&&M>>26,L&=67108863,this.words[M]=L}return k!==0&&(this.words[M]=k,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(E){var _=E<0;if(this.negative!==0&&!_)return-1;if(this.negative===0&&_)return 1;this._strip();var O;if(this.length>1)O=1;else{_&&(E=-E),n(E<=67108863,"Number is too big");var N=this.words[0]|0;O=N===E?0:NE.length)return 1;if(this.length=0;O--){var N=this.words[O]|0,k=E.words[O]|0;if(N!==k){Nk&&(_=1);break}}return _},s.prototype.gtn=function(E){return this.cmpn(E)===1},s.prototype.gt=function(E){return this.cmp(E)===1},s.prototype.gten=function(E){return this.cmpn(E)>=0},s.prototype.gte=function(E){return this.cmp(E)>=0},s.prototype.ltn=function(E){return this.cmpn(E)===-1},s.prototype.lt=function(E){return this.cmp(E)===-1},s.prototype.lten=function(E){return this.cmpn(E)<=0},s.prototype.lte=function(E){return this.cmp(E)<=0},s.prototype.eqn=function(E){return this.cmpn(E)===0},s.prototype.eq=function(E){return this.cmp(E)===0},s.red=function(E){return new H(E)},s.prototype.toRed=function(E){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),E.convertTo(this)._forceRed(E)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(E){return this.red=E,this},s.prototype.forceRed=function(E){return n(!this.red,"Already a number in reduction context"),this._forceRed(E)},s.prototype.redAdd=function(E){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,E)},s.prototype.redIAdd=function(E){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,E)},s.prototype.redSub=function(E){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,E)},s.prototype.redISub=function(E){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,E)},s.prototype.redShl=function(E){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,E)},s.prototype.redMul=function(E){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,E),this.red.mul(this,E)},s.prototype.redIMul=function(E){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,E),this.red.imul(this,E)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(E){return n(this.red&&!E.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,E)};var P={k256:null,p224:null,p192:null,p25519:null};function T(F,E){this.name=F,this.p=new s(E,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}T.prototype._tmp=function(){var E=new s(null);return E.words=new Array(Math.ceil(this.n/13)),E},T.prototype.ireduce=function(E){var _=E,O;do this.split(_,this.tmp),_=this.imulK(_),_=_.iadd(this.tmp),O=_.bitLength();while(O>this.n);var N=O0?_.isub(this.p):_.strip!==void 0?_.strip():_._strip(),_},T.prototype.split=function(E,_){E.iushrn(this.n,0,_)},T.prototype.imulK=function(E){return E.imul(this.k)};function w(){T.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(w,T),w.prototype.split=function(E,_){for(var O=4194303,N=Math.min(E.length,9),k=0;k>>22,M=L}M>>>=22,E.words[k-10]=M,M===0&&E.length>10?E.length-=10:E.length-=9},w.prototype.imulK=function(E){E.words[E.length]=0,E.words[E.length+1]=0,E.length+=2;for(var _=0,O=0;O>>=26,E.words[O]=k,_=N}return _!==0&&(E.words[E.length++]=_),E},s._prime=function(E){if(P[E])return P[E];var _;if(E==="k256")_=new w;else if(E==="p224")_=new I;else if(E==="p192")_=new B;else if(E==="p25519")_=new j;else throw new Error("Unknown prime "+E);return P[E]=_,_};function H(F){if(typeof F=="string"){var E=s._prime(F);this.m=E.p,this.prime=E}else n(F.gtn(1),"modulus must be greater than 1"),this.m=F,this.prime=null}H.prototype._verify1=function(E){n(E.negative===0,"red works only with positives"),n(E.red,"red works only with red numbers")},H.prototype._verify2=function(E,_){n((E.negative|_.negative)===0,"red works only with positives"),n(E.red&&E.red===_.red,"red works only with red numbers")},H.prototype.imod=function(E){return this.prime?this.prime.ireduce(E)._forceRed(this):(u(E,E.umod(this.m)._forceRed(this)),E)},H.prototype.neg=function(E){return E.isZero()?E.clone():this.m.sub(E)._forceRed(this)},H.prototype.add=function(E,_){this._verify2(E,_);var O=E.add(_);return O.cmp(this.m)>=0&&O.isub(this.m),O._forceRed(this)},H.prototype.iadd=function(E,_){this._verify2(E,_);var O=E.iadd(_);return O.cmp(this.m)>=0&&O.isub(this.m),O},H.prototype.sub=function(E,_){this._verify2(E,_);var O=E.sub(_);return O.cmpn(0)<0&&O.iadd(this.m),O._forceRed(this)},H.prototype.isub=function(E,_){this._verify2(E,_);var O=E.isub(_);return O.cmpn(0)<0&&O.iadd(this.m),O},H.prototype.shl=function(E,_){return this._verify1(E),this.imod(E.ushln(_))},H.prototype.imul=function(E,_){return this._verify2(E,_),this.imod(E.imul(_))},H.prototype.mul=function(E,_){return this._verify2(E,_),this.imod(E.mul(_))},H.prototype.isqr=function(E){return this.imul(E,E.clone())},H.prototype.sqr=function(E){return this.mul(E,E)},H.prototype.sqrt=function(E){if(E.isZero())return E.clone();var _=this.m.andln(3);if(n(_%2===1),_===3){var O=this.m.add(new s(1)).iushrn(2);return this.pow(E,O)}for(var N=this.m.subn(1),k=0;!N.isZero()&&N.andln(1)===0;)k++,N.iushrn(1);n(!N.isZero());var M=new s(1).toRed(this),L=M.redNeg(),$=this.m.subn(1).iushrn(1),A=this.m.bitLength();for(A=new s(2*A*A).toRed(this);this.pow(A,$).cmp(L)!==0;)A.redIAdd(L);for(var D=this.pow(A,N),V=this.pow(E,N.addn(1).iushrn(1)),R=this.pow(E,N),U=k;R.cmp(M)!==0;){for(var W=R,q=0;W.cmp(M)!==0;q++)W=W.redSqr();n(q=0;k--){for(var D=_.words[k],V=A-1;V>=0;V--){var R=D>>V&1;if(M!==N[0]&&(M=this.sqr(M)),R===0&&L===0){$=0;continue}L<<=1,L|=R,$++,!($!==O&&(k!==0||V!==0))&&(M=this.mul(M,N[L]),$=0,L=0)}A=26}return M},H.prototype.convertTo=function(E){var _=E.umod(this.m);return _===E?_.clone():_},H.prototype.convertFrom=function(E){var _=E.clone();return _.red=null,_},s.mont=function(E){return new K(E)};function K(F){H.call(this,F),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(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)}i(K,H),K.prototype.convertTo=function(E){return this.imod(E.ushln(this.shift))},K.prototype.convertFrom=function(E){var _=this.imod(E.mul(this.rinv));return _.red=null,_},K.prototype.imul=function(E,_){if(E.isZero()||_.isZero())return E.words[0]=0,E.length=1,E;var O=E.imul(_),N=O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),k=O.isub(N).iushrn(this.shift),M=k;return k.cmp(this.m)>=0?M=k.isub(this.m):k.cmpn(0)<0&&(M=k.iadd(this.m)),M._forceRed(this)},K.prototype.mul=function(E,_){if(E.isZero()||_.isZero())return new s(0)._forceRed(this);var O=E.mul(_),N=O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),k=O.isub(N).iushrn(this.shift),M=k;return k.cmp(this.m)>=0?M=k.isub(this.m):k.cmpn(0)<0&&(M=k.iadd(this.m)),M._forceRed(this)},K.prototype.invm=function(E){var _=this.imod(E._invmp(this.m).mul(this.r2));return _._forceRed(this)}})(t,ul)})(H6);var TV=H6.exports;const _e=ks(TV),IV="logger/5.7.0";let WA=!1,HA=!1;const Cv={debug:1,default:2,info:2,warning:3,error:4,off:5};let qA=Cv.default,Vw=null;function OV(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const VA=OV();var mx;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(mx||(mx={}));var cs;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(cs||(cs={}));const GA="0123456789abcdef";let ee=class Tr{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();Cv[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(qA>Cv[n])&&console.log.apply(console,r)}debug(...e){this._log(Tr.levels.DEBUG,e)}info(...e){this._log(Tr.levels.INFO,e)}warn(...e){this._log(Tr.levels.WARNING,e)}makeError(e,r,n){if(HA)return this.makeError("censored error",r,{});r||(r=Tr.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(c=>{const l=n[c];try{if(l instanceof Uint8Array){let u="";for(let f=0;f>4],u+=GA[l[f]&15];i.push(c+"=Uint8Array(0x"+u+")")}else i.push(c+"="+JSON.stringify(l))}catch{i.push(c+"="+JSON.stringify(n[c].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case cs.NUMERIC_FAULT:{o="NUMERIC_FAULT";const c=e;switch(c){case"overflow":case"underflow":case"division-by-zero":o+="-"+c;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case cs.CALL_EXCEPTION:case cs.INSUFFICIENT_FUNDS:case cs.MISSING_NEW:case cs.NONCE_EXPIRED:case cs.REPLACEMENT_UNDERPRICED:case cs.TRANSACTION_REPLACED:case cs.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(c){a[c]=n[c]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,Tr.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){VA&&this.throwError("platform missing String.prototype.normalize",Tr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:VA})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Tr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Tr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,Tr.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Tr.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Tr.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Tr.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return Vw||(Vw=new Tr(IV)),Vw}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Tr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),WA){if(!e)return;this.globalLogger().throwError("error censorship permanent",Tr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}HA=!!e,WA=!!r}static setLogLevel(e){const r=Cv[e.toLowerCase()];if(r==null){Tr.globalLogger().warn("invalid log level - "+e);return}qA=r}static from(e){return new Tr(e)}};ee.errors=cs;ee.levels=mx;const RV="bytes/5.7.0",dr=new ee(RV);function vR(t){return!!t.toHexString}function cf(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return cf(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Wo(t){return Fe(t)&&!(t.length%2)||aa(t)}function KA(t){return typeof t=="number"&&t==t&&t%1===0}function aa(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!KA(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function re(t,e){if(e||(e={}),typeof t=="number"){dr.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),cf(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),vR(t)&&(t=t.toHexString()),Fe(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":dr.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ire(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),cf(n)}function eo(t){let e=re(t);if(e.length===0)return e;let r=0;for(;re&&dr.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),cf(r)}function Fe(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const Gw="0123456789abcdef";function te(t,e){if(e||(e={}),typeof t=="number"){dr.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=Gw[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),vR(t))return t.toHexString();if(Fe(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":dr.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(aa(t)){let r="0x";for(let n=0;n>4]+Gw[i&15]}return r}return dr.throwArgumentError("invalid hexlify value","value",t)}function co(t){if(typeof t!="string")t=te(t);else if(!Fe(t)||t.length%2)return null;return(t.length-2)/2}function br(t,e,r){return typeof t!="string"?t=te(t):(!Fe(t)||t.length%2)&&dr.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Rn(t){let e="0x";return t.forEach(r=>{e+=te(r).substring(2)}),e}function gs(t){const e=mR(te(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function mR(t){typeof t!="string"&&(t=te(t)),Fe(t)||dr.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&dr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Jl(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Wo(t)){let r=re(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=te(r.slice(0,32)),e.s=te(r.slice(32,64))):r.length===65?(e.r=te(r.slice(0,32)),e.s=te(r.slice(32,64)),e.v=r[64]):dr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:dr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=te(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=_h(re(e._vs),32);e._vs=te(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&dr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=te(i);e.s==null?e.s=o:e.s!==o&&dr.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?dr.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&dr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Fe(e.r)?dr.throwArgumentError("signature missing or invalid r","signature",t):e.r=dt(e.r,32),e.s==null||!Fe(e.s)?dr.throwArgumentError("signature missing or invalid s","signature",t):e.s=dt(e.s,32);const r=re(e.s);r[0]>=128&&dr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=te(r);e._vs&&(Fe(e._vs)||dr.throwArgumentError("signature invalid _vs","signature",t),e._vs=dt(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&dr.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function MV(t){return t=Jl(t),te(qt([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}const yR="bignumber/5.7.0";var g0=_e.BN;const Eo=new ee(yR),Kw={},QA=9007199254740991;function $V(t){return t!=null&&(J.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Fe(t)||typeof t=="bigint"||aa(t))}let YA=!1;class J{constructor(e,r){e!==Kw&&Eo.throwError("cannot call constructor directly; use BigNumber.from",ee.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return zn(Ge(this).fromTwos(e))}toTwos(e){return zn(Ge(this).toTwos(e))}abs(){return this._hex[0]==="-"?J.from(this._hex.substring(1)):this}add(e){return zn(Ge(this).add(Ge(e)))}sub(e){return zn(Ge(this).sub(Ge(e)))}div(e){return J.from(e).isZero()&&_i("division-by-zero","div"),zn(Ge(this).div(Ge(e)))}mul(e){return zn(Ge(this).mul(Ge(e)))}mod(e){const r=Ge(e);return r.isNeg()&&_i("division-by-zero","mod"),zn(Ge(this).umod(r))}pow(e){const r=Ge(e);return r.isNeg()&&_i("negative-power","pow"),zn(Ge(this).pow(r))}and(e){const r=Ge(e);return(this.isNegative()||r.isNeg())&&_i("unbound-bitwise-result","and"),zn(Ge(this).and(r))}or(e){const r=Ge(e);return(this.isNegative()||r.isNeg())&&_i("unbound-bitwise-result","or"),zn(Ge(this).or(r))}xor(e){const r=Ge(e);return(this.isNegative()||r.isNeg())&&_i("unbound-bitwise-result","xor"),zn(Ge(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&_i("negative-width","mask"),zn(Ge(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&_i("negative-width","shl"),zn(Ge(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&_i("negative-width","shr"),zn(Ge(this).shrn(e))}eq(e){return Ge(this).eq(Ge(e))}lt(e){return Ge(this).lt(Ge(e))}lte(e){return Ge(this).lte(Ge(e))}gt(e){return Ge(this).gt(Ge(e))}gte(e){return Ge(this).gte(Ge(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Ge(this).isZero()}toNumber(){try{return Ge(this).toNumber()}catch{_i("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Eo.throwError("this platform does not support BigInt",ee.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?YA||(YA=!0,Eo.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Eo.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",ee.errors.UNEXPECTED_ARGUMENT,{}):Eo.throwError("BigNumber.toString does not accept parameters",ee.errors.UNEXPECTED_ARGUMENT,{})),Ge(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof J)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new J(Kw,b0(e)):e.match(/^-?[0-9]+$/)?new J(Kw,b0(new g0(e))):Eo.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&_i("underflow","BigNumber.from",e),(e>=QA||e<=-QA)&&_i("overflow","BigNumber.from",e),J.from(String(e));const r=e;if(typeof r=="bigint")return J.from(r.toString());if(aa(r))return J.from(te(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return J.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(Fe(n)||n[0]==="-"&&Fe(n.substring(1))))return J.from(n)}return Eo.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function b0(t){if(typeof t!="string")return b0(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Eo.throwArgumentError("invalid hex","value",t),t=b0(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function zn(t){return J.from(b0(t))}function Ge(t){const e=J.from(t).toHexString();return e[0]==="-"?new g0("-"+e.substring(3),16):new g0(e.substring(2),16)}function _i(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),Eo.throwError(t,ee.errors.NUMERIC_FAULT,n)}function NV(t){return new g0(t,36).toString(16)}function DV(t){return new g0(t,16).toString(36)}const Mn=new ee(yR),Ph={},gR=J.from(0),bR=J.from(-1);function wR(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),Mn.throwError(t,ee.errors.NUMERIC_FAULT,i)}let Th="0";for(;Th.length<256;)Th+=Th;function q6(t){if(typeof t!="number")try{t=J.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+Th.substring(0,t):Mn.throwArgumentError("invalid decimal size","decimals",t)}function Sv(t,e){e==null&&(e=0);const r=q6(e);t=J.from(t);const n=t.lt(gR);n&&(t=t.mul(bR));let i=t.mod(r).toString();for(;i.length2&&Mn.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&wR("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.lengthe[o]==null?c:(typeof e[o]!==a&&Mn.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&Mn.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Mn.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new lf(Ph,r,n,i)}}class Qr{constructor(e,r,n,i){e!==Ph&&Mn.throwError("cannot use FixedNumber constructor; use FixedNumber.from",ee.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Mn.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Ds(this._value,this.format.decimals),n=Ds(e._value,e.format.decimals);return Qr.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Ds(this._value,this.format.decimals),n=Ds(e._value,e.format.decimals);return Qr.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Ds(this._value,this.format.decimals),n=Ds(e._value,e.format.decimals);return Qr.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Ds(this._value,this.format.decimals),n=Ds(e._value,e.format.decimals);return Qr.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=Qr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(JA.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=Qr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(JA.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&Mn.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=Qr.from("1"+Th.substring(0,e),this.format),i=LV.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Mn.throwArgumentError("invalid byte width","width",e);const r=J.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return dt(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Qr.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!$V(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),Qr.fromString(Sv(e,r),lf.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=lf.from(r),i=Ds(e,n.decimals);!n.signed&&i.lt(gR)&&wR("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=dt(s,n.width/8));const o=Sv(i,n.decimals);return new Qr(Ph,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=lf.from(r);if(re(e).length>n.width/8)throw new Error("overflow");let i=J.from(e);n.signed&&(i=i.fromTwos(n.width));const s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=Sv(i,n.decimals);return new Qr(Ph,s,o,n)}static from(e,r){if(typeof e=="string")return Qr.fromString(e,r);if(aa(e))return Qr.fromBytes(e,r);try{return Qr.fromValue(e,0,r)}catch(n){if(n.code!==ee.errors.INVALID_ARGUMENT)throw n}return Mn.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const JA=Qr.from(1),LV=Qr.from("0.5"),BV="properties/5.7.0";var FV=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const _m=new ee(BV);function ie(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function hs(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function vt(t){return FV(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function V6(t,e){(!t||typeof t!="object")&&_m.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||_m.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function Vt(t){const e={};for(const r in t)e[r]=t[r];return e}const jV={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function ER(t){if(t==null||jV[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;rvi(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&ie(e,r,vi(n))}return e}return _m.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function vi(t){return UV(t)}class x1{constructor(e){for(const r in e)this[r]=vi(e[r])}}const C1="abi/5.7.0",Xe=new ee(C1),Ml={};let XA={calldata:!0,memory:!0,storage:!0},zV={calldata:!0,memory:!0};function Ap(t,e){if(t==="bytes"||t==="string"){if(XA[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&zV[e])return!0;return(XA[e]||e==="payable")&&Xe.throwArgumentError("invalid modifier","name",e),!1}function WV(t,e){let r=t;function n(a){Xe.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let c={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(c.indexed=!1),c}let s={type:"",name:"",state:{allowType:!0}},o=s;for(let a=0;aJSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==et.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===et.full?", ":",")+")"):r+=this.type,e!==et.sighash&&(this.indexed===!0&&(r+=" indexed"),e===et.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?Nr.fromString(e,r):Nr.fromObject(e)}static fromObject(e){return Nr.isParamType(e)?e:new Nr(Ml,{name:e.name||null,type:Au(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(Nr.fromObject):null})}static fromString(e,r){function n(i){return Nr.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(WV(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function w0(t,e){return VV(t).map(r=>Nr.fromString(r,e))}class Qs{constructor(e,r){e!==Ml&&Xe.throwError("use a static from method",ee.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),kv(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return Qs.isFragment(e)?e:typeof e=="string"?Qs.fromString(e):Qs.fromObject(e)}static fromObject(e){if(Qs.isFragment(e))return e;switch(e.type){case"function":return ds.fromObject(e);case"event":return Vs.fromObject(e);case"constructor":return fs.fromObject(e);case"error":return To.fromObject(e);case"fallback":case"receive":return null}return Xe.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?Vs.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?ds.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?fs.fromString(e.trim()):e.split(" ")[0]==="error"?To.fromString(e.substring(5).trim()):Xe.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class Vs extends Qs{format(e){if(e||(e=et.sighash),et[e]||Xe.throwArgumentError("invalid format type","format",e),e===et.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==et.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===et.full?", ":",")+") ",e!==et.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?Vs.fromString(e):Vs.fromObject(e)}static fromObject(e){if(Vs.isEventFragment(e))return e;e.type!=="event"&&Xe.throwArgumentError("invalid event object","value",e);const r={name:E0(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Nr.fromObject):[],type:"event"};return new Vs(Ml,r)}static fromString(e){let r=e.match(x0);r||Xe.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:Xe.warn("unknown modifier: "+i)}}),Vs.fromObject({name:r[1].trim(),anonymous:n,inputs:w0(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function xR(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&Xe.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||Xe.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=J.from(r[1]),r[0]):t}function CR(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function SR(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&Xe.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&Xe.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&Xe.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&Xe.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&Xe.throwArgumentError("unable to determine stateMutability","value",t),e}class fs extends Qs{format(e){if(e||(e=et.sighash),et[e]||Xe.throwArgumentError("invalid format type","format",e),e===et.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===et.sighash&&Xe.throwError("cannot format a constructor for sighash",ee.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===et.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?fs.fromString(e):fs.fromObject(e)}static fromObject(e){if(fs.isConstructorFragment(e))return e;e.type!=="constructor"&&Xe.throwArgumentError("invalid constructor object","value",e);let r=SR(e);r.constant&&Xe.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Nr.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?J.from(e.gas):null};return new fs(Ml,n)}static fromString(e){let r={type:"constructor"};e=xR(e,r);let n=e.match(x0);return(!n||n[1].trim()!=="constructor")&&Xe.throwArgumentError("invalid constructor string","value",e),r.inputs=w0(n[2].trim(),!1),CR(n[3].trim(),r),fs.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class ds extends fs{format(e){if(e||(e=et.sighash),et[e]||Xe.throwArgumentError("invalid format type","format",e),e===et.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==et.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===et.full?", ":",")+") ",e!==et.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?ds.fromString(e):ds.fromObject(e)}static fromObject(e){if(ds.isFunctionFragment(e))return e;e.type!=="function"&&Xe.throwArgumentError("invalid function object","value",e);let r=SR(e);const n={type:e.type,name:E0(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(Nr.fromObject):[],outputs:e.outputs?e.outputs.map(Nr.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?J.from(e.gas):null};return new ds(Ml,n)}static fromString(e){let r={type:"function"};e=xR(e,r);let n=e.split(" returns ");n.length>2&&Xe.throwArgumentError("invalid function string","value",e);let i=n[0].match(x0);if(i||Xe.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&E0(r.name),r.inputs=w0(i[2],!1),CR(i[3].trim(),r),n.length>1){let s=n[1].match(x0);(s[1].trim()!=""||s[3].trim()!="")&&Xe.throwArgumentError("unexpected tokens","value",e),r.outputs=w0(s[2],!1)}else r.outputs=[];return ds.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function ZA(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&Xe.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class To extends Qs{format(e){if(e||(e=et.sighash),et[e]||Xe.throwArgumentError("invalid format type","format",e),e===et.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==et.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===et.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?To.fromString(e):To.fromObject(e)}static fromObject(e){if(To.isErrorFragment(e))return e;e.type!=="error"&&Xe.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:E0(e.name),inputs:e.inputs?e.inputs.map(Nr.fromObject):[]};return ZA(new To(Ml,r))}static fromString(e){let r={type:"error"},n=e.match(x0);return n||Xe.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&E0(r.name),r.inputs=w0(n[2],!1),ZA(To.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function Au(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const qV=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function E0(t){return(!t||!t.match(qV))&&Xe.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const x0=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function VV(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&G6.throwError("value out-of-bounds",ee.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=qt([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}}class Pm{constructor(e,r,n,i){ie(this,"_data",re(e)),ie(this,"wordSize",r||32),ie(this,"_coerceFunc",n),ie(this,"allowLoose",i),this._offset=0}get data(){return te(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):Pm.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:G6.throwError("data out-of-bounds",ee.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new Pm(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return J.from(this.readBytes(this.wordSize))}}var AR={exports:{}};/** +`+s.stack}return{value:t,source:e,stack:i,digest:null}}function Qw(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function lx(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var OV=typeof WeakMap=="function"?WeakMap:Map;function JO(t,e,r){r=No(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){Pm||(Pm=!0,bx=n),lx(t,e)},r}function XO(t,e,r){r=No(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return n(i)},r.callback=function(){lx(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){lx(t,e),typeof n!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function MA(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new OV;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(i.add(r),t=qV.bind(null,t,e,r),e.then(t,t))}function NA(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function DA(t,e,r,n,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=No(-1,1),e.tag=2,Ja(r,e,1))),r.lanes|=1),t)}var RV=aa.ReactCurrentOwner,Qn=!1;function On(t,e,r,n){e.child=t===null?IO(e,null,r,n):_f(e,t.child,r,n)}function LA(t,e,r,n,i){r=r.render;var s=e.ref;return cf(e,i),n=D6(t,e,r,n,s,i),r=L6(),t!==null&&!Qn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,zo(t,e,i)):(er&&r&&S6(e),e.flags|=1,On(t,e,n,i),e.child)}function FA(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!G6(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=s,ZO(t,e,s,n,i)):(t=_v(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(r=r.compare,r=r!==null?r:f0,r(o,n)&&t.ref===e.ref)return zo(t,e,i)}return e.flags|=1,t=ec(s,n),t.ref=e.ref,t.return=e,e.child=t}function ZO(t,e,r,n,i){if(t!==null){var s=t.memoizedProps;if(f0(s,n)&&t.ref===e.ref)if(Qn=!1,e.pendingProps=n=s,(t.lanes&i)!==0)t.flags&131072&&(Qn=!0);else return e.lanes=t.lanes,zo(t,e,i)}return ux(t,e,r,n,i)}function eR(t,e,r){var n=e.pendingProps,i=n.children,s=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},gt(Vu,ci),ci|=r;else{if(!(r&1073741824))return t=s!==null?s.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,gt(Vu,ci),ci|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,gt(Vu,ci),ci|=n}else s!==null?(n=s.baseLanes|r,e.memoizedState=null):n=r,gt(Vu,ci),ci|=n;return On(t,e,i,r),e.child}function tR(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function ux(t,e,r,n,i){var s=Zn(r)?Tl:Cn.current;return s=kf(e,s),cf(e,i),r=D6(t,e,r,n,s,i),n=L6(),t!==null&&!Qn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,zo(t,e,i)):(er&&n&&S6(e),e.flags|=1,On(t,e,r,i),e.child)}function BA(t,e,r,n,i){if(Zn(r)){var s=!0;gm(e)}else s=!1;if(cf(e,i),e.stateNode===null)Sv(t,e),PO(e,r,n),cx(e,r,n,i),n=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var c=o.context,l=r.contextType;typeof l=="object"&&l!==null?l=ji(l):(l=Zn(r)?Tl:Cn.current,l=kf(e,l));var u=r.getDerivedStateFromProps,f=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||c!==l)&&IA(e,o,n,l),Oa=!1;var d=e.memoizedState;o.state=d,Cm(e,n,o,i),c=e.memoizedState,a!==n||d!==c||Xn.current||Oa?(typeof u=="function"&&(ax(e,r,u,n),c=e.memoizedState),(a=Oa||TA(e,r,a,n,d,c,l))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=c),o.props=n,o.state=c,o.context=l,n=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,AO(t,e),a=e.memoizedProps,l=e.type===e.elementType?a:ls(e.type,a),o.props=l,f=e.pendingProps,d=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=ji(c):(c=Zn(r)?Tl:Cn.current,c=kf(e,c));var h=r.getDerivedStateFromProps;(u=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||d!==c)&&IA(e,o,n,c),Oa=!1,d=e.memoizedState,o.state=d,Cm(e,n,o,i);var p=e.memoizedState;a!==f||d!==p||Xn.current||Oa?(typeof h=="function"&&(ax(e,r,h,n),p=e.memoizedState),(l=Oa||TA(e,r,l,n,d,p,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,p,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,p,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=p),o.props=n,o.state=p,o.context=c,n=l):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),n=!1)}return fx(t,e,r,n,s,i)}function fx(t,e,r,n,i,s){tR(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return i&&SA(e,r,!1),zo(t,e,s);n=e.stateNode,RV.current=e;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=_f(e,t.child,null,s),e.child=_f(e,null,a,s)):On(t,e,a,s),e.memoizedState=n.state,i&&SA(e,r,!0),e.child}function rR(t){var e=t.stateNode;e.pendingContext?CA(t,e.pendingContext,e.pendingContext!==e.context):e.context&&CA(t,e.context,!1),R6(t,e.containerInfo)}function jA(t,e,r,n,i){return Af(),A6(i),e.flags|=256,On(t,e,r,n),e.child}var dx={dehydrated:null,treeContext:null,retryLane:0};function hx(t){return{baseLanes:t,cachePool:null,transitions:null}}function nR(t,e,r){var n=e.pendingProps,i=sr.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),gt(sr,i&1),t===null)return sx(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=n.children,t=n.fallback,s?(n=e.mode,s=e.child,o={mode:"hidden",children:o},!(n&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=bg(o,n,0,null),t=bl(t,n,r,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=hx(r),e.memoizedState=dx,t):j6(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return $V(t,e,o,n,a,i,r);if(s){s=n.fallback,o=e.mode,i=t.child,a=i.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&e.child!==i?(n=e.child,n.childLanes=0,n.pendingProps=c,e.deletions=null):(n=ec(i,c),n.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=ec(a,s):(s=bl(s,o,r,null),s.flags|=2),s.return=e,n.return=e,n.sibling=s,e.child=n,n=s,s=e.child,o=t.child.memoizedState,o=o===null?hx(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~r,e.memoizedState=dx,n}return s=t.child,t=s.sibling,n=ec(s,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function j6(t,e){return e=bg({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function _p(t,e,r,n){return n!==null&&A6(n),_f(e,t.child,null,r),t=j6(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function $V(t,e,r,n,i,s,o){if(r)return e.flags&256?(e.flags&=-257,n=Qw(Error(oe(422))),_p(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=n.fallback,i=e.mode,n=bg({mode:"visible",children:n.children},i,0,null),s=bl(s,i,o,null),s.flags|=2,n.return=e,s.return=e,n.sibling=s,e.child=n,e.mode&1&&_f(e,t.child,null,o),e.child.memoizedState=hx(o),e.memoizedState=dx,s);if(!(e.mode&1))return _p(t,e,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var a=n.dgst;return n=a,s=Error(oe(419)),n=Qw(s,n,void 0),_p(t,e,o,n)}if(a=(o&t.childLanes)!==0,Qn||a){if(n=Kr,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Uo(t,i),ws(n,t,i,-1))}return V6(),n=Qw(Error(oe(421))),_p(t,e,o,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=VV.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,pi=Ya(i.nextSibling),vi=e,er=!0,ds=null,t!==null&&($i[Mi++]=Ro,$i[Mi++]=$o,$i[Mi++]=Il,Ro=t.id,$o=t.overflow,Il=e),e=j6(e,n.children),e.flags|=4096,e)}function UA(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),ox(t.return,e,r)}function Yw(t,e,r,n,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function iR(t,e,r){var n=e.pendingProps,i=n.revealOrder,s=n.tail;if(On(t,e,n.children,r),n=sr.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&UA(t,r,e);else if(t.tag===19)UA(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(gt(sr,n),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&Sm(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),Yw(e,!1,i,r,s);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Sm(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}Yw(e,!0,r,null,s);break;case"together":Yw(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Sv(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function zo(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Rl|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(oe(153));if(e.child!==null){for(t=e.child,r=ec(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=ec(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function MV(t,e,r){switch(e.tag){case 3:rR(e),Af();break;case 5:OO(e);break;case 1:Zn(e.type)&&gm(e);break;case 4:R6(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;gt(Em,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(gt(sr,sr.current&1),e.flags|=128,null):r&e.child.childLanes?nR(t,e,r):(gt(sr,sr.current&1),t=zo(t,e,r),t!==null?t.sibling:null);gt(sr,sr.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return iR(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),gt(sr,sr.current),n)break;return null;case 22:case 23:return e.lanes=0,eR(t,e,r)}return zo(t,e,r)}var sR,px,oR,aR;sR=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};px=function(){};oR=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,hl(eo.current);var s=null;switch(r){case"input":i=DE(t,i),n=DE(t,n),s=[];break;case"select":i=ur({},i,{value:void 0}),n=ur({},n,{value:void 0}),s=[];break;case"textarea":i=BE(t,i),n=BE(t,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=mm)}UE(r,n);var o;r=null;for(l in i)if(!n.hasOwnProperty(l)&&i.hasOwnProperty(l)&&i[l]!=null)if(l==="style"){var a=i[l];for(o in a)a.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else l!=="dangerouslySetInnerHTML"&&l!=="children"&&l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(i0.hasOwnProperty(l)?s||(s=[]):(s=s||[]).push(l,null));for(l in n){var c=n[l];if(a=i!=null?i[l]:void 0,n.hasOwnProperty(l)&&c!==a&&(c!=null||a!=null))if(l==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(s||(s=[]),s.push(l,r)),r=c;else l==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(s=s||[]).push(l,c)):l==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(l,""+c):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&(i0.hasOwnProperty(l)?(c!=null&&l==="onScroll"&&jt("scroll",t),s||a===c||(s=[])):(s=s||[]).push(l,c))}r&&(s=s||[]).push("style",r);var l=s;(e.updateQueue=l)&&(e.flags|=4)}};aR=function(t,e,r,n){r!==n&&(e.flags|=4)};function Hd(t,e){if(!er)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function fn(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function NV(t,e,r){var n=e.pendingProps;switch(k6(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fn(e),null;case 1:return Zn(e.type)&&ym(),fn(e),null;case 3:return n=e.stateNode,Pf(),Ht(Xn),Ht(Cn),M6(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(kp(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,ds!==null&&(xx(ds),ds=null))),px(t,e),fn(e),null;case 5:$6(e);var i=hl(m0.current);if(r=e.type,t!==null&&e.stateNode!=null)oR(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(oe(166));return fn(e),null}if(t=hl(eo.current),kp(e)){n=e.stateNode,r=e.type;var s=e.memoizedProps;switch(n[Gs]=e,n[p0]=s,t=(e.mode&1)!==0,r){case"dialog":jt("cancel",n),jt("close",n);break;case"iframe":case"object":case"embed":jt("load",n);break;case"video":case"audio":for(i=0;i<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[Gs]=e,t[p0]=n,sR(t,e,!1,!1),e.stateNode=t;e:{switch(o=zE(r,n),r){case"dialog":jt("cancel",t),jt("close",t),i=n;break;case"iframe":case"object":case"embed":jt("load",t),i=n;break;case"video":case"audio":for(i=0;iIf&&(e.flags|=128,n=!0,Hd(s,!1),e.lanes=4194304)}else{if(!n)if(t=Sm(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Hd(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!er)return fn(e),null}else 2*wr()-s.renderingStartTime>If&&r!==1073741824&&(e.flags|=128,n=!0,Hd(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=wr(),e.sibling=null,r=sr.current,gt(sr,n?r&1|2:r&1),e):(fn(e),null);case 22:case 23:return q6(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?ci&1073741824&&(fn(e),e.subtreeFlags&6&&(e.flags|=8192)):fn(e),null;case 24:return null;case 25:return null}throw Error(oe(156,e.tag))}function DV(t,e){switch(k6(e),e.tag){case 1:return Zn(e.type)&&ym(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Pf(),Ht(Xn),Ht(Cn),M6(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return $6(e),null;case 13:if(Ht(sr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(oe(340));Af()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ht(sr),null;case 4:return Pf(),null;case 10:return T6(e.type._context),null;case 22:case 23:return q6(),null;case 24:return null;default:return null}}var Pp=!1,vn=!1,LV=typeof WeakSet=="function"?WeakSet:Set,fe=null;function qu(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){hr(t,e,n)}else r.current=null}function vx(t,e,r){try{r()}catch(n){hr(t,e,n)}}var zA=!1;function FV(t,e){if(XE=hm,t=fO(),C6(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,c=-1,l=0,u=0,f=t,d=null;t:for(;;){for(var h;f!==r||i!==0&&f.nodeType!==3||(a=o+i),f!==s||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===t)break t;if(d===r&&++l===i&&(a=o),d===s&&++u===n&&(c=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(ZE={focusedElem:t,selectionRange:r},hm=!1,fe=e;fe!==null;)if(e=fe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,fe=t;else for(;fe!==null;){e=fe;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var v=p.memoizedProps,b=p.memoizedState,y=e.stateNode,m=y.getSnapshotBeforeUpdate(e.elementType===e.type?v:ls(e.type,v),b);y.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var g=e.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(S){hr(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,fe=t;break}fe=e.return}return p=zA,zA=!1,p}function Ph(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&vx(e,r,s)}i=i.next}while(i!==n)}}function yg(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function mx(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function cR(t){var e=t.alternate;e!==null&&(t.alternate=null,cR(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Gs],delete e[p0],delete e[rx],delete e[wV],delete e[EV])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function lR(t){return t.tag===5||t.tag===3||t.tag===4}function WA(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||lR(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function yx(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=mm));else if(n!==4&&(t=t.child,t!==null))for(yx(t,e,r),t=t.sibling;t!==null;)yx(t,e,r),t=t.sibling}function gx(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(gx(t,e,r),t=t.sibling;t!==null;)gx(t,e,r),t=t.sibling}var Jr=null,fs=!1;function xa(t,e,r){for(r=r.child;r!==null;)uR(t,e,r),r=r.sibling}function uR(t,e,r){if(Zs&&typeof Zs.onCommitFiberUnmount=="function")try{Zs.onCommitFiberUnmount(lg,r)}catch{}switch(r.tag){case 5:vn||qu(r,e);case 6:var n=Jr,i=fs;Jr=null,xa(t,e,r),Jr=n,fs=i,Jr!==null&&(fs?(t=Jr,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Jr.removeChild(r.stateNode));break;case 18:Jr!==null&&(fs?(t=Jr,r=r.stateNode,t.nodeType===8?Ww(t.parentNode,r):t.nodeType===1&&Ww(t,r),l0(t)):Ww(Jr,r.stateNode));break;case 4:n=Jr,i=fs,Jr=r.stateNode.containerInfo,fs=!0,xa(t,e,r),Jr=n,fs=i;break;case 0:case 11:case 14:case 15:if(!vn&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&vx(r,e,o),i=i.next}while(i!==n)}xa(t,e,r);break;case 1:if(!vn&&(qu(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){hr(r,e,a)}xa(t,e,r);break;case 21:xa(t,e,r);break;case 22:r.mode&1?(vn=(n=vn)||r.memoizedState!==null,xa(t,e,r),vn=n):xa(t,e,r);break;default:xa(t,e,r)}}function HA(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new LV),e.forEach(function(n){var i=GV.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function es(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=wr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*jV(n/1960))-n,10t?16:t,ja===null)var n=!1;else{if(t=ja,ja=null,Tm=0,nt&6)throw Error(oe(331));var i=nt;for(nt|=4,fe=t.current;fe!==null;){var s=fe,o=s.child;if(fe.flags&16){var a=s.deletions;if(a!==null){for(var c=0;cwr()-W6?gl(t,0):z6|=r),ei(t,e)}function gR(t,e){e===0&&(t.mode&1?(e=bp,bp<<=1,!(bp&130023424)&&(bp=4194304)):e=1);var r=Mn();t=Uo(t,e),t!==null&&(E1(t,e,r),ei(t,r))}function VV(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),gR(t,r)}function GV(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(oe(314))}n!==null&&n.delete(e),gR(t,r)}var bR;bR=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Xn.current)Qn=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Qn=!1,MV(t,e,r);Qn=!!(t.flags&131072)}else Qn=!1,er&&e.flags&1048576&&xO(e,wm,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Sv(t,e),t=e.pendingProps;var i=kf(e,Cn.current);cf(e,r),i=D6(null,e,n,t,i,r);var s=L6();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Zn(n)?(s=!0,gm(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,O6(e),i.updater=vg,e.stateNode=i,i._reactInternals=e,cx(e,n,t,r),e=fx(null,e,n,!0,s,r)):(e.tag=0,er&&s&&S6(e),On(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Sv(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=QV(n),t=ls(n,t),i){case 0:e=ux(null,e,n,t,r);break e;case 1:e=BA(null,e,n,t,r);break e;case 11:e=LA(null,e,n,t,r);break e;case 14:e=FA(null,e,n,ls(n.type,t),r);break e}throw Error(oe(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:ls(n,i),ux(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:ls(n,i),BA(t,e,n,i,r);case 3:e:{if(rR(e),t===null)throw Error(oe(387));n=e.pendingProps,s=e.memoizedState,i=s.element,AO(t,e),Cm(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Tf(Error(oe(423)),e),e=jA(t,e,n,r,i);break e}else if(n!==i){i=Tf(Error(oe(424)),e),e=jA(t,e,n,r,i);break e}else for(pi=Ya(e.stateNode.containerInfo.firstChild),vi=e,er=!0,ds=null,r=IO(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Af(),n===i){e=zo(t,e,r);break e}On(t,e,n,r)}e=e.child}return e;case 5:return OO(e),t===null&&sx(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,ex(n,i)?o=null:s!==null&&ex(n,s)&&(e.flags|=32),tR(t,e),On(t,e,o,r),e.child;case 6:return t===null&&sx(e),null;case 13:return nR(t,e,r);case 4:return R6(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=_f(e,null,n,r):On(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:ls(n,i),LA(t,e,n,i,r);case 7:return On(t,e,e.pendingProps,r),e.child;case 8:return On(t,e,e.pendingProps.children,r),e.child;case 12:return On(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,gt(Em,n._currentValue),n._currentValue=o,s!==null)if(Cs(s.value,o)){if(s.children===i.children&&!Xn.current){e=zo(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===n){if(s.tag===1){c=No(-1,r&-r),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var u=l.pending;u===null?c.next=c:(c.next=u.next,u.next=c),l.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),ox(s.return,r,e),a.lanes|=r;break}c=c.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(oe(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),ox(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}On(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,cf(e,r),i=ji(i),n=n(i),e.flags|=1,On(t,e,n,r),e.child;case 14:return n=e.type,i=ls(n,e.pendingProps),i=ls(n.type,i),FA(t,e,n,i,r);case 15:return ZO(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:ls(n,i),Sv(t,e),e.tag=1,Zn(n)?(t=!0,gm(e)):t=!1,cf(e,r),PO(e,n,i),cx(e,n,i,r),fx(null,e,n,!0,t,r);case 19:return iR(t,e,r);case 22:return eR(t,e,r)}throw Error(oe(156,e.tag))};function wR(t,e){return V7(t,e)}function KV(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Li(t,e,r,n){return new KV(t,e,r,n)}function G6(t){return t=t.prototype,!(!t||!t.isReactComponent)}function QV(t){if(typeof t=="function")return G6(t)?1:0;if(t!=null){if(t=t.$$typeof,t===d6)return 11;if(t===h6)return 14}return 2}function ec(t,e){var r=t.alternate;return r===null?(r=Li(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function _v(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")G6(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Du:return bl(r.children,i,s,e);case f6:o=8,i|=8;break;case RE:return t=Li(12,r,e,i|2),t.elementType=RE,t.lanes=s,t;case $E:return t=Li(13,r,e,i),t.elementType=$E,t.lanes=s,t;case ME:return t=Li(19,r,e,i),t.elementType=ME,t.lanes=s,t;case T7:return bg(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case _7:o=10;break e;case P7:o=9;break e;case d6:o=11;break e;case h6:o=14;break e;case Ia:o=16,n=null;break e}throw Error(oe(130,t==null?t:typeof t,""))}return e=Li(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function bl(t,e,r,n){return t=Li(7,t,n,e),t.lanes=r,t}function bg(t,e,r,n){return t=Li(22,t,n,e),t.elementType=T7,t.lanes=r,t.stateNode={isHidden:!1},t}function Jw(t,e,r){return t=Li(6,t,null,e),t.lanes=r,t}function Xw(t,e,r){return e=Li(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function YV(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rw(0),this.expirationTimes=Rw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rw(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function K6(t,e,r,n,i,s,o,a,c){return t=new YV(t,e,r,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Li(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},O6(s),t}function JV(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(SR)}catch(t){console.error(t)}}SR(),x7.exports=xi;var Ts=x7.exports;const rG=Ps(Ts);var XA=Ts;IE.createRoot=XA.createRoot,IE.hydrateRoot=XA.hydrateRoot;var X6={exports:{}};const nG={},iG=Object.freeze(Object.defineProperty({__proto__:null,default:nG},Symbol.toStringTag,{value:"Module"})),kR=u7(iG);X6.exports;(function(t){(function(e,r){function n(B,E){if(!B)throw new Error(E||"Assertion failed")}function i(B,E){B.super_=E;var _=function(){};_.prototype=E.prototype,B.prototype=new _,B.prototype.constructor=B}function s(B,E,_){if(s.isBN(B))return B;this.negative=0,this.words=null,this.length=0,this.red=null,B!==null&&((E==="le"||E==="be")&&(_=E,E=10),this._init(B||0,E||10,_||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=kR.Buffer}catch{}s.isBN=function(E){return E instanceof s?!0:E!==null&&typeof E=="object"&&E.constructor.wordSize===s.wordSize&&Array.isArray(E.words)},s.max=function(E,_){return E.cmp(_)>0?E:_},s.min=function(E,_){return E.cmp(_)<0?E:_},s.prototype._init=function(E,_,O){if(typeof E=="number")return this._initNumber(E,_,O);if(typeof E=="object")return this._initArray(E,_,O);_==="hex"&&(_=16),n(_===(_|0)&&_>=2&&_<=36),E=E.toString().replace(/\s+/g,"");var N=0;E[0]==="-"&&(N++,this.negative=1),N=0;N-=3)$=E[N]|E[N-1]<<8|E[N-2]<<16,this.words[k]|=$<>>26-L&67108863,L+=24,L>=26&&(L-=26,k++);else if(O==="le")for(N=0,k=0;N>>26-L&67108863,L+=24,L>=26&&(L-=26,k++);return this._strip()};function a(B,E){var _=B.charCodeAt(E);if(_>=48&&_<=57)return _-48;if(_>=65&&_<=70)return _-55;if(_>=97&&_<=102)return _-87;n(!1,"Invalid character in "+B)}function c(B,E,_){var O=a(B,_);return _-1>=E&&(O|=a(B,_-1)<<4),O}s.prototype._parseHex=function(E,_,O){this.length=Math.ceil((E.length-_)/6),this.words=new Array(this.length);for(var N=0;N=_;N-=2)L=c(E,_,N)<=18?(k-=18,$+=1,this.words[$]|=L>>>26):k+=8;else{var M=E.length-_;for(N=M%2===0?_+1:_;N=18?(k-=18,$+=1,this.words[$]|=L>>>26):k+=8}this._strip()};function l(B,E,_,O){for(var N=0,k=0,$=Math.min(B.length,_),L=E;L<$;L++){var M=B.charCodeAt(L)-48;N*=O,M>=49?k=M-49+10:M>=17?k=M-17+10:k=M,n(M>=0&&k1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{s.prototype.inspect=f}else s.prototype.inspect=f;function f(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[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];s.prototype.toString=function(E,_){E=E||10,_=_|0||1;var O;if(E===16||E==="hex"){O="";for(var N=0,k=0,$=0;$>>24-N&16777215,N+=2,N>=26&&(N-=26,$--),k!==0||$!==this.length-1?O=d[6-M.length]+M+O:O=M+O}for(k!==0&&(O=k.toString(16)+O);O.length%_!==0;)O="0"+O;return this.negative!==0&&(O="-"+O),O}if(E===(E|0)&&E>=2&&E<=36){var A=h[E],D=p[E];O="";var V=this.clone();for(V.negative=0;!V.isZero();){var R=V.modrn(D).toString(E);V=V.idivn(D),V.isZero()?O=R+O:O=d[A-R.length]+R+O}for(this.isZero()&&(O="0"+O);O.length%_!==0;)O="0"+O;return this.negative!==0&&(O="-"+O),O}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var E=this.words[0];return this.length===2?E+=this.words[1]*67108864:this.length===3&&this.words[2]===1?E+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-E:E},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(E,_){return this.toArrayLike(o,E,_)}),s.prototype.toArray=function(E,_){return this.toArrayLike(Array,E,_)};var v=function(E,_){return E.allocUnsafe?E.allocUnsafe(_):new E(_)};s.prototype.toArrayLike=function(E,_,O){this._strip();var N=this.byteLength(),k=O||Math.max(1,N);n(N<=k,"byte array longer than desired length"),n(k>0,"Requested array length <= 0");var $=v(E,k),L=_==="le"?"LE":"BE";return this["_toArrayLike"+L]($,N),$},s.prototype._toArrayLikeLE=function(E,_){for(var O=0,N=0,k=0,$=0;k>8&255),O>16&255),$===6?(O>24&255),N=0,$=0):(N=L>>>24,$+=2)}if(O=0&&(E[O--]=L>>8&255),O>=0&&(E[O--]=L>>16&255),$===6?(O>=0&&(E[O--]=L>>24&255),N=0,$=0):(N=L>>>24,$+=2)}if(O>=0)for(E[O--]=N;O>=0;)E[O--]=0},Math.clz32?s.prototype._countBits=function(E){return 32-Math.clz32(E)}:s.prototype._countBits=function(E){var _=E,O=0;return _>=4096&&(O+=13,_>>>=13),_>=64&&(O+=7,_>>>=7),_>=8&&(O+=4,_>>>=4),_>=2&&(O+=2,_>>>=2),O+_},s.prototype._zeroBits=function(E){if(E===0)return 26;var _=E,O=0;return _&8191||(O+=13,_>>>=13),_&127||(O+=7,_>>>=7),_&15||(O+=4,_>>>=4),_&3||(O+=2,_>>>=2),_&1||O++,O},s.prototype.bitLength=function(){var E=this.words[this.length-1],_=this._countBits(E);return(this.length-1)*26+_};function b(B){for(var E=new Array(B.bitLength()),_=0;_>>N&1}return E}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var E=0,_=0;_E.length?this.clone().ior(E):E.clone().ior(this)},s.prototype.uor=function(E){return this.length>E.length?this.clone().iuor(E):E.clone().iuor(this)},s.prototype.iuand=function(E){var _;this.length>E.length?_=E:_=this;for(var O=0;O<_.length;O++)this.words[O]=this.words[O]&E.words[O];return this.length=_.length,this._strip()},s.prototype.iand=function(E){return n((this.negative|E.negative)===0),this.iuand(E)},s.prototype.and=function(E){return this.length>E.length?this.clone().iand(E):E.clone().iand(this)},s.prototype.uand=function(E){return this.length>E.length?this.clone().iuand(E):E.clone().iuand(this)},s.prototype.iuxor=function(E){var _,O;this.length>E.length?(_=this,O=E):(_=E,O=this);for(var N=0;NE.length?this.clone().ixor(E):E.clone().ixor(this)},s.prototype.uxor=function(E){return this.length>E.length?this.clone().iuxor(E):E.clone().iuxor(this)},s.prototype.inotn=function(E){n(typeof E=="number"&&E>=0);var _=Math.ceil(E/26)|0,O=E%26;this._expand(_),O>0&&_--;for(var N=0;N<_;N++)this.words[N]=~this.words[N]&67108863;return O>0&&(this.words[N]=~this.words[N]&67108863>>26-O),this._strip()},s.prototype.notn=function(E){return this.clone().inotn(E)},s.prototype.setn=function(E,_){n(typeof E=="number"&&E>=0);var O=E/26|0,N=E%26;return this._expand(O+1),_?this.words[O]=this.words[O]|1<E.length?(O=this,N=E):(O=E,N=this);for(var k=0,$=0;$>>26;for(;k!==0&&$>>26;if(this.length=O.length,k!==0)this.words[this.length]=k,this.length++;else if(O!==this)for(;$E.length?this.clone().iadd(E):E.clone().iadd(this)},s.prototype.isub=function(E){if(E.negative!==0){E.negative=0;var _=this.iadd(E);return E.negative=1,_._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(E),this.negative=1,this._normSign();var O=this.cmp(E);if(O===0)return this.negative=0,this.length=1,this.words[0]=0,this;var N,k;O>0?(N=this,k=E):(N=E,k=this);for(var $=0,L=0;L>26,this.words[L]=_&67108863;for(;$!==0&&L>26,this.words[L]=_&67108863;if($===0&&L>>26,V=M&67108863,R=Math.min(A,E.length-1),U=Math.max(0,A-B.length+1);U<=R;U++){var W=A-U|0;N=B.words[W]|0,k=E.words[U]|0,$=N*k+V,D+=$/67108864|0,V=$&67108863}_.words[A]=V|0,M=D|0}return M!==0?_.words[A]=M|0:_.length--,_._strip()}var m=function(E,_,O){var N=E.words,k=_.words,$=O.words,L=0,M,A,D,V=N[0]|0,R=V&8191,U=V>>>13,W=N[1]|0,q=W&8191,Y=W>>>13,X=N[2]|0,Q=X&8191,Z=X>>>13,ae=N[3]|0,se=ae&8191,ue=ae>>>13,ot=N[4]|0,Te=ot&8191,_e=ot>>>13,at=N[5]|0,xe=at&8191,be=at>>>13,Kt=N[6]|0,Ie=Kt&8191,Oe=Kt>>>13,Qt=N[7]|0,Re=Qt&8191,$e=Qt>>>13,Yt=N[8]|0,Me=Yt&8191,Ne=Yt>>>13,Jt=N[9]|0,De=Jt&8191,Le=Jt>>>13,Xt=k[0]|0,Fe=Xt&8191,Et=Xt>>>13,jc=k[1]|0,xt=jc&8191,Ct=jc>>>13,Uc=k[2]|0,St=Uc&8191,kt=Uc>>>13,zc=k[3]|0,At=zc&8191,_t=zc>>>13,Wc=k[4]|0,Pt=Wc&8191,Tt=Wc>>>13,Hc=k[5]|0,It=Hc&8191,Ot=Hc>>>13,qc=k[6]|0,Rt=qc&8191,$t=qc>>>13,Vc=k[7]|0,Mt=Vc&8191,Nt=Vc>>>13,Gc=k[8]|0,Dt=Gc&8191,Lt=Gc>>>13,Kc=k[9]|0,Ft=Kc&8191,Bt=Kc>>>13;O.negative=E.negative^_.negative,O.length=19,M=Math.imul(R,Fe),A=Math.imul(R,Et),A=A+Math.imul(U,Fe)|0,D=Math.imul(U,Et);var ya=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(ya>>>26)|0,ya&=67108863,M=Math.imul(q,Fe),A=Math.imul(q,Et),A=A+Math.imul(Y,Fe)|0,D=Math.imul(Y,Et),M=M+Math.imul(R,xt)|0,A=A+Math.imul(R,Ct)|0,A=A+Math.imul(U,xt)|0,D=D+Math.imul(U,Ct)|0;var ga=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(ga>>>26)|0,ga&=67108863,M=Math.imul(Q,Fe),A=Math.imul(Q,Et),A=A+Math.imul(Z,Fe)|0,D=Math.imul(Z,Et),M=M+Math.imul(q,xt)|0,A=A+Math.imul(q,Ct)|0,A=A+Math.imul(Y,xt)|0,D=D+Math.imul(Y,Ct)|0,M=M+Math.imul(R,St)|0,A=A+Math.imul(R,kt)|0,A=A+Math.imul(U,St)|0,D=D+Math.imul(U,kt)|0;var ba=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(ba>>>26)|0,ba&=67108863,M=Math.imul(se,Fe),A=Math.imul(se,Et),A=A+Math.imul(ue,Fe)|0,D=Math.imul(ue,Et),M=M+Math.imul(Q,xt)|0,A=A+Math.imul(Q,Ct)|0,A=A+Math.imul(Z,xt)|0,D=D+Math.imul(Z,Ct)|0,M=M+Math.imul(q,St)|0,A=A+Math.imul(q,kt)|0,A=A+Math.imul(Y,St)|0,D=D+Math.imul(Y,kt)|0,M=M+Math.imul(R,At)|0,A=A+Math.imul(R,_t)|0,A=A+Math.imul(U,At)|0,D=D+Math.imul(U,_t)|0;var wa=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(wa>>>26)|0,wa&=67108863,M=Math.imul(Te,Fe),A=Math.imul(Te,Et),A=A+Math.imul(_e,Fe)|0,D=Math.imul(_e,Et),M=M+Math.imul(se,xt)|0,A=A+Math.imul(se,Ct)|0,A=A+Math.imul(ue,xt)|0,D=D+Math.imul(ue,Ct)|0,M=M+Math.imul(Q,St)|0,A=A+Math.imul(Q,kt)|0,A=A+Math.imul(Z,St)|0,D=D+Math.imul(Z,kt)|0,M=M+Math.imul(q,At)|0,A=A+Math.imul(q,_t)|0,A=A+Math.imul(Y,At)|0,D=D+Math.imul(Y,_t)|0,M=M+Math.imul(R,Pt)|0,A=A+Math.imul(R,Tt)|0,A=A+Math.imul(U,Pt)|0,D=D+Math.imul(U,Tt)|0;var Ea=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(Ea>>>26)|0,Ea&=67108863,M=Math.imul(xe,Fe),A=Math.imul(xe,Et),A=A+Math.imul(be,Fe)|0,D=Math.imul(be,Et),M=M+Math.imul(Te,xt)|0,A=A+Math.imul(Te,Ct)|0,A=A+Math.imul(_e,xt)|0,D=D+Math.imul(_e,Ct)|0,M=M+Math.imul(se,St)|0,A=A+Math.imul(se,kt)|0,A=A+Math.imul(ue,St)|0,D=D+Math.imul(ue,kt)|0,M=M+Math.imul(Q,At)|0,A=A+Math.imul(Q,_t)|0,A=A+Math.imul(Z,At)|0,D=D+Math.imul(Z,_t)|0,M=M+Math.imul(q,Pt)|0,A=A+Math.imul(q,Tt)|0,A=A+Math.imul(Y,Pt)|0,D=D+Math.imul(Y,Tt)|0,M=M+Math.imul(R,It)|0,A=A+Math.imul(R,Ot)|0,A=A+Math.imul(U,It)|0,D=D+Math.imul(U,Ot)|0;var hw=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(hw>>>26)|0,hw&=67108863,M=Math.imul(Ie,Fe),A=Math.imul(Ie,Et),A=A+Math.imul(Oe,Fe)|0,D=Math.imul(Oe,Et),M=M+Math.imul(xe,xt)|0,A=A+Math.imul(xe,Ct)|0,A=A+Math.imul(be,xt)|0,D=D+Math.imul(be,Ct)|0,M=M+Math.imul(Te,St)|0,A=A+Math.imul(Te,kt)|0,A=A+Math.imul(_e,St)|0,D=D+Math.imul(_e,kt)|0,M=M+Math.imul(se,At)|0,A=A+Math.imul(se,_t)|0,A=A+Math.imul(ue,At)|0,D=D+Math.imul(ue,_t)|0,M=M+Math.imul(Q,Pt)|0,A=A+Math.imul(Q,Tt)|0,A=A+Math.imul(Z,Pt)|0,D=D+Math.imul(Z,Tt)|0,M=M+Math.imul(q,It)|0,A=A+Math.imul(q,Ot)|0,A=A+Math.imul(Y,It)|0,D=D+Math.imul(Y,Ot)|0,M=M+Math.imul(R,Rt)|0,A=A+Math.imul(R,$t)|0,A=A+Math.imul(U,Rt)|0,D=D+Math.imul(U,$t)|0;var pw=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(pw>>>26)|0,pw&=67108863,M=Math.imul(Re,Fe),A=Math.imul(Re,Et),A=A+Math.imul($e,Fe)|0,D=Math.imul($e,Et),M=M+Math.imul(Ie,xt)|0,A=A+Math.imul(Ie,Ct)|0,A=A+Math.imul(Oe,xt)|0,D=D+Math.imul(Oe,Ct)|0,M=M+Math.imul(xe,St)|0,A=A+Math.imul(xe,kt)|0,A=A+Math.imul(be,St)|0,D=D+Math.imul(be,kt)|0,M=M+Math.imul(Te,At)|0,A=A+Math.imul(Te,_t)|0,A=A+Math.imul(_e,At)|0,D=D+Math.imul(_e,_t)|0,M=M+Math.imul(se,Pt)|0,A=A+Math.imul(se,Tt)|0,A=A+Math.imul(ue,Pt)|0,D=D+Math.imul(ue,Tt)|0,M=M+Math.imul(Q,It)|0,A=A+Math.imul(Q,Ot)|0,A=A+Math.imul(Z,It)|0,D=D+Math.imul(Z,Ot)|0,M=M+Math.imul(q,Rt)|0,A=A+Math.imul(q,$t)|0,A=A+Math.imul(Y,Rt)|0,D=D+Math.imul(Y,$t)|0,M=M+Math.imul(R,Mt)|0,A=A+Math.imul(R,Nt)|0,A=A+Math.imul(U,Mt)|0,D=D+Math.imul(U,Nt)|0;var vw=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(vw>>>26)|0,vw&=67108863,M=Math.imul(Me,Fe),A=Math.imul(Me,Et),A=A+Math.imul(Ne,Fe)|0,D=Math.imul(Ne,Et),M=M+Math.imul(Re,xt)|0,A=A+Math.imul(Re,Ct)|0,A=A+Math.imul($e,xt)|0,D=D+Math.imul($e,Ct)|0,M=M+Math.imul(Ie,St)|0,A=A+Math.imul(Ie,kt)|0,A=A+Math.imul(Oe,St)|0,D=D+Math.imul(Oe,kt)|0,M=M+Math.imul(xe,At)|0,A=A+Math.imul(xe,_t)|0,A=A+Math.imul(be,At)|0,D=D+Math.imul(be,_t)|0,M=M+Math.imul(Te,Pt)|0,A=A+Math.imul(Te,Tt)|0,A=A+Math.imul(_e,Pt)|0,D=D+Math.imul(_e,Tt)|0,M=M+Math.imul(se,It)|0,A=A+Math.imul(se,Ot)|0,A=A+Math.imul(ue,It)|0,D=D+Math.imul(ue,Ot)|0,M=M+Math.imul(Q,Rt)|0,A=A+Math.imul(Q,$t)|0,A=A+Math.imul(Z,Rt)|0,D=D+Math.imul(Z,$t)|0,M=M+Math.imul(q,Mt)|0,A=A+Math.imul(q,Nt)|0,A=A+Math.imul(Y,Mt)|0,D=D+Math.imul(Y,Nt)|0,M=M+Math.imul(R,Dt)|0,A=A+Math.imul(R,Lt)|0,A=A+Math.imul(U,Dt)|0,D=D+Math.imul(U,Lt)|0;var mw=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(mw>>>26)|0,mw&=67108863,M=Math.imul(De,Fe),A=Math.imul(De,Et),A=A+Math.imul(Le,Fe)|0,D=Math.imul(Le,Et),M=M+Math.imul(Me,xt)|0,A=A+Math.imul(Me,Ct)|0,A=A+Math.imul(Ne,xt)|0,D=D+Math.imul(Ne,Ct)|0,M=M+Math.imul(Re,St)|0,A=A+Math.imul(Re,kt)|0,A=A+Math.imul($e,St)|0,D=D+Math.imul($e,kt)|0,M=M+Math.imul(Ie,At)|0,A=A+Math.imul(Ie,_t)|0,A=A+Math.imul(Oe,At)|0,D=D+Math.imul(Oe,_t)|0,M=M+Math.imul(xe,Pt)|0,A=A+Math.imul(xe,Tt)|0,A=A+Math.imul(be,Pt)|0,D=D+Math.imul(be,Tt)|0,M=M+Math.imul(Te,It)|0,A=A+Math.imul(Te,Ot)|0,A=A+Math.imul(_e,It)|0,D=D+Math.imul(_e,Ot)|0,M=M+Math.imul(se,Rt)|0,A=A+Math.imul(se,$t)|0,A=A+Math.imul(ue,Rt)|0,D=D+Math.imul(ue,$t)|0,M=M+Math.imul(Q,Mt)|0,A=A+Math.imul(Q,Nt)|0,A=A+Math.imul(Z,Mt)|0,D=D+Math.imul(Z,Nt)|0,M=M+Math.imul(q,Dt)|0,A=A+Math.imul(q,Lt)|0,A=A+Math.imul(Y,Dt)|0,D=D+Math.imul(Y,Lt)|0,M=M+Math.imul(R,Ft)|0,A=A+Math.imul(R,Bt)|0,A=A+Math.imul(U,Ft)|0,D=D+Math.imul(U,Bt)|0;var yw=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(yw>>>26)|0,yw&=67108863,M=Math.imul(De,xt),A=Math.imul(De,Ct),A=A+Math.imul(Le,xt)|0,D=Math.imul(Le,Ct),M=M+Math.imul(Me,St)|0,A=A+Math.imul(Me,kt)|0,A=A+Math.imul(Ne,St)|0,D=D+Math.imul(Ne,kt)|0,M=M+Math.imul(Re,At)|0,A=A+Math.imul(Re,_t)|0,A=A+Math.imul($e,At)|0,D=D+Math.imul($e,_t)|0,M=M+Math.imul(Ie,Pt)|0,A=A+Math.imul(Ie,Tt)|0,A=A+Math.imul(Oe,Pt)|0,D=D+Math.imul(Oe,Tt)|0,M=M+Math.imul(xe,It)|0,A=A+Math.imul(xe,Ot)|0,A=A+Math.imul(be,It)|0,D=D+Math.imul(be,Ot)|0,M=M+Math.imul(Te,Rt)|0,A=A+Math.imul(Te,$t)|0,A=A+Math.imul(_e,Rt)|0,D=D+Math.imul(_e,$t)|0,M=M+Math.imul(se,Mt)|0,A=A+Math.imul(se,Nt)|0,A=A+Math.imul(ue,Mt)|0,D=D+Math.imul(ue,Nt)|0,M=M+Math.imul(Q,Dt)|0,A=A+Math.imul(Q,Lt)|0,A=A+Math.imul(Z,Dt)|0,D=D+Math.imul(Z,Lt)|0,M=M+Math.imul(q,Ft)|0,A=A+Math.imul(q,Bt)|0,A=A+Math.imul(Y,Ft)|0,D=D+Math.imul(Y,Bt)|0;var gw=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(gw>>>26)|0,gw&=67108863,M=Math.imul(De,St),A=Math.imul(De,kt),A=A+Math.imul(Le,St)|0,D=Math.imul(Le,kt),M=M+Math.imul(Me,At)|0,A=A+Math.imul(Me,_t)|0,A=A+Math.imul(Ne,At)|0,D=D+Math.imul(Ne,_t)|0,M=M+Math.imul(Re,Pt)|0,A=A+Math.imul(Re,Tt)|0,A=A+Math.imul($e,Pt)|0,D=D+Math.imul($e,Tt)|0,M=M+Math.imul(Ie,It)|0,A=A+Math.imul(Ie,Ot)|0,A=A+Math.imul(Oe,It)|0,D=D+Math.imul(Oe,Ot)|0,M=M+Math.imul(xe,Rt)|0,A=A+Math.imul(xe,$t)|0,A=A+Math.imul(be,Rt)|0,D=D+Math.imul(be,$t)|0,M=M+Math.imul(Te,Mt)|0,A=A+Math.imul(Te,Nt)|0,A=A+Math.imul(_e,Mt)|0,D=D+Math.imul(_e,Nt)|0,M=M+Math.imul(se,Dt)|0,A=A+Math.imul(se,Lt)|0,A=A+Math.imul(ue,Dt)|0,D=D+Math.imul(ue,Lt)|0,M=M+Math.imul(Q,Ft)|0,A=A+Math.imul(Q,Bt)|0,A=A+Math.imul(Z,Ft)|0,D=D+Math.imul(Z,Bt)|0;var bw=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(bw>>>26)|0,bw&=67108863,M=Math.imul(De,At),A=Math.imul(De,_t),A=A+Math.imul(Le,At)|0,D=Math.imul(Le,_t),M=M+Math.imul(Me,Pt)|0,A=A+Math.imul(Me,Tt)|0,A=A+Math.imul(Ne,Pt)|0,D=D+Math.imul(Ne,Tt)|0,M=M+Math.imul(Re,It)|0,A=A+Math.imul(Re,Ot)|0,A=A+Math.imul($e,It)|0,D=D+Math.imul($e,Ot)|0,M=M+Math.imul(Ie,Rt)|0,A=A+Math.imul(Ie,$t)|0,A=A+Math.imul(Oe,Rt)|0,D=D+Math.imul(Oe,$t)|0,M=M+Math.imul(xe,Mt)|0,A=A+Math.imul(xe,Nt)|0,A=A+Math.imul(be,Mt)|0,D=D+Math.imul(be,Nt)|0,M=M+Math.imul(Te,Dt)|0,A=A+Math.imul(Te,Lt)|0,A=A+Math.imul(_e,Dt)|0,D=D+Math.imul(_e,Lt)|0,M=M+Math.imul(se,Ft)|0,A=A+Math.imul(se,Bt)|0,A=A+Math.imul(ue,Ft)|0,D=D+Math.imul(ue,Bt)|0;var ww=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(ww>>>26)|0,ww&=67108863,M=Math.imul(De,Pt),A=Math.imul(De,Tt),A=A+Math.imul(Le,Pt)|0,D=Math.imul(Le,Tt),M=M+Math.imul(Me,It)|0,A=A+Math.imul(Me,Ot)|0,A=A+Math.imul(Ne,It)|0,D=D+Math.imul(Ne,Ot)|0,M=M+Math.imul(Re,Rt)|0,A=A+Math.imul(Re,$t)|0,A=A+Math.imul($e,Rt)|0,D=D+Math.imul($e,$t)|0,M=M+Math.imul(Ie,Mt)|0,A=A+Math.imul(Ie,Nt)|0,A=A+Math.imul(Oe,Mt)|0,D=D+Math.imul(Oe,Nt)|0,M=M+Math.imul(xe,Dt)|0,A=A+Math.imul(xe,Lt)|0,A=A+Math.imul(be,Dt)|0,D=D+Math.imul(be,Lt)|0,M=M+Math.imul(Te,Ft)|0,A=A+Math.imul(Te,Bt)|0,A=A+Math.imul(_e,Ft)|0,D=D+Math.imul(_e,Bt)|0;var Ew=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(Ew>>>26)|0,Ew&=67108863,M=Math.imul(De,It),A=Math.imul(De,Ot),A=A+Math.imul(Le,It)|0,D=Math.imul(Le,Ot),M=M+Math.imul(Me,Rt)|0,A=A+Math.imul(Me,$t)|0,A=A+Math.imul(Ne,Rt)|0,D=D+Math.imul(Ne,$t)|0,M=M+Math.imul(Re,Mt)|0,A=A+Math.imul(Re,Nt)|0,A=A+Math.imul($e,Mt)|0,D=D+Math.imul($e,Nt)|0,M=M+Math.imul(Ie,Dt)|0,A=A+Math.imul(Ie,Lt)|0,A=A+Math.imul(Oe,Dt)|0,D=D+Math.imul(Oe,Lt)|0,M=M+Math.imul(xe,Ft)|0,A=A+Math.imul(xe,Bt)|0,A=A+Math.imul(be,Ft)|0,D=D+Math.imul(be,Bt)|0;var xw=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(xw>>>26)|0,xw&=67108863,M=Math.imul(De,Rt),A=Math.imul(De,$t),A=A+Math.imul(Le,Rt)|0,D=Math.imul(Le,$t),M=M+Math.imul(Me,Mt)|0,A=A+Math.imul(Me,Nt)|0,A=A+Math.imul(Ne,Mt)|0,D=D+Math.imul(Ne,Nt)|0,M=M+Math.imul(Re,Dt)|0,A=A+Math.imul(Re,Lt)|0,A=A+Math.imul($e,Dt)|0,D=D+Math.imul($e,Lt)|0,M=M+Math.imul(Ie,Ft)|0,A=A+Math.imul(Ie,Bt)|0,A=A+Math.imul(Oe,Ft)|0,D=D+Math.imul(Oe,Bt)|0;var Cw=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(Cw>>>26)|0,Cw&=67108863,M=Math.imul(De,Mt),A=Math.imul(De,Nt),A=A+Math.imul(Le,Mt)|0,D=Math.imul(Le,Nt),M=M+Math.imul(Me,Dt)|0,A=A+Math.imul(Me,Lt)|0,A=A+Math.imul(Ne,Dt)|0,D=D+Math.imul(Ne,Lt)|0,M=M+Math.imul(Re,Ft)|0,A=A+Math.imul(Re,Bt)|0,A=A+Math.imul($e,Ft)|0,D=D+Math.imul($e,Bt)|0;var Sw=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(Sw>>>26)|0,Sw&=67108863,M=Math.imul(De,Dt),A=Math.imul(De,Lt),A=A+Math.imul(Le,Dt)|0,D=Math.imul(Le,Lt),M=M+Math.imul(Me,Ft)|0,A=A+Math.imul(Me,Bt)|0,A=A+Math.imul(Ne,Ft)|0,D=D+Math.imul(Ne,Bt)|0;var kw=(L+M|0)+((A&8191)<<13)|0;L=(D+(A>>>13)|0)+(kw>>>26)|0,kw&=67108863,M=Math.imul(De,Ft),A=Math.imul(De,Bt),A=A+Math.imul(Le,Ft)|0,D=Math.imul(Le,Bt);var Aw=(L+M|0)+((A&8191)<<13)|0;return L=(D+(A>>>13)|0)+(Aw>>>26)|0,Aw&=67108863,$[0]=ya,$[1]=ga,$[2]=ba,$[3]=wa,$[4]=Ea,$[5]=hw,$[6]=pw,$[7]=vw,$[8]=mw,$[9]=yw,$[10]=gw,$[11]=bw,$[12]=ww,$[13]=Ew,$[14]=xw,$[15]=Cw,$[16]=Sw,$[17]=kw,$[18]=Aw,L!==0&&($[19]=L,O.length++),O};Math.imul||(m=y);function g(B,E,_){_.negative=E.negative^B.negative,_.length=B.length+E.length;for(var O=0,N=0,k=0;k<_.length-1;k++){var $=N;N=0;for(var L=O&67108863,M=Math.min(k,E.length-1),A=Math.max(0,k-B.length+1);A<=M;A++){var D=k-A,V=B.words[D]|0,R=E.words[A]|0,U=V*R,W=U&67108863;$=$+(U/67108864|0)|0,W=W+L|0,L=W&67108863,$=$+(W>>>26)|0,N+=$>>>26,$&=67108863}_.words[k]=L,O=$,$=N}return O!==0?_.words[k]=O:_.length--,_._strip()}function S(B,E,_){return g(B,E,_)}s.prototype.mulTo=function(E,_){var O,N=this.length+E.length;return this.length===10&&E.length===10?O=m(this,E,_):N<63?O=y(this,E,_):N<1024?O=g(this,E,_):O=S(this,E,_),O},s.prototype.mul=function(E){var _=new s(null);return _.words=new Array(this.length+E.length),this.mulTo(E,_)},s.prototype.mulf=function(E){var _=new s(null);return _.words=new Array(this.length+E.length),S(this,E,_)},s.prototype.imul=function(E){return this.clone().mulTo(E,this)},s.prototype.imuln=function(E){var _=E<0;_&&(E=-E),n(typeof E=="number"),n(E<67108864);for(var O=0,N=0;N>=26,O+=k/67108864|0,O+=$>>>26,this.words[N]=$&67108863}return O!==0&&(this.words[N]=O,this.length++),_?this.ineg():this},s.prototype.muln=function(E){return this.clone().imuln(E)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(E){var _=b(E);if(_.length===0)return new s(1);for(var O=this,N=0;N<_.length&&_[N]===0;N++,O=O.sqr());if(++N<_.length)for(var k=O.sqr();N<_.length;N++,k=k.sqr())_[N]!==0&&(O=O.mul(k));return O},s.prototype.iushln=function(E){n(typeof E=="number"&&E>=0);var _=E%26,O=(E-_)/26,N=67108863>>>26-_<<26-_,k;if(_!==0){var $=0;for(k=0;k>>26-_}$&&(this.words[k]=$,this.length++)}if(O!==0){for(k=this.length-1;k>=0;k--)this.words[k+O]=this.words[k];for(k=0;k=0);var N;_?N=(_-_%26)/26:N=0;var k=E%26,$=Math.min((E-k)/26,this.length),L=67108863^67108863>>>k<$)for(this.length-=$,A=0;A=0&&(D!==0||A>=N);A--){var V=this.words[A]|0;this.words[A]=D<<26-k|V>>>k,D=V&L}return M&&D!==0&&(M.words[M.length++]=D),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(E,_,O){return n(this.negative===0),this.iushrn(E,_,O)},s.prototype.shln=function(E){return this.clone().ishln(E)},s.prototype.ushln=function(E){return this.clone().iushln(E)},s.prototype.shrn=function(E){return this.clone().ishrn(E)},s.prototype.ushrn=function(E){return this.clone().iushrn(E)},s.prototype.testn=function(E){n(typeof E=="number"&&E>=0);var _=E%26,O=(E-_)/26,N=1<<_;if(this.length<=O)return!1;var k=this.words[O];return!!(k&N)},s.prototype.imaskn=function(E){n(typeof E=="number"&&E>=0);var _=E%26,O=(E-_)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=O)return this;if(_!==0&&O++,this.length=Math.min(O,this.length),_!==0){var N=67108863^67108863>>>_<<_;this.words[this.length-1]&=N}return this._strip()},s.prototype.maskn=function(E){return this.clone().imaskn(E)},s.prototype.iaddn=function(E){return n(typeof E=="number"),n(E<67108864),E<0?this.isubn(-E):this.negative!==0?this.length===1&&(this.words[0]|0)<=E?(this.words[0]=E-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(E),this.negative=1,this):this._iaddn(E)},s.prototype._iaddn=function(E){this.words[0]+=E;for(var _=0;_=67108864;_++)this.words[_]-=67108864,_===this.length-1?this.words[_+1]=1:this.words[_+1]++;return this.length=Math.max(this.length,_+1),this},s.prototype.isubn=function(E){if(n(typeof E=="number"),n(E<67108864),E<0)return this.iaddn(-E);if(this.negative!==0)return this.negative=0,this.iaddn(E),this.negative=1,this;if(this.words[0]-=E,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var _=0;_>26)-(M/67108864|0),this.words[k+O]=$&67108863}for(;k>26,this.words[k+O]=$&67108863;if(L===0)return this._strip();for(n(L===-1),L=0,k=0;k>26,this.words[k]=$&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(E,_){var O=this.length-E.length,N=this.clone(),k=E,$=k.words[k.length-1]|0,L=this._countBits($);O=26-L,O!==0&&(k=k.ushln(O),N.iushln(O),$=k.words[k.length-1]|0);var M=N.length-k.length,A;if(_!=="mod"){A=new s(null),A.length=M+1,A.words=new Array(A.length);for(var D=0;D=0;R--){var U=(N.words[k.length+R]|0)*67108864+(N.words[k.length+R-1]|0);for(U=Math.min(U/$|0,67108863),N._ishlnsubmul(k,U,R);N.negative!==0;)U--,N.negative=0,N._ishlnsubmul(k,1,R),N.isZero()||(N.negative^=1);A&&(A.words[R]=U)}return A&&A._strip(),N._strip(),_!=="div"&&O!==0&&N.iushrn(O),{div:A||null,mod:N}},s.prototype.divmod=function(E,_,O){if(n(!E.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var N,k,$;return this.negative!==0&&E.negative===0?($=this.neg().divmod(E,_),_!=="mod"&&(N=$.div.neg()),_!=="div"&&(k=$.mod.neg(),O&&k.negative!==0&&k.iadd(E)),{div:N,mod:k}):this.negative===0&&E.negative!==0?($=this.divmod(E.neg(),_),_!=="mod"&&(N=$.div.neg()),{div:N,mod:$.mod}):this.negative&E.negative?($=this.neg().divmod(E.neg(),_),_!=="div"&&(k=$.mod.neg(),O&&k.negative!==0&&k.isub(E)),{div:$.div,mod:k}):E.length>this.length||this.cmp(E)<0?{div:new s(0),mod:this}:E.length===1?_==="div"?{div:this.divn(E.words[0]),mod:null}:_==="mod"?{div:null,mod:new s(this.modrn(E.words[0]))}:{div:this.divn(E.words[0]),mod:new s(this.modrn(E.words[0]))}:this._wordDiv(E,_)},s.prototype.div=function(E){return this.divmod(E,"div",!1).div},s.prototype.mod=function(E){return this.divmod(E,"mod",!1).mod},s.prototype.umod=function(E){return this.divmod(E,"mod",!0).mod},s.prototype.divRound=function(E){var _=this.divmod(E);if(_.mod.isZero())return _.div;var O=_.div.negative!==0?_.mod.isub(E):_.mod,N=E.ushrn(1),k=E.andln(1),$=O.cmp(N);return $<0||k===1&&$===0?_.div:_.div.negative!==0?_.div.isubn(1):_.div.iaddn(1)},s.prototype.modrn=function(E){var _=E<0;_&&(E=-E),n(E<=67108863);for(var O=(1<<26)%E,N=0,k=this.length-1;k>=0;k--)N=(O*N+(this.words[k]|0))%E;return _?-N:N},s.prototype.modn=function(E){return this.modrn(E)},s.prototype.idivn=function(E){var _=E<0;_&&(E=-E),n(E<=67108863);for(var O=0,N=this.length-1;N>=0;N--){var k=(this.words[N]|0)+O*67108864;this.words[N]=k/E|0,O=k%E}return this._strip(),_?this.ineg():this},s.prototype.divn=function(E){return this.clone().idivn(E)},s.prototype.egcd=function(E){n(E.negative===0),n(!E.isZero());var _=this,O=E.clone();_.negative!==0?_=_.umod(E):_=_.clone();for(var N=new s(1),k=new s(0),$=new s(0),L=new s(1),M=0;_.isEven()&&O.isEven();)_.iushrn(1),O.iushrn(1),++M;for(var A=O.clone(),D=_.clone();!_.isZero();){for(var V=0,R=1;!(_.words[0]&R)&&V<26;++V,R<<=1);if(V>0)for(_.iushrn(V);V-- >0;)(N.isOdd()||k.isOdd())&&(N.iadd(A),k.isub(D)),N.iushrn(1),k.iushrn(1);for(var U=0,W=1;!(O.words[0]&W)&&U<26;++U,W<<=1);if(U>0)for(O.iushrn(U);U-- >0;)($.isOdd()||L.isOdd())&&($.iadd(A),L.isub(D)),$.iushrn(1),L.iushrn(1);_.cmp(O)>=0?(_.isub(O),N.isub($),k.isub(L)):(O.isub(_),$.isub(N),L.isub(k))}return{a:$,b:L,gcd:O.iushln(M)}},s.prototype._invmp=function(E){n(E.negative===0),n(!E.isZero());var _=this,O=E.clone();_.negative!==0?_=_.umod(E):_=_.clone();for(var N=new s(1),k=new s(0),$=O.clone();_.cmpn(1)>0&&O.cmpn(1)>0;){for(var L=0,M=1;!(_.words[0]&M)&&L<26;++L,M<<=1);if(L>0)for(_.iushrn(L);L-- >0;)N.isOdd()&&N.iadd($),N.iushrn(1);for(var A=0,D=1;!(O.words[0]&D)&&A<26;++A,D<<=1);if(A>0)for(O.iushrn(A);A-- >0;)k.isOdd()&&k.iadd($),k.iushrn(1);_.cmp(O)>=0?(_.isub(O),N.isub(k)):(O.isub(_),k.isub(N))}var V;return _.cmpn(1)===0?V=N:V=k,V.cmpn(0)<0&&V.iadd(E),V},s.prototype.gcd=function(E){if(this.isZero())return E.abs();if(E.isZero())return this.abs();var _=this.clone(),O=E.clone();_.negative=0,O.negative=0;for(var N=0;_.isEven()&&O.isEven();N++)_.iushrn(1),O.iushrn(1);do{for(;_.isEven();)_.iushrn(1);for(;O.isEven();)O.iushrn(1);var k=_.cmp(O);if(k<0){var $=_;_=O,O=$}else if(k===0||O.cmpn(1)===0)break;_.isub(O)}while(!0);return O.iushln(N)},s.prototype.invm=function(E){return this.egcd(E).a.umod(E)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(E){return this.words[0]&E},s.prototype.bincn=function(E){n(typeof E=="number");var _=E%26,O=(E-_)/26,N=1<<_;if(this.length<=O)return this._expand(O+1),this.words[O]|=N,this;for(var k=N,$=O;k!==0&&$>>26,L&=67108863,this.words[$]=L}return k!==0&&(this.words[$]=k,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(E){var _=E<0;if(this.negative!==0&&!_)return-1;if(this.negative===0&&_)return 1;this._strip();var O;if(this.length>1)O=1;else{_&&(E=-E),n(E<=67108863,"Number is too big");var N=this.words[0]|0;O=N===E?0:NE.length)return 1;if(this.length=0;O--){var N=this.words[O]|0,k=E.words[O]|0;if(N!==k){Nk&&(_=1);break}}return _},s.prototype.gtn=function(E){return this.cmpn(E)===1},s.prototype.gt=function(E){return this.cmp(E)===1},s.prototype.gten=function(E){return this.cmpn(E)>=0},s.prototype.gte=function(E){return this.cmp(E)>=0},s.prototype.ltn=function(E){return this.cmpn(E)===-1},s.prototype.lt=function(E){return this.cmp(E)===-1},s.prototype.lten=function(E){return this.cmpn(E)<=0},s.prototype.lte=function(E){return this.cmp(E)<=0},s.prototype.eqn=function(E){return this.cmpn(E)===0},s.prototype.eq=function(E){return this.cmp(E)===0},s.red=function(E){return new H(E)},s.prototype.toRed=function(E){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),E.convertTo(this)._forceRed(E)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(E){return this.red=E,this},s.prototype.forceRed=function(E){return n(!this.red,"Already a number in reduction context"),this._forceRed(E)},s.prototype.redAdd=function(E){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,E)},s.prototype.redIAdd=function(E){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,E)},s.prototype.redSub=function(E){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,E)},s.prototype.redISub=function(E){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,E)},s.prototype.redShl=function(E){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,E)},s.prototype.redMul=function(E){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,E),this.red.mul(this,E)},s.prototype.redIMul=function(E){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,E),this.red.imul(this,E)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(E){return n(this.red&&!E.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,E)};var P={k256:null,p224:null,p192:null,p25519:null};function T(B,E){this.name=B,this.p=new s(E,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}T.prototype._tmp=function(){var E=new s(null);return E.words=new Array(Math.ceil(this.n/13)),E},T.prototype.ireduce=function(E){var _=E,O;do this.split(_,this.tmp),_=this.imulK(_),_=_.iadd(this.tmp),O=_.bitLength();while(O>this.n);var N=O0?_.isub(this.p):_.strip!==void 0?_.strip():_._strip(),_},T.prototype.split=function(E,_){E.iushrn(this.n,0,_)},T.prototype.imulK=function(E){return E.imul(this.k)};function w(){T.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(w,T),w.prototype.split=function(E,_){for(var O=4194303,N=Math.min(E.length,9),k=0;k>>22,$=L}$>>>=22,E.words[k-10]=$,$===0&&E.length>10?E.length-=10:E.length-=9},w.prototype.imulK=function(E){E.words[E.length]=0,E.words[E.length+1]=0,E.length+=2;for(var _=0,O=0;O>>=26,E.words[O]=k,_=N}return _!==0&&(E.words[E.length++]=_),E},s._prime=function(E){if(P[E])return P[E];var _;if(E==="k256")_=new w;else if(E==="p224")_=new I;else if(E==="p192")_=new F;else if(E==="p25519")_=new j;else throw new Error("Unknown prime "+E);return P[E]=_,_};function H(B){if(typeof B=="string"){var E=s._prime(B);this.m=E.p,this.prime=E}else n(B.gtn(1),"modulus must be greater than 1"),this.m=B,this.prime=null}H.prototype._verify1=function(E){n(E.negative===0,"red works only with positives"),n(E.red,"red works only with red numbers")},H.prototype._verify2=function(E,_){n((E.negative|_.negative)===0,"red works only with positives"),n(E.red&&E.red===_.red,"red works only with red numbers")},H.prototype.imod=function(E){return this.prime?this.prime.ireduce(E)._forceRed(this):(u(E,E.umod(this.m)._forceRed(this)),E)},H.prototype.neg=function(E){return E.isZero()?E.clone():this.m.sub(E)._forceRed(this)},H.prototype.add=function(E,_){this._verify2(E,_);var O=E.add(_);return O.cmp(this.m)>=0&&O.isub(this.m),O._forceRed(this)},H.prototype.iadd=function(E,_){this._verify2(E,_);var O=E.iadd(_);return O.cmp(this.m)>=0&&O.isub(this.m),O},H.prototype.sub=function(E,_){this._verify2(E,_);var O=E.sub(_);return O.cmpn(0)<0&&O.iadd(this.m),O._forceRed(this)},H.prototype.isub=function(E,_){this._verify2(E,_);var O=E.isub(_);return O.cmpn(0)<0&&O.iadd(this.m),O},H.prototype.shl=function(E,_){return this._verify1(E),this.imod(E.ushln(_))},H.prototype.imul=function(E,_){return this._verify2(E,_),this.imod(E.imul(_))},H.prototype.mul=function(E,_){return this._verify2(E,_),this.imod(E.mul(_))},H.prototype.isqr=function(E){return this.imul(E,E.clone())},H.prototype.sqr=function(E){return this.mul(E,E)},H.prototype.sqrt=function(E){if(E.isZero())return E.clone();var _=this.m.andln(3);if(n(_%2===1),_===3){var O=this.m.add(new s(1)).iushrn(2);return this.pow(E,O)}for(var N=this.m.subn(1),k=0;!N.isZero()&&N.andln(1)===0;)k++,N.iushrn(1);n(!N.isZero());var $=new s(1).toRed(this),L=$.redNeg(),M=this.m.subn(1).iushrn(1),A=this.m.bitLength();for(A=new s(2*A*A).toRed(this);this.pow(A,M).cmp(L)!==0;)A.redIAdd(L);for(var D=this.pow(A,N),V=this.pow(E,N.addn(1).iushrn(1)),R=this.pow(E,N),U=k;R.cmp($)!==0;){for(var W=R,q=0;W.cmp($)!==0;q++)W=W.redSqr();n(q=0;k--){for(var D=_.words[k],V=A-1;V>=0;V--){var R=D>>V&1;if($!==N[0]&&($=this.sqr($)),R===0&&L===0){M=0;continue}L<<=1,L|=R,M++,!(M!==O&&(k!==0||V!==0))&&($=this.mul($,N[L]),M=0,L=0)}A=26}return $},H.prototype.convertTo=function(E){var _=E.umod(this.m);return _===E?_.clone():_},H.prototype.convertFrom=function(E){var _=E.clone();return _.red=null,_},s.mont=function(E){return new K(E)};function K(B){H.call(this,B),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(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)}i(K,H),K.prototype.convertTo=function(E){return this.imod(E.ushln(this.shift))},K.prototype.convertFrom=function(E){var _=this.imod(E.mul(this.rinv));return _.red=null,_},K.prototype.imul=function(E,_){if(E.isZero()||_.isZero())return E.words[0]=0,E.length=1,E;var O=E.imul(_),N=O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),k=O.isub(N).iushrn(this.shift),$=k;return k.cmp(this.m)>=0?$=k.isub(this.m):k.cmpn(0)<0&&($=k.iadd(this.m)),$._forceRed(this)},K.prototype.mul=function(E,_){if(E.isZero()||_.isZero())return new s(0)._forceRed(this);var O=E.mul(_),N=O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),k=O.isub(N).iushrn(this.shift),$=k;return k.cmp(this.m)>=0?$=k.isub(this.m):k.cmpn(0)<0&&($=k.iadd(this.m)),$._forceRed(this)},K.prototype.invm=function(E){var _=this.imod(E._invmp(this.m).mul(this.r2));return _._forceRed(this)}})(t,ul)})(X6);var sG=X6.exports;const Pe=Ps(sG),oG="logger/5.7.0";let ZA=!1,e4=!1;const Pv={debug:1,default:2,info:2,warning:3,error:4,off:5};let t4=Pv.default,Zw=null;function aG(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const r4=aG();var Cx;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(Cx||(Cx={}));var us;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(us||(us={}));const n4="0123456789abcdef";let ee=class Ir{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();Pv[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(t4>Pv[n])&&console.log.apply(console,r)}debug(...e){this._log(Ir.levels.DEBUG,e)}info(...e){this._log(Ir.levels.INFO,e)}warn(...e){this._log(Ir.levels.WARNING,e)}makeError(e,r,n){if(e4)return this.makeError("censored error",r,{});r||(r=Ir.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(c=>{const l=n[c];try{if(l instanceof Uint8Array){let u="";for(let f=0;f>4],u+=n4[l[f]&15];i.push(c+"=Uint8Array(0x"+u+")")}else i.push(c+"="+JSON.stringify(l))}catch{i.push(c+"="+JSON.stringify(n[c].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case us.NUMERIC_FAULT:{o="NUMERIC_FAULT";const c=e;switch(c){case"overflow":case"underflow":case"division-by-zero":o+="-"+c;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case us.CALL_EXCEPTION:case us.INSUFFICIENT_FUNDS:case us.MISSING_NEW:case us.NONCE_EXPIRED:case us.REPLACEMENT_UNDERPRICED:case us.TRANSACTION_REPLACED:case us.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(c){a[c]=n[c]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,Ir.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){r4&&this.throwError("platform missing String.prototype.normalize",Ir.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:r4})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Ir.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Ir.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,Ir.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Ir.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Ir.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Ir.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return Zw||(Zw=new Ir(oG)),Zw}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Ir.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),ZA){if(!e)return;this.globalLogger().throwError("error censorship permanent",Ir.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}e4=!!e,ZA=!!r}static setLogLevel(e){const r=Pv[e.toLowerCase()];if(r==null){Ir.globalLogger().warn("invalid log level - "+e);return}t4=r}static from(e){return new Ir(e)}};ee.errors=us;ee.levels=Cx;const cG="bytes/5.7.0",dr=new ee(cG);function AR(t){return!!t.toHexString}function uf(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return uf(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Wo(t){return je(t)&&!(t.length%2)||ca(t)}function i4(t){return typeof t=="number"&&t==t&&t%1===0}function ca(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!i4(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function re(t,e){if(e||(e={}),typeof t=="number"){dr.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),uf(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),AR(t)&&(t=t.toHexString()),je(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":dr.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ire(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),uf(n)}function to(t){let e=re(t);if(e.length===0)return e;let r=0;for(;re&&dr.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),uf(r)}function je(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const e2="0123456789abcdef";function te(t,e){if(e||(e={}),typeof t=="number"){dr.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=e2[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),AR(t))return t.toHexString();if(je(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":dr.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(ca(t)){let r="0x";for(let n=0;n>4]+e2[i&15]}return r}return dr.throwArgumentError("invalid hexlify value","value",t)}function lo(t){if(typeof t!="string")t=te(t);else if(!je(t)||t.length%2)return null;return(t.length-2)/2}function br(t,e,r){return typeof t!="string"?t=te(t):(!je(t)||t.length%2)&&dr.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Rn(t){let e="0x";return t.forEach(r=>{e+=te(r).substring(2)}),e}function Es(t){const e=_R(te(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function _R(t){typeof t!="string"&&(t=te(t)),je(t)||dr.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&dr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Xl(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Wo(t)){let r=re(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=te(r.slice(0,32)),e.s=te(r.slice(32,64))):r.length===65?(e.r=te(r.slice(0,32)),e.s=te(r.slice(32,64)),e.v=r[64]):dr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:dr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=te(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=Oh(re(e._vs),32);e._vs=te(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&dr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=te(i);e.s==null?e.s=o:e.s!==o&&dr.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?dr.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&dr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!je(e.r)?dr.throwArgumentError("signature missing or invalid r","signature",t):e.r=dt(e.r,32),e.s==null||!je(e.s)?dr.throwArgumentError("signature missing or invalid s","signature",t):e.s=dt(e.s,32);const r=re(e.s);r[0]>=128&&dr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=te(r);e._vs&&(je(e._vs)||dr.throwArgumentError("signature invalid _vs","signature",t),e._vs=dt(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&dr.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function lG(t){return t=Xl(t),te(qt([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}const PR="bignumber/5.7.0";var E0=Pe.BN;const xo=new ee(PR),t2={},s4=9007199254740991;function uG(t){return t!=null&&(J.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||je(t)||typeof t=="bigint"||ca(t))}let o4=!1;class J{constructor(e,r){e!==t2&&xo.throwError("cannot call constructor directly; use BigNumber.from",ee.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Wn(Qe(this).fromTwos(e))}toTwos(e){return Wn(Qe(this).toTwos(e))}abs(){return this._hex[0]==="-"?J.from(this._hex.substring(1)):this}add(e){return Wn(Qe(this).add(Qe(e)))}sub(e){return Wn(Qe(this).sub(Qe(e)))}div(e){return J.from(e).isZero()&&Pi("division-by-zero","div"),Wn(Qe(this).div(Qe(e)))}mul(e){return Wn(Qe(this).mul(Qe(e)))}mod(e){const r=Qe(e);return r.isNeg()&&Pi("division-by-zero","mod"),Wn(Qe(this).umod(r))}pow(e){const r=Qe(e);return r.isNeg()&&Pi("negative-power","pow"),Wn(Qe(this).pow(r))}and(e){const r=Qe(e);return(this.isNegative()||r.isNeg())&&Pi("unbound-bitwise-result","and"),Wn(Qe(this).and(r))}or(e){const r=Qe(e);return(this.isNegative()||r.isNeg())&&Pi("unbound-bitwise-result","or"),Wn(Qe(this).or(r))}xor(e){const r=Qe(e);return(this.isNegative()||r.isNeg())&&Pi("unbound-bitwise-result","xor"),Wn(Qe(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Pi("negative-width","mask"),Wn(Qe(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Pi("negative-width","shl"),Wn(Qe(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Pi("negative-width","shr"),Wn(Qe(this).shrn(e))}eq(e){return Qe(this).eq(Qe(e))}lt(e){return Qe(this).lt(Qe(e))}lte(e){return Qe(this).lte(Qe(e))}gt(e){return Qe(this).gt(Qe(e))}gte(e){return Qe(this).gte(Qe(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Qe(this).isZero()}toNumber(){try{return Qe(this).toNumber()}catch{Pi("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return xo.throwError("this platform does not support BigInt",ee.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?o4||(o4=!0,xo.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?xo.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",ee.errors.UNEXPECTED_ARGUMENT,{}):xo.throwError("BigNumber.toString does not accept parameters",ee.errors.UNEXPECTED_ARGUMENT,{})),Qe(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof J)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new J(t2,x0(e)):e.match(/^-?[0-9]+$/)?new J(t2,x0(new E0(e))):xo.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Pi("underflow","BigNumber.from",e),(e>=s4||e<=-s4)&&Pi("overflow","BigNumber.from",e),J.from(String(e));const r=e;if(typeof r=="bigint")return J.from(r.toString());if(ca(r))return J.from(te(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return J.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(je(n)||n[0]==="-"&&je(n.substring(1))))return J.from(n)}return xo.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function x0(t){if(typeof t!="string")return x0(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&xo.throwArgumentError("invalid hex","value",t),t=x0(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Wn(t){return J.from(x0(t))}function Qe(t){const e=J.from(t).toHexString();return e[0]==="-"?new E0("-"+e.substring(3),16):new E0(e.substring(2),16)}function Pi(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),xo.throwError(t,ee.errors.NUMERIC_FAULT,n)}function fG(t){return new E0(t,36).toString(16)}function dG(t){return new E0(t,16).toString(36)}const $n=new ee(PR),Rh={},TR=J.from(0),IR=J.from(-1);function OR(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),$n.throwError(t,ee.errors.NUMERIC_FAULT,i)}let $h="0";for(;$h.length<256;)$h+=$h;function Z6(t){if(typeof t!="number")try{t=J.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+$h.substring(0,t):$n.throwArgumentError("invalid decimal size","decimals",t)}function Tv(t,e){e==null&&(e=0);const r=Z6(e);t=J.from(t);const n=t.lt(TR);n&&(t=t.mul(IR));let i=t.mod(r).toString();for(;i.length2&&$n.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&OR("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.lengthe[o]==null?c:(typeof e[o]!==a&&$n.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&$n.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&$n.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new ff(Rh,r,n,i)}}class Yr{constructor(e,r,n,i){e!==Rh&&$n.throwError("cannot use FixedNumber constructor; use FixedNumber.from",ee.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&$n.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Fs(this._value,this.format.decimals),n=Fs(e._value,e.format.decimals);return Yr.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Fs(this._value,this.format.decimals),n=Fs(e._value,e.format.decimals);return Yr.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Fs(this._value,this.format.decimals),n=Fs(e._value,e.format.decimals);return Yr.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Fs(this._value,this.format.decimals),n=Fs(e._value,e.format.decimals);return Yr.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=Yr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(a4.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=Yr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(a4.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&$n.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=Yr.from("1"+$h.substring(0,e),this.format),i=hG.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&$n.throwArgumentError("invalid byte width","width",e);const r=J.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return dt(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Yr.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!uG(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),Yr.fromString(Tv(e,r),ff.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=ff.from(r),i=Fs(e,n.decimals);!n.signed&&i.lt(TR)&&OR("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=dt(s,n.width/8));const o=Tv(i,n.decimals);return new Yr(Rh,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=ff.from(r);if(re(e).length>n.width/8)throw new Error("overflow");let i=J.from(e);n.signed&&(i=i.fromTwos(n.width));const s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=Tv(i,n.decimals);return new Yr(Rh,s,o,n)}static from(e,r){if(typeof e=="string")return Yr.fromString(e,r);if(ca(e))return Yr.fromBytes(e,r);try{return Yr.fromValue(e,0,r)}catch(n){if(n.code!==ee.errors.INVALID_ARGUMENT)throw n}return $n.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const a4=Yr.from(1),hG=Yr.from("0.5"),pG="properties/5.7.0";var vG=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Rm=new ee(pG);function ie(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function vs(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function vt(t){return vG(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function e3(t,e){(!t||typeof t!="object")&&Rm.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||Rm.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function Vt(t){const e={};for(const r in t)e[r]=t[r];return e}const mG={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function RR(t){if(t==null||mG[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;rmi(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&ie(e,r,mi(n))}return e}return Rm.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function mi(t){return yG(t)}class k1{constructor(e){for(const r in e)this[r]=mi(e[r])}}const A1="abi/5.7.0",Ze=new ee(A1),Ml={};let c4={calldata:!0,memory:!0,storage:!0},gG={calldata:!0,memory:!0};function Op(t,e){if(t==="bytes"||t==="string"){if(c4[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&gG[e])return!0;return(c4[e]||e==="payable")&&Ze.throwArgumentError("invalid modifier","name",e),!1}function bG(t,e){let r=t;function n(a){Ze.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let c={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(c.indexed=!1),c}let s={type:"",name:"",state:{allowType:!0}},o=s;for(let a=0;aJSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==tt.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===tt.full?", ":",")+")"):r+=this.type,e!==tt.sighash&&(this.indexed===!0&&(r+=" indexed"),e===tt.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?Lr.fromString(e,r):Lr.fromObject(e)}static fromObject(e){return Lr.isParamType(e)?e:new Lr(Ml,{name:e.name||null,type:_u(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(Lr.fromObject):null})}static fromString(e,r){function n(i){return Lr.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(bG(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function C0(t,e){return xG(t).map(r=>Lr.fromString(r,e))}class Ys{constructor(e,r){e!==Ml&&Ze.throwError("use a static from method",ee.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Iv(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return Ys.isFragment(e)?e:typeof e=="string"?Ys.fromString(e):Ys.fromObject(e)}static fromObject(e){if(Ys.isFragment(e))return e;switch(e.type){case"function":return ps.fromObject(e);case"event":return Ks.fromObject(e);case"constructor":return hs.fromObject(e);case"error":return Io.fromObject(e);case"fallback":case"receive":return null}return Ze.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?Ks.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?ps.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?hs.fromString(e.trim()):e.split(" ")[0]==="error"?Io.fromString(e.substring(5).trim()):Ze.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class Ks extends Ys{format(e){if(e||(e=tt.sighash),tt[e]||Ze.throwArgumentError("invalid format type","format",e),e===tt.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==tt.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===tt.full?", ":",")+") ",e!==tt.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?Ks.fromString(e):Ks.fromObject(e)}static fromObject(e){if(Ks.isEventFragment(e))return e;e.type!=="event"&&Ze.throwArgumentError("invalid event object","value",e);const r={name:S0(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Lr.fromObject):[],type:"event"};return new Ks(Ml,r)}static fromString(e){let r=e.match(k0);r||Ze.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:Ze.warn("unknown modifier: "+i)}}),Ks.fromObject({name:r[1].trim(),anonymous:n,inputs:C0(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function $R(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&Ze.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||Ze.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=J.from(r[1]),r[0]):t}function MR(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function NR(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&Ze.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&Ze.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&Ze.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&Ze.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&Ze.throwArgumentError("unable to determine stateMutability","value",t),e}class hs extends Ys{format(e){if(e||(e=tt.sighash),tt[e]||Ze.throwArgumentError("invalid format type","format",e),e===tt.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===tt.sighash&&Ze.throwError("cannot format a constructor for sighash",ee.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===tt.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?hs.fromString(e):hs.fromObject(e)}static fromObject(e){if(hs.isConstructorFragment(e))return e;e.type!=="constructor"&&Ze.throwArgumentError("invalid constructor object","value",e);let r=NR(e);r.constant&&Ze.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Lr.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?J.from(e.gas):null};return new hs(Ml,n)}static fromString(e){let r={type:"constructor"};e=$R(e,r);let n=e.match(k0);return(!n||n[1].trim()!=="constructor")&&Ze.throwArgumentError("invalid constructor string","value",e),r.inputs=C0(n[2].trim(),!1),MR(n[3].trim(),r),hs.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class ps extends hs{format(e){if(e||(e=tt.sighash),tt[e]||Ze.throwArgumentError("invalid format type","format",e),e===tt.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==tt.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===tt.full?", ":",")+") ",e!==tt.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?ps.fromString(e):ps.fromObject(e)}static fromObject(e){if(ps.isFunctionFragment(e))return e;e.type!=="function"&&Ze.throwArgumentError("invalid function object","value",e);let r=NR(e);const n={type:e.type,name:S0(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(Lr.fromObject):[],outputs:e.outputs?e.outputs.map(Lr.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?J.from(e.gas):null};return new ps(Ml,n)}static fromString(e){let r={type:"function"};e=$R(e,r);let n=e.split(" returns ");n.length>2&&Ze.throwArgumentError("invalid function string","value",e);let i=n[0].match(k0);if(i||Ze.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&S0(r.name),r.inputs=C0(i[2],!1),MR(i[3].trim(),r),n.length>1){let s=n[1].match(k0);(s[1].trim()!=""||s[3].trim()!="")&&Ze.throwArgumentError("unexpected tokens","value",e),r.outputs=C0(s[2],!1)}else r.outputs=[];return ps.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function l4(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&Ze.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class Io extends Ys{format(e){if(e||(e=tt.sighash),tt[e]||Ze.throwArgumentError("invalid format type","format",e),e===tt.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==tt.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===tt.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?Io.fromString(e):Io.fromObject(e)}static fromObject(e){if(Io.isErrorFragment(e))return e;e.type!=="error"&&Ze.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:S0(e.name),inputs:e.inputs?e.inputs.map(Lr.fromObject):[]};return l4(new Io(Ml,r))}static fromString(e){let r={type:"error"},n=e.match(k0);return n||Ze.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&S0(r.name),r.inputs=C0(n[2],!1),l4(Io.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function _u(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const EG=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function S0(t){return(!t||!t.match(EG))&&Ze.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const k0=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function xG(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&t3.throwError("value out-of-bounds",ee.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=qt([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}}class $m{constructor(e,r,n,i){ie(this,"_data",re(e)),ie(this,"wordSize",r||32),ie(this,"_coerceFunc",n),ie(this,"allowLoose",i),this._offset=0}get data(){return te(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):$m.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:t3.throwError("data out-of-bounds",ee.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new $m(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return J.from(this.readBytes(this.wordSize))}}var LR={exports:{}};/** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.8.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT - */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=ul:s&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,c=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",l="0123456789abcdef".split(""),u=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],d=[1,256,65536,16777216],h=[6,1536,393216,100663296],p=[0,8,16,24],v=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],b=[224,256,384,512],y=[128,256],m=["hex","buffer","arrayBuffer","array","digest"],g={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(R){return Object.prototype.toString.call(R)==="[object Array]"}),c&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(R){return typeof R=="object"&&R.buffer&&R.buffer.constructor===ArrayBuffer});for(var S=function(R,U,W){return function(q){return new A(R,U,R).update(q)[W]()}},P=function(R,U,W){return function(q,Y){return new A(R,U,Y).update(q)[W]()}},T=function(R,U,W){return function(q,Y,X,Q){return E["cshake"+R].update(q,Y,X,Q)[W]()}},w=function(R,U,W){return function(q,Y,X,Q){return E["kmac"+R].update(q,Y,X,Q)[W]()}},I=function(R,U,W,q){for(var Y=0;Y>5,this.byteCount=this.blockCount<<2,this.outputBlocks=W>>5,this.extraBytes=(W&31)>>3;for(var q=0;q<50;++q)this.s[q]=0}A.prototype.update=function(R){if(this.finalized)throw new Error(r);var U,W=typeof R;if(W!=="string"){if(W==="object"){if(R===null)throw new Error(e);if(c&&R.constructor===ArrayBuffer)R=new Uint8Array(R);else if(!Array.isArray(R)&&(!c||!ArrayBuffer.isView(R)))throw new Error(e)}else throw new Error(e);U=!0}for(var q=this.blocks,Y=this.byteCount,X=R.length,Q=this.blockCount,Z=0,ae=this.s,se,ue;Z>2]|=R[Z]<>2]|=ue<>2]|=(192|ue>>6)<>2]|=(128|ue&63)<=57344?(q[se>>2]|=(224|ue>>12)<>2]|=(128|ue>>6&63)<>2]|=(128|ue&63)<>2]|=(240|ue>>18)<>2]|=(128|ue>>12&63)<>2]|=(128|ue>>6&63)<>2]|=(128|ue&63)<=Y){for(this.start=se-Y,this.block=q[Q],se=0;se>8,W=R&255;W>0;)Y.unshift(W),R=R>>8,W=R&255,++q;return U?Y.push(q):Y.unshift(q),this.update(Y),Y.length},A.prototype.encodeString=function(R){var U,W=typeof R;if(W!=="string"){if(W==="object"){if(R===null)throw new Error(e);if(c&&R.constructor===ArrayBuffer)R=new Uint8Array(R);else if(!Array.isArray(R)&&(!c||!ArrayBuffer.isView(R)))throw new Error(e)}else throw new Error(e);U=!0}var q=0,Y=R.length;if(U)q=Y;else for(var X=0;X=57344?q+=3:(Q=65536+((Q&1023)<<10|R.charCodeAt(++X)&1023),q+=4)}return q+=this.encode(q*8),this.update(R),q},A.prototype.bytepad=function(R,U){for(var W=this.encode(U),q=0;q>2]|=this.padding[U&3],this.lastByteIndex===this.byteCount)for(R[0]=R[W],U=1;U>4&15]+l[Z&15]+l[Z>>12&15]+l[Z>>8&15]+l[Z>>20&15]+l[Z>>16&15]+l[Z>>28&15]+l[Z>>24&15];X%R===0&&(V(U),Y=0)}return q&&(Z=U[Y],Q+=l[Z>>4&15]+l[Z&15],q>1&&(Q+=l[Z>>12&15]+l[Z>>8&15]),q>2&&(Q+=l[Z>>20&15]+l[Z>>16&15])),Q},A.prototype.arrayBuffer=function(){this.finalize();var R=this.blockCount,U=this.s,W=this.outputBlocks,q=this.extraBytes,Y=0,X=0,Q=this.outputBits>>3,Z;q?Z=new ArrayBuffer(W+1<<2):Z=new ArrayBuffer(Q);for(var ae=new Uint32Array(Z);X>8&255,Q[Z+2]=ae>>16&255,Q[Z+3]=ae>>24&255;X%R===0&&V(U)}return q&&(Z=X<<2,ae=U[Y],Q[Z]=ae&255,q>1&&(Q[Z+1]=ae>>8&255),q>2&&(Q[Z+2]=ae>>16&255)),Q};function D(R,U,W){A.call(this,R,U,W)}D.prototype=new A,D.prototype.finalize=function(){return this.encode(this.outputBits,!0),A.prototype.finalize.call(this)};var V=function(R){var U,W,q,Y,X,Q,Z,ae,se,ue,ot,Pe,Ae,at,xe,be,Kt,Te,Ie,Qt,Oe,Re,Yt,Me,$e,Jt,Ne,De,Xt,Le,Et,jc,xt,Ct,Uc,St,kt,zc,At,_t,Wc,Pt,Tt,Hc,It,Ot,qc,Rt,Mt,Vc,$t,Nt,Gc,Dt,Lt,Kc,Bt,Ft,ma,ya,ga,ba,wa;for(q=0;q<48;q+=2)Y=R[0]^R[10]^R[20]^R[30]^R[40],X=R[1]^R[11]^R[21]^R[31]^R[41],Q=R[2]^R[12]^R[22]^R[32]^R[42],Z=R[3]^R[13]^R[23]^R[33]^R[43],ae=R[4]^R[14]^R[24]^R[34]^R[44],se=R[5]^R[15]^R[25]^R[35]^R[45],ue=R[6]^R[16]^R[26]^R[36]^R[46],ot=R[7]^R[17]^R[27]^R[37]^R[47],Pe=R[8]^R[18]^R[28]^R[38]^R[48],Ae=R[9]^R[19]^R[29]^R[39]^R[49],U=Pe^(Q<<1|Z>>>31),W=Ae^(Z<<1|Q>>>31),R[0]^=U,R[1]^=W,R[10]^=U,R[11]^=W,R[20]^=U,R[21]^=W,R[30]^=U,R[31]^=W,R[40]^=U,R[41]^=W,U=Y^(ae<<1|se>>>31),W=X^(se<<1|ae>>>31),R[2]^=U,R[3]^=W,R[12]^=U,R[13]^=W,R[22]^=U,R[23]^=W,R[32]^=U,R[33]^=W,R[42]^=U,R[43]^=W,U=Q^(ue<<1|ot>>>31),W=Z^(ot<<1|ue>>>31),R[4]^=U,R[5]^=W,R[14]^=U,R[15]^=W,R[24]^=U,R[25]^=W,R[34]^=U,R[35]^=W,R[44]^=U,R[45]^=W,U=ae^(Pe<<1|Ae>>>31),W=se^(Ae<<1|Pe>>>31),R[6]^=U,R[7]^=W,R[16]^=U,R[17]^=W,R[26]^=U,R[27]^=W,R[36]^=U,R[37]^=W,R[46]^=U,R[47]^=W,U=ue^(Y<<1|X>>>31),W=ot^(X<<1|Y>>>31),R[8]^=U,R[9]^=W,R[18]^=U,R[19]^=W,R[28]^=U,R[29]^=W,R[38]^=U,R[39]^=W,R[48]^=U,R[49]^=W,at=R[0],xe=R[1],Ot=R[11]<<4|R[10]>>>28,qc=R[10]<<4|R[11]>>>28,De=R[20]<<3|R[21]>>>29,Xt=R[21]<<3|R[20]>>>29,ya=R[31]<<9|R[30]>>>23,ga=R[30]<<9|R[31]>>>23,Pt=R[40]<<18|R[41]>>>14,Tt=R[41]<<18|R[40]>>>14,Ct=R[2]<<1|R[3]>>>31,Uc=R[3]<<1|R[2]>>>31,be=R[13]<<12|R[12]>>>20,Kt=R[12]<<12|R[13]>>>20,Rt=R[22]<<10|R[23]>>>22,Mt=R[23]<<10|R[22]>>>22,Le=R[33]<<13|R[32]>>>19,Et=R[32]<<13|R[33]>>>19,ba=R[42]<<2|R[43]>>>30,wa=R[43]<<2|R[42]>>>30,Dt=R[5]<<30|R[4]>>>2,Lt=R[4]<<30|R[5]>>>2,St=R[14]<<6|R[15]>>>26,kt=R[15]<<6|R[14]>>>26,Te=R[25]<<11|R[24]>>>21,Ie=R[24]<<11|R[25]>>>21,Vc=R[34]<<15|R[35]>>>17,$t=R[35]<<15|R[34]>>>17,jc=R[45]<<29|R[44]>>>3,xt=R[44]<<29|R[45]>>>3,Me=R[6]<<28|R[7]>>>4,$e=R[7]<<28|R[6]>>>4,Kc=R[17]<<23|R[16]>>>9,Bt=R[16]<<23|R[17]>>>9,zc=R[26]<<25|R[27]>>>7,At=R[27]<<25|R[26]>>>7,Qt=R[36]<<21|R[37]>>>11,Oe=R[37]<<21|R[36]>>>11,Nt=R[47]<<24|R[46]>>>8,Gc=R[46]<<24|R[47]>>>8,Hc=R[8]<<27|R[9]>>>5,It=R[9]<<27|R[8]>>>5,Jt=R[18]<<20|R[19]>>>12,Ne=R[19]<<20|R[18]>>>12,Ft=R[29]<<7|R[28]>>>25,ma=R[28]<<7|R[29]>>>25,_t=R[38]<<8|R[39]>>>24,Wc=R[39]<<8|R[38]>>>24,Re=R[48]<<14|R[49]>>>18,Yt=R[49]<<14|R[48]>>>18,R[0]=at^~be&Te,R[1]=xe^~Kt&Ie,R[10]=Me^~Jt&De,R[11]=$e^~Ne&Xt,R[20]=Ct^~St&zc,R[21]=Uc^~kt&At,R[30]=Hc^~Ot&Rt,R[31]=It^~qc&Mt,R[40]=Dt^~Kc&Ft,R[41]=Lt^~Bt&ma,R[2]=be^~Te&Qt,R[3]=Kt^~Ie&Oe,R[12]=Jt^~De&Le,R[13]=Ne^~Xt&Et,R[22]=St^~zc&_t,R[23]=kt^~At&Wc,R[32]=Ot^~Rt&Vc,R[33]=qc^~Mt&$t,R[42]=Kc^~Ft&ya,R[43]=Bt^~ma&ga,R[4]=Te^~Qt&Re,R[5]=Ie^~Oe&Yt,R[14]=De^~Le&jc,R[15]=Xt^~Et&xt,R[24]=zc^~_t&Pt,R[25]=At^~Wc&Tt,R[34]=Rt^~Vc&Nt,R[35]=Mt^~$t&Gc,R[44]=Ft^~ya&ba,R[45]=ma^~ga&wa,R[6]=Qt^~Re&at,R[7]=Oe^~Yt&xe,R[16]=Le^~jc&Me,R[17]=Et^~xt&$e,R[26]=_t^~Pt&Ct,R[27]=Wc^~Tt&Uc,R[36]=Vc^~Nt&Hc,R[37]=$t^~Gc&It,R[46]=ya^~ba&Dt,R[47]=ga^~wa&Lt,R[8]=Re^~at&be,R[9]=Yt^~xe&Kt,R[18]=jc^~Me&Jt,R[19]=xt^~$e&Ne,R[28]=Pt^~Ct&St,R[29]=Tt^~Uc&kt,R[38]=Nt^~Hc&Ot,R[39]=Gc^~It&qc,R[48]=ba^~Dt&Kc,R[49]=wa^~Lt&Bt,R[0]^=v[q],R[1]^=v[q+1]};if(a)t.exports=E;else for(O=0;O<_.length;++O)i[_[O]]=E[_[O]]})()})(AR);var GV=AR.exports;const KV=ks(GV);function Be(t){return"0x"+KV.keccak_256(re(t))}const QV="rlp/5.7.0",js=new ee(QV);function e4(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function t4(t,e,r){let n=0;for(let i=0;ie+1+n&&js.throwError("child data too short",ee.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function PR(t,e){if(t.length===0&&js.throwError("data too short",ee.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&js.throwError("data short segment too short",ee.errors.BUFFER_OVERRUN,{});const n=t4(t,e+1,r);return e+1+r+n>t.length&&js.throwError("data long segment too short",ee.errors.BUFFER_OVERRUN,{}),r4(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&js.throwError("data array too short",ee.errors.BUFFER_OVERRUN,{}),r4(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&js.throwError("data array too short",ee.errors.BUFFER_OVERRUN,{});const n=t4(t,e+1,r);e+1+r+n>t.length&&js.throwError("data array too short",ee.errors.BUFFER_OVERRUN,{});const i=te(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&js.throwError("data too short",ee.errors.BUFFER_OVERRUN,{});const n=te(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:te(t[e])}}function gg(t){const e=re(t),r=PR(e,0);return r.consumed!==e.length&&js.throwArgumentError("invalid rlp data","data",t),r.result}const YV=Object.freeze(Object.defineProperty({__proto__:null,decode:gg,encode:$l},Symbol.toStringTag,{value:"Module"})),JV="address/5.7.0",ja=new ee(JV);function n4(t){Fe(t,20)||ja.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=re(Be(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const XV=9007199254740991;function ZV(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const K6={};for(let t=0;t<10;t++)K6[String(t)]=String(t);for(let t=0;t<26;t++)K6[String.fromCharCode(65+t)]=String(10+t);const i4=Math.floor(ZV(XV));function TR(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>K6[n]).join("");for(;e.length>=i4;){let n=e.substring(0,i4);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function qe(t){let e=null;if(typeof t!="string"&&ja.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=n4(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&ja.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==TR(t)&&ja.throwArgumentError("bad icap checksum","address",t),e=NV(t.substring(4));e.length<40;)e="0"+e;e=n4("0x"+e)}else ja.throwArgumentError("invalid address","address",t);return e}function IR(t){try{return qe(t),!0}catch{}return!1}function eG(t){let e=DV(qe(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+TR("XE00"+e)+e}function Q6(t){let e=null;try{e=qe(t.from)}catch{ja.throwArgumentError("missing from address","transaction",t)}const r=eo(re(J.from(t.nonce).toHexString()));return qe(br(Be($l([e,r])),12))}function tG(t,e,r){return co(e)!==32&&ja.throwArgumentError("salt must be 32 bytes","salt",e),co(r)!==32&&ja.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),qe(br(Be(qt(["0xff",qe(t),e,r])),12))}class rG extends ca{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=qe(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return qe(dt(e.readValue().toHexString(),20))}}class nG extends ca{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}const qu=new ee(C1);function OR(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(l=>{const u=l.localName;return u||qu.throwError("cannot encode object for signature with missing names",ee.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),c[u]&&qu.throwError("cannot encode object for signature with duplicate names",ee.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),c[u]=!0,r[u]})}else qu.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&qu.throwArgumentError("types/value length mismatch","tuple",r);let i=new yx(t.wordSize),s=new yx(t.wordSize),o=[];e.forEach((c,l)=>{let u=n[l];if(c.dynamic){let f=s.length;c.encode(s,u);let d=i.writeUpdatableValue();o.push(h=>{d(h+f)})}else c.encode(i,u)}),o.forEach(c=>{c(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function RR(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readValue(),c=n.subReader(a.toNumber());try{o=s.decode(c)}catch(l){if(l.code===ee.errors.BUFFER_OVERRUN)throw l;o=l,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(a.code===ee.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}o!=null&&r.push(o)});const i=e.reduce((s,o)=>{const a=o.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});e.forEach((s,o)=>{let a=s.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const c=r[o];c instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw c}}):r[a]=c});for(let s=0;s{throw o}})}return Object.freeze(r)}class iG extends ca{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&qu.throwError("insufficient data length",ee.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i>6===2;o++)s++;return s}return t===Vn.OVERRUN?r.length-e-1:0}function pG(t,e,r,n,i){return t===Vn.OVERLONG?(n.push(i),0):(n.push(65533),LR(t,e,r))}const BR=Object.freeze({error:hG,ignore:LR,replace:pG});function Y6(t,e){e==null&&(e=BR.error),t=re(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(Vn.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(Vn.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(Vn.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let c=0;c1114111){n+=e(Vn.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(Vn.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(Vn.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function wt(t,e=Ho.current){e!=Ho.current&&(DR.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return re(r)}function Qw(t){const e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function vG(t,e){return'"'+Y6(t,e).map(r=>{if(r<256){switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(r>=32&&r<127)return String.fromCharCode(r)}return r<=65535?Qw(r):(r-=65536,Qw((r>>10&1023)+55296)+Qw((r&1023)+56320))}).join("")+'"'}function gx(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function la(t,e){return gx(Y6(t,e))}function Im(t,e=Ho.current){return Y6(wt(t,e))}function mG(t){const e=wt(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return te(qt([e,Tm]).slice(0,32))}function yG(t){const e=re(t);if(e.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(e[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;e[r-1]===0;)r--;return la(e.slice(0,r))}function gG(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r{let s=i.split(":");r+=parseInt(s[0],16),n[r]=e(s[1])}),n}function FR(t){let e=0;return t.split(",").map(r=>{let n=r.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let i=e+parseInt(n[0],16);return e=parseInt(n[1],16),{l:i,h:e}})}function X6(t,e){let r=0;for(let n=0;n=r&&t<=r+i.h&&(t-r)%(i.d||1)===0){if(i.e&&i.e.indexOf(t-r)!==-1)continue;return i}}return null}const bG=FR("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"),wG="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),EG=[{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}],xG=J6("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"),CG=J6("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"),SG=J6("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",gG),kG=FR("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function AG(t){return t.reduce((e,r)=>(r.forEach(n=>{e.push(n)}),e),[])}function _G(t){return!!X6(t,bG)}function PG(t){let e=X6(t,EG);if(e)return[t+e.s];let r=xG[t];if(r)return r;let n=CG[t];if(n)return[t+n[0]];let i=SG[t];return i||null}function TG(t){return!!X6(t,kG)}function IG(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();let e=Im(t);e=AG(e.map(n=>{if(wG.indexOf(n)>=0)return[];if(n>=65024&&n<=65039)return[];let i=PG(n);return i||[n]})),e=Im(gx(e),Ho.NFKC),e.forEach(n=>{if(TG(n))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),e.forEach(n=>{if(_G(n))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let r=gx(e);if(r.substring(0,1)==="-"||r.substring(2,4)==="--"||r.substring(r.length-1)==="-")throw new Error("invalid hyphen");return r}class OG extends MR{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,wt(r))}decode(e){return la(super.decode(e))}}class _p extends ca{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return OR(e,this.coders,r)}decode(e){return e.coerce(this.name,RR(e,this.coders))}}const Pp=new ee(C1),RG=new RegExp(/^bytes([0-9]*)$/),MG=new RegExp(/^(u?int)([0-9]*)$/);class Z6{constructor(e){ie(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new rG(e.name);case"bool":return new sG(e.name);case"string":return new OG(e.name);case"bytes":return new oG(e.name);case"array":return new iG(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new _p((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new cG(e.name)}let r=e.type.match(MG);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&Pp.throwArgumentError("invalid "+r[1]+" bit length","param",e),new fG(n/8,r[1]==="int",e.name)}if(r=e.type.match(RG),r){let n=parseInt(r[1]);return(n===0||n>32)&&Pp.throwArgumentError("invalid bytes length","param",e),new aG(n,e.name)}return Pp.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new Pm(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new yx(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(Nr.from(i)));return new _p(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&Pp.throwError("types/values length mismatch",ee.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(o=>this._getCoder(Nr.from(o))),i=new _p(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>this._getCoder(Nr.from(o)));return new _p(i,"_").decode(this._getReader(re(r),n))}}const Bn=new Z6;function Ua(t){return Be(wt(t))}const jR="hash/5.7.0";function e3(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function NG(t){const e={};for(let r=0;r>--c&1}const f=31,d=Math.pow(2,f),h=d>>>1,p=h>>1,v=d-1;let b=0;for(let P=0;P1;){let j=T+w>>>1;P>>1|u(),I=I<<1^h,B=(B^h)<<1|h|1;m=I,g=1+B-I}let S=n-4;return y.map(P=>{switch(P-S){case 3:return S+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return S+256+(t[a++]<<8|t[a++]);case 1:return S+t[a++];default:return P-1}})}function LG(t){let e=0;return()=>t[e++]}function BG(t){return LG(DG(t))}function FG(t){return t&1?~t>>1:t>>1}function jG(t,e){let r=Array(t);for(let n=0;ne[o]):r}function zG(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(HG(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(qG(r,t))}return NG(UR(e))}function WG(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function zR(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(s));return n}function HG(t,e){let r=1+e(),n=e(),i=WG(e),s=zR(i.length,1+t,e);return UR(s.map((o,a)=>{const c=o[0],l=o.slice(1);return Array(i[a]).fill(void 0).map((u,f)=>{let d=f*n;return[c+f*r,l.map(h=>h+d)]})}))}function qG(t,e){let r=1+e();return zR(r,1+t,e).map(i=>[i[0],i.slice(1)])}function VG(t){let e=Om(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let l=Om(t,e);if(l.length==0)break;n.push({set:new Set(l),node:r()})}n.sort((l,u)=>u.set.size-l.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,c=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:c}}}function GG(){return BG(e3("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=="))}const bg=GG(),KG=new Set(Om(bg)),QG=new Set(Om(bg)),YG=zG(bg),JG=VG(bg),o4=45,a4=95;function WR(t){return Im(t)}function XG(t){return t.filter(e=>e!=65039)}function HR(t){for(let e of t.split(".")){let r=WR(e);try{for(let n=r.lastIndexOf(a4)-1;n>=0;n--)if(r[n]!==a4)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===o4&&r[3]===o4)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function ZG(t){return HR(eK(t,XG))}function eK(t,e){let r=WR(t).reverse(),n=[];for(;r.length;){let i=rK(r);if(i){n.push(...e(i));continue}let s=r.pop();if(KG.has(s)){n.push(s);continue}if(QG.has(s))continue;let o=YG[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return HR(tK(String.fromCodePoint(...n)))}function tK(t){return t.normalize("NFC")}function rK(t,e){var r;let n=JG,i,s,o=[],a=t.length;for(e&&(e.length=0);a;){let c=t[--a];if(n=(r=n.branches.find(l=>l.set.has(c)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=c;else if(n.check&&c===s)break;o.push(c),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const nK=new ee(jR),qR=new Uint8Array(32);qR.fill(0);function c4(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function r3(t){const e=wt(ZG(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(c4(e.slice(n))),r}function iK(t){try{return r3(t).length!==0}catch{}return!1}function Ih(t){typeof t!="string"&&nK.throwArgumentError("invalid ENS name; not a string","name",t);let e=qR;const r=r3(t);for(;r.length;)e=Be(qt([e,Be(r.pop())]));return te(e)}function VR(t){return te(qt(r3(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}const sK=`Ethereum Signed Message: -`;function n3(t){return typeof t=="string"&&(t=wt(t)),Be(qt([wt(sK),wt(String(t.length)),t]))}var oK=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const nr=new ee(jR),GR=new Uint8Array(32);GR.fill(0);const aK=J.from(-1),KR=J.from(0),QR=J.from(1),cK=J.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function lK(t){const e=re(t),r=e.length%32;return r?Rn([e,GR.slice(r)]):te(e)}const uK=dt(QR.toHexString(),32),fK=dt(KR.toHexString(),32),l4={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Yw=["name","version","chainId","verifyingContract","salt"];function u4(t){return function(e){return typeof e!="string"&&nr.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const dK={name:u4("name"),version:u4("version"),chainId:function(t){try{return J.from(t).toString()}catch{}return nr.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return qe(t).toLowerCase()}catch{}return nr.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=re(t);if(e.length!==32)throw new Error("bad length");return te(e)}catch{}return nr.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Jw(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&nr.throwArgumentError("invalid numeric width","type",t);const i=cK.mask(r?n-1:n),s=r?i.add(QR).mul(aK):KR;return function(o){const a=J.from(o);return(a.lt(s)||a.gt(i))&&nr.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),dt(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&nr.throwArgumentError("invalid bytes width","type",t),function(n){return re(n).length!==r&&nr.throwArgumentError(`invalid length for ${t}`,"value",n),lK(n)}}}switch(t){case"address":return function(e){return dt(qe(e),32)};case"bool":return function(e){return e?uK:fK};case"bytes":return function(e){return Be(e)};case"string":return function(e){return Ua(e)}}return null}function f4(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class Wr{constructor(e){ie(this,"types",Object.freeze(vi(e))),ie(this,"_encoderCache",{}),ie(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const c={};e[a].forEach(l=>{c[l.name]&&nr.throwArgumentError(`duplicate variable name ${JSON.stringify(l.name)} in ${JSON.stringify(a)}`,"types",e),c[l.name]=!0;const u=l.type.match(/^([^\x5b]*)(\x5b|$)/)[1];u===a&&nr.throwArgumentError(`circular type reference to ${JSON.stringify(u)}`,"types",e),!Jw(u)&&(n[u]||nr.throwArgumentError(`unknown type ${JSON.stringify(u)}`,"types",e),n[u].push(a),r[a][u]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?nr.throwArgumentError("missing primary type","types",e):s.length>1&&nr.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),ie(this,"primaryType",s[0]);function o(a,c){c[a]&&nr.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),c[a]=!0,Object.keys(r[a]).forEach(l=>{n[l]&&(o(l,c),Object.keys(c).forEach(u=>{i[u][l]=!0}))}),delete c[a]}o(this.primaryType,{});for(const a in i){const c=Object.keys(i[a]);c.sort(),this._types[a]=f4(a,e[a])+c.map(l=>f4(l,e[l])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=Jw(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&nr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let c=a.map(s);return this._types[i]&&(c=c.map(Be)),Be(Rn(c))}}const n=this.types[e];if(n){const i=Ua(this._types[e]);return s=>{const o=n.map(({name:a,type:c})=>{const l=this.getEncoder(c)(s[a]);return this._types[c]?Be(l):l});return o.unshift(i),Rn(o)}}return nr.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||nr.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return Be(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(Jw(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&nr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(c=>this._visit(o,c,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,r[a],n),o),{}):nr.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Wr(e)}static getPrimaryType(e){return Wr.from(e).primaryType}static hashStruct(e,r,n){return Wr.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=l4[n];i||nr.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>Yw.indexOf(n.name)-Yw.indexOf(i.name)),Wr.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Rn(["0x1901",Wr.hashDomain(e),Wr.from(r).hash(n)])}static hash(e,r,n){return Be(Wr.encode(e,r,n))}static resolveNames(e,r,n,i){return oK(this,void 0,void 0,function*(){e=Vt(e);const s={};e.verifyingContract&&!Fe(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=Wr.from(r);o.visit(n,(a,c)=>(a==="address"&&!Fe(c,20)&&(s[c]="0x"),c));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&s[c]?s[c]:c),{domain:e,value:n}})}static getPayload(e,r,n){Wr.hashDomain(e);const i={},s=[];Yw.forEach(c=>{const l=e[c];l!=null&&(i[c]=dK[c](l),s.push({name:c,type:l4[c]}))});const o=Wr.from(r),a=Vt(r);return a.EIP712Domain?nr.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(c,l)=>{if(c.match(/^bytes(\d*)/))return te(re(l));if(c.match(/^u?int/))return J.from(l).toString();switch(c){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return typeof l!="string"&&nr.throwArgumentError("invalid string","value",l),l}return nr.throwArgumentError("unsupported type","type",c)})}}}const rr=new ee(C1);class YR extends x1{}class JR extends x1{}class hK extends x1{}class Rm extends x1{static isIndexed(e){return!!(e&&e._isIndexed)}}const pK={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function d4(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class Br{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,ie(this,"fragments",r.map(n=>Qs.from(n)).filter(n=>n!=null)),ie(this,"_abiCoder",hs(new.target,"getAbiCoder")()),ie(this,"functions",{}),ie(this,"errors",{}),ie(this,"events",{}),ie(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){rr.warn("duplicate definition - constructor");return}ie(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let s=n.format();if(i[s]){rr.warn("duplicate definition - "+s);return}i[s]=n}),this.deploy||ie(this,"deploy",fs.from({payable:!1,type:"constructor"})),ie(this,"_isInterface",!0)}format(e){e||(e=et.full),e===et.sighash&&rr.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===et.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return Bn}static getAddress(e){return qe(e)}static getSighash(e){return br(Ua(e.format()),0,4)}static getEventTopic(e){return Ua(e.format())}getFunction(e){if(Fe(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];rr.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(s=>s.split("(")[0]===n);return i.length===0?rr.throwArgumentError("no matching function","name",n):i.length>1&&rr.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[ds.fromString(e).format()];return r||rr.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(Fe(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];rr.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(s=>s.split("(")[0]===n);return i.length===0?rr.throwArgumentError("no matching event","name",n):i.length>1&&rr.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[Vs.fromString(e).format()];return r||rr.throwArgumentError("no matching event","signature",e),r}getError(e){if(Fe(e)){const n=hs(this.constructor,"getSighash");for(const i in this.errors){const s=this.errors[i];if(e===n(s))return this.errors[i]}rr.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(s=>s.split("(")[0]===n);return i.length===0?rr.throwArgumentError("no matching error","name",n):i.length>1&&rr.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[ds.fromString(e).format()];return r||rr.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return hs(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),hs(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=re(r);return te(n.slice(0,4))!==this.getSighash(e)&&rr.throwArgumentError(`data signature does not match error ${e.name}.`,"data",te(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),te(qt([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=re(r);return te(n.slice(0,4))!==this.getSighash(e)&&rr.throwArgumentError(`data signature does not match function ${e.name}.`,"data",te(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),te(qt([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=re(r),i=null,s="",o=null,a=null,c=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const l=te(n.slice(0,4)),u=pK[l];if(u)o=this._abiCoder.decode(u.inputs,n.slice(4)),a=u.name,c=u.signature,u.reason&&(i=o[0]),a==="Error"?s=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:a==="Panic"&&(s=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const f=this.getError(l);o=this._abiCoder.decode(f.inputs,n.slice(4)),a=f.name,c=f.format()}catch{}break}}return rr.throwError("call revert exception"+s,ee.errors.CALL_EXCEPTION,{method:e.format(),data:te(r),errorArgs:o,errorName:a,errorSignature:c,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),te(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&rr.throwError("too many arguments for "+e.format(),ee.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(s,o)=>s.type==="string"?Ua(o):s.type==="bytes"?Be(te(o)):(s.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),s.type.match(/^u?int/)&&(o=J.from(o).toHexString()),s.type==="address"&&this._abiCoder.encode(["address"],[o]),dt(te(o),32));for(r.forEach((s,o)=>{let a=e.inputs[o];if(!a.indexed){s!=null&&rr.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?rr.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(c=>i(a,c))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],s=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&rr.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const c=r[a];if(o.indexed)if(o.type==="string")n.push(Ua(c));else if(o.type==="bytes")n.push(Be(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([o.type],[c]))}else i.push(o),s.push(c)}),{data:this._abiCoder.encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let d=this.getEventTopic(e);(!Fe(n[0],32)||n[0].toLowerCase()!==d)&&rr.throwError("fragment/topic mismatch",ee.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:d,value:n[0]}),n=n.slice(1)}let i=[],s=[],o=[];e.inputs.forEach((d,h)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(Nr.fromObject({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(s.push(d),o.push(!1))});let a=n!=null?this._abiCoder.decode(i,qt(n)):null,c=this._abiCoder.decode(s,r,!0),l=[],u=0,f=0;e.inputs.forEach((d,h)=>{if(d.indexed)if(a==null)l[h]=new Rm({_isIndexed:!0,hash:null});else if(o[h])l[h]=new Rm({_isIndexed:!0,hash:a[f++]});else try{l[h]=a[f++]}catch(p){l[h]=p}else try{l[h]=c[u++]}catch(p){l[h]=p}if(d.name&&l[d.name]==null){const p=l[h];p instanceof Error?Object.defineProperty(l,d.name,{enumerable:!0,get:()=>{throw d4(`property ${JSON.stringify(d.name)}`,p)}}):l[d.name]=p}});for(let d=0;d{throw d4(`index ${d}`,h)}})}return Object.freeze(l)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new JR({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:J.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new YR({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=te(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new hK({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}}const vK="abstract-provider/5.7.0";var mK=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const yK=new ee(vK);class gK extends x1{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class Tc{constructor(){yK.checkAbstract(new.target,Tc),ie(this,"_isProvider",!0)}getFeeData(){return mK(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield vt({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=J.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const bK="abstract-signer/5.7.0";var Zi=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Pi=new ee(bK),wK=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],EK=[ee.errors.INSUFFICIENT_FUNDS,ee.errors.NONCE_EXPIRED,ee.errors.REPLACEMENT_UNDERPRICED];let Nl=class XR{constructor(){Pi.checkAbstract(new.target,XR),ie(this,"_isSigner",!0)}getBalance(e){return Zi(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Zi(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Zi(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield vt(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return Zi(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield vt(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return Zi(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return Zi(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Zi(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Zi(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Zi(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)wK.indexOf(n)===-1&&Pi.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=Vt(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&Pi.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return Zi(this,void 0,void 0,function*(){const r=yield vt(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>Zi(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&Pi.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?Pi.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&Pi.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&Pi.throwError("network does not support EIP-1559",ee.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):Pi.throwError("failed to get consistent fee data",ee.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(EK.indexOf(i.code)>=0)throw i;return Pi.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ee.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&Pi.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield vt(r)})}_checkProvider(e){this.provider||Pi.throwError("missing provider",ee.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}};class i3 extends Nl{constructor(e,r){super(),ie(this,"address",e),ie(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{Pi.throwError(e,ee.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new i3(this.address,e)}}var ZR={},Ye={},S1=eM;function eM(t,e){if(!t)throw new Error(e||"Assertion failed")}eM.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var bx={exports:{}};typeof Object.create=="function"?bx.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:bx.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var xK=bx.exports,CK=S1,SK=xK;Ye.inherits=SK;function kK(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function AK(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):kK(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Ye.htonl=tM;function PK(t,e){for(var r="",n=0;n>>0}return s}Ye.join32=TK;function IK(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}Ye.split32=IK;function OK(t,e){return t>>>e|t<<32-e}Ye.rotr32=OK;function RK(t,e){return t<>>32-e}Ye.rotl32=RK;function MK(t,e){return t+e>>>0}Ye.sum32=MK;function $K(t,e,r){return t+e+r>>>0}Ye.sum32_3=$K;function NK(t,e,r,n){return t+e+r+n>>>0}Ye.sum32_4=NK;function DK(t,e,r,n,i){return t+e+r+n+i>>>0}Ye.sum32_5=DK;function LK(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}Ye.sum64=LK;function BK(t,e,r,n){var i=e+n>>>0,s=(i>>0}Ye.sum64_hi=BK;function FK(t,e,r,n){var i=e+n;return i>>>0}Ye.sum64_lo=FK;function jK(t,e,r,n,i,s,o,a){var c=0,l=e;l=l+n>>>0,c+=l>>0,c+=l>>0,c+=l>>0}Ye.sum64_4_hi=jK;function UK(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}Ye.sum64_4_lo=UK;function zK(t,e,r,n,i,s,o,a,c,l){var u=0,f=e;f=f+n>>>0,u+=f>>0,u+=f>>0,u+=f>>0,u+=f>>0}Ye.sum64_5_hi=zK;function WK(t,e,r,n,i,s,o,a,c,l){var u=e+n+s+a+l;return u>>>0}Ye.sum64_5_lo=WK;function HK(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}Ye.rotr64_hi=HK;function qK(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Ye.rotr64_lo=qK;function VK(t,e,r){return t>>>r}Ye.shr64_hi=VK;function GK(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Ye.shr64_lo=GK;var td={},h4=Ye,KK=S1;function wg(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}td.BlockHash=wg;wg.prototype.update=function(e,r){if(e=h4.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=h4.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}go.g0_256=ZK;function eQ(t){return to(t,17)^to(t,19)^t>>>10}go.g1_256=eQ;var Tf=Ye,tQ=td,rQ=go,Xw=Tf.rotl32,Wd=Tf.sum32,nQ=Tf.sum32_5,iQ=rQ.ft_1,aM=tQ.BlockHash,sQ=[1518500249,1859775393,2400959708,3395469782];function lo(){if(!(this instanceof lo))return new lo;aM.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Tf.inherits(lo,aM);var oQ=lo;lo.blockSize=512;lo.outSize=160;lo.hmacStrength=80;lo.padLength=64;lo.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),GQ(e.length<=this.blockSize);for(var r=e.length;r>8,d=u&255;f?c.push(f,d):c.push(d)}return c}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",c=0;c(d>>1)-1?v=(d>>1)-b:v=b,h.isubn(v)):v=0,f[p]=v,h.iushrn(1)}return f}r.getNAF=n;function i(c,l){var u=[[],[]];c=c.clone(),l=l.clone();for(var f=0,d=0,h;c.cmpn(-f)>0||l.cmpn(-d)>0;){var p=c.andln(3)+f&3,v=l.andln(3)+d&3;p===3&&(p=-1),v===3&&(v=-1);var b;p&1?(h=c.andln(7)+f&7,(h===3||h===5)&&v===2?b=-p:b=p):b=0,u[0].push(b);var y;v&1?(h=l.andln(7)+d&7,(h===3||h===5)&&p===2?y=-v:y=v):y=0,u[1].push(y),2*f===b+1&&(f=1-f),2*d===y+1&&(d=1-d),c.iushrn(1),l.iushrn(1)}return u}r.getJSF=i;function s(c,l,u){var f="_"+l;c.prototype[l]=function(){return this[f]!==void 0?this[f]:this[f]=u.call(this)}}r.cachedProperty=s;function o(c){return typeof c=="string"?r.toArray(c,"hex"):c}r.parseBytes=o;function a(c){return new _e(c,"hex","le")}r.intFromLE=a}),Mm=Ci.getNAF,YQ=Ci.getJSF,$m=Ci.assert;function Ic(t,e){this.type=t,this.p=new _e(e.p,16),this.red=e.prime?_e.red(e.prime):_e.mont(this.p),this.zero=new _e(0).toRed(this.red),this.one=new _e(1).toRed(this.red),this.two=new _e(2).toRed(this.red),this.n=e.n&&new _e(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Xl=Ic;Ic.prototype.point=function(){throw new Error("Not implemented")};Ic.prototype.validate=function(){throw new Error("Not implemented")};Ic.prototype._fixedNafMul=function(e,r){$m(e.precomputed);var n=e._getDoubles(),i=Mm(r,1,this._bitLength),s=(1<=a;l--)c=(c<<1)+i[l];o.push(c)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=s;d>0;d--){for(a=0;a=0;c--){for(var l=0;c>=0&&o[c]===0;c--)l++;if(c>=0&&l++,a=a.dblp(l),c<0)break;var u=o[c];$m(u!==0),e.type==="affine"?u>0?a=a.mixedAdd(s[u-1>>1]):a=a.mixedAdd(s[-u-1>>1].neg()):u>0?a=a.add(s[u-1>>1]):a=a.add(s[-u-1>>1].neg())}return e.type==="affine"?a.toP():a};Ic.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,u,f,d;for(u=0;u=1;u-=2){var p=u-1,v=u;if(o[p]!==1||o[v]!==1){c[p]=Mm(n[p],o[p],this._bitLength),c[v]=Mm(n[v],o[v],this._bitLength),l=Math.max(c[p].length,l),l=Math.max(c[v].length,l);continue}var b=[r[p],null,null,r[v]];r[p].y.cmp(r[v].y)===0?(b[1]=r[p].add(r[v]),b[2]=r[p].toJ().mixedAdd(r[v].neg())):r[p].y.cmp(r[v].y.redNeg())===0?(b[1]=r[p].toJ().mixedAdd(r[v]),b[2]=r[p].add(r[v].neg())):(b[1]=r[p].toJ().mixedAdd(r[v]),b[2]=r[p].toJ().mixedAdd(r[v].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],m=YQ(n[p],n[v]);for(l=Math.max(m[0].length,l),c[p]=new Array(l),c[v]=new Array(l),f=0;f=0;u--){for(var w=0;u>=0;){var I=!0;for(f=0;f=0&&w++,P=P.dblp(w),u<0)break;for(f=0;f0?d=a[f][B-1>>1]:B<0&&(d=a[f][-B-1>>1].neg()),d.type==="affine"?P=P.mixedAdd(d):P=P.add(d))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};Gi.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(h=l,p=u),f.negative&&(f=f.neg(),d=d.neg()),h.negative&&(h=h.neg(),p=p.neg()),[{a:f,b:d},{a:h,b:p}]};Ki.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),l=s.mul(n.b),u=o.mul(i.b),f=e.sub(a).sub(c),d=l.add(u).neg();return{k1:f,k2:d}};Ki.prototype.pointFromX=function(e,r){e=new _e(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};Ki.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};Ki.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};Kr.prototype.isInfinity=function(){return this.inf};Kr.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};Kr.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};Kr.prototype.getX=function(){return this.x.fromRed()};Kr.prototype.getY=function(){return this.y.fromRed()};Kr.prototype.mul=function(e){return e=new _e(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)};Kr.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};Kr.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};Kr.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Kr.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};Kr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function on(t,e,r,n){Xl.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new _e(0)):(this.x=new _e(e,16),this.y=new _e(r,16),this.z=new _e(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o3(on,Xl.BasePoint);Ki.prototype.jpoint=function(e,r,n){return new on(this,e,r,n)};on.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};on.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};on.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=o.redSub(a);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=c.redSqr(),f=u.redMul(c),d=i.redMul(u),h=l.redSqr().redIAdd(f).redISub(d).redISub(d),p=l.redMul(d.redISub(h)).redISub(o.redMul(f)),v=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(h,p,v)};on.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),u=l.redMul(a),f=n.redMul(l),d=c.redSqr().redIAdd(u).redISub(f).redISub(f),h=c.redMul(f.redISub(d)).redISub(s.redMul(u)),p=this.z.redMul(a);return this.curve.jpoint(d,h,p)};on.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};on.prototype.inspect=function(){return this.isInfinity()?"":""};on.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Av=id(function(t,e){var r=e;r.base=Xl,r.short=XQ,r.mont=null,r.edwards=null}),_v=id(function(t,e){var r=e,n=Ci.assert;function i(a){a.type==="short"?this.curve=new Av.short(a):a.type==="edwards"?this.curve=new Av.edwards(a):this.curve=new Av.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,c){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var l=new i(c);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:l}),l}})}s("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:qn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:qn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:qn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:qn.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"]}),s("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:qn.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:qn.sha256,gRed:!1,g:["9"]}),s("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:qn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("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:qn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function cc(t){if(!(this instanceof cc))return new cc(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=ps.toArray(t.entropy,t.entropyEnc||"hex"),r=ps.toArray(t.nonce,t.nonceEnc||"hex"),n=ps.toArray(t.pers,t.persEnc||"hex");s3(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var bM=cc;cc.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};cc.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=ps.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var ZQ=Ci.assert;function Eg(t,e){if(t instanceof Eg)return t;this._importDER(t,e)||(ZQ(t.r&&t.s,"Signature without r or s"),this.r=new _e(t.r,16),this.s=new _e(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var xg=Eg;function eY(){this.place=0}function t2(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function y4(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}Eg.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=y4(r),n=y4(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];r2(i,r.length),i=i.concat(r),i.push(2),r2(i,n.length);var s=i.concat(n),o=[48];return r2(o,s.length),o=o.concat(s),Ci.encode(o,e)};var tY=function(){throw new Error("unsupported")},wM=Ci.assert;function Ui(t){if(!(this instanceof Ui))return new Ui(t);typeof t=="string"&&(wM(Object.prototype.hasOwnProperty.call(_v,t),"Unknown curve "+t),t=_v[t]),t instanceof _v.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var rY=Ui;Ui.prototype.keyPair=function(e){return new a3(this,e)};Ui.prototype.keyFromPrivate=function(e,r){return a3.fromPrivate(this,e,r)};Ui.prototype.keyFromPublic=function(e,r){return a3.fromPublic(this,e,r)};Ui.prototype.genKeyPair=function(e){e||(e={});for(var r=new bM({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||tY(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new _e(2));;){var s=new _e(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};Ui.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};Ui.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new _e(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new bM({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new _e(1)),u=0;;u++){var f=i.k?i.k(u):new _e(c.generate(this.n.byteLength()));if(f=this._truncateToN(f,!0),!(f.cmpn(1)<=0||f.cmp(l)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var h=d.getX(),p=h.umod(this.n);if(p.cmpn(0)!==0){var v=f.invm(this.n).mul(p.mul(r.getPrivate()).iadd(e));if(v=v.umod(this.n),v.cmpn(0)!==0){var b=(d.getY().isOdd()?1:0)|(h.cmp(p)!==0?2:0);return i.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),b^=1),new xg({r:p,s:v,recoveryParam:b})}}}}}};Ui.prototype.verify=function(e,r,n,i){e=this._truncateToN(new _e(e,16)),n=this.keyFromPublic(n,i),r=new xg(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),c=a.mul(e).umod(this.n),l=a.mul(s).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(c,n.getPublic(),l),u.isInfinity()?!1:u.eqXToP(s)):(u=this.g.mulAdd(c,n.getPublic(),l),u.isInfinity()?!1:u.getX().umod(this.n).cmp(s)===0)};Ui.prototype.recoverPubKey=function(t,e,r,n){wM((3&r)===r,"The recovery param is more than two bits"),e=new xg(e,n);var i=this.n,s=new _e(t),o=e.r,a=e.s,c=r&1,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var u=e.r.invm(i),f=i.sub(s).mul(u).umod(i),d=a.mul(u).umod(i);return this.g.mulAdd(f,o,d)};Ui.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new xg(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var nY=id(function(t,e){var r=e;r.version="6.5.4",r.utils=Ci,r.rand=function(){throw new Error("unsupported")},r.curve=Av,r.curves=_v,r.ec=rY,r.eddsa=null}),iY=nY.ec;const sY="signing-key/5.7.0",Cx=new ee(sY);let n2=null;function Us(){return n2||(n2=new iY("secp256k1")),n2}class Nm{constructor(e){ie(this,"curve","secp256k1"),ie(this,"privateKey",te(e)),co(this.privateKey)!==32&&Cx.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=Us().keyFromPrivate(re(this.privateKey));ie(this,"publicKey","0x"+r.getPublic(!1,"hex")),ie(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),ie(this,"_isSigningKey",!0)}_addPoint(e){const r=Us().keyFromPublic(re(this.publicKey)),n=Us().keyFromPublic(re(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=Us().keyFromPrivate(re(this.privateKey)),n=re(e);n.length!==32&&Cx.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return Jl({recoveryParam:i.recoveryParam,r:dt("0x"+i.r.toString(16),32),s:dt("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=Us().keyFromPrivate(re(this.privateKey)),n=Us().keyFromPublic(re(c3(e)));return dt("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function EM(t,e){const r=Jl(e),n={r:re(r.r),s:re(r.s)};return"0x"+Us().recoverPubKey(re(t),n,r.recoveryParam).encode("hex",!1)}function c3(t,e){const r=re(t);if(r.length===32){const n=new Nm(r);return e?"0x"+Us().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?te(r):"0x"+Us().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+Us().keyFromPublic(r).getPublic(!0,"hex"):te(r)}return Cx.throwArgumentError("invalid public or private key","key","[REDACTED]")}const oY="transactions/5.7.0",yn=new ee(oY);var Sx;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(Sx||(Sx={}));function l3(t){return t==="0x"?null:qe(t)}function mn(t){return t==="0x"?tr:J.from(t)}const aY=[{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"}],cY={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function u3(t){const e=c3(t);return qe(br(Be(br(e,1)),12))}function Ll(t,e){return u3(EM(re(t),e))}function ci(t,e){const r=eo(J.from(t).toHexString());return r.length>32&&yn.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function i2(t,e){return{address:qe(t),storageKeys:(e||[]).map((r,n)=>(co(r)!==32&&yn.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function Zl(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&yn.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),i2(r[0],r[1])):i2(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return i2(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function xM(t){return Zl(t).map(e=>[e.address,e.storageKeys])}function CM(t,e){if(t.gasPrice!=null){const n=J.from(t.gasPrice),i=J.from(t.maxFeePerGas||0);n.eq(i)||yn.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[ci(t.chainId||0,"chainId"),ci(t.nonce||0,"nonce"),ci(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ci(t.maxFeePerGas||0,"maxFeePerGas"),ci(t.gasLimit||0,"gasLimit"),t.to!=null?qe(t.to):"0x",ci(t.value||0,"value"),t.data||"0x",xM(t.accessList||[])];if(e){const n=Jl(e);r.push(ci(n.recoveryParam,"recoveryParam")),r.push(eo(n.r)),r.push(eo(n.s))}return Rn(["0x02",$l(r)])}function SM(t,e){const r=[ci(t.chainId||0,"chainId"),ci(t.nonce||0,"nonce"),ci(t.gasPrice||0,"gasPrice"),ci(t.gasLimit||0,"gasLimit"),t.to!=null?qe(t.to):"0x",ci(t.value||0,"value"),t.data||"0x",xM(t.accessList||[])];if(e){const n=Jl(e);r.push(ci(n.recoveryParam,"recoveryParam")),r.push(eo(n.r)),r.push(eo(n.s))}return Rn(["0x01",$l(r)])}function lY(t,e){V6(t,cY);const r=[];aY.forEach(function(o){let a=t[o.name]||[];const c={};o.numeric&&(c.hexPad="left"),a=re(te(a,c)),o.length&&a.length!==o.length&&a.length>0&&yn.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,a),o.maxLength&&(a=eo(a),a.length>o.maxLength&&yn.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,a)),r.push(te(a))});let n=0;if(t.chainId!=null?(n=t.chainId,typeof n!="number"&&yn.throwArgumentError("invalid transaction.chainId","transaction",t)):e&&!Wo(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),n!==0&&(r.push(te(n)),r.push("0x"),r.push("0x")),!e)return $l(r);const i=Jl(e);let s=27+i.recoveryParam;return n!==0?(r.pop(),r.pop(),r.pop(),s+=n*2+8,i.v>28&&i.v!==s&&yn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==s&&yn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(te(s)),r.push(eo(re(i.r))),r.push(eo(re(i.s))),$l(r)}function uY(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&yn.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),lY(t,e);switch(t.type){case 1:return SM(t,e);case 2:return CM(t,e)}return yn.throwError(`unsupported transaction type: ${t.type}`,ee.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function kM(t,e,r){try{const n=mn(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{yn.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=dt(e[1],32),t.s=dt(e[2],32);try{const n=Be(r(t));t.from=Ll(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function fY(t){const e=gg(t.slice(1));e.length!==9&&e.length!==12&&yn.throwArgumentError("invalid component count for transaction type: 2","payload",te(t));const r=mn(e[2]),n=mn(e[3]),i={type:2,chainId:mn(e[0]).toNumber(),nonce:mn(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:mn(e[4]),to:l3(e[5]),value:mn(e[6]),data:e[7],accessList:Zl(e[8])};return e.length===9||(i.hash=Be(t),kM(i,e.slice(9),CM)),i}function dY(t){const e=gg(t.slice(1));e.length!==8&&e.length!==11&&yn.throwArgumentError("invalid component count for transaction type: 1","payload",te(t));const r={type:1,chainId:mn(e[0]).toNumber(),nonce:mn(e[1]).toNumber(),gasPrice:mn(e[2]),gasLimit:mn(e[3]),to:l3(e[4]),value:mn(e[5]),data:e[6],accessList:Zl(e[7])};return e.length===8||(r.hash=Be(t),kM(r,e.slice(8),SM)),r}function hY(t){const e=gg(t);e.length!==9&&e.length!==6&&yn.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:mn(e[0]).toNumber(),gasPrice:mn(e[1]),gasLimit:mn(e[2]),to:l3(e[3]),value:mn(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=J.from(e[6]).toNumber()}catch{return r}if(r.r=dt(e[7],32),r.s=dt(e[8],32),J.from(r.r).isZero()&&J.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 n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(te(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=Be($l(i));try{r.from=Ll(s,{r:te(r.r),s:te(r.s),recoveryParam:n})}catch{}r.hash=Be(t)}return r.type=null,r}function AM(t){const e=re(t);if(e[0]>127)return hY(e);switch(e[0]){case 1:return dY(e);case 2:return fY(e)}return yn.throwError(`unsupported transaction type: ${e[0]}`,ee.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const pY="contracts/5.7.0";var Bl=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const gr=new ee(pY);function Dm(t,e){return Bl(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&gr.throwArgumentError("invalid address or ENS name","name",r);try{return qe(r)}catch{}t||gr.throwError("a provider or signer is needed to resolve ENS names",ee.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&gr.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function Pv(t,e,r){return Bl(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>Pv(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield Dm(t,e):r.type==="tuple"?yield Pv(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>Pv(t,n,r.arrayChildren))):Promise.reject(gr.makeError("invalid value for array",ee.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function Cg(t,e,r){return Bl(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=Vt(r.pop())),gr.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=vt({override:Dm(t.signer,n.from),signer:t.signer.getAddress()}).then(l=>Bl(this,void 0,void 0,function*(){return qe(l.signer)!==l.override&&gr.throwError("Contract with a Signer cannot override from",ee.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),l.override})):n.from=t.signer.getAddress():n.from&&(n.from=Dm(t.provider,n.from));const i=yield vt({args:Pv(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:vt(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),o={data:s,to:i.address},a=i.overrides;if(a.nonce!=null&&(o.nonce=J.from(a.nonce).toNumber()),a.gasLimit!=null&&(o.gasLimit=J.from(a.gasLimit)),a.gasPrice!=null&&(o.gasPrice=J.from(a.gasPrice)),a.maxFeePerGas!=null&&(o.maxFeePerGas=J.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(o.maxPriorityFeePerGas=J.from(a.maxPriorityFeePerGas)),a.from!=null&&(o.from=a.from),a.type!=null&&(o.type=a.type),a.accessList!=null&&(o.accessList=Zl(a.accessList)),o.gasLimit==null&&e.gas!=null){let l=21e3;const u=re(s);for(let f=0;fn[l]!=null);return c.length&&gr.throwError(`cannot override ${c.map(l=>JSON.stringify(l)).join(",")}`,ee.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),o})}function vY(t,e){return function(...r){return Cg(t,e,r)}}function mY(t,e){const r=t.signer||t.provider;return function(...n){return Bl(this,void 0,void 0,function*(){r||gr.throwError("estimate require a provider or signer",ee.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Cg(t,e,n);return yield r.estimateGas(i)})}}function yY(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(s=>{let o=vi(s),a=null;try{a=t.interface.parseLog(s)}catch{}return a&&(o.args=a.args,o.decode=(c,l)=>t.interface.decodeEventLog(a.eventFragment,c,l),o.event=a.name,o.eventSignature=a.signature),o.removeListener=()=>t.provider,o.getBlock=()=>t.provider.getBlock(i.blockHash),o.getTransaction=()=>t.provider.getTransaction(i.transactionHash),o.getTransactionReceipt=()=>Promise.resolve(i),o}),i))}function _M(t,e,r){const n=t.signer||t.provider;return function(...i){return Bl(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const c=Vt(i.pop());c.blockTag!=null&&(s=yield c.blockTag),delete c.blockTag,i.push(c)}t.deployTransaction!=null&&(yield t._deployed(s));const o=yield Cg(t,e,i),a=yield n.call(o,s);try{let c=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(c=c[0]),c}catch(c){throw c.code===ee.errors.CALL_EXCEPTION&&(c.address=t.address,c.args=i,c.transaction=o),c}})}}function gY(t,e){return function(...r){return Bl(this,void 0,void 0,function*(){t.signer||gr.throwError("sending a transaction requires a signer",ee.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield Cg(t,e,r),i=yield t.signer.sendTransaction(n);return yY(t,i),i})}}function g4(t,e,r){return e.constant?_M(t,e,r):gY(t,e)}function PM(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class C0{constructor(e,r){ie(this,"tag",e),ie(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class bY extends C0{constructor(){super("error",null)}}class b4 extends C0{constructor(e,r,n,i){const s={address:e};let o=r.getEventTopic(n);i?(o!==i[0]&&gr.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[o],super(PM(s),s),ie(this,"address",e),ie(this,"interface",r),ie(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=kR(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class w4 extends C0{constructor(e,r){super("*",{address:e}),ie(this,"address",e),ie(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}class wY{constructor(e,r,n){ie(this,"interface",hs(new.target,"getInterface")(r)),n==null?(ie(this,"provider",null),ie(this,"signer",null)):Nl.isSigner(n)?(ie(this,"provider",n.provider||null),ie(this,"signer",n)):Tc.isProvider(n)?(ie(this,"provider",n),ie(this,"signer",null)):gr.throwArgumentError("invalid signer or provider","signerOrProvider",n),ie(this,"callStatic",{}),ie(this,"estimateGas",{}),ie(this,"functions",{}),ie(this,"populateTransaction",{}),ie(this,"filters",{});{const o={};Object.keys(this.interface.events).forEach(a=>{const c=this.interface.events[a];ie(this.filters,a,(...l)=>({address:this.address,topics:this.interface.encodeFilterTopics(c,l)})),o[c.name]||(o[c.name]=[]),o[c.name].push(a)}),Object.keys(o).forEach(a=>{const c=o[a];c.length===1?ie(this.filters,a,this.filters[c[0]]):gr.warn(`Duplicate definition of ${a} (${c.join(", ")})`)})}if(ie(this,"_runningEvents",{}),ie(this,"_wrappedEmits",{}),e==null&&gr.throwArgumentError("invalid contract address or ENS name","addressOrName",e),ie(this,"address",e),this.provider)ie(this,"resolvedAddress",Dm(this.provider,e));else try{ie(this,"resolvedAddress",Promise.resolve(qe(e)))}catch{gr.throwError("provider is required to use ENS name as contract address",ee.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(o=>{});const i={},s={};Object.keys(this.interface.functions).forEach(o=>{const a=this.interface.functions[o];if(s[o]){gr.warn(`Duplicate ABI entry for ${JSON.stringify(o)}`);return}s[o]=!0;{const c=a.name;i[`%${c}`]||(i[`%${c}`]=[]),i[`%${c}`].push(o)}this[o]==null&&ie(this,o,g4(this,a,!0)),this.functions[o]==null&&ie(this.functions,o,g4(this,a,!1)),this.callStatic[o]==null&&ie(this.callStatic,o,_M(this,a,!0)),this.populateTransaction[o]==null&&ie(this.populateTransaction,o,vY(this,a)),this.estimateGas[o]==null&&ie(this.estimateGas,o,mY(this,a))}),Object.keys(i).forEach(o=>{const a=i[o];if(a.length>1)return;o=o.substring(1);const c=a[0];try{this[o]==null&&ie(this,o,this[c])}catch{}this.functions[o]==null&&ie(this.functions,o,this.functions[c]),this.callStatic[o]==null&&ie(this.callStatic,o,this.callStatic[c]),this.populateTransaction[o]==null&&ie(this.populateTransaction,o,this.populateTransaction[c]),this.estimateGas[o]==null&&ie(this.estimateGas,o,this.estimateGas[c])})}static getContractAddress(e){return Q6(e)}static getInterface(e){return Br.isInterface(e)?e:new Br(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(r=>(r==="0x"&&gr.throwError("contract not deployed",ee.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||gr.throwError("sending a transactions require a signer",ee.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=Vt(e||{});return["from","to"].forEach(function(n){r[n]!=null&&gr.throwError("cannot override "+n,ee.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new i3(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&ie(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return Rm.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new bY);if(e==="event")return this._normalizeRunningEvent(new C0("event",null));if(e==="*")return this._normalizeRunningEvent(new w4(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new b4(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new b4(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new C0(PM(r),r))}return this._normalizeRunningEvent(new w4(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=vi(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||gr.throwError("events require a provider or a signer with a provider",ee.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let o=this._wrapEvent(e,s,r);if(o.decodeError==null)try{const a=e.getEmit(o);this.emit(e.filter,...a)}catch(a){o.decodeError=a.error}e.filter!=null&&this.emit("event",o),o.decodeError!=null&&this.emit("error",o.decodeError,o)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=Vt(i.filter);return typeof r=="string"&&Fe(r,32)?(n!=null&&gr.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(o=>o.map(a=>this._wrapEvent(i,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}}class sd extends wY{}class TM{constructor(e){ie(this,"alphabet",e),ie(this,"base",e.length),ie(this,"_alphabetMap",{}),ie(this,"_leader",e.charAt(0));for(let r=0;r0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s=0;--s)i+=this.alphabet[n[s]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n>=8;for(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n>24&255,c[e.length+1]=f>>16&255,c[e.length+2]=f>>8&255,c[e.length+3]=f&255;let d=re(S0(i,t,c));s||(s=d.length,u=new Uint8Array(s),o=Math.ceil(n/s),l=n-(o-1)*s),u.set(d);for(let v=1;v>5,this.byteCount=this.blockCount<<2,this.outputBlocks=W>>5,this.extraBytes=(W&31)>>3;for(var q=0;q<50;++q)this.s[q]=0}A.prototype.update=function(R){if(this.finalized)throw new Error(r);var U,W=typeof R;if(W!=="string"){if(W==="object"){if(R===null)throw new Error(e);if(c&&R.constructor===ArrayBuffer)R=new Uint8Array(R);else if(!Array.isArray(R)&&(!c||!ArrayBuffer.isView(R)))throw new Error(e)}else throw new Error(e);U=!0}for(var q=this.blocks,Y=this.byteCount,X=R.length,Q=this.blockCount,Z=0,ae=this.s,se,ue;Z>2]|=R[Z]<>2]|=ue<>2]|=(192|ue>>6)<>2]|=(128|ue&63)<=57344?(q[se>>2]|=(224|ue>>12)<>2]|=(128|ue>>6&63)<>2]|=(128|ue&63)<>2]|=(240|ue>>18)<>2]|=(128|ue>>12&63)<>2]|=(128|ue>>6&63)<>2]|=(128|ue&63)<=Y){for(this.start=se-Y,this.block=q[Q],se=0;se>8,W=R&255;W>0;)Y.unshift(W),R=R>>8,W=R&255,++q;return U?Y.push(q):Y.unshift(q),this.update(Y),Y.length},A.prototype.encodeString=function(R){var U,W=typeof R;if(W!=="string"){if(W==="object"){if(R===null)throw new Error(e);if(c&&R.constructor===ArrayBuffer)R=new Uint8Array(R);else if(!Array.isArray(R)&&(!c||!ArrayBuffer.isView(R)))throw new Error(e)}else throw new Error(e);U=!0}var q=0,Y=R.length;if(U)q=Y;else for(var X=0;X=57344?q+=3:(Q=65536+((Q&1023)<<10|R.charCodeAt(++X)&1023),q+=4)}return q+=this.encode(q*8),this.update(R),q},A.prototype.bytepad=function(R,U){for(var W=this.encode(U),q=0;q>2]|=this.padding[U&3],this.lastByteIndex===this.byteCount)for(R[0]=R[W],U=1;U>4&15]+l[Z&15]+l[Z>>12&15]+l[Z>>8&15]+l[Z>>20&15]+l[Z>>16&15]+l[Z>>28&15]+l[Z>>24&15];X%R===0&&(V(U),Y=0)}return q&&(Z=U[Y],Q+=l[Z>>4&15]+l[Z&15],q>1&&(Q+=l[Z>>12&15]+l[Z>>8&15]),q>2&&(Q+=l[Z>>20&15]+l[Z>>16&15])),Q},A.prototype.arrayBuffer=function(){this.finalize();var R=this.blockCount,U=this.s,W=this.outputBlocks,q=this.extraBytes,Y=0,X=0,Q=this.outputBits>>3,Z;q?Z=new ArrayBuffer(W+1<<2):Z=new ArrayBuffer(Q);for(var ae=new Uint32Array(Z);X>8&255,Q[Z+2]=ae>>16&255,Q[Z+3]=ae>>24&255;X%R===0&&V(U)}return q&&(Z=X<<2,ae=U[Y],Q[Z]=ae&255,q>1&&(Q[Z+1]=ae>>8&255),q>2&&(Q[Z+2]=ae>>16&255)),Q};function D(R,U,W){A.call(this,R,U,W)}D.prototype=new A,D.prototype.finalize=function(){return this.encode(this.outputBits,!0),A.prototype.finalize.call(this)};var V=function(R){var U,W,q,Y,X,Q,Z,ae,se,ue,ot,Te,_e,at,xe,be,Kt,Ie,Oe,Qt,Re,$e,Yt,Me,Ne,Jt,De,Le,Xt,Fe,Et,jc,xt,Ct,Uc,St,kt,zc,At,_t,Wc,Pt,Tt,Hc,It,Ot,qc,Rt,$t,Vc,Mt,Nt,Gc,Dt,Lt,Kc,Ft,Bt,ya,ga,ba,wa,Ea;for(q=0;q<48;q+=2)Y=R[0]^R[10]^R[20]^R[30]^R[40],X=R[1]^R[11]^R[21]^R[31]^R[41],Q=R[2]^R[12]^R[22]^R[32]^R[42],Z=R[3]^R[13]^R[23]^R[33]^R[43],ae=R[4]^R[14]^R[24]^R[34]^R[44],se=R[5]^R[15]^R[25]^R[35]^R[45],ue=R[6]^R[16]^R[26]^R[36]^R[46],ot=R[7]^R[17]^R[27]^R[37]^R[47],Te=R[8]^R[18]^R[28]^R[38]^R[48],_e=R[9]^R[19]^R[29]^R[39]^R[49],U=Te^(Q<<1|Z>>>31),W=_e^(Z<<1|Q>>>31),R[0]^=U,R[1]^=W,R[10]^=U,R[11]^=W,R[20]^=U,R[21]^=W,R[30]^=U,R[31]^=W,R[40]^=U,R[41]^=W,U=Y^(ae<<1|se>>>31),W=X^(se<<1|ae>>>31),R[2]^=U,R[3]^=W,R[12]^=U,R[13]^=W,R[22]^=U,R[23]^=W,R[32]^=U,R[33]^=W,R[42]^=U,R[43]^=W,U=Q^(ue<<1|ot>>>31),W=Z^(ot<<1|ue>>>31),R[4]^=U,R[5]^=W,R[14]^=U,R[15]^=W,R[24]^=U,R[25]^=W,R[34]^=U,R[35]^=W,R[44]^=U,R[45]^=W,U=ae^(Te<<1|_e>>>31),W=se^(_e<<1|Te>>>31),R[6]^=U,R[7]^=W,R[16]^=U,R[17]^=W,R[26]^=U,R[27]^=W,R[36]^=U,R[37]^=W,R[46]^=U,R[47]^=W,U=ue^(Y<<1|X>>>31),W=ot^(X<<1|Y>>>31),R[8]^=U,R[9]^=W,R[18]^=U,R[19]^=W,R[28]^=U,R[29]^=W,R[38]^=U,R[39]^=W,R[48]^=U,R[49]^=W,at=R[0],xe=R[1],Ot=R[11]<<4|R[10]>>>28,qc=R[10]<<4|R[11]>>>28,Le=R[20]<<3|R[21]>>>29,Xt=R[21]<<3|R[20]>>>29,ga=R[31]<<9|R[30]>>>23,ba=R[30]<<9|R[31]>>>23,Pt=R[40]<<18|R[41]>>>14,Tt=R[41]<<18|R[40]>>>14,Ct=R[2]<<1|R[3]>>>31,Uc=R[3]<<1|R[2]>>>31,be=R[13]<<12|R[12]>>>20,Kt=R[12]<<12|R[13]>>>20,Rt=R[22]<<10|R[23]>>>22,$t=R[23]<<10|R[22]>>>22,Fe=R[33]<<13|R[32]>>>19,Et=R[32]<<13|R[33]>>>19,wa=R[42]<<2|R[43]>>>30,Ea=R[43]<<2|R[42]>>>30,Dt=R[5]<<30|R[4]>>>2,Lt=R[4]<<30|R[5]>>>2,St=R[14]<<6|R[15]>>>26,kt=R[15]<<6|R[14]>>>26,Ie=R[25]<<11|R[24]>>>21,Oe=R[24]<<11|R[25]>>>21,Vc=R[34]<<15|R[35]>>>17,Mt=R[35]<<15|R[34]>>>17,jc=R[45]<<29|R[44]>>>3,xt=R[44]<<29|R[45]>>>3,Me=R[6]<<28|R[7]>>>4,Ne=R[7]<<28|R[6]>>>4,Kc=R[17]<<23|R[16]>>>9,Ft=R[16]<<23|R[17]>>>9,zc=R[26]<<25|R[27]>>>7,At=R[27]<<25|R[26]>>>7,Qt=R[36]<<21|R[37]>>>11,Re=R[37]<<21|R[36]>>>11,Nt=R[47]<<24|R[46]>>>8,Gc=R[46]<<24|R[47]>>>8,Hc=R[8]<<27|R[9]>>>5,It=R[9]<<27|R[8]>>>5,Jt=R[18]<<20|R[19]>>>12,De=R[19]<<20|R[18]>>>12,Bt=R[29]<<7|R[28]>>>25,ya=R[28]<<7|R[29]>>>25,_t=R[38]<<8|R[39]>>>24,Wc=R[39]<<8|R[38]>>>24,$e=R[48]<<14|R[49]>>>18,Yt=R[49]<<14|R[48]>>>18,R[0]=at^~be&Ie,R[1]=xe^~Kt&Oe,R[10]=Me^~Jt&Le,R[11]=Ne^~De&Xt,R[20]=Ct^~St&zc,R[21]=Uc^~kt&At,R[30]=Hc^~Ot&Rt,R[31]=It^~qc&$t,R[40]=Dt^~Kc&Bt,R[41]=Lt^~Ft&ya,R[2]=be^~Ie&Qt,R[3]=Kt^~Oe&Re,R[12]=Jt^~Le&Fe,R[13]=De^~Xt&Et,R[22]=St^~zc&_t,R[23]=kt^~At&Wc,R[32]=Ot^~Rt&Vc,R[33]=qc^~$t&Mt,R[42]=Kc^~Bt&ga,R[43]=Ft^~ya&ba,R[4]=Ie^~Qt&$e,R[5]=Oe^~Re&Yt,R[14]=Le^~Fe&jc,R[15]=Xt^~Et&xt,R[24]=zc^~_t&Pt,R[25]=At^~Wc&Tt,R[34]=Rt^~Vc&Nt,R[35]=$t^~Mt&Gc,R[44]=Bt^~ga&wa,R[45]=ya^~ba&Ea,R[6]=Qt^~$e&at,R[7]=Re^~Yt&xe,R[16]=Fe^~jc&Me,R[17]=Et^~xt&Ne,R[26]=_t^~Pt&Ct,R[27]=Wc^~Tt&Uc,R[36]=Vc^~Nt&Hc,R[37]=Mt^~Gc&It,R[46]=ga^~wa&Dt,R[47]=ba^~Ea&Lt,R[8]=$e^~at&be,R[9]=Yt^~xe&Kt,R[18]=jc^~Me&Jt,R[19]=xt^~Ne&De,R[28]=Pt^~Ct&St,R[29]=Tt^~Uc&kt,R[38]=Nt^~Hc&Ot,R[39]=Gc^~It&qc,R[48]=wa^~Dt&Kc,R[49]=Ea^~Lt&Ft,R[0]^=v[q],R[1]^=v[q+1]};if(a)t.exports=E;else for(O=0;O<_.length;++O)i[_[O]]=E[_[O]]})()})(LR);var CG=LR.exports;const SG=Ps(CG);function Be(t){return"0x"+SG.keccak_256(re(t))}const kG="rlp/5.7.0",zs=new ee(kG);function u4(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function f4(t,e,r){let n=0;for(let i=0;ie+1+n&&zs.throwError("child data too short",ee.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function BR(t,e){if(t.length===0&&zs.throwError("data too short",ee.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&zs.throwError("data short segment too short",ee.errors.BUFFER_OVERRUN,{});const n=f4(t,e+1,r);return e+1+r+n>t.length&&zs.throwError("data long segment too short",ee.errors.BUFFER_OVERRUN,{}),d4(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&zs.throwError("data array too short",ee.errors.BUFFER_OVERRUN,{}),d4(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&zs.throwError("data array too short",ee.errors.BUFFER_OVERRUN,{});const n=f4(t,e+1,r);e+1+r+n>t.length&&zs.throwError("data array too short",ee.errors.BUFFER_OVERRUN,{});const i=te(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&zs.throwError("data too short",ee.errors.BUFFER_OVERRUN,{});const n=te(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:te(t[e])}}function Sg(t){const e=re(t),r=BR(e,0);return r.consumed!==e.length&&zs.throwArgumentError("invalid rlp data","data",t),r.result}const AG=Object.freeze(Object.defineProperty({__proto__:null,decode:Sg,encode:Nl},Symbol.toStringTag,{value:"Module"})),_G="address/5.7.0",Ua=new ee(_G);function h4(t){je(t,20)||Ua.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=re(Be(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const PG=9007199254740991;function TG(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const r3={};for(let t=0;t<10;t++)r3[String(t)]=String(t);for(let t=0;t<26;t++)r3[String.fromCharCode(65+t)]=String(10+t);const p4=Math.floor(TG(PG));function jR(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>r3[n]).join("");for(;e.length>=p4;){let n=e.substring(0,p4);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function Ve(t){let e=null;if(typeof t!="string"&&Ua.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=h4(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Ua.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==jR(t)&&Ua.throwArgumentError("bad icap checksum","address",t),e=fG(t.substring(4));e.length<40;)e="0"+e;e=h4("0x"+e)}else Ua.throwArgumentError("invalid address","address",t);return e}function UR(t){try{return Ve(t),!0}catch{}return!1}function IG(t){let e=dG(Ve(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+jR("XE00"+e)+e}function n3(t){let e=null;try{e=Ve(t.from)}catch{Ua.throwArgumentError("missing from address","transaction",t)}const r=to(re(J.from(t.nonce).toHexString()));return Ve(br(Be(Nl([e,r])),12))}function OG(t,e,r){return lo(e)!==32&&Ua.throwArgumentError("salt must be 32 bytes","salt",e),lo(r)!==32&&Ua.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),Ve(br(Be(qt(["0xff",Ve(t),e,r])),12))}class RG extends la{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=Ve(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return Ve(dt(e.readValue().toHexString(),20))}}class $G extends la{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}const Gu=new ee(A1);function zR(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(l=>{const u=l.localName;return u||Gu.throwError("cannot encode object for signature with missing names",ee.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),c[u]&&Gu.throwError("cannot encode object for signature with duplicate names",ee.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),c[u]=!0,r[u]})}else Gu.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Gu.throwArgumentError("types/value length mismatch","tuple",r);let i=new Sx(t.wordSize),s=new Sx(t.wordSize),o=[];e.forEach((c,l)=>{let u=n[l];if(c.dynamic){let f=s.length;c.encode(s,u);let d=i.writeUpdatableValue();o.push(h=>{d(h+f)})}else c.encode(i,u)}),o.forEach(c=>{c(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function WR(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readValue(),c=n.subReader(a.toNumber());try{o=s.decode(c)}catch(l){if(l.code===ee.errors.BUFFER_OVERRUN)throw l;o=l,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(a.code===ee.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}o!=null&&r.push(o)});const i=e.reduce((s,o)=>{const a=o.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});e.forEach((s,o)=>{let a=s.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const c=r[o];c instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw c}}):r[a]=c});for(let s=0;s{throw o}})}return Object.freeze(r)}class MG extends la{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&Gu.throwError("insufficient data length",ee.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i>6===2;o++)s++;return s}return t===Gn.OVERRUN?r.length-e-1:0}function HG(t,e,r,n,i){return t===Gn.OVERLONG?(n.push(i),0):(n.push(65533),KR(t,e,r))}const QR=Object.freeze({error:WG,ignore:KR,replace:HG});function i3(t,e){e==null&&(e=QR.error),t=re(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(Gn.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(Gn.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(Gn.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let c=0;c1114111){n+=e(Gn.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(Gn.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(Gn.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function wt(t,e=Ho.current){e!=Ho.current&&(GR.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return re(r)}function r2(t){const e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function qG(t,e){return'"'+i3(t,e).map(r=>{if(r<256){switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(r>=32&&r<127)return String.fromCharCode(r)}return r<=65535?r2(r):(r-=65536,r2((r>>10&1023)+55296)+r2((r&1023)+56320))}).join("")+'"'}function kx(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function ua(t,e){return kx(i3(t,e))}function Nm(t,e=Ho.current){return i3(wt(t,e))}function VG(t){const e=wt(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return te(qt([e,Mm]).slice(0,32))}function GG(t){const e=re(t);if(e.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(e[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;e[r-1]===0;)r--;return ua(e.slice(0,r))}function KG(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r{let s=i.split(":");r+=parseInt(s[0],16),n[r]=e(s[1])}),n}function YR(t){let e=0;return t.split(",").map(r=>{let n=r.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let i=e+parseInt(n[0],16);return e=parseInt(n[1],16),{l:i,h:e}})}function o3(t,e){let r=0;for(let n=0;n=r&&t<=r+i.h&&(t-r)%(i.d||1)===0){if(i.e&&i.e.indexOf(t-r)!==-1)continue;return i}}return null}const QG=YR("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"),YG="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),JG=[{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}],XG=s3("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"),ZG=s3("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"),eK=s3("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",KG),tK=YR("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function rK(t){return t.reduce((e,r)=>(r.forEach(n=>{e.push(n)}),e),[])}function nK(t){return!!o3(t,QG)}function iK(t){let e=o3(t,JG);if(e)return[t+e.s];let r=XG[t];if(r)return r;let n=ZG[t];if(n)return[t+n[0]];let i=eK[t];return i||null}function sK(t){return!!o3(t,tK)}function oK(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();let e=Nm(t);e=rK(e.map(n=>{if(YG.indexOf(n)>=0)return[];if(n>=65024&&n<=65039)return[];let i=iK(n);return i||[n]})),e=Nm(kx(e),Ho.NFKC),e.forEach(n=>{if(sK(n))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),e.forEach(n=>{if(nK(n))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let r=kx(e);if(r.substring(0,1)==="-"||r.substring(2,4)==="--"||r.substring(r.length-1)==="-")throw new Error("invalid hyphen");return r}class aK extends HR{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,wt(r))}decode(e){return ua(super.decode(e))}}class Rp extends la{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return zR(e,this.coders,r)}decode(e){return e.coerce(this.name,WR(e,this.coders))}}const $p=new ee(A1),cK=new RegExp(/^bytes([0-9]*)$/),lK=new RegExp(/^(u?int)([0-9]*)$/);class a3{constructor(e){ie(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new RG(e.name);case"bool":return new NG(e.name);case"string":return new aK(e.name);case"bytes":return new DG(e.name);case"array":return new MG(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Rp((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new FG(e.name)}let r=e.type.match(lK);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&$p.throwArgumentError("invalid "+r[1]+" bit length","param",e),new UG(n/8,r[1]==="int",e.name)}if(r=e.type.match(cK),r){let n=parseInt(r[1]);return(n===0||n>32)&&$p.throwArgumentError("invalid bytes length","param",e),new LG(n,e.name)}return $p.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new $m(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new Sx(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(Lr.from(i)));return new Rp(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&$p.throwError("types/values length mismatch",ee.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(o=>this._getCoder(Lr.from(o))),i=new Rp(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>this._getCoder(Lr.from(o)));return new Rp(i,"_").decode(this._getReader(re(r),n))}}const Bn=new a3;function za(t){return Be(wt(t))}const JR="hash/5.7.0";function c3(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function fK(t){const e={};for(let r=0;r>--c&1}const f=31,d=Math.pow(2,f),h=d>>>1,p=h>>1,v=d-1;let b=0;for(let P=0;P1;){let j=T+w>>>1;P>>1|u(),I=I<<1^h,F=(F^h)<<1|h|1;m=I,g=1+F-I}let S=n-4;return y.map(P=>{switch(P-S){case 3:return S+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return S+256+(t[a++]<<8|t[a++]);case 1:return S+t[a++];default:return P-1}})}function hK(t){let e=0;return()=>t[e++]}function pK(t){return hK(dK(t))}function vK(t){return t&1?~t>>1:t>>1}function mK(t,e){let r=Array(t);for(let n=0;ne[o]):r}function gK(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(wK(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(EK(r,t))}return fK(XR(e))}function bK(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function ZR(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(s));return n}function wK(t,e){let r=1+e(),n=e(),i=bK(e),s=ZR(i.length,1+t,e);return XR(s.map((o,a)=>{const c=o[0],l=o.slice(1);return Array(i[a]).fill(void 0).map((u,f)=>{let d=f*n;return[c+f*r,l.map(h=>h+d)]})}))}function EK(t,e){let r=1+e();return ZR(r,1+t,e).map(i=>[i[0],i.slice(1)])}function xK(t){let e=Dm(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let l=Dm(t,e);if(l.length==0)break;n.push({set:new Set(l),node:r()})}n.sort((l,u)=>u.set.size-l.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,c=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:c}}}function CK(){return pK(c3("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=="))}const kg=CK(),SK=new Set(Dm(kg)),kK=new Set(Dm(kg)),AK=gK(kg),_K=xK(kg),m4=45,y4=95;function e$(t){return Nm(t)}function PK(t){return t.filter(e=>e!=65039)}function t$(t){for(let e of t.split(".")){let r=e$(e);try{for(let n=r.lastIndexOf(y4)-1;n>=0;n--)if(r[n]!==y4)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===m4&&r[3]===m4)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function TK(t){return t$(IK(t,PK))}function IK(t,e){let r=e$(t).reverse(),n=[];for(;r.length;){let i=RK(r);if(i){n.push(...e(i));continue}let s=r.pop();if(SK.has(s)){n.push(s);continue}if(kK.has(s))continue;let o=AK[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return t$(OK(String.fromCodePoint(...n)))}function OK(t){return t.normalize("NFC")}function RK(t,e){var r;let n=_K,i,s,o=[],a=t.length;for(e&&(e.length=0);a;){let c=t[--a];if(n=(r=n.branches.find(l=>l.set.has(c)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=c;else if(n.check&&c===s)break;o.push(c),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const $K=new ee(JR),r$=new Uint8Array(32);r$.fill(0);function g4(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function u3(t){const e=wt(TK(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(g4(e.slice(n))),r}function MK(t){try{return u3(t).length!==0}catch{}return!1}function Mh(t){typeof t!="string"&&$K.throwArgumentError("invalid ENS name; not a string","name",t);let e=r$;const r=u3(t);for(;r.length;)e=Be(qt([e,Be(r.pop())]));return te(e)}function n$(t){return te(qt(u3(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}const NK=`Ethereum Signed Message: +`;function f3(t){return typeof t=="string"&&(t=wt(t)),Be(qt([wt(NK),wt(String(t.length)),t]))}var DK=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const nr=new ee(JR),i$=new Uint8Array(32);i$.fill(0);const LK=J.from(-1),s$=J.from(0),o$=J.from(1),FK=J.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function BK(t){const e=re(t),r=e.length%32;return r?Rn([e,i$.slice(r)]):te(e)}const jK=dt(o$.toHexString(),32),UK=dt(s$.toHexString(),32),b4={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},n2=["name","version","chainId","verifyingContract","salt"];function w4(t){return function(e){return typeof e!="string"&&nr.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const zK={name:w4("name"),version:w4("version"),chainId:function(t){try{return J.from(t).toString()}catch{}return nr.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Ve(t).toLowerCase()}catch{}return nr.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=re(t);if(e.length!==32)throw new Error("bad length");return te(e)}catch{}return nr.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function i2(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&nr.throwArgumentError("invalid numeric width","type",t);const i=FK.mask(r?n-1:n),s=r?i.add(o$).mul(LK):s$;return function(o){const a=J.from(o);return(a.lt(s)||a.gt(i))&&nr.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),dt(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&nr.throwArgumentError("invalid bytes width","type",t),function(n){return re(n).length!==r&&nr.throwArgumentError(`invalid length for ${t}`,"value",n),BK(n)}}}switch(t){case"address":return function(e){return dt(Ve(e),32)};case"bool":return function(e){return e?jK:UK};case"bytes":return function(e){return Be(e)};case"string":return function(e){return za(e)}}return null}function E4(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class qr{constructor(e){ie(this,"types",Object.freeze(mi(e))),ie(this,"_encoderCache",{}),ie(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const c={};e[a].forEach(l=>{c[l.name]&&nr.throwArgumentError(`duplicate variable name ${JSON.stringify(l.name)} in ${JSON.stringify(a)}`,"types",e),c[l.name]=!0;const u=l.type.match(/^([^\x5b]*)(\x5b|$)/)[1];u===a&&nr.throwArgumentError(`circular type reference to ${JSON.stringify(u)}`,"types",e),!i2(u)&&(n[u]||nr.throwArgumentError(`unknown type ${JSON.stringify(u)}`,"types",e),n[u].push(a),r[a][u]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?nr.throwArgumentError("missing primary type","types",e):s.length>1&&nr.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),ie(this,"primaryType",s[0]);function o(a,c){c[a]&&nr.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),c[a]=!0,Object.keys(r[a]).forEach(l=>{n[l]&&(o(l,c),Object.keys(c).forEach(u=>{i[u][l]=!0}))}),delete c[a]}o(this.primaryType,{});for(const a in i){const c=Object.keys(i[a]);c.sort(),this._types[a]=E4(a,e[a])+c.map(l=>E4(l,e[l])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=i2(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&nr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let c=a.map(s);return this._types[i]&&(c=c.map(Be)),Be(Rn(c))}}const n=this.types[e];if(n){const i=za(this._types[e]);return s=>{const o=n.map(({name:a,type:c})=>{const l=this.getEncoder(c)(s[a]);return this._types[c]?Be(l):l});return o.unshift(i),Rn(o)}}return nr.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||nr.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return Be(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(i2(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&nr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(c=>this._visit(o,c,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,r[a],n),o),{}):nr.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new qr(e)}static getPrimaryType(e){return qr.from(e).primaryType}static hashStruct(e,r,n){return qr.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=b4[n];i||nr.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>n2.indexOf(n.name)-n2.indexOf(i.name)),qr.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Rn(["0x1901",qr.hashDomain(e),qr.from(r).hash(n)])}static hash(e,r,n){return Be(qr.encode(e,r,n))}static resolveNames(e,r,n,i){return DK(this,void 0,void 0,function*(){e=Vt(e);const s={};e.verifyingContract&&!je(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=qr.from(r);o.visit(n,(a,c)=>(a==="address"&&!je(c,20)&&(s[c]="0x"),c));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&s[c]?s[c]:c),{domain:e,value:n}})}static getPayload(e,r,n){qr.hashDomain(e);const i={},s=[];n2.forEach(c=>{const l=e[c];l!=null&&(i[c]=zK[c](l),s.push({name:c,type:b4[c]}))});const o=qr.from(r),a=Vt(r);return a.EIP712Domain?nr.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(c,l)=>{if(c.match(/^bytes(\d*)/))return te(re(l));if(c.match(/^u?int/))return J.from(l).toString();switch(c){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return typeof l!="string"&&nr.throwArgumentError("invalid string","value",l),l}return nr.throwArgumentError("unsupported type","type",c)})}}}const rr=new ee(A1);class a$ extends k1{}class c$ extends k1{}class WK extends k1{}class Lm extends k1{static isIndexed(e){return!!(e&&e._isIndexed)}}const HK={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function x4(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class jr{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,ie(this,"fragments",r.map(n=>Ys.from(n)).filter(n=>n!=null)),ie(this,"_abiCoder",vs(new.target,"getAbiCoder")()),ie(this,"functions",{}),ie(this,"errors",{}),ie(this,"events",{}),ie(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){rr.warn("duplicate definition - constructor");return}ie(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let s=n.format();if(i[s]){rr.warn("duplicate definition - "+s);return}i[s]=n}),this.deploy||ie(this,"deploy",hs.from({payable:!1,type:"constructor"})),ie(this,"_isInterface",!0)}format(e){e||(e=tt.full),e===tt.sighash&&rr.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===tt.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return Bn}static getAddress(e){return Ve(e)}static getSighash(e){return br(za(e.format()),0,4)}static getEventTopic(e){return za(e.format())}getFunction(e){if(je(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];rr.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(s=>s.split("(")[0]===n);return i.length===0?rr.throwArgumentError("no matching function","name",n):i.length>1&&rr.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[ps.fromString(e).format()];return r||rr.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(je(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];rr.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(s=>s.split("(")[0]===n);return i.length===0?rr.throwArgumentError("no matching event","name",n):i.length>1&&rr.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[Ks.fromString(e).format()];return r||rr.throwArgumentError("no matching event","signature",e),r}getError(e){if(je(e)){const n=vs(this.constructor,"getSighash");for(const i in this.errors){const s=this.errors[i];if(e===n(s))return this.errors[i]}rr.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(s=>s.split("(")[0]===n);return i.length===0?rr.throwArgumentError("no matching error","name",n):i.length>1&&rr.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[ps.fromString(e).format()];return r||rr.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return vs(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),vs(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=re(r);return te(n.slice(0,4))!==this.getSighash(e)&&rr.throwArgumentError(`data signature does not match error ${e.name}.`,"data",te(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),te(qt([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=re(r);return te(n.slice(0,4))!==this.getSighash(e)&&rr.throwArgumentError(`data signature does not match function ${e.name}.`,"data",te(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),te(qt([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=re(r),i=null,s="",o=null,a=null,c=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const l=te(n.slice(0,4)),u=HK[l];if(u)o=this._abiCoder.decode(u.inputs,n.slice(4)),a=u.name,c=u.signature,u.reason&&(i=o[0]),a==="Error"?s=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:a==="Panic"&&(s=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const f=this.getError(l);o=this._abiCoder.decode(f.inputs,n.slice(4)),a=f.name,c=f.format()}catch{}break}}return rr.throwError("call revert exception"+s,ee.errors.CALL_EXCEPTION,{method:e.format(),data:te(r),errorArgs:o,errorName:a,errorSignature:c,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),te(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&rr.throwError("too many arguments for "+e.format(),ee.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(s,o)=>s.type==="string"?za(o):s.type==="bytes"?Be(te(o)):(s.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),s.type.match(/^u?int/)&&(o=J.from(o).toHexString()),s.type==="address"&&this._abiCoder.encode(["address"],[o]),dt(te(o),32));for(r.forEach((s,o)=>{let a=e.inputs[o];if(!a.indexed){s!=null&&rr.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?rr.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(c=>i(a,c))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],s=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&rr.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const c=r[a];if(o.indexed)if(o.type==="string")n.push(za(c));else if(o.type==="bytes")n.push(Be(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([o.type],[c]))}else i.push(o),s.push(c)}),{data:this._abiCoder.encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let d=this.getEventTopic(e);(!je(n[0],32)||n[0].toLowerCase()!==d)&&rr.throwError("fragment/topic mismatch",ee.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:d,value:n[0]}),n=n.slice(1)}let i=[],s=[],o=[];e.inputs.forEach((d,h)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(Lr.fromObject({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(s.push(d),o.push(!1))});let a=n!=null?this._abiCoder.decode(i,qt(n)):null,c=this._abiCoder.decode(s,r,!0),l=[],u=0,f=0;e.inputs.forEach((d,h)=>{if(d.indexed)if(a==null)l[h]=new Lm({_isIndexed:!0,hash:null});else if(o[h])l[h]=new Lm({_isIndexed:!0,hash:a[f++]});else try{l[h]=a[f++]}catch(p){l[h]=p}else try{l[h]=c[u++]}catch(p){l[h]=p}if(d.name&&l[d.name]==null){const p=l[h];p instanceof Error?Object.defineProperty(l,d.name,{enumerable:!0,get:()=>{throw x4(`property ${JSON.stringify(d.name)}`,p)}}):l[d.name]=p}});for(let d=0;d{throw x4(`index ${d}`,h)}})}return Object.freeze(l)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new c$({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:J.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new a$({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=te(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new WK({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}}const qK="abstract-provider/5.7.0";var VK=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const GK=new ee(qK);class KK extends k1{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class Tc{constructor(){GK.checkAbstract(new.target,Tc),ie(this,"_isProvider",!0)}getFeeData(){return VK(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield vt({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=J.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const QK="abstract-signer/5.7.0";var ts=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Ti=new ee(QK),YK=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],JK=[ee.errors.INSUFFICIENT_FUNDS,ee.errors.NONCE_EXPIRED,ee.errors.REPLACEMENT_UNDERPRICED];let Dl=class l${constructor(){Ti.checkAbstract(new.target,l$),ie(this,"_isSigner",!0)}getBalance(e){return ts(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return ts(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return ts(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield vt(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return ts(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield vt(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return ts(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return ts(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return ts(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return ts(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return ts(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)YK.indexOf(n)===-1&&Ti.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=Vt(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&Ti.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return ts(this,void 0,void 0,function*(){const r=yield vt(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>ts(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&Ti.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?Ti.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&Ti.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&Ti.throwError("network does not support EIP-1559",ee.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):Ti.throwError("failed to get consistent fee data",ee.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(JK.indexOf(i.code)>=0)throw i;return Ti.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ee.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&Ti.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield vt(r)})}_checkProvider(e){this.provider||Ti.throwError("missing provider",ee.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}};class d3 extends Dl{constructor(e,r){super(),ie(this,"address",e),ie(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{Ti.throwError(e,ee.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new d3(this.address,e)}}var u$={},Xe={},_1=f$;function f$(t,e){if(!t)throw new Error(e||"Assertion failed")}f$.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var Ax={exports:{}};typeof Object.create=="function"?Ax.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Ax.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var XK=Ax.exports,ZK=_1,eQ=XK;Xe.inherits=eQ;function tQ(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function rQ(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):tQ(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Xe.htonl=d$;function iQ(t,e){for(var r="",n=0;n>>0}return s}Xe.join32=sQ;function oQ(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}Xe.split32=oQ;function aQ(t,e){return t>>>e|t<<32-e}Xe.rotr32=aQ;function cQ(t,e){return t<>>32-e}Xe.rotl32=cQ;function lQ(t,e){return t+e>>>0}Xe.sum32=lQ;function uQ(t,e,r){return t+e+r>>>0}Xe.sum32_3=uQ;function fQ(t,e,r,n){return t+e+r+n>>>0}Xe.sum32_4=fQ;function dQ(t,e,r,n,i){return t+e+r+n+i>>>0}Xe.sum32_5=dQ;function hQ(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}Xe.sum64=hQ;function pQ(t,e,r,n){var i=e+n>>>0,s=(i>>0}Xe.sum64_hi=pQ;function vQ(t,e,r,n){var i=e+n;return i>>>0}Xe.sum64_lo=vQ;function mQ(t,e,r,n,i,s,o,a){var c=0,l=e;l=l+n>>>0,c+=l>>0,c+=l>>0,c+=l>>0}Xe.sum64_4_hi=mQ;function yQ(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}Xe.sum64_4_lo=yQ;function gQ(t,e,r,n,i,s,o,a,c,l){var u=0,f=e;f=f+n>>>0,u+=f>>0,u+=f>>0,u+=f>>0,u+=f>>0}Xe.sum64_5_hi=gQ;function bQ(t,e,r,n,i,s,o,a,c,l){var u=e+n+s+a+l;return u>>>0}Xe.sum64_5_lo=bQ;function wQ(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}Xe.rotr64_hi=wQ;function EQ(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Xe.rotr64_lo=EQ;function xQ(t,e,r){return t>>>r}Xe.shr64_hi=xQ;function CQ(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Xe.shr64_lo=CQ;var id={},C4=Xe,SQ=_1;function Ag(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}id.BlockHash=Ag;Ag.prototype.update=function(e,r){if(e=C4.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=C4.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}bo.g0_256=TQ;function IQ(t){return ro(t,17)^ro(t,19)^t>>>10}bo.g1_256=IQ;var Of=Xe,OQ=id,RQ=bo,s2=Of.rotl32,Vd=Of.sum32,$Q=Of.sum32_5,MQ=RQ.ft_1,g$=OQ.BlockHash,NQ=[1518500249,1859775393,2400959708,3395469782];function uo(){if(!(this instanceof uo))return new uo;g$.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Of.inherits(uo,g$);var DQ=uo;uo.blockSize=512;uo.outSize=160;uo.hmacStrength=80;uo.padLength=64;uo.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),CY(e.length<=this.blockSize);for(var r=e.length;r>8,d=u&255;f?c.push(f,d):c.push(d)}return c}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",c=0;c(d>>1)-1?v=(d>>1)-b:v=b,h.isubn(v)):v=0,f[p]=v,h.iushrn(1)}return f}r.getNAF=n;function i(c,l){var u=[[],[]];c=c.clone(),l=l.clone();for(var f=0,d=0,h;c.cmpn(-f)>0||l.cmpn(-d)>0;){var p=c.andln(3)+f&3,v=l.andln(3)+d&3;p===3&&(p=-1),v===3&&(v=-1);var b;p&1?(h=c.andln(7)+f&7,(h===3||h===5)&&v===2?b=-p:b=p):b=0,u[0].push(b);var y;v&1?(h=l.andln(7)+d&7,(h===3||h===5)&&p===2?y=-v:y=v):y=0,u[1].push(y),2*f===b+1&&(f=1-f),2*d===y+1&&(d=1-d),c.iushrn(1),l.iushrn(1)}return u}r.getJSF=i;function s(c,l,u){var f="_"+l;c.prototype[l]=function(){return this[f]!==void 0?this[f]:this[f]=u.call(this)}}r.cachedProperty=s;function o(c){return typeof c=="string"?r.toArray(c,"hex"):c}r.parseBytes=o;function a(c){return new Pe(c,"hex","le")}r.intFromLE=a}),Fm=Si.getNAF,AY=Si.getJSF,Bm=Si.assert;function Ic(t,e){this.type=t,this.p=new Pe(e.p,16),this.red=e.prime?Pe.red(e.prime):Pe.mont(this.p),this.zero=new Pe(0).toRed(this.red),this.one=new Pe(1).toRed(this.red),this.two=new Pe(2).toRed(this.red),this.n=e.n&&new Pe(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Zl=Ic;Ic.prototype.point=function(){throw new Error("Not implemented")};Ic.prototype.validate=function(){throw new Error("Not implemented")};Ic.prototype._fixedNafMul=function(e,r){Bm(e.precomputed);var n=e._getDoubles(),i=Fm(r,1,this._bitLength),s=(1<=a;l--)c=(c<<1)+i[l];o.push(c)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=s;d>0;d--){for(a=0;a=0;c--){for(var l=0;c>=0&&o[c]===0;c--)l++;if(c>=0&&l++,a=a.dblp(l),c<0)break;var u=o[c];Bm(u!==0),e.type==="affine"?u>0?a=a.mixedAdd(s[u-1>>1]):a=a.mixedAdd(s[-u-1>>1].neg()):u>0?a=a.add(s[u-1>>1]):a=a.add(s[-u-1>>1].neg())}return e.type==="affine"?a.toP():a};Ic.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,u,f,d;for(u=0;u=1;u-=2){var p=u-1,v=u;if(o[p]!==1||o[v]!==1){c[p]=Fm(n[p],o[p],this._bitLength),c[v]=Fm(n[v],o[v],this._bitLength),l=Math.max(c[p].length,l),l=Math.max(c[v].length,l);continue}var b=[r[p],null,null,r[v]];r[p].y.cmp(r[v].y)===0?(b[1]=r[p].add(r[v]),b[2]=r[p].toJ().mixedAdd(r[v].neg())):r[p].y.cmp(r[v].y.redNeg())===0?(b[1]=r[p].toJ().mixedAdd(r[v]),b[2]=r[p].add(r[v].neg())):(b[1]=r[p].toJ().mixedAdd(r[v]),b[2]=r[p].toJ().mixedAdd(r[v].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],m=AY(n[p],n[v]);for(l=Math.max(m[0].length,l),c[p]=new Array(l),c[v]=new Array(l),f=0;f=0;u--){for(var w=0;u>=0;){var I=!0;for(f=0;f=0&&w++,P=P.dblp(w),u<0)break;for(f=0;f0?d=a[f][F-1>>1]:F<0&&(d=a[f][-F-1>>1].neg()),d.type==="affine"?P=P.mixedAdd(d):P=P.add(d))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};Ki.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(h=l,p=u),f.negative&&(f=f.neg(),d=d.neg()),h.negative&&(h=h.neg(),p=p.neg()),[{a:f,b:d},{a:h,b:p}]};Qi.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),l=s.mul(n.b),u=o.mul(i.b),f=e.sub(a).sub(c),d=l.add(u).neg();return{k1:f,k2:d}};Qi.prototype.pointFromX=function(e,r){e=new Pe(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};Qi.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};Qi.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};Qr.prototype.isInfinity=function(){return this.inf};Qr.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};Qr.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};Qr.prototype.getX=function(){return this.x.fromRed()};Qr.prototype.getY=function(){return this.y.fromRed()};Qr.prototype.mul=function(e){return e=new Pe(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)};Qr.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};Qr.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};Qr.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Qr.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};Qr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function on(t,e,r,n){Zl.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Pe(0)):(this.x=new Pe(e,16),this.y=new Pe(r,16),this.z=new Pe(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}p3(on,Zl.BasePoint);Qi.prototype.jpoint=function(e,r,n){return new on(this,e,r,n)};on.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};on.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};on.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=o.redSub(a);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=c.redSqr(),f=u.redMul(c),d=i.redMul(u),h=l.redSqr().redIAdd(f).redISub(d).redISub(d),p=l.redMul(d.redISub(h)).redISub(o.redMul(f)),v=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(h,p,v)};on.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),u=l.redMul(a),f=n.redMul(l),d=c.redSqr().redIAdd(u).redISub(f).redISub(f),h=c.redMul(f.redISub(d)).redISub(s.redMul(u)),p=this.z.redMul(a);return this.curve.jpoint(d,h,p)};on.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};on.prototype.inspect=function(){return this.isInfinity()?"":""};on.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Ov=ad(function(t,e){var r=e;r.base=Zl,r.short=PY,r.mont=null,r.edwards=null}),Rv=ad(function(t,e){var r=e,n=Si.assert;function i(a){a.type==="short"?this.curve=new Ov.short(a):a.type==="edwards"?this.curve=new Ov.edwards(a):this.curve=new Ov.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,c){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var l=new i(c);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:l}),l}})}s("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:Vn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:Vn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:Vn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:Vn.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"]}),s("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:Vn.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Vn.sha256,gRed:!1,g:["9"]}),s("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:Vn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("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:Vn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function lc(t){if(!(this instanceof lc))return new lc(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=ms.toArray(t.entropy,t.entropyEnc||"hex"),r=ms.toArray(t.nonce,t.nonceEnc||"hex"),n=ms.toArray(t.pers,t.persEnc||"hex");h3(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var I$=lc;lc.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};lc.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=ms.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var TY=Si.assert;function _g(t,e){if(t instanceof _g)return t;this._importDER(t,e)||(TY(t.r&&t.s,"Signature without r or s"),this.r=new Pe(t.r,16),this.s=new Pe(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Pg=_g;function IY(){this.place=0}function c2(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function _4(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}_g.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=_4(r),n=_4(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];l2(i,r.length),i=i.concat(r),i.push(2),l2(i,n.length);var s=i.concat(n),o=[48];return l2(o,s.length),o=o.concat(s),Si.encode(o,e)};var OY=function(){throw new Error("unsupported")},O$=Si.assert;function zi(t){if(!(this instanceof zi))return new zi(t);typeof t=="string"&&(O$(Object.prototype.hasOwnProperty.call(Rv,t),"Unknown curve "+t),t=Rv[t]),t instanceof Rv.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var RY=zi;zi.prototype.keyPair=function(e){return new v3(this,e)};zi.prototype.keyFromPrivate=function(e,r){return v3.fromPrivate(this,e,r)};zi.prototype.keyFromPublic=function(e,r){return v3.fromPublic(this,e,r)};zi.prototype.genKeyPair=function(e){e||(e={});for(var r=new I$({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||OY(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Pe(2));;){var s=new Pe(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};zi.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};zi.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new Pe(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new I$({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new Pe(1)),u=0;;u++){var f=i.k?i.k(u):new Pe(c.generate(this.n.byteLength()));if(f=this._truncateToN(f,!0),!(f.cmpn(1)<=0||f.cmp(l)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var h=d.getX(),p=h.umod(this.n);if(p.cmpn(0)!==0){var v=f.invm(this.n).mul(p.mul(r.getPrivate()).iadd(e));if(v=v.umod(this.n),v.cmpn(0)!==0){var b=(d.getY().isOdd()?1:0)|(h.cmp(p)!==0?2:0);return i.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),b^=1),new Pg({r:p,s:v,recoveryParam:b})}}}}}};zi.prototype.verify=function(e,r,n,i){e=this._truncateToN(new Pe(e,16)),n=this.keyFromPublic(n,i),r=new Pg(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),c=a.mul(e).umod(this.n),l=a.mul(s).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(c,n.getPublic(),l),u.isInfinity()?!1:u.eqXToP(s)):(u=this.g.mulAdd(c,n.getPublic(),l),u.isInfinity()?!1:u.getX().umod(this.n).cmp(s)===0)};zi.prototype.recoverPubKey=function(t,e,r,n){O$((3&r)===r,"The recovery param is more than two bits"),e=new Pg(e,n);var i=this.n,s=new Pe(t),o=e.r,a=e.s,c=r&1,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var u=e.r.invm(i),f=i.sub(s).mul(u).umod(i),d=a.mul(u).umod(i);return this.g.mulAdd(f,o,d)};zi.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Pg(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var $Y=ad(function(t,e){var r=e;r.version="6.5.4",r.utils=Si,r.rand=function(){throw new Error("unsupported")},r.curve=Ov,r.curves=Rv,r.ec=RY,r.eddsa=null}),MY=$Y.ec;const NY="signing-key/5.7.0",Ix=new ee(NY);let u2=null;function Ws(){return u2||(u2=new MY("secp256k1")),u2}class jm{constructor(e){ie(this,"curve","secp256k1"),ie(this,"privateKey",te(e)),lo(this.privateKey)!==32&&Ix.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=Ws().keyFromPrivate(re(this.privateKey));ie(this,"publicKey","0x"+r.getPublic(!1,"hex")),ie(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),ie(this,"_isSigningKey",!0)}_addPoint(e){const r=Ws().keyFromPublic(re(this.publicKey)),n=Ws().keyFromPublic(re(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=Ws().keyFromPrivate(re(this.privateKey)),n=re(e);n.length!==32&&Ix.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return Xl({recoveryParam:i.recoveryParam,r:dt("0x"+i.r.toString(16),32),s:dt("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=Ws().keyFromPrivate(re(this.privateKey)),n=Ws().keyFromPublic(re(m3(e)));return dt("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function R$(t,e){const r=Xl(e),n={r:re(r.r),s:re(r.s)};return"0x"+Ws().recoverPubKey(re(t),n,r.recoveryParam).encode("hex",!1)}function m3(t,e){const r=re(t);if(r.length===32){const n=new jm(r);return e?"0x"+Ws().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?te(r):"0x"+Ws().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+Ws().keyFromPublic(r).getPublic(!0,"hex"):te(r)}return Ix.throwArgumentError("invalid public or private key","key","[REDACTED]")}const DY="transactions/5.7.0",yn=new ee(DY);var Ox;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(Ox||(Ox={}));function y3(t){return t==="0x"?null:Ve(t)}function mn(t){return t==="0x"?tr:J.from(t)}const LY=[{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"}],FY={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function g3(t){const e=m3(t);return Ve(br(Be(br(e,1)),12))}function Fl(t,e){return g3(R$(re(t),e))}function li(t,e){const r=to(J.from(t).toHexString());return r.length>32&&yn.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function f2(t,e){return{address:Ve(t),storageKeys:(e||[]).map((r,n)=>(lo(r)!==32&&yn.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function eu(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&yn.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),f2(r[0],r[1])):f2(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return f2(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function $$(t){return eu(t).map(e=>[e.address,e.storageKeys])}function M$(t,e){if(t.gasPrice!=null){const n=J.from(t.gasPrice),i=J.from(t.maxFeePerGas||0);n.eq(i)||yn.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[li(t.chainId||0,"chainId"),li(t.nonce||0,"nonce"),li(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),li(t.maxFeePerGas||0,"maxFeePerGas"),li(t.gasLimit||0,"gasLimit"),t.to!=null?Ve(t.to):"0x",li(t.value||0,"value"),t.data||"0x",$$(t.accessList||[])];if(e){const n=Xl(e);r.push(li(n.recoveryParam,"recoveryParam")),r.push(to(n.r)),r.push(to(n.s))}return Rn(["0x02",Nl(r)])}function N$(t,e){const r=[li(t.chainId||0,"chainId"),li(t.nonce||0,"nonce"),li(t.gasPrice||0,"gasPrice"),li(t.gasLimit||0,"gasLimit"),t.to!=null?Ve(t.to):"0x",li(t.value||0,"value"),t.data||"0x",$$(t.accessList||[])];if(e){const n=Xl(e);r.push(li(n.recoveryParam,"recoveryParam")),r.push(to(n.r)),r.push(to(n.s))}return Rn(["0x01",Nl(r)])}function BY(t,e){e3(t,FY);const r=[];LY.forEach(function(o){let a=t[o.name]||[];const c={};o.numeric&&(c.hexPad="left"),a=re(te(a,c)),o.length&&a.length!==o.length&&a.length>0&&yn.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,a),o.maxLength&&(a=to(a),a.length>o.maxLength&&yn.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,a)),r.push(te(a))});let n=0;if(t.chainId!=null?(n=t.chainId,typeof n!="number"&&yn.throwArgumentError("invalid transaction.chainId","transaction",t)):e&&!Wo(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),n!==0&&(r.push(te(n)),r.push("0x"),r.push("0x")),!e)return Nl(r);const i=Xl(e);let s=27+i.recoveryParam;return n!==0?(r.pop(),r.pop(),r.pop(),s+=n*2+8,i.v>28&&i.v!==s&&yn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==s&&yn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(te(s)),r.push(to(re(i.r))),r.push(to(re(i.s))),Nl(r)}function jY(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&yn.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),BY(t,e);switch(t.type){case 1:return N$(t,e);case 2:return M$(t,e)}return yn.throwError(`unsupported transaction type: ${t.type}`,ee.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function D$(t,e,r){try{const n=mn(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{yn.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=dt(e[1],32),t.s=dt(e[2],32);try{const n=Be(r(t));t.from=Fl(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function UY(t){const e=Sg(t.slice(1));e.length!==9&&e.length!==12&&yn.throwArgumentError("invalid component count for transaction type: 2","payload",te(t));const r=mn(e[2]),n=mn(e[3]),i={type:2,chainId:mn(e[0]).toNumber(),nonce:mn(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:mn(e[4]),to:y3(e[5]),value:mn(e[6]),data:e[7],accessList:eu(e[8])};return e.length===9||(i.hash=Be(t),D$(i,e.slice(9),M$)),i}function zY(t){const e=Sg(t.slice(1));e.length!==8&&e.length!==11&&yn.throwArgumentError("invalid component count for transaction type: 1","payload",te(t));const r={type:1,chainId:mn(e[0]).toNumber(),nonce:mn(e[1]).toNumber(),gasPrice:mn(e[2]),gasLimit:mn(e[3]),to:y3(e[4]),value:mn(e[5]),data:e[6],accessList:eu(e[7])};return e.length===8||(r.hash=Be(t),D$(r,e.slice(8),N$)),r}function WY(t){const e=Sg(t);e.length!==9&&e.length!==6&&yn.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:mn(e[0]).toNumber(),gasPrice:mn(e[1]),gasLimit:mn(e[2]),to:y3(e[3]),value:mn(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=J.from(e[6]).toNumber()}catch{return r}if(r.r=dt(e[7],32),r.s=dt(e[8],32),J.from(r.r).isZero()&&J.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 n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(te(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=Be(Nl(i));try{r.from=Fl(s,{r:te(r.r),s:te(r.s),recoveryParam:n})}catch{}r.hash=Be(t)}return r.type=null,r}function L$(t){const e=re(t);if(e[0]>127)return WY(e);switch(e[0]){case 1:return zY(e);case 2:return UY(e)}return yn.throwError(`unsupported transaction type: ${e[0]}`,ee.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const HY="contracts/5.7.0";var Bl=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const gr=new ee(HY);function Um(t,e){return Bl(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&gr.throwArgumentError("invalid address or ENS name","name",r);try{return Ve(r)}catch{}t||gr.throwError("a provider or signer is needed to resolve ENS names",ee.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&gr.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function $v(t,e,r){return Bl(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>$v(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield Um(t,e):r.type==="tuple"?yield $v(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>$v(t,n,r.arrayChildren))):Promise.reject(gr.makeError("invalid value for array",ee.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function Tg(t,e,r){return Bl(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=Vt(r.pop())),gr.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=vt({override:Um(t.signer,n.from),signer:t.signer.getAddress()}).then(l=>Bl(this,void 0,void 0,function*(){return Ve(l.signer)!==l.override&&gr.throwError("Contract with a Signer cannot override from",ee.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),l.override})):n.from=t.signer.getAddress():n.from&&(n.from=Um(t.provider,n.from));const i=yield vt({args:$v(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:vt(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),o={data:s,to:i.address},a=i.overrides;if(a.nonce!=null&&(o.nonce=J.from(a.nonce).toNumber()),a.gasLimit!=null&&(o.gasLimit=J.from(a.gasLimit)),a.gasPrice!=null&&(o.gasPrice=J.from(a.gasPrice)),a.maxFeePerGas!=null&&(o.maxFeePerGas=J.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(o.maxPriorityFeePerGas=J.from(a.maxPriorityFeePerGas)),a.from!=null&&(o.from=a.from),a.type!=null&&(o.type=a.type),a.accessList!=null&&(o.accessList=eu(a.accessList)),o.gasLimit==null&&e.gas!=null){let l=21e3;const u=re(s);for(let f=0;fn[l]!=null);return c.length&&gr.throwError(`cannot override ${c.map(l=>JSON.stringify(l)).join(",")}`,ee.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),o})}function qY(t,e){return function(...r){return Tg(t,e,r)}}function VY(t,e){const r=t.signer||t.provider;return function(...n){return Bl(this,void 0,void 0,function*(){r||gr.throwError("estimate require a provider or signer",ee.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Tg(t,e,n);return yield r.estimateGas(i)})}}function GY(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(s=>{let o=mi(s),a=null;try{a=t.interface.parseLog(s)}catch{}return a&&(o.args=a.args,o.decode=(c,l)=>t.interface.decodeEventLog(a.eventFragment,c,l),o.event=a.name,o.eventSignature=a.signature),o.removeListener=()=>t.provider,o.getBlock=()=>t.provider.getBlock(i.blockHash),o.getTransaction=()=>t.provider.getTransaction(i.transactionHash),o.getTransactionReceipt=()=>Promise.resolve(i),o}),i))}function F$(t,e,r){const n=t.signer||t.provider;return function(...i){return Bl(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const c=Vt(i.pop());c.blockTag!=null&&(s=yield c.blockTag),delete c.blockTag,i.push(c)}t.deployTransaction!=null&&(yield t._deployed(s));const o=yield Tg(t,e,i),a=yield n.call(o,s);try{let c=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(c=c[0]),c}catch(c){throw c.code===ee.errors.CALL_EXCEPTION&&(c.address=t.address,c.args=i,c.transaction=o),c}})}}function KY(t,e){return function(...r){return Bl(this,void 0,void 0,function*(){t.signer||gr.throwError("sending a transaction requires a signer",ee.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield Tg(t,e,r),i=yield t.signer.sendTransaction(n);return GY(t,i),i})}}function P4(t,e,r){return e.constant?F$(t,e,r):KY(t,e)}function B$(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class A0{constructor(e,r){ie(this,"tag",e),ie(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class QY extends A0{constructor(){super("error",null)}}class T4 extends A0{constructor(e,r,n,i){const s={address:e};let o=r.getEventTopic(n);i?(o!==i[0]&&gr.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[o],super(B$(s),s),ie(this,"address",e),ie(this,"interface",r),ie(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=DR(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class I4 extends A0{constructor(e,r){super("*",{address:e}),ie(this,"address",e),ie(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}class YY{constructor(e,r,n){ie(this,"interface",vs(new.target,"getInterface")(r)),n==null?(ie(this,"provider",null),ie(this,"signer",null)):Dl.isSigner(n)?(ie(this,"provider",n.provider||null),ie(this,"signer",n)):Tc.isProvider(n)?(ie(this,"provider",n),ie(this,"signer",null)):gr.throwArgumentError("invalid signer or provider","signerOrProvider",n),ie(this,"callStatic",{}),ie(this,"estimateGas",{}),ie(this,"functions",{}),ie(this,"populateTransaction",{}),ie(this,"filters",{});{const o={};Object.keys(this.interface.events).forEach(a=>{const c=this.interface.events[a];ie(this.filters,a,(...l)=>({address:this.address,topics:this.interface.encodeFilterTopics(c,l)})),o[c.name]||(o[c.name]=[]),o[c.name].push(a)}),Object.keys(o).forEach(a=>{const c=o[a];c.length===1?ie(this.filters,a,this.filters[c[0]]):gr.warn(`Duplicate definition of ${a} (${c.join(", ")})`)})}if(ie(this,"_runningEvents",{}),ie(this,"_wrappedEmits",{}),e==null&&gr.throwArgumentError("invalid contract address or ENS name","addressOrName",e),ie(this,"address",e),this.provider)ie(this,"resolvedAddress",Um(this.provider,e));else try{ie(this,"resolvedAddress",Promise.resolve(Ve(e)))}catch{gr.throwError("provider is required to use ENS name as contract address",ee.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(o=>{});const i={},s={};Object.keys(this.interface.functions).forEach(o=>{const a=this.interface.functions[o];if(s[o]){gr.warn(`Duplicate ABI entry for ${JSON.stringify(o)}`);return}s[o]=!0;{const c=a.name;i[`%${c}`]||(i[`%${c}`]=[]),i[`%${c}`].push(o)}this[o]==null&&ie(this,o,P4(this,a,!0)),this.functions[o]==null&&ie(this.functions,o,P4(this,a,!1)),this.callStatic[o]==null&&ie(this.callStatic,o,F$(this,a,!0)),this.populateTransaction[o]==null&&ie(this.populateTransaction,o,qY(this,a)),this.estimateGas[o]==null&&ie(this.estimateGas,o,VY(this,a))}),Object.keys(i).forEach(o=>{const a=i[o];if(a.length>1)return;o=o.substring(1);const c=a[0];try{this[o]==null&&ie(this,o,this[c])}catch{}this.functions[o]==null&&ie(this.functions,o,this.functions[c]),this.callStatic[o]==null&&ie(this.callStatic,o,this.callStatic[c]),this.populateTransaction[o]==null&&ie(this.populateTransaction,o,this.populateTransaction[c]),this.estimateGas[o]==null&&ie(this.estimateGas,o,this.estimateGas[c])})}static getContractAddress(e){return n3(e)}static getInterface(e){return jr.isInterface(e)?e:new jr(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(r=>(r==="0x"&&gr.throwError("contract not deployed",ee.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||gr.throwError("sending a transactions require a signer",ee.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=Vt(e||{});return["from","to"].forEach(function(n){r[n]!=null&&gr.throwError("cannot override "+n,ee.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new d3(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&ie(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return Lm.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new QY);if(e==="event")return this._normalizeRunningEvent(new A0("event",null));if(e==="*")return this._normalizeRunningEvent(new I4(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new T4(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new T4(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new A0(B$(r),r))}return this._normalizeRunningEvent(new I4(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=mi(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||gr.throwError("events require a provider or a signer with a provider",ee.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let o=this._wrapEvent(e,s,r);if(o.decodeError==null)try{const a=e.getEmit(o);this.emit(e.filter,...a)}catch(a){o.decodeError=a.error}e.filter!=null&&this.emit("event",o),o.decodeError!=null&&this.emit("error",o.decodeError,o)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=Vt(i.filter);return typeof r=="string"&&je(r,32)?(n!=null&&gr.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(o=>o.map(a=>this._wrapEvent(i,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}}class cd extends YY{}class j${constructor(e){ie(this,"alphabet",e),ie(this,"base",e.length),ie(this,"_alphabetMap",{}),ie(this,"_leader",e.charAt(0));for(let r=0;r0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s=0;--s)i+=this.alphabet[n[s]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n>=8;for(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n>24&255,c[e.length+1]=f>>16&255,c[e.length+2]=f>>8&255,c[e.length+3]=f&255;let d=re(_0(i,t,c));s||(s=d.length,u=new Uint8Array(s),o=Math.ceil(n/s),l=n-(o-1)*s),u.set(d);for(let v=1;v=256)throw new Error("Depth too large!");return C4(qt([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",te(this.depth),this.parentFingerprint,dt(te(this.index),4),this.chainCode,this.privateKey!=null?qt(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new xo(hu,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(e&~_u));const n=new Uint8Array(37);if(e&_u){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(re(this.privateKey),1),r&&(r+="'")}else n.set(re(this.publicKey));for(let f=24;f>=0;f-=8)n[33+(f>>3)]=e>>24-f&255;const i=re(S0(Mf.sha512,this.chainCode,n)),s=i.slice(0,32),o=i.slice(32);let a=null,c=null;this.privateKey?a=Ip(J.from(s).add(this.privateKey).mod(IY)):c=new Nm(te(s))._addPoint(this.publicKey);let l=r;const u=this.mnemonic;return u&&(l=Object.freeze({phrase:u.phrase,path:r,locale:u.locale||"en"})),new xo(hu,a,c,this.fingerprint,Ip(o),e,this.depth+1,l)}derivePath(e){const r=e.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);r[0]==="m"&&r.shift();let n=this;for(let i=0;i=_u)throw new Error("invalid path index - "+s);n=n._derive(_u+o)}else if(s.match(/^[0-9]+$/)){const o=parseInt(s);if(o>=_u)throw new Error("invalid path index - "+s);n=n._derive(o)}else throw new Error("invalid path component - "+s)}return n}static _fromSeed(e,r){const n=re(e);if(n.length<16||n.length>64)throw new Error("invalid seed");const i=re(S0(Mf.sha512,OY,n));return new xo(hu,Ip(i.slice(0,32)),null,"0x00000000",Ip(i.slice(32)),0,0,r)}static fromMnemonic(e,r,n){return n=f3(n),e=$M(d3(e,n),n),xo._fromSeed(MM(e,r),{phrase:e,path:"m",locale:n.locale})}static fromSeed(e){return xo._fromSeed(e,null)}static fromExtendedKey(e){const r=Rf.decode(e);(r.length!==82||C4(r.slice(0,78))!==e)&&k0.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const n=r[4],i=te(r.slice(5,9)),s=parseInt(te(r.slice(9,13)).substring(2),16),o=te(r.slice(13,45)),a=r.slice(45,78);switch(te(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new xo(hu,null,te(a),i,o,s,n,null);case"0x0488ade4":case"0x04358394 ":if(a[0]!==0)break;return new xo(hu,te(a.slice(1)),null,i,o,s,n,null)}return k0.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function MM(t,e){e||(e="");const r=wt("mnemonic"+e,Ho.NFKD);return SY(wt(t,Ho.NFKD),r,2048,64,"sha512")}function d3(t,e){e=f3(e),k0.checkNormalize();const r=e.split(t);if(r.length%3!==0)throw new Error("invalid mnemonic");const n=re(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let l=0;l>3]|=1<<7-i%8),i++}const s=32*r.length/3,o=r.length/3,a=RM(o);if((re(Go(n.slice(0,s/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return te(n.slice(0,s/8))}function $M(t,e){if(e=f3(e),t=re(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&RY(8-n)),n+=3);const i=t.length/4,s=re(Go(t))[0]&RM(i);return r[r.length-1]<<=i,r[r.length-1]|=s>>8-i,e.join(r.map(o=>e.getWord(o)))}function $Y(t,e){try{return d3(t,e),!0}catch{}return!1}function NY(t){return(typeof t!="number"||t<0||t>=_u||t%1)&&k0.throwArgumentError("invalid account index","index",t),`m/44'/60'/${t}'/0/0`}const DY="random/5.7.0",kx=new ee(DY);function LY(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const S4=LY();let Tv=S4.crypto||S4.msCrypto;(!Tv||!Tv.getRandomValues)&&(kx.warn("WARNING: Missing strong random number source"),Tv={getRandomValues:function(t){return kx.throwError("no secure random source avaialble",ee.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function A1(t){(t<=0||t>1024||t%1||t!=t)&&kx.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return Tv.getRandomValues(e),re(e)}function NM(t){t=t.slice();for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}function BY(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return e.encseed&&e.ethaddr}function FY(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return!(!e.version||parseInt(e.version)!==e.version||parseInt(e.version)!==3)}function jY(t){if(BY(t))try{return qe(JSON.parse(t).ethaddr)}catch{return null}if(FY(t))try{return qe(JSON.parse(t).address)}catch{return null}return null}globalThis&&globalThis.__awaiter;function DM(t,e){return Ll(n3(t),e)}function UY(t,e,r,n){return Ll(Wr.hash(t,e,r),n)}const zY="networks/5.7.1",k4=new ee(zY);function WY(t){return t&&typeof t.renetwork=="function"}function _o(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const s=["goerli","ropsten","rinkeby","sepolia"];try{const o=new r.PocketProvider(t,n.pocket);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const s=["ropsten"],o=new r.AnkrProvider(t,n.ankr);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let s=1;return n.quorum!=null?s=n.quorum:t==="homestead"&&(s=2),new r.FallbackProvider(i,s)}return i[0]};return e.renetwork=function(r){return _o(r)},e}function Lm(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return Lm(t,n)},r}const A4={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:_o("homestead")},_4={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:_o("ropsten")},P4={chainId:63,name:"classicMordor",_defaultProvider:Lm("https://www.ethercluster.com/mordor","classicMordor")},Op={unspecified:{chainId:0,name:"unspecified"},homestead:A4,mainnet:A4,morden:{chainId:2,name:"morden"},ropsten:_4,testnet:_4,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:Lm("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:P4,classicTestnet:P4,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Lm("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 HY(t){if(t==null)return null;if(typeof t=="number"){for(const n in Op){const i=Op[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=Op[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=Op[t.name];if(!e)return typeof t.chainId!="number"&&k4.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&k4.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(WY(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}const qY="web/5.7.1";var VY=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};function GY(t,e){return VY(this,void 0,void 0,function*(){e==null&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};if(e.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),e.fetchOptions!=null){const o=e.fetchOptions;o.mode&&(r.mode=o.mode),o.cache&&(r.cache=o.cache),o.credentials&&(r.credentials=o.credentials),o.redirect&&(r.redirect=o.redirect),o.referrer&&(r.referrer=o.referrer)}const n=yield fetch(t,r),i=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach((o,a)=>{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:re(new Uint8Array(i))}})}var KY=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const is=new ee(qY);function T4(t){return new Promise(e=>{setTimeout(e,t)})}function Ca(t,e){if(t==null)return null;if(typeof t=="string")return t;if(Wo(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return la(t)}catch{}return te(t)}return t}function QY(t){return wt(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function LM(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;is.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;is.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};let c=null;const l={method:"GET"};let u=!1,f=2*60*1e3;if(typeof t=="string")c=t;else if(typeof t=="object"){if((t==null||t.url==null)&&is.throwArgumentError("missing URL","connection.url",t),c=t.url,typeof t.timeout=="number"&&t.timeout>0&&(f=t.timeout),t.headers)for(const y in t.headers)a[y.toLowerCase()]={key:y,value:String(t.headers[y])},["if-none-match","if-modified-since"].indexOf(y.toLowerCase())>=0&&(u=!0);if(l.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){c.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&is.throwError("basic authentication requires a secure https url",ee.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:t.user,password:"[REDACTED]"});const y=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+t3(wt(y))}}t.skipFetchSetup!=null&&(l.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(l.fetchOptions=Vt(t.fetchOptions))}const d=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=c?c.match(d):null;if(h)try{const y={statusCode:200,statusMessage:"OK",headers:{"content-type":h[1]||"text/plain"},body:h[2]?e3(h[3]):QY(h[3])};let m=y.body;return r&&(m=r(y.body,y)),Promise.resolve(m)}catch(y){is.throwError("processing response error",ee.errors.SERVER_ERROR,{body:Ca(h[1],h[2]),error:y,requestBody:null,requestMethod:"GET",url:c})}e&&(l.method="POST",l.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const p={};Object.keys(a).forEach(y=>{const m=a[y];p[m.key]=m.value}),l.headers=p;const v=function(){let y=null;return{promise:new Promise(function(S,P){f&&(y=setTimeout(()=>{y!=null&&(y=null,P(is.makeError("timeout",ee.errors.TIMEOUT,{requestBody:Ca(l.body,p["content-type"]),requestMethod:l.method,timeout:f,url:c})))},f))}),cancel:function(){y!=null&&(clearTimeout(y),y=null)}}}(),b=function(){return KY(this,void 0,void 0,function*(){for(let y=0;y=300)&&(v.cancel(),is.throwError("bad response",ee.errors.SERVER_ERROR,{status:m.statusCode,headers:m.headers,body:Ca(g,m.headers?m.headers["content-type"]:null),requestBody:Ca(l.body,p["content-type"]),requestMethod:l.method,url:c})),r)try{const S=yield r(g,m);return v.cancel(),S}catch(S){if(S.throttleRetry&&y{let a=null;if(s!=null)try{a=JSON.parse(la(s))}catch(c){is.throwError("invalid JSON",ee.errors.SERVER_ERROR,{body:s,error:c})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=wt(e);const s=typeof t=="string"?{url:t}:Vt(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=Vt(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return LM(t,i,n)}function za(t,e){return e||(e={}),e=Vt(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let c=0;function l(){return t().then(function(u){if(u!==void 0)o()&&r(u);else if(e.oncePoll)e.oncePoll.once("poll",l);else if(e.onceBlock)e.onceBlock.once("block",l);else if(!s){if(c++,c>a){o()&&n(new Error("retry limit reached"));return}let f=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));fe.ceiling&&(f=e.ceiling),setTimeout(l,f)}return null},function(u){o()&&n(u)})}l()})}var Bm="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Ax={};for(var Rp=0;Rp>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function BM(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=uf(e)^n>>5}for(e=uf(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=BM(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s>5)throw new Error("Non 5-bit word");n=uf(n)^o,i+=Bm.charAt(o)}for(s=0;s<6;++s)n=uf(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=Bm.charAt(a)}return i}function FM(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=BM(s);if(typeof a=="string")return a;for(var c=[],l=0;l=o.length)&&c.push(f)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:c}}function JY(){var t=FM.apply(null,arguments);if(typeof t=="object")return t}function XY(t){var e=FM.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function Sg(t,e,r,n){for(var i=0,s=0,o=(1<=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<=e)return"Excess padding";if(i<this.data(f,!0);return e.transaction={hash:o,type:l,accessList:de.allowNull(this.accessList.bind(this),null),blockHash:de.allowNull(o,null),blockNumber:de.allowNull(c,null),transactionIndex:de.allowNull(c,null),confirmations:de.allowNull(c,null),from:r,gasPrice:de.allowNull(n),maxPriorityFeePerGas:de.allowNull(n),maxFeePerGas:de.allowNull(n),gasLimit:n,to:de.allowNull(r,null),value:n,nonce:c,data:s,r:de.allowNull(this.uint256),s:de.allowNull(this.uint256),v:de.allowNull(c),creates:de.allowNull(r,null),raw:de.allowNull(s)},e.transactionRequest={from:de.allowNull(r),nonce:de.allowNull(c),gasLimit:de.allowNull(n),gasPrice:de.allowNull(n),maxPriorityFeePerGas:de.allowNull(n),maxFeePerGas:de.allowNull(n),to:de.allowNull(r),value:de.allowNull(n),data:de.allowNull(u),type:de.allowNull(c),accessList:de.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:o,address:r,topics:de.arrayOf(o),data:s,logIndex:c,blockHash:o},e.receipt={to:de.allowNull(this.address,null),from:de.allowNull(this.address,null),contractAddress:de.allowNull(r,null),transactionIndex:c,root:de.allowNull(a),gasUsed:n,logsBloom:de.allowNull(s),blockHash:o,transactionHash:o,logs:de.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:de.allowNull(c,null),cumulativeGasUsed:n,effectiveGasPrice:de.allowNull(n),status:de.allowNull(c),type:l},e.block={hash:de.allowNull(o),parentHash:o,number:c,timestamp:c,nonce:de.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:de.allowNull(r),extraData:s,transactions:de.allowNull(de.arrayOf(o)),baseFeePerGas:de.allowNull(n)},e.blockWithTransactions=Vt(e.block),e.blockWithTransactions.transactions=de.allowNull(de.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:de.allowNull(i,void 0),toBlock:de.allowNull(i,void 0),blockHash:de.allowNull(o,void 0),address:de.allowNull(r,void 0),topics:de.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:de.allowNull(c),blockHash:de.allowNull(o),transactionIndex:c,removed:de.allowNull(this.boolean.bind(this)),address:r,data:de.allowFalsish(s,"0x"),topics:de.arrayOf(o),transactionHash:o,logIndex:c},e}accessList(e){return Zl(e||[])}number(e){return e==="0x"?0:J.from(e).toNumber()}type(e){return e==="0x"||e==null?0:J.from(e).toNumber()}bigNumber(e){return J.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),Fe(e))?e.toLowerCase():qd.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return qe(e)}callAddress(e){if(!Fe(e,32))return null;const r=qe(br(e,12));return r===lr?null:r}contractAddress(e){return Q6(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||Fe(e))return gs(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return co(n)!==32?qd.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=J.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!Fe(e))throw new Error("invalid uint256");return dt(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=de.check(r,e);return i._difficulty=n==null?null:J.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return de.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&J.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=de.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;Fe(n)&&(n=J.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),Fe(n)&&(n=J.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return AM(e)}receiptLog(e){return de.check(this.formats.receiptLog,e)}receipt(e){const r=de.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=J.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&qd.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):qd.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&qd.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return de.check(this.formats.filter,e)}filterLog(e){return de.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}function iJ(t){return t&&typeof t.isCommunityResource=="function"}function O4(t){return iJ(t)&&t.isCommunityResource()}var Se=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const He=new ee(od),sJ=10;function R4(t){return t==null?"null":(co(t)!==32&&He.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function M4(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[R4(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return R4(e)}).join("&")}function oJ(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function pu(t){if(typeof t=="string"){if(t=t.toLowerCase(),co(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+M4(t);if(gK.isForkEvent(t))throw He.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+M4(t.topics||[])}throw new Error("invalid event - "+t)}function Vd(){return new Date().getTime()}function $4(t){return new Promise(e=>{setTimeout(e,t)})}const aJ=["block","network","pending","poll"];let cJ=class{constructor(e,r,n){ie(this,"tag",e),ie(this,"listener",r),ie(this,"once",n),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(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=oJ(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||aJ.indexOf(this.tag)>=0}};const lJ={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 o2(t){return dt(J.from(t).toHexString(),32)}function N4(t){return Rf.encode(qt([t,br(Go(Go(t)),0,4)]))}const jM=new RegExp("^(ipfs)://(.*)$","i"),D4=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),jM,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Iv(t,e){try{return la(A0(t,e))}catch{}return null}function A0(t,e){if(t==="0x")return null;const r=J.from(br(t,e,e+32)).toNumber(),n=J.from(br(t,r,r+32)).toNumber();return br(t,r+32,r+32+n)}function a2(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):He.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function L4(t){const e=re(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function uJ(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function UM(t){const e=[];let r=0;for(let n=0;nJ.from(e).eq(1)).catch(e=>{if(e.code===ee.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return Se(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:Rn([e,Ih(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=Rn(["0x9061b923",UM([VR(this.name),n.data])]));try{let s=yield this.provider.call(n);return re(s).length%32===4&&He.throwError("resolver threw error",ee.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=A0(s,0)),s}catch(s){if(s.code===ee.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return Se(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?A0(n,0):null})}_getAddress(e,r){const n=lJ[String(e)];if(n==null&&He.throwError(`unsupported coin type: ${e}`,ee.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=re(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return N4(qt([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return N4(qt([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=I4.toWords(i.slice(2));return a.unshift(o),I4.encode(n.prefix,a)}}return null}getAddress(e){return Se(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===Tm?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===ee.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",o2(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&He.throwError("invalid or unsupported coin data",ee.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return Se(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;no[c])}return He.throwError("invalid or unsupported content hash data",ee.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return Se(this,void 0,void 0,function*(){let r=wt(e);r=qt([o2(64),o2(r.length),r]),r.length%32!==0&&(r=qt([r,dt("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",te(r));return n==null||n==="0x"?null:la(n)})}}let c2=null,fJ=1;class kg extends Tc{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),ie(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=hs(new.target,"getNetwork")(e);r?(ie(this,"_network",r),this.emit("network",r,null)):He.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Se(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||He.throwError("no network detected",ee.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:ie(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return za(()=>this._ready().then(e=>e,e=>{if(!(e.code===ee.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return c2==null&&(c2=new de),c2}static getNetwork(e){return HY(e??"homestead")}ccipReadFetch(e,r,n){return Se(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=0?null:JSON.stringify({data:s,sender:i}),f=yield _1({url:l,errorPassThrough:!0},u,(h,p)=>(h.status=p.statusCode,h));if(f.data)return f.data;const d=f.message||"unknown error";if(f.status>=400&&f.status<500)return He.throwError(`response not found during CCIP fetch: ${d}`,ee.errors.SERVER_ERROR,{url:c,errorMessage:d});o.push(d)}return He.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,ee.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(e){return Se(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(Vd()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=Vd(),n=vt({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=Vd();return i=J.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return Se(this,void 0,void 0,function*(){const e=fJ++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)He.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",He.makeError("network block skew detected",ee.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).then(c=>{i._inflight=!1,c.length!==0&&c.forEach(l=>{l.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=l.blockNumber),this._emitted["b:"+l.blockHash]=l.blockNumber,this._emitted["t:"+l.transactionHash]=l.blockNumber,this.emit(s,l)})}).catch(c=>{this.emit("error",c),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Se(this,void 0,void 0,function*(){return He.throwError("provider does not support network detection",ee.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return Se(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,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",r,e),yield $4(0),this._network;const n=He.makeError("underlying network changed",ee.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}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(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=Vd();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return Se(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return Se(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const c=[];let l=!1;const u=function(){return l?!0:(l=!0,c.forEach(d=>{d()}),!1)},f=d=>{d.confirmations{this.removeListener(e,f)}),i){let d=i.startBlock,h=null;const p=v=>Se(this,void 0,void 0,function*(){l||(yield $4(1e3),this.getTransactionCount(i.from).then(b=>Se(this,void 0,void 0,function*(){if(!l){if(b<=i.nonce)d=v;else{{const y=yield this.getTransaction(e);if(y&&y.blockNumber!=null)return}for(h==null&&(h=d-3,h{l||this.once("block",p)}))});if(l)return;this.once("block",p),c.push(()=>{this.removeListener("block",p)})}if(typeof n=="number"&&n>0){const d=setTimeout(()=>{u()||a(He.makeError("timeout exceeded",ee.errors.TIMEOUT,{timeout:n}))},n);d.unref&&d.unref(),c.push(()=>{clearTimeout(d)})}})})}getBlockNumber(){return Se(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return Se(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return J.from(e)}catch(r){return He.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return Se(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield vt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return J.from(i)}catch(s){return He.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return Se(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield vt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return J.from(i).toNumber()}catch(s){return He.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return Se(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield vt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return te(i)}catch(s){return He.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return Se(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield vt({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>gs(o))}),s=yield this.perform("getStorageAt",i);try{return te(s)}catch(o){return He.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&co(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&He.throwError("Transaction hash mismatch from Provider.sendTransaction.",ee.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>Se(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const c=yield this._waitForTransaction(e.hash,s,o,a);return c==null&&s===0?null:(this._emitted["t:"+e.hash]=c.blockNumber,c.status===0&&He.throwError("transaction failed",ee.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:c}),c)}),i}sendTransaction(e){return Se(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>te(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return Se(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?J.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?te(s):null))}),this.formatter.transactionRequest(yield vt(n))})}_getFilter(e){return Se(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield vt(r))})}_call(e,r,n){return Se(this,void 0,void 0,function*(){n>=sJ&&He.throwError("CCIP read exceeded maximum redirections",ee.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&co(s)%32===4)try{const o=br(s,4),a=br(o,0,32);J.from(a).eq(i)||He.throwError("CCIP Read sender did not match",ee.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const c=[],l=J.from(br(o,32,64)).toNumber(),u=J.from(br(o,l,l+32)).toNumber(),f=br(o,l+32);for(let y=0;ySe(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let c=0;cthis._wrapTransaction(c)),a}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Se(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return za(()=>Se(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return Se(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return za(()=>Se(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return Se(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield vt({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),de.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return Se(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return Se(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&He.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return Se(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new _x(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return Se(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||He.throwError("network does not support ENS",ee.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+Ih(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return Se(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(Fe(e))throw n}typeof e!="string"&&He.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return Se(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=Iv(yield this.call({to:n,data:"0x691f3431"+Ih(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return Se(this,void 0,void 0,function*(){let r=null;if(Fe(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new _x(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==ee.errors.CALL_EXCEPTION)throw a}try{const a=Iv(yield this.call({to:o,data:"0x691f3431"+Ih(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==ee.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return He.throwError(e+" not implemented",ee.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new cJ(pu(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=pu(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=pu(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=pu(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=pu(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=pu(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var Co=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const kr=new ee(od),dJ=["call","estimateGas"];function Rh(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=Fe(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=Rh(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return Rh(JSON.parse(t),e)}catch{}return null}function zM(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=Rh(e,!0);if(s)return s.data;kr.throwError("missing revert data in call exception; Transaction reverted without a reason string",ee.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=Rh(e.body,!1);s==null&&(s=Rh(e,!1)),s&&kr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ee.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===ee.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&kr.throwError("insufficient funds for intrinsic transaction cost",ee.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&kr.throwError("nonce has already been used",ee.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&kr.throwError("replacement fee too low",ee.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&kr.throwError("legacy pre-eip-155 transactions not supported",ee.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),dJ.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&kr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ee.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function B4(t){return new Promise(function(e){setTimeout(e,t)})}function hJ(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function Gd(t){return t&&t.toLowerCase()}const Px={};class WM extends Nl{constructor(e,r,n){if(super(),e!==Px)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");ie(this,"provider",r),n==null&&(n=0),typeof n=="string"?(ie(this,"_address",this.provider.formatter.address(n)),ie(this,"_index",null)):typeof n=="number"?(ie(this,"_index",n),ie(this,"_address",null)):kr.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return kr.throwError("cannot alter JSON-RPC Signer connection",ee.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new pJ(Px,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&&kr.throwError("unknown account #"+this._index,ee.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=Vt(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=Vt(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>Co(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&kr.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),vt({tx:vt(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&kr.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&kr.throwError("user rejected transaction",ee.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),zM("sendTransaction",o,s)))})}signTransaction(e){return kr.throwError("signing transactions is unsupported",ee.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Co(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield za(()=>Co(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return Co(this,void 0,void 0,function*(){const r=typeof e=="string"?wt(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[te(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&kr.throwError("user rejected signing",ee.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return Co(this,void 0,void 0,function*(){const r=typeof e=="string"?wt(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),te(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&kr.throwError("user rejected signing",ee.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return Co(this,void 0,void 0,function*(){const i=yield Wr.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(Wr.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&kr.throwError("user rejected signing",ee.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return Co(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class pJ extends WM{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const vJ={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};let Ko=class extends kg{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=hs(this.constructor,"defaultUrl")()),typeof e=="string"?ie(this,"connection",Object.freeze({url:e})):ie(this,"connection",Object.freeze(Vt(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(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 Co(this,void 0,void 0,function*(){yield B4(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=hs(this.constructor,"getNetwork");try{return r(J.from(e).toNumber())}catch(n){return kr.throwError("could not detect network",ee.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return kr.throwError("could not detect network",ee.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new WM(Px,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:vi(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=_1(this.connection,JSON.stringify(n),hJ).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Gd(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Gd(r.address),r.blockTag]];case"getCode":return["eth_getCode",[Gd(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Gd(r.address),dt(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[hs(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[hs(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=Gd(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return Co(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&J.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=Vt(r),r.transaction=Vt(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&kr.throwError(e+" not implemented",ee.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return zM(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(c){return e.emit("pending",c),null})})}),o.then(function(){return B4(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=Vt(vJ);if(r)for(const s in r)r[s]&&(n[s]=!0);V6(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=gs(J.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=te(e[s]))}),e.accessList&&(i.accessList=Zl(e.accessList)),i}};var mJ=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const yJ=new ee(od);class Fm extends Ko{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return mJ(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||yJ.throwError("no network detected",ee.errors.UNKNOWN_ERROR,{}),this._network==null&&(ie(this,"_network",r),this.emit("network",r,null))),r})}}var jm=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const il=new ee(od);function Mp(){return new Date().getTime()}function F4(t){let e=null;for(let r=0;re?null:(n+i)/2}function Vu(t){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return JSON.stringify(t);if(typeof t=="string")return t;if(J.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map(e=>Vu(e)));if(typeof t=="object"){const e=Object.keys(t);return e.sort(),"{"+e.map(r=>{let n=t[r];return typeof n=="function"?n="[function]":n=Vu(n),JSON.stringify(r)+":"+n}).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}let gJ=1;function U4(t){let e=null,r=null,n=new Promise(o=>{e=function(){r&&(clearTimeout(r),r=null),o()},r=setTimeout(e,t)});const i=o=>(n=n.then(o),n);function s(){return n}return{cancel:e,getPromise:s,wait:i}}const bJ=[ee.errors.CALL_EXCEPTION,ee.errors.INSUFFICIENT_FUNDS,ee.errors.NONCE_EXPIRED,ee.errors.REPLACEMENT_UNDERPRICED,ee.errors.UNPREDICTABLE_GAS_LIMIT],wJ=["address","args","errorArgs","errorSignature","method","transaction"];function $p(t,e){const r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function EJ(t,e){return function(r){const n={};r.forEach(s=>{const o=t(s.result);n[o]||(n[o]={count:0,result:s.result}),n[o].count++});const i=Object.keys(n);for(let s=0;s=e)return o.result}}}function xJ(t,e,r){let n=Vu;switch(e){case"getBlockNumber":return function(i){const s=i.map(a=>a.result);let o=j4(i.map(a=>a.result),2);if(o!=null)return o=Math.ceil(o),s.indexOf(o+1)>=0&&o++,o>=t._highestBlockNumber&&(t._highestBlockNumber=o),t._highestBlockNumber};case"getGasPrice":return function(i){const s=i.map(o=>o.result);return s.sort(),s[Math.floor(s.length/2)]};case"getEtherPrice":return function(i){return j4(i.map(s=>s.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(i){return i==null?null:(i=Vt(i),i.confirmations=-1,Vu(i))};break;case"getBlock":r.includeTransactions?n=function(i){return i==null?null:(i=Vt(i),i.transactions=i.transactions.map(s=>(s=Vt(s),s.confirmations=-1,s)),Vu(i))}:n=function(i){return i==null?null:Vu(i)};break;default:throw new Error("unknown method: "+e)}return EJ(n,t.quorum)}function Kd(t,e){return jm(this,void 0,void 0,function*(){const r=t.provider;return r.blockNumber!=null&&r.blockNumber>=e||e===-1?r:za(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}function CJ(t,e,r,n){return jm(this,void 0,void 0,function*(){let i=t.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&&Fe(n.blockTag)&&(i=yield Kd(t,e)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&Fe(n.blockTag)&&(i=yield Kd(t,e)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&Fe(n.blockTag)&&(i=yield Kd(t,e)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&Fe(n.blockTag)&&(i=yield Kd(t,e)),r==="call"&&n.blockTag?i[r](n.transaction,n.blockTag):i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let s=n.filter;return(s.fromBlock&&Fe(s.fromBlock)||s.toBlock&&Fe(s.toBlock))&&(i=yield Kd(t,e)),i.getLogs(s)}}return il.throwError("unknown method error",ee.errors.UNKNOWN_ERROR,{method:r,params:n})})}class SJ extends kg{constructor(e,r){e.length===0&&il.throwArgumentError("missing providers","providers",e);const n=e.map((o,a)=>{if(Tc.isProvider(o)){const u=O4(o)?2e3:750;return Object.freeze({provider:o,weight:1,stallTimeout:u,priority:1})}const c=Vt(o);c.priority==null&&(c.priority=1),c.stallTimeout==null&&(c.stallTimeout=O4(o)?2e3:750),c.weight==null&&(c.weight=1);const l=c.weight;return(l%1||l>512||l<1)&&il.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${a}].weight`,l),Object.freeze(c)}),i=n.reduce((o,a)=>o+a.weight,0);r==null?r=i/2:r>i&&il.throwArgumentError("quorum will always fail; larger than total weight","quorum",r);let s=F4(n.map(o=>o.provider.network));s==null&&(s=new Promise((o,a)=>{setTimeout(()=>{this.detectNetwork().then(o,a)},0)})),super(s),ie(this,"providerConfigs",Object.freeze(n)),ie(this,"quorum",r),this._highestBlockNumber=-1}detectNetwork(){return jm(this,void 0,void 0,function*(){const e=yield Promise.all(this.providerConfigs.map(r=>r.provider.getNetwork()));return F4(e)})}perform(e,r){return jm(this,void 0,void 0,function*(){if(e==="sendTransaction"){const c=yield Promise.all(this.providerConfigs.map(l=>l.provider.sendTransaction(r.signedTransaction).then(u=>u.hash,u=>u)));for(let l=0;lc.priority-l.priority);const s=this._highestBlockNumber;let o=0,a=!0;for(;;){const c=Mp();let l=i.filter(h=>h.runner&&c-h.starth+p.weight,0);for(;l{h.staller=null}),h.runner=CJ(h,s,e,r).then(v=>{h.done=!0,h.result=v,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:$p(h,Mp()),request:{method:e,params:vi(r)},provider:this})},v=>{h.done=!0,h.error=v,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:$p(h,Mp()),request:{method:e,params:vi(r)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:$p(h,null),request:{method:e,params:vi(r)},provider:this}),l+=h.weight}const u=[];i.forEach(h=>{h.done||!h.runner||(u.push(h.runner),h.staller&&u.push(h.staller.getPromise()))}),u.length&&(yield Promise.race(u));const f=i.filter(h=>h.done&&h.error==null);if(f.length>=this.quorum){const h=n(f);if(h!==void 0)return i.forEach(p=>{p.staller&&p.staller.cancel(),p.cancelled=!0}),h;a||(yield U4(100).getPromise()),a=!1}const d=i.reduce((h,p)=>{if(!p.done||p.error==null)return h;const v=p.error.code;return bJ.indexOf(v)>=0&&(h[v]||(h[v]={error:p.error,weight:0}),h[v].weight+=p.weight),h},{});if(Object.keys(d).forEach(h=>{const p=d[h];if(p.weight{y.staller&&y.staller.cancel(),y.cancelled=!0});const v=p.error,b={};wJ.forEach(y=>{v[y]!=null&&(b[y]=v[y])}),il.throwError(v.reason||v.message,h,b)}),i.filter(h=>!h.done).length===0)break}return i.forEach(c=>{c.staller&&c.staller.cancel(),c.cancelled=!0}),il.throwError("failed to meet quorum",ee.errors.SERVER_ERROR,{method:e,params:r,results:i.map(c=>$p(c)),provider:this})})}}const z4=new ee(od);let kJ=1;function W4(t,e){const r="Web3LegacyFetcher";return function(n,i){const s={method:n,params:i,id:kJ++,jsonrpc:"2.0"};return new Promise((o,a)=>{this.emit("debug",{action:"request",fetcher:r,request:vi(s),provider:this}),e(s,(c,l)=>{if(c)return this.emit("debug",{action:"response",fetcher:r,error:c,request:s,provider:this}),a(c);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:l,provider:this}),l.error){const u=new Error(l.error.message);return u.code=l.error.code,u.data=l.error.data,a(u)}o(l.result)})})}}function AJ(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:vi(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class HM extends Ko{constructor(e,r){e==null&&z4.throwArgumentError("missing provider","provider",e);let n=null,i=null,s=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(n===""&&(n="eip-1193:"),i=AJ(e)):e.sendAsync?i=W4(e,e.sendAsync.bind(e)):e.send?i=W4(e,e.send.bind(e)):z4.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),ie(this,"jsonRpcFetchFunc",i),ie(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}const _J="solidity/5.7.0",PJ=new RegExp("^bytes([0-9]+)$"),TJ=new RegExp("^(u?int)([0-9]*)$"),IJ=new RegExp("^(.*)\\[([0-9]*)\\]$"),OJ="0000000000000000000000000000000000000000000000000000000000000000",Pu=new ee(_J);function qM(t,e,r){switch(t){case"address":return r?_h(e,32):re(e);case"string":return wt(e);case"bytes":return re(e);case"bool":return e=e?"0x01":"0x00",r?_h(e,32):re(e)}let n=t.match(TJ);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!==0||i===0||i>256)&&Pu.throwArgumentError("invalid number type","type",t),r&&(i=256),e=J.from(e).toTwos(i),_h(e,i/8)}if(n=t.match(PJ),n){const i=parseInt(n[1]);return(String(i)!==n[1]||i===0||i>32)&&Pu.throwArgumentError("invalid bytes type","type",t),re(e).byteLength!==i&&Pu.throwArgumentError(`invalid value for ${t}`,"value",e),r?re((e+OJ).substring(0,66)):e}if(n=t.match(IJ),n&&Array.isArray(e)){const i=n[1];parseInt(n[2]||String(e.length))!=e.length&&Pu.throwArgumentError(`invalid array length for ${t}`,"value",e);const o=[];return e.forEach(function(a){o.push(qM(i,a,!0))}),qt(o)}return Pu.throwArgumentError("invalid type","type",t)}function We(t,e){t.length!=e.length&&Pu.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach(function(n,i){r.push(qM(n,e[i]))}),te(qt(r))}function ec(t,e){return Be(We(t,e))}function RJ(t,e){return Go(We(t,e))}const MJ="units/5.7.0",VM=new ee(MJ),GM=["wei","kwei","mwei","gwei","szabo","finney","ether"];function $J(t){const e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||t==="."||t==="-.")&&VM.throwArgumentError("invalid value","value",t);let r=e[0],n="";for(r.substring(0,1)==="-"&&(n="-",r=r.substring(1));r.substring(0,1)==="0";)r=r.substring(1);r===""&&(r="0");let i="";for(e.length===2&&(i="."+(e[1]||"0"));i.length>2&&i[i.length-1]==="0";)i=i.substring(0,i.length-1);const s=[];for(;r.length;)if(r.length<=3){s.unshift(r);break}else{const o=r.length-3;s.unshift(r.substring(o)),r=r.substring(0,o)}return n+s.join(",")+i}function xr(t,e){if(typeof e=="string"){const r=GM.indexOf(e);r!==-1&&(e=3*r)}return Sv(t,e??18)}function $f(t,e){if(typeof t!="string"&&VM.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=GM.indexOf(e);r!==-1&&(e=3*r)}return Ds(t,e??18)}function NJ(t){return xr(t,18)}function DJ(t){return $f(t,18)}const LJ=Object.freeze(Object.defineProperty({__proto__:null,AbiCoder:Z6,ConstructorFragment:fs,ErrorFragment:To,EventFragment:Vs,FormatTypes:et,Fragment:Qs,FunctionFragment:ds,HDNode:xo,Indexed:Rm,Interface:Br,LogDescription:YR,Logger:ee,ParamType:Nr,RLP:YV,SigningKey:Nm,get SupportedAlgorithm(){return Mf},TransactionDescription:JR,get TransactionTypes(){return Sx},get UnicodeNormalizationForm(){return Ho},Utf8ErrorFuncs:BR,get Utf8ErrorReason(){return Vn},_TypedDataEncoder:Wr,_fetchData:LM,_toEscapedUtf8String:vG,accessListify:Zl,arrayify:re,base58:Rf,base64:$G,checkProperties:V6,checkResultErrors:kR,commify:$J,computeAddress:u3,computeHmac:S0,computePublicKey:c3,concat:qt,deepCopy:vi,defaultAbiCoder:Bn,defaultPath:MY,defineReadOnly:ie,dnsEncode:VR,entropyToMnemonic:$M,fetchJson:_1,formatBytes32String:mG,formatEther:NJ,formatUnits:xr,getAccountPath:NY,getAddress:qe,getContractAddress:Q6,getCreate2Address:tG,getIcapAddress:eG,getJsonWalletAddress:jY,getStatic:hs,hashMessage:n3,hexConcat:Rn,hexDataLength:co,hexDataSlice:br,hexStripZeros:mR,hexValue:gs,hexZeroPad:dt,hexlify:te,id:Ua,isAddress:IR,isBytes:aa,isBytesLike:Wo,isHexString:Fe,isValidMnemonic:$Y,isValidName:iK,joinSignature:MV,keccak256:Be,mnemonicToEntropy:d3,mnemonicToSeed:MM,namehash:Ih,nameprep:IG,parseBytes32String:yG,parseEther:DJ,parseTransaction:AM,parseUnits:$f,poll:za,randomBytes:A1,recoverAddress:Ll,recoverPublicKey:EM,resolveProperties:vt,ripemd160:IM,serializeTransaction:uY,sha256:Go,sha512:CY,shallowCopy:Vt,shuffled:NM,solidityKeccak256:ec,solidityPack:We,soliditySha256:RJ,splitSignature:Jl,stripZeros:eo,toUtf8Bytes:wt,toUtf8CodePoints:Im,toUtf8String:la,verifyMessage:DM,verifyTypedData:UY,zeroPad:_h},Symbol.toStringTag,{value:"Module"})),KM="%[a-f0-9]{2}",H4=new RegExp("("+KM+")|([^%]+?)","gi"),q4=new RegExp("("+KM+")+","gi");function Tx(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;const r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],Tx(r),Tx(n))}function BJ(t){try{return decodeURIComponent(t)}catch{let e=t.match(H4)||[];for(let r=1;rt==null,WJ=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Ix=Symbol("encodeFragmentIdentifier");function HJ(t){switch(t.arrayFormat){case"index":return e=>(r,n)=>{const i=r.length;return n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[Sr(e,t),"[",i,"]"].join("")]:[...r,[Sr(e,t),"[",Sr(i,t),"]=",Sr(n,t)].join("")]};case"bracket":return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[Sr(e,t),"[]"].join("")]:[...r,[Sr(e,t),"[]=",Sr(n,t)].join("")];case"colon-list-separator":return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[Sr(e,t),":list="].join("")]:[...r,[Sr(e,t),":list=",Sr(n,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e=t.arrayFormat==="bracket-separator"?"[]=":"=";return r=>(n,i)=>i===void 0||t.skipNull&&i===null||t.skipEmptyString&&i===""?n:(i=i===null?"":i,n.length===0?[[Sr(r,t),e,Sr(i,t)].join("")]:[[n,Sr(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,Sr(e,t)]:[...r,[Sr(e,t),"=",Sr(n,t)].join("")]}}function qJ(t){let e;switch(t.arrayFormat){case"index":return(r,n,i)=>{if(e=/\[(\d*)]$/.exec(r),r=r.replace(/\[\d*]$/,""),!e){i[r]=n;return}i[r]===void 0&&(i[r]={}),i[r][e[1]]=n};case"bracket":return(r,n,i)=>{if(e=/(\[])$/.exec(r),r=r.replace(/\[]$/,""),!e){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[...i[r],n]};case"colon-list-separator":return(r,n,i)=>{if(e=/(:list)$/.exec(r),r=r.replace(/:list$/,""),!e){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[...i[r],n]};case"comma":case"separator":return(r,n,i)=>{const s=typeof n=="string"&&n.includes(t.arrayFormatSeparator),o=typeof n=="string"&&!s&&Po(n,t).includes(t.arrayFormatSeparator);n=o?Po(n,t):n;const a=s||o?n.split(t.arrayFormatSeparator).map(c=>Po(c,t)):n===null?n:Po(n,t);i[r]=a};case"bracket-separator":return(r,n,i)=>{const s=/(\[])$/.test(r);if(r=r.replace(/\[]$/,""),!s){i[r]=n&&Po(n,t);return}const o=n===null?[]:n.split(t.arrayFormatSeparator).map(a=>Po(a,t));if(i[r]===void 0){i[r]=o;return}i[r]=[...i[r],...o]};default:return(r,n,i)=>{if(i[r]===void 0){i[r]=n;return}i[r]=[...[i[r]].flat(),n]}}}function YM(t){if(typeof t!="string"||t.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Sr(t,e){return e.encode?e.strict?WJ(t):encodeURIComponent(t):t}function Po(t,e){return e.decode?jJ(t):t}function JM(t){return Array.isArray(t)?t.sort():typeof t=="object"?JM(Object.keys(t)).sort((e,r)=>Number(e)-Number(r)).map(e=>t[e]):t}function XM(t){const e=t.indexOf("#");return e!==-1&&(t=t.slice(0,e)),t}function VJ(t){let e="";const r=t.indexOf("#");return r!==-1&&(e=t.slice(r)),e}function V4(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&typeof t=="string"&&t.trim()!==""?t=Number(t):e.parseBooleans&&t!==null&&(t.toLowerCase()==="true"||t.toLowerCase()==="false")&&(t=t.toLowerCase()==="true"),t}function h3(t){t=XM(t);const e=t.indexOf("?");return e===-1?"":t.slice(e+1)}function p3(t,e){e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e},YM(e.arrayFormatSeparator);const r=qJ(e),n=Object.create(null);if(typeof t!="string"||(t=t.trim().replace(/^[?#&]/,""),!t))return n;for(const i of t.split("&")){if(i==="")continue;const s=e.decode?i.replace(/\+/g," "):i;let[o,a]=QM(s,"=");o===void 0&&(o=s),a=a===void 0?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:Po(a,e),r(Po(o,e),a,n)}for(const[i,s]of Object.entries(n))if(typeof s=="object"&&s!==null)for(const[o,a]of Object.entries(s))s[o]=V4(a,e);else n[i]=V4(s,e);return e.sort===!1?n:(e.sort===!0?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce((i,s)=>{const o=n[s];return o&&typeof o=="object"&&!Array.isArray(o)?i[s]=JM(o):i[s]=o,i},Object.create(null))}function ZM(t,e){if(!t)return"";e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e},YM(e.arrayFormatSeparator);const r=o=>e.skipNull&&zJ(t[o])||e.skipEmptyString&&t[o]==="",n=HJ(e),i={};for(const[o,a]of Object.entries(t))r(o)||(i[o]=a);const s=Object.keys(i);return e.sort!==!1&&s.sort(e.sort),s.map(o=>{const a=t[o];return a===void 0?"":a===null?Sr(o,e):Array.isArray(a)?a.length===0&&e.arrayFormat==="bracket-separator"?Sr(o,e)+"[]":a.reduce(n(o),[]).join("&"):Sr(o,e)+"="+Sr(a,e)}).filter(o=>o.length>0).join("&")}function e$(t,e){var i;e={decode:!0,...e};let[r,n]=QM(t,"#");return r===void 0&&(r=t),{url:((i=r==null?void 0:r.split("?"))==null?void 0:i[0])??"",query:p3(h3(t),e),...e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:Po(n,e)}:{}}}function t$(t,e){e={encode:!0,strict:!0,[Ix]:!0,...e};const r=XM(t.url).split("?")[0]||"",n=h3(t.url),i={...p3(n,{sort:!1}),...t.query};let s=ZM(i,e);s&&(s=`?${s}`);let o=VJ(t.url);if(t.fragmentIdentifier){const a=new URL(r);a.hash=t.fragmentIdentifier,o=e[Ix]?a.hash:`#${t.fragmentIdentifier}`}return`${r}${s}${o}`}function r$(t,e,r){r={parseFragmentIdentifier:!0,[Ix]:!1,...r};const{url:n,query:i,fragmentIdentifier:s}=e$(t,r);return t$({url:n,query:UJ(i,e),fragmentIdentifier:s},r)}function GJ(t,e,r){const n=Array.isArray(e)?i=>!e.includes(i):(i,s)=>!e(i,s);return r$(t,n,r)}const n$=Object.freeze(Object.defineProperty({__proto__:null,exclude:GJ,extract:h3,parse:p3,parseUrl:e$,pick:r$,stringify:ZM,stringifyUrl:t$},Symbol.toStringTag,{value:"Module"})),v3=C.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Ag=C.createContext({});function KJ(){return C.useContext(Ag).visualElement}const P1=C.createContext(null),_g=typeof document<"u",Um=_g?C.useLayoutEffect:C.useEffect,i$=C.createContext({strict:!1});function QJ(t,e,r,n){const i=KJ(),s=C.useContext(i$),o=C.useContext(P1),a=C.useContext(v3).reducedMotion,c=C.useRef();n=n||s.renderer,!c.current&&n&&(c.current=n(t,{visualState:e,parent:i,props:r,presenceId:o?o.id:void 0,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const l=c.current;return Um(()=>{l&&l.render()}),(window.HandoffAppearAnimations?Um:C.useEffect)(()=>{l&&l.animationState&&l.animationState.animateChanges()}),l}function Gu(t){return typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function YJ(t,e,r){return C.useCallback(n=>{n&&t.mount&&t.mount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):Gu(r)&&(r.current=n))},[e])}function _0(t){return typeof t=="string"||Array.isArray(t)}function Pg(t){return typeof t=="object"&&typeof t.start=="function"}const JJ=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function Tg(t){return Pg(t.animate)||JJ.some(e=>_0(t[e]))}function s$(t){return!!(Tg(t)||t.variants)}function XJ(t,e){if(Tg(t)){const{initial:r,animate:n}=t;return{initial:r===!1||_0(r)?r:void 0,animate:_0(n)?n:void 0}}return t.inherit!==!1?e:{}}function ZJ(t){const{initial:e,animate:r}=XJ(t,C.useContext(Ag));return C.useMemo(()=>({initial:e,animate:r}),[G4(e),G4(r)])}function G4(t){return Array.isArray(t)?t.join(" "):t}const bo=t=>({isEnabled:e=>t.some(r=>!!e[r])}),P0={measureLayout:bo(["layout","layoutId","drag"]),animation:bo(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:bo(["exit"]),drag:bo(["drag","dragControls"]),focus:bo(["whileFocus"]),hover:bo(["whileHover","onHoverStart","onHoverEnd"]),tap:bo(["whileTap","onTap","onTapStart","onTapCancel"]),pan:bo(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:bo(["whileInView","onViewportEnter","onViewportLeave"])};function eX(t){for(const e in t)e==="projectionNodeConstructor"?P0.projectionNodeConstructor=t[e]:P0[e].Component=t[e]}function Ig(t){const e=C.useRef(null);return e.current===null&&(e.current=t()),e.current}const Mh={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let tX=1;function rX(){return Ig(()=>{if(Mh.hasEverUpdated)return tX++})}const m3=C.createContext({});class nX extends x.Component{getSnapshotBeforeUpdate(){const{visualElement:e,props:r}=this.props;return e&&e.setProps(r),null}componentDidUpdate(){}render(){return this.props.children}}const o$=C.createContext({}),iX=Symbol.for("motionComponentSymbol");function sX({preloadedFeatures:t,createVisualElement:e,projectionNodeConstructor:r,useRender:n,useVisualState:i,Component:s}){t&&eX(t);function o(c,l){const u={...C.useContext(v3),...c,layoutId:oX(c)},{isStatic:f}=u;let d=null;const h=ZJ(c),p=f?void 0:rX(),v=i(c,f);if(!f&&_g){h.visualElement=QJ(s,v,u,e);const b=C.useContext(i$).strict,y=C.useContext(o$);h.visualElement&&(d=h.visualElement.loadFeatures(u,b,t,p,r||P0.projectionNodeConstructor,y))}return C.createElement(nX,{visualElement:h.visualElement,props:u},d,C.createElement(Ag.Provider,{value:h},n(s,c,p,YJ(v,h.visualElement,l),v,f,h.visualElement)))}const a=C.forwardRef(o);return a[iX]=s,a}function oX({layoutId:t}){const e=C.useContext(m3).id;return e&&t!==void 0?e+"-"+t:t}function aX(t){function e(n,i={}){return sX(t(n,i))}if(typeof Proxy>"u")return e;const r=new Map;return new Proxy(e,{get:(n,i)=>(r.has(i)||r.set(i,e(i)),r.get(i))})}const cX=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function y3(t){return typeof t!="string"||t.includes("-")?!1:!!(cX.indexOf(t)>-1||/[A-Z]/.test(t))}const zm={};function lX(t){Object.assign(zm,t)}const Wm=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ad=new Set(Wm);function a$(t,{layout:e,layoutId:r}){return ad.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!zm[t]||t==="opacity")}const ni=t=>!!(t!=null&&t.getVelocity),uX={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},fX=(t,e)=>Wm.indexOf(t)-Wm.indexOf(e);function dX({transform:t,transformKeys:e},{enableHardwareAcceleration:r=!0,allowTransformNone:n=!0},i,s){let o="";e.sort(fX);for(const a of e)o+=`${uX[a]||a}(${t[a]}) `;return r&&!t.z&&(o+="translateZ(0)"),o=o.trim(),s?o=s(t,i?"":o):n&&i&&(o="none"),o}function c$(t){return t.startsWith("--")}const hX=(t,e)=>e&&typeof t=="number"?e.transform(t):t,Nf=(t,e,r)=>Math.min(Math.max(r,t),e),eu={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},$h={...eu,transform:t=>Nf(0,1,t)},Np={...eu,default:1},Nh=t=>Math.round(t*1e5)/1e5,T0=/(-)?([\d]*\.?[\d])+/g,Ox=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,pX=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function T1(t){return typeof t=="string"}const I1=t=>({test:e=>T1(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Sa=I1("deg"),io=I1("%"),we=I1("px"),vX=I1("vh"),mX=I1("vw"),K4={...io,parse:t=>io.parse(t)/100,transform:t=>io.transform(t*100)},Q4={...eu,transform:Math.round},l$={borderWidth:we,borderTopWidth:we,borderRightWidth:we,borderBottomWidth:we,borderLeftWidth:we,borderRadius:we,radius:we,borderTopLeftRadius:we,borderTopRightRadius:we,borderBottomRightRadius:we,borderBottomLeftRadius:we,width:we,maxWidth:we,height:we,maxHeight:we,size:we,top:we,right:we,bottom:we,left:we,padding:we,paddingTop:we,paddingRight:we,paddingBottom:we,paddingLeft:we,margin:we,marginTop:we,marginRight:we,marginBottom:we,marginLeft:we,rotate:Sa,rotateX:Sa,rotateY:Sa,rotateZ:Sa,scale:Np,scaleX:Np,scaleY:Np,scaleZ:Np,skew:Sa,skewX:Sa,skewY:Sa,distance:we,translateX:we,translateY:we,translateZ:we,x:we,y:we,z:we,perspective:we,transformPerspective:we,opacity:$h,originX:K4,originY:K4,originZ:we,zIndex:Q4,fillOpacity:$h,strokeOpacity:$h,numOctaves:Q4};function g3(t,e,r,n){const{style:i,vars:s,transform:o,transformKeys:a,transformOrigin:c}=t;a.length=0;let l=!1,u=!1,f=!0;for(const d in e){const h=e[d];if(c$(d)){s[d]=h;continue}const p=l$[d],v=hX(h,p);if(ad.has(d)){if(l=!0,o[d]=v,a.push(d),!f)continue;h!==(p.default||0)&&(f=!1)}else d.startsWith("origin")?(u=!0,c[d]=v):i[d]=v}if(e.transform||(l||n?i.transform=dX(t,r,f,n):i.transform&&(i.transform="none")),u){const{originX:d="50%",originY:h="50%",originZ:p=0}=c;i.transformOrigin=`${d} ${h} ${p}`}}const b3=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function u$(t,e,r){for(const n in e)!ni(e[n])&&!a$(n,r)&&(t[n]=e[n])}function yX({transformTemplate:t},e,r){return C.useMemo(()=>{const n=b3();return g3(n,e,{enableHardwareAcceleration:!r},t),Object.assign({},n.vars,n.style)},[e])}function gX(t,e,r){const n=t.style||{},i={};return u$(i,n,t),Object.assign(i,yX(t,e,r)),t.transformValues?t.transformValues(i):i}function bX(t,e,r){const n={},i=gX(t,e,r);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),n.style=i,n}const wX=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","viewport"]);function Hm(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||wX.has(t)}let f$=t=>!Hm(t);function EX(t){t&&(f$=e=>e.startsWith("on")?!Hm(e):t(e))}try{EX(require("@emotion/is-prop-valid").default)}catch{}function xX(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(f$(i)||r===!0&&Hm(i)||!e&&!Hm(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function Y4(t,e,r){return typeof t=="string"?t:we.transform(e+r*t)}function CX(t,e,r){const n=Y4(e,t.x,t.width),i=Y4(r,t.y,t.height);return`${n} ${i}`}const SX={offset:"stroke-dashoffset",array:"stroke-dasharray"},kX={offset:"strokeDashoffset",array:"strokeDasharray"};function AX(t,e,r=1,n=0,i=!0){t.pathLength=1;const s=i?SX:kX;t[s.offset]=we.transform(-n);const o=we.transform(e),a=we.transform(r);t[s.array]=`${o} ${a}`}function w3(t,{attrX:e,attrY:r,originX:n,originY:i,pathLength:s,pathSpacing:o=1,pathOffset:a=0,...c},l,u,f){if(g3(t,c,l,f),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:h,dimensions:p}=t;d.transform&&(p&&(h.transform=d.transform),delete d.transform),p&&(n!==void 0||i!==void 0||h.transform)&&(h.transformOrigin=CX(p,n!==void 0?n:.5,i!==void 0?i:.5)),e!==void 0&&(d.x=e),r!==void 0&&(d.y=r),s!==void 0&&AX(d,s,o,a,!1)}const d$=()=>({...b3(),attrs:{}}),E3=t=>typeof t=="string"&&t.toLowerCase()==="svg";function _X(t,e,r,n){const i=C.useMemo(()=>{const s=d$();return w3(s,e,{enableHardwareAcceleration:!1},E3(n),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};u$(s,t.style,t),i.style={...s,...i.style}}return i}function PX(t=!1){return(r,n,i,s,{latestValues:o},a)=>{const l=(y3(r)?_X:bX)(n,o,a,r),f={...xX(n,typeof r=="string",t),...l,ref:s},{children:d}=n,h=C.useMemo(()=>ni(d)?d.get():d,[d]);return i&&(f["data-projection-id"]=i),C.createElement(r,{...f,children:h})}}const x3=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function h$(t,{style:e,vars:r},n,i){Object.assign(t.style,e,i&&i.getProjectionStyles(n));for(const s in r)t.style.setProperty(s,r[s])}const p$=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function v$(t,e,r,n){h$(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(p$.has(i)?i:x3(i),e.attrs[i])}function C3(t,e){const{style:r}=t,n={};for(const i in r)(ni(r[i])||e.style&&ni(e.style[i])||a$(i,t))&&(n[i]=r[i]);return n}function m$(t,e){const r=C3(t,e);for(const n in t)if(ni(t[n])||ni(e[n])){const i=n==="x"||n==="y"?"attr"+n.toUpperCase():n;r[i]=t[n]}return r}function S3(t,e,r,n={},i={}){return typeof e=="function"&&(e=e(r!==void 0?r:t.custom,n,i)),typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"&&(e=e(r!==void 0?r:t.custom,n,i)),e}const qm=t=>Array.isArray(t),TX=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),IX=t=>qm(t)?t[t.length-1]||0:t;function Ov(t){const e=ni(t)?t.get():t;return TX(e)?e.toValue():e}function OX({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:r},n,i,s){const o={latestValues:RX(n,i,s,t),renderState:e()};return r&&(o.mount=a=>r(n,a,o)),o}const y$=t=>(e,r)=>{const n=C.useContext(Ag),i=C.useContext(P1),s=()=>OX(t,e,n,i);return r?s():Ig(s)};function RX(t,e,r,n){const i={},s=n(t,{});for(const d in s)i[d]=Ov(s[d]);let{initial:o,animate:a}=t;const c=Tg(t),l=s$(t);e&&l&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=r?r.initial===!1:!1;u=u||o===!1;const f=u?a:o;return f&&typeof f!="boolean"&&!Pg(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=S3(t,h);if(!p)return;const{transitionEnd:v,transition:b,...y}=p;for(const m in y){let g=y[m];if(Array.isArray(g)){const S=u?g.length-1:0;g=g[S]}g!==null&&(i[m]=g)}for(const m in v)i[m]=v[m]}),i}const MX={useVisualState:y$({scrapeMotionValuesFromProps:m$,createRenderState:d$,onMount:(t,e,{renderState:r,latestValues:n})=>{try{r.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}w3(r,n,{enableHardwareAcceleration:!1},E3(e.tagName),t.transformTemplate),v$(e,r)}})},$X={useVisualState:y$({scrapeMotionValuesFromProps:C3,createRenderState:b3})};function NX(t,{forwardMotionProps:e=!1},r,n,i){return{...y3(t)?MX:$X,preloadedFeatures:r,useRender:PX(e),createVisualElement:n,projectionNodeConstructor:i,Component:t}}var mt;(function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"})(mt||(mt={}));function Og(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}function Rx(t,e,r,n){C.useEffect(()=>{const i=t.current;if(r&&i)return Og(i,e,r,n)},[t,e,r,n])}function DX({whileFocus:t,visualElement:e}){const{animationState:r}=e,n=C.useCallback(()=>{r&&r.setActive(mt.Focus,!0)},[r]),i=C.useCallback(()=>{r&&r.setActive(mt.Focus,!1)},[r]);Rx(e,"focus",t?n:void 0),Rx(e,"blur",t?i:void 0)}const g$=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function k3(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const b$=t=>e=>g$(e)&&t(e,k3(e));function ff(t,e,r,n){return Og(t,e,b$(r),n)}function Vm(t,e,r,n){return Rx(t,e,r&&b$(r),n)}function w$(t){let e=null;return()=>{const r=()=>{e=null};return e===null?(e=t,r):!1}}const J4=w$("dragHorizontal"),X4=w$("dragVertical");function E$(t){let e=!1;if(t==="y")e=X4();else if(t==="x")e=J4();else{const r=J4(),n=X4();r&&n?e=()=>{r(),n()}:(r&&r(),n&&n())}return e}function x$(){const t=E$(!0);return t?(t(),!1):!0}function Z4(t,e,r,n){return(i,s)=>{i.type==="touch"||x$()||(r&&t.animationState&&t.animationState.setActive(mt.Hover,e),n&&n(i,s))}}function LX({onHoverStart:t,onHoverEnd:e,whileHover:r,visualElement:n}){Vm(n,"pointerenter",C.useMemo(()=>t||r?Z4(n,!0,!!r,t):void 0,[t,!!r,n]),{passive:!t}),Vm(n,"pointerleave",C.useMemo(()=>e||r?Z4(n,!1,!!r,e):void 0,[t,!!r,n]),{passive:!e})}const C$=(t,e)=>e?t===e?!0:C$(t,e.parentElement):!1;function A3(t){return C.useEffect(()=>()=>t(),[])}const BX=(t,e)=>r=>e(t(r)),Rg=(...t)=>t.reduce(BX);function FX({onTap:t,onTapStart:e,onTapCancel:r,whileTap:n,visualElement:i,...s}){const o=t||e||r||n,a=C.useRef(!1),c=C.useRef(null),l={passive:!(e||t||r||s.onPointerDown)};function u(){c.current&&c.current(),c.current=null}function f(){return u(),a.current=!1,i.getProps().whileTap&&i.animationState&&i.animationState.setActive(mt.Tap,!1),!x$()}function d(v,b){var y,m,g,S;f()&&(C$(i.current,v.target)?(S=(g=i.getProps()).onTap)===null||S===void 0||S.call(g,v,b):(m=(y=i.getProps()).onTapCancel)===null||m===void 0||m.call(y,v,b))}function h(v,b){var y,m;f()&&((m=(y=i.getProps()).onTapCancel)===null||m===void 0||m.call(y,v,b))}const p=C.useCallback((v,b)=>{var y;if(u(),a.current)return;a.current=!0,c.current=Rg(ff(window,"pointerup",d,l),ff(window,"pointercancel",h,l));const m=i.getProps();m.whileTap&&i.animationState&&i.animationState.setActive(mt.Tap,!0),(y=m.onTapStart)===null||y===void 0||y.call(m,v,b)},[!!e,i]);Vm(i,"pointerdown",o?p:void 0,l),A3(u)}const Mx=new WeakMap,l2=new WeakMap,jX=t=>{const e=Mx.get(t.target);e&&e(t)},UX=t=>{t.forEach(jX)};function zX({root:t,...e}){const r=t||document;l2.has(r)||l2.set(r,{});const n=l2.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(UX,{root:t,...e})),n[i]}function WX(t,e,r){const n=zX(e);return Mx.set(t,r),n.observe(t),()=>{Mx.delete(t),n.unobserve(t)}}function HX({visualElement:t,whileInView:e,onViewportEnter:r,onViewportLeave:n,viewport:i={}}){const s=C.useRef({hasEnteredView:!1,isInView:!1});let o=!!(e||r||n);i.once&&s.current.hasEnteredView&&(o=!1),(typeof IntersectionObserver>"u"?GX:VX)(o,s.current,t,i)}const qX={some:0,all:1};function VX(t,e,r,{root:n,margin:i,amount:s="some",once:o}){C.useEffect(()=>{if(!t||!r.current)return;const a={root:n==null?void 0:n.current,rootMargin:i,threshold:typeof s=="number"?s:qX[s]},c=l=>{const{isIntersecting:u}=l;if(e.isInView===u||(e.isInView=u,o&&!u&&e.hasEnteredView))return;u&&(e.hasEnteredView=!0),r.animationState&&r.animationState.setActive(mt.InView,u);const f=r.getProps(),d=u?f.onViewportEnter:f.onViewportLeave;d&&d(l)};return WX(r.current,a,c)},[t,n,i,s])}function GX(t,e,r,{fallback:n=!0}){C.useEffect(()=>{!t||!n||requestAnimationFrame(()=>{e.hasEnteredView=!0;const{onViewportEnter:i}=r.getProps();i&&i(null),r.animationState&&r.animationState.setActive(mt.InView,!0)})},[t])}const Wa=t=>e=>(t(e),null),KX={inView:Wa(HX),tap:Wa(FX),focus:Wa(DX),hover:Wa(LX)};function S$(){const t=C.useContext(P1);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:r,register:n}=t,i=C.useId();return C.useEffect(()=>n(i),[]),!e&&r?[!1,()=>r&&r(i)]:[!0]}function k$(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;n/^\-?\d*\.?\d+$/.test(t),YX=t=>/^0[^.\s]+$/.test(t),Do={delta:0,timestamp:0},A$=1/60*1e3,JX=typeof performance<"u"?()=>performance.now():()=>Date.now(),_$=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(JX()),A$);function XX(t){let e=[],r=[],n=0,i=!1,s=!1;const o=new WeakSet,a={schedule:(c,l=!1,u=!1)=>{const f=u&&i,d=f?e:r;return l&&o.add(c),d.indexOf(c)===-1&&(d.push(c),f&&i&&(n=e.length)),c},cancel:c=>{const l=r.indexOf(c);l!==-1&&r.splice(l,1),o.delete(c)},process:c=>{if(i){s=!0;return}if(i=!0,[e,r]=[r,e],r.length=0,n=e.length,n)for(let l=0;l(t[e]=XX(()=>I0=!0),t),{}),xn=O1.reduce((t,e)=>{const r=Mg[e];return t[e]=(n,i=!1,s=!1)=>(I0||tZ(),r.schedule(n,i,s)),t},{}),lc=O1.reduce((t,e)=>(t[e]=Mg[e].cancel,t),{}),u2=O1.reduce((t,e)=>(t[e]=()=>Mg[e].process(Do),t),{}),eZ=t=>Mg[t].process(Do),P$=t=>{I0=!1,Do.delta=$x?A$:Math.max(Math.min(t-Do.timestamp,ZX),1),Do.timestamp=t,Nx=!0,O1.forEach(eZ),Nx=!1,I0&&($x=!1,_$(P$))},tZ=()=>{I0=!0,$x=!0,Nx||_$(P$)};function _3(t,e){t.indexOf(e)===-1&&t.push(e)}function P3(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}class T3{constructor(){this.subscriptions=[]}add(e){return _3(this.subscriptions,e),()=>P3(this.subscriptions,e)}notify(e,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,n);else for(let s=0;s!isNaN(parseFloat(t));class nZ{constructor(e,r={}){this.version="8.5.5",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(n,i=!0)=>{this.prev=this.current,this.current=n;const{delta:s,timestamp:o}=Do;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,xn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>xn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=rZ(this.current),this.owner=r.owner}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new T3);const n=this.events[e].add(r);return e==="change"?()=>{n(),xn.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e,r=!0){!r||!this.passiveEffect?this.updateAndNotify(e,r):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,r,n){this.set(r),this.prev=e,this.timeDelta=n}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?I3(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r)||null,this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Df(t,e){return new nZ(t,e)}const O3=(t,e)=>r=>!!(T1(r)&&pX.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),T$=(t,e,r)=>n=>{if(!T1(n))return n;const[i,s,o,a]=n.match(T0);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},iZ=t=>Nf(0,255,t),f2={...eu,transform:t=>Math.round(iZ(t))},pl={test:O3("rgb","red"),parse:T$("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+f2.transform(t)+", "+f2.transform(e)+", "+f2.transform(r)+", "+Nh($h.transform(n))+")"};function sZ(t){let e="",r="",n="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const Dx={test:O3("#"),parse:sZ,transform:pl.transform},Ku={test:O3("hsl","hue"),parse:T$("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+io.transform(Nh(e))+", "+io.transform(Nh(r))+", "+Nh($h.transform(n))+")"},In={test:t=>pl.test(t)||Dx.test(t)||Ku.test(t),parse:t=>pl.test(t)?pl.parse(t):Ku.test(t)?Ku.parse(t):Dx.parse(t),transform:t=>T1(t)?t:t.hasOwnProperty("red")?pl.transform(t):Ku.transform(t)},I$="${c}",O$="${n}";function oZ(t){var e,r;return isNaN(t)&&T1(t)&&(((e=t.match(T0))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(Ox))===null||r===void 0?void 0:r.length)||0)>0}function Gm(t){typeof t=="number"&&(t=`${t}`);const e=[];let r=0,n=0;const i=t.match(Ox);i&&(r=i.length,t=t.replace(Ox,I$),e.push(...i.map(In.parse)));const s=t.match(T0);return s&&(n=s.length,t=t.replace(T0,O$),e.push(...s.map(eu.parse))),{values:e,numColors:r,numNumbers:n,tokenised:t}}function R$(t){return Gm(t).values}function M$(t){const{values:e,numColors:r,tokenised:n}=Gm(t),i=e.length;return s=>{let o=n;for(let a=0;atypeof t=="number"?0:t;function cZ(t){const e=R$(t);return M$(t)(e.map(aZ))}const uc={test:oZ,parse:R$,createTransformer:M$,getAnimatableNone:cZ},lZ=new Set(["brightness","contrast","saturate","opacity"]);function uZ(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(T0)||[];if(!n)return t;const i=r.replace(n,"");let s=lZ.has(e)?1:0;return n!==r&&(s*=100),e+"("+s+i+")"}const fZ=/([a-z-]*)\(.*?\)/g,Lx={...uc,getAnimatableNone:t=>{const e=t.match(fZ);return e?e.map(uZ).join(" "):t}},dZ={...l$,color:In,backgroundColor:In,outlineColor:In,fill:In,stroke:In,borderColor:In,borderTopColor:In,borderRightColor:In,borderBottomColor:In,borderLeftColor:In,filter:Lx,WebkitFilter:Lx},R3=t=>dZ[t];function M3(t,e){var r;let n=R3(t);return n!==Lx&&(n=uc),(r=n.getAnimatableNone)===null||r===void 0?void 0:r.call(n,e)}const $$=t=>e=>e.test(t),hZ={test:t=>t==="auto",parse:t=>t},N$=[eu,we,io,Sa,mX,vX,hZ],Qd=t=>N$.find($$(t)),pZ=[...N$,In,uc],vZ=t=>pZ.find($$(t));function mZ(t){const e={};return t.values.forEach((r,n)=>e[n]=r.get()),e}function yZ(t){const e={};return t.values.forEach((r,n)=>e[n]=r.getVelocity()),e}function $g(t,e,r){const n=t.getProps();return S3(n,e,r!==void 0?r:n.custom,mZ(t),yZ(t))}function gZ(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,Df(r))}function bZ(t,e){const r=$g(t,e);let{transitionEnd:n={},transition:i={},...s}=r?t.makeTargetAnimatable(r,!1):{};s={...s,...n};for(const o in s){const a=IX(s[o]);gZ(t,o,a)}}function wZ(t,e,r){var n,i;const s=Object.keys(e).filter(a=>!t.hasValue(a)),o=s.length;if(o)for(let a=0;at*1e3,AZ={current:!1},$3=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,N3=t=>e=>1-t(1-e),D3=t=>t*t,_Z=N3(D3),L3=$3(D3),vr=(t,e,r)=>-r*t+r*e+t;function d2(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function PZ({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{const a=r<.5?r*(1+e):r+e-r*e,c=2*r-a;i=d2(c,a,t+1/3),s=d2(c,a,t),o=d2(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}const h2=(t,e,r)=>{const n=t*t;return Math.sqrt(Math.max(0,r*(e*e-n)+n))},TZ=[Dx,pl,Ku],IZ=t=>TZ.find(e=>e.test(t));function e_(t){const e=IZ(t);let r=e.parse(t);return e===Ku&&(r=PZ(r)),r}const D$=(t,e)=>{const r=e_(t),n=e_(e),i={...r};return s=>(i.red=h2(r.red,n.red,s),i.green=h2(r.green,n.green,s),i.blue=h2(r.blue,n.blue,s),i.alpha=vr(r.alpha,n.alpha,s),pl.transform(i))};function L$(t,e){return typeof t=="number"?r=>vr(t,e,r):In.test(t)?D$(t,e):F$(t,e)}const B$=(t,e)=>{const r=[...t],n=r.length,i=t.map((s,o)=>L$(s,e[o]));return s=>{for(let o=0;o{const r={...t,...e},n={};for(const i in r)t[i]!==void 0&&e[i]!==void 0&&(n[i]=L$(t[i],e[i]));return i=>{for(const s in n)r[s]=n[s](i);return r}},F$=(t,e)=>{const r=uc.createTransformer(e),n=Gm(t),i=Gm(e);return n.numColors===i.numColors&&n.numNumbers>=i.numNumbers?Rg(B$(n.values,i.values),r):o=>`${o>0?e:t}`},Ym=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},t_=(t,e)=>r=>vr(t,e,r);function RZ(t){return typeof t=="number"?t_:typeof t=="string"?In.test(t)?D$:F$:Array.isArray(t)?B$:typeof t=="object"?OZ:t_}function MZ(t,e,r){const n=[],i=r||RZ(t[0]),s=t.length-1;for(let o=0;ot[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=MZ(e,n,i),a=o.length,c=l=>{let u=0;if(a>1)for(;uc(Nf(t[0],t[s-1],l)):c}const B3=t=>t,U$=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,$Z=1e-7,NZ=12;function DZ(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=U$(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>$Z&&++aDZ(s,0,1,t,r);return s=>s===0||s===1?s:U$(i(s),e,n)}const W$=t=>1-Math.sin(Math.acos(t)),F3=N3(W$),LZ=$3(F3),H$=z$(.33,1.53,.69,.99),j3=N3(H$),BZ=$3(j3),FZ=t=>(t*=2)<1?.5*j3(t):.5*(2-Math.pow(2,-10*(t-1))),jZ={linear:B3,easeIn:D3,easeInOut:L3,easeOut:_Z,circIn:W$,circInOut:LZ,circOut:F3,backIn:j3,backInOut:BZ,backOut:H$,anticipate:FZ},r_=t=>{if(Array.isArray(t)){Qm(t.length===4);const[e,r,n,i]=t;return z$(e,r,n,i)}else if(typeof t=="string")return jZ[t];return t},UZ=t=>Array.isArray(t)&&typeof t[0]!="number";function zZ(t,e){return t.map(()=>e||L3).splice(0,t.length-1)}function WZ(t){const e=t.length;return t.map((r,n)=>n!==0?n/(e-1):0)}function HZ(t,e){return t.map(r=>r*e)}function Bx({keyframes:t,ease:e=L3,times:r,duration:n=300}){t=[...t];const i=UZ(e)?e.map(r_):r_(e),s={done:!1,value:t[0]},o=HZ(r&&r.length===t.length?r:WZ(t),n);function a(){return j$(o,t,{ease:Array.isArray(i)?i:zZ(t,i)})}let c=a();return{next:l=>(s.value=c(l),s.done=l>=n,s),flipTarget:()=>{t.reverse(),c=a()}}}const p2=.001,qZ=.01,n_=10,VZ=.05,GZ=1;function KZ({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s;kZ(t<=n_*1e3);let o=1-e;o=Nf(VZ,GZ,o),t=Nf(qZ,n_,t/1e3),o<1?(i=l=>{const u=l*o,f=u*t,d=u-r,h=Fx(l,o),p=Math.exp(-f);return p2-d/h*p},s=l=>{const f=l*o*t,d=f*r+r,h=Math.pow(o,2)*Math.pow(l,2)*t,p=Math.exp(-f),v=Fx(Math.pow(l,2),o);return(-i(l)+p2>0?-1:1)*((d-h)*p)/v}):(i=l=>{const u=Math.exp(-l*t),f=(l-r)*t+1;return-p2+u*f},s=l=>{const u=Math.exp(-l*t),f=(r-l)*(t*t);return u*f});const a=5/t,c=YZ(i,s,a);if(t=t*1e3,isNaN(c))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(c,2)*n;return{stiffness:l,damping:o*2*Math.sqrt(n*l),duration:t}}}const QZ=12;function YZ(t,e,r){let n=r;for(let i=1;it[r]!==void 0)}function ZZ(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!i_(t,XZ)&&i_(t,JZ)){const r=KZ(t);e={...e,...r,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}const eee=5;function q$({keyframes:t,restDelta:e,restSpeed:r,...n}){let i=t[0],s=t[t.length-1];const o={done:!1,value:i},{stiffness:a,damping:c,mass:l,velocity:u,duration:f,isResolvedFromDuration:d}=ZZ(n);let h=tee,p=u?-(u/1e3):0;const v=c/(2*Math.sqrt(a*l));function b(){const y=s-i,m=Math.sqrt(a/l)/1e3,g=Math.abs(y)<5;if(r||(r=g?.01:2),e||(e=g?.005:.5),v<1){const S=Fx(m,v);h=P=>{const T=Math.exp(-v*m*P);return s-T*((p+v*m*y)/S*Math.sin(S*P)+y*Math.cos(S*P))}}else if(v===1)h=S=>s-Math.exp(-m*S)*(y+(p+m*y)*S);else{const S=m*Math.sqrt(v*v-1);h=P=>{const T=Math.exp(-v*m*P),w=Math.min(S*P,300);return s-T*((p+v*m*y)*Math.sinh(w)+S*y*Math.cosh(w))/S}}}return b(),{next:y=>{const m=h(y);if(d)o.done=y>=f;else{let g=p;if(y!==0)if(v<1){const T=Math.max(0,y-eee);g=I3(m-h(T),y-T)}else g=0;const S=Math.abs(g)<=r,P=Math.abs(s-m)<=e;o.done=S&&P}return o.value=o.done?s:m,o},flipTarget:()=>{p=-p,[i,s]=[s,i],b()}}}q$.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";const tee=t=>0;function ree({keyframes:t=[0],velocity:e=0,power:r=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){const o=t[0],a={done:!1,value:o};let c=r*e;const l=o+c,u=s===void 0?l:s(l);return u!==l&&(c=u-o),{next:f=>{const d=-c*Math.exp(-f/n);return a.done=!(d>i||d<-i),a.value=a.done?u:u+d,a},flipTarget:()=>{}}}const nee={decay:ree,keyframes:Bx,tween:Bx,spring:q$};function V$(t,e,r=0){return t-e-r}function iee(t,e=0,r=0,n=!0){return n?V$(e+-t,e,r):e-(t-e)+r}function see(t,e,r,n){return n?t>=e+r:t<=-r}const oee=t=>{const e=({delta:r})=>t(r);return{start:()=>xn.update(e,!0),stop:()=>lc.update(e)}};function Jm({duration:t,driver:e=oee,elapsed:r=0,repeat:n=0,repeatType:i="loop",repeatDelay:s=0,keyframes:o,autoplay:a=!0,onPlay:c,onStop:l,onComplete:u,onRepeat:f,onUpdate:d,type:h="keyframes",...p}){var v,b;const y=r;let m,g=0,S=t,P=!1,T=!0,w;const I=nee[o.length>2?"keyframes":h]||Bx,B=o[0],j=o[o.length-1];let H={done:!1,value:B};!((b=(v=I).needsInterpolation)===null||b===void 0)&&b.call(v,B,j)&&(w=j$([0,100],[B,j],{clamp:!1}),o=[0,100]);const K=I({...p,duration:t,keyframes:o});function F(){g++,i==="reverse"?(T=g%2===0,r=iee(r,S,s,T)):(r=V$(r,S,s),i==="mirror"&&K.flipTarget()),P=!1,f&&f()}function E(){m&&m.stop(),u&&u()}function _(N){T||(N=-N),r+=N,P||(H=K.next(Math.max(0,r)),w&&(H.value=w(H.value)),P=T?H.done:r<=0),d&&d(H.value),P&&(g===0&&(S=S!==void 0?S:r),g{l&&l(),m&&m.stop()},set currentTime(N){r=y,_(N)},sample:N=>{r=y;const k=t&&typeof t=="number"?Math.max(t*.5,50):50;let M=0;for(_(0);M<=N;){const L=N-M;_(Math.min(L,k)),M+=k}return H}}}function aee(t){return!t||Array.isArray(t)||typeof t=="string"&&G$[t]}const dh=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`,G$={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:dh([0,.65,.55,1]),circOut:dh([.55,0,1,.45]),backIn:dh([.31,.01,.66,-.59]),backOut:dh([.33,1.53,.69,.99])};function cee(t){if(t)return Array.isArray(t)?dh(t):G$[t]}function lee(t,e,r,{delay:n=0,duration:i,repeat:s=0,repeatType:o="loop",ease:a,times:c}={}){return t.animate({[e]:r,offset:c},{delay:n,duration:i,easing:cee(a),fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const s_={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},v2={},K$={};for(const t in s_)K$[t]=()=>(v2[t]===void 0&&(v2[t]=s_[t]()),v2[t]);function uee(t,{repeat:e,repeatType:r="loop"}){const n=e&&r!=="loop"&&e%2===1?0:t.length-1;return t[n]}const fee=new Set(["opacity"]),Dp=10;function dee(t,e,{onUpdate:r,onComplete:n,...i}){if(!(K$.waapi()&&fee.has(e)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0))return!1;let{keyframes:o,duration:a=300,elapsed:c=0,ease:l}=i;if(i.type==="spring"||!aee(i.ease)){if(i.repeat===1/0)return;const f=Jm({...i,elapsed:0});let d={done:!1,value:o[0]};const h=[];let p=0;for(;!d.done&&p<2e4;)d=f.sample(p),h.push(d.value),p+=Dp;o=h,a=p-Dp,l="linear"}const u=lee(t.owner.current,e,o,{...i,delay:-c,duration:a,ease:l});return u.onfinish=()=>{t.set(uee(o,i)),xn.update(()=>u.cancel()),n&&n()},{get currentTime(){return u.currentTime||0},set currentTime(f){u.currentTime=f},stop:()=>{const{currentTime:f}=u;if(f){const d=Jm({...i,autoplay:!1});t.setWithVelocity(d.sample(f-Dp).value,d.sample(f).value,Dp)}xn.update(()=>u.cancel())}}}function Q$(t,e){const r=performance.now(),n=({timestamp:i})=>{const s=i-r;s>=e&&(lc.read(n),t(s-e))};return xn.read(n,!0),()=>lc.read(n)}function hee({keyframes:t,elapsed:e,onUpdate:r,onComplete:n}){const i=()=>{r&&r(t[t.length-1]),n&&n()};return e?{stop:Q$(i,-e)}:i()}function pee({keyframes:t,velocity:e=0,min:r,max:n,power:i=.8,timeConstant:s=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:c=1,modifyTarget:l,driver:u,onUpdate:f,onComplete:d,onStop:h}){const p=t[0];let v;function b(S){return r!==void 0&&Sn}function y(S){return r===void 0?n:n===void 0||Math.abs(r-S){var T;f==null||f(P),(T=S.onUpdate)===null||T===void 0||T.call(S,P)},onComplete:d,onStop:h})}function g(S){m({type:"spring",stiffness:o,damping:a,restDelta:c,...S})}if(b(p))g({velocity:e,keyframes:[p,y(p)]});else{let S=i*e+p;typeof l<"u"&&(S=l(S));const P=y(S),T=P===r?-1:1;let w,I;const B=j=>{w=I,I=j,e=I3(j-w,Do.delta),(T===1&&j>P||T===-1&&jv==null?void 0:v.stop()}}const Qc=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Lp=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),m2=()=>({type:"keyframes",ease:"linear",duration:.3}),vee={type:"keyframes",duration:.8},o_={x:Qc,y:Qc,z:Qc,rotate:Qc,rotateX:Qc,rotateY:Qc,rotateZ:Qc,scaleX:Lp,scaleY:Lp,scale:Lp,opacity:m2,backgroundColor:m2,color:m2,default:Lp},mee=(t,{keyframes:e})=>e.length>2?vee:(o_[t]||o_.default)(e[1]),jx=(t,e)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&uc.test(e)&&!e.startsWith("url("));function yee({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}function a_(t){return t===0||typeof t=="string"&&parseFloat(t)===0&&t.indexOf(" ")===-1}function c_(t){return typeof t=="number"?0:M3("",t)}function Y$(t,e){return t[e]||t.default||t}function gee(t,e,r,n){const i=jx(e,r);let s=n.from!==void 0?n.from:t.get();return s==="none"&&i&&typeof r=="string"?s=M3(e,r):a_(s)&&typeof r=="string"?s=c_(r):!Array.isArray(r)&&a_(r)&&typeof s=="string"&&(r=c_(s)),Array.isArray(r)?(r[0]===null&&(r[0]=s),r):[s,r]}const U3=(t,e,r,n={})=>i=>{const s=Y$(n,t)||{},o=s.delay||n.delay||0;let{elapsed:a=0}=n;a=a-Rv(o);const c=gee(e,t,r,s),l=c[0],u=c[c.length-1],f=jx(t,l),d=jx(t,u);let h={keyframes:c,velocity:e.getVelocity(),...s,elapsed:a,onUpdate:b=>{e.set(b),s.onUpdate&&s.onUpdate(b)},onComplete:()=>{i(),s.onComplete&&s.onComplete()}};if(!f||!d||AZ.current||s.type===!1)return hee(h);if(s.type==="inertia")return pee(h);yee(s)||(h={...h,...mee(t,h)}),h.duration&&(h.duration=Rv(h.duration)),h.repeatDelay&&(h.repeatDelay=Rv(h.repeatDelay));const p=e.owner,v=p&&p.current;if(p&&v instanceof HTMLElement&&!(p!=null&&p.getProps().onUpdate)){const b=dee(e,t,h);if(b)return b}return Jm(h)};function bee(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(s=>Ux(t,s,r));n=Promise.all(i)}else if(typeof e=="string")n=Ux(t,e,r);else{const i=typeof e=="function"?$g(t,e,r.custom):e;n=J$(t,i,r)}return n.then(()=>t.notify("AnimationComplete",e))}function Ux(t,e,r={}){var n;const i=$g(t,e,r.custom);let{transition:s=t.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(s=r.transitionOverride);const o=i?()=>J$(t,i,r):()=>Promise.resolve(),a=!((n=t.variantChildren)===null||n===void 0)&&n.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:d}=s;return wee(t,e,u+l,f,d,r)}:()=>Promise.resolve(),{when:c}=s;if(c){const[l,u]=c==="beforeChildren"?[o,a]:[a,o];return l().then(u)}else return Promise.all([o(),a(r.delay)])}function J$(t,e,{delay:r=0,transitionOverride:n,type:i}={}){var s;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...c}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");n&&(o=n);const u=[],f=i&&((s=t.animationState)===null||s===void 0?void 0:s.getState()[i]);for(const d in c){const h=t.getValue(d),p=c[d];if(!h||p===void 0||f&&xee(f,d))continue;const v={delay:r,elapsed:0,...o};if(window.HandoffAppearAnimations&&!h.hasAnimated){const y=t.getProps()[SZ];y&&(v.elapsed=window.HandoffAppearAnimations(y,d,h,xn))}let b=h.start(U3(d,h,p,t.shouldReduceMotion&&ad.has(d)?{type:!1}:v));Km(l)&&(l.add(d),b=b.then(()=>l.remove(d))),u.push(b)}return Promise.all(u).then(()=>{a&&bZ(t,a)})}function wee(t,e,r=0,n=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*n,c=i===1?(l=0)=>l*n:(l=0)=>a-l*n;return Array.from(t.variantChildren).sort(Eee).forEach((l,u)=>{l.notify("AnimationStart",e),o.push(Ux(l,e,{...s,delay:r+c(u)}).then(()=>l.notify("AnimationComplete",e)))}),Promise.all(o)}function Eee(t,e){return t.sortNodePosition(e)}function xee({protectedKeys:t,needsAnimating:e},r){const n=t.hasOwnProperty(r)&&e[r]!==!0;return e[r]=!1,n}const z3=[mt.Animate,mt.InView,mt.Focus,mt.Hover,mt.Tap,mt.Drag,mt.Exit],Cee=[...z3].reverse(),See=z3.length;function kee(t){return e=>Promise.all(e.map(({animation:r,options:n})=>bee(t,r,n)))}function Aee(t){let e=kee(t);const r=Pee();let n=!0;const i=(c,l)=>{const u=$g(t,l);if(u){const{transition:f,transitionEnd:d,...h}=u;c={...c,...h,...d}}return c};function s(c){e=c(t)}function o(c,l){const u=t.getProps(),f=t.getVariantContext(!0)||{},d=[],h=new Set;let p={},v=1/0;for(let y=0;yv&&P;const j=Array.isArray(S)?S:[S];let H=j.reduce(i,{});T===!1&&(H={});const{prevResolvedValues:K={}}=g,F={...K,...H},E=_=>{B=!0,h.delete(_),g.needsAnimating[_]=!0};for(const _ in F){const O=H[_],N=K[_];p.hasOwnProperty(_)||(O!==N?qm(O)&&qm(N)?!k$(O,N)||I?E(_):g.protectedKeys[_]=!0:O!==void 0?E(_):h.add(_):O!==void 0&&h.has(_)?E(_):g.protectedKeys[_]=!0)}g.prevProp=S,g.prevResolvedValues=H,g.isActive&&(p={...p,...H}),n&&t.blockInitialAnimation&&(B=!1),B&&!w&&d.push(...j.map(_=>({animation:_,options:{type:m,...c}})))}if(h.size){const y={};h.forEach(m=>{const g=t.getBaseTarget(m);g!==void 0&&(y[m]=g)}),d.push({animation:y})}let b=!!d.length;return n&&u.initial===!1&&!t.manuallyAnimateOnMount&&(b=!1),n=!1,b?e(d):Promise.resolve()}function a(c,l,u){var f;if(r[c].isActive===l)return Promise.resolve();(f=t.variantChildren)===null||f===void 0||f.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(c,l)}),r[c].isActive=l;const d=o(u,c);for(const h in r)r[h].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>r}}function _ee(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!k$(e,t):!1}function Yc(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Pee(){return{[mt.Animate]:Yc(!0),[mt.InView]:Yc(),[mt.Hover]:Yc(),[mt.Tap]:Yc(),[mt.Drag]:Yc(),[mt.Focus]:Yc(),[mt.Exit]:Yc()}}const Tee={animation:Wa(({visualElement:t,animate:e})=>{t.animationState||(t.animationState=Aee(t)),Pg(e)&&C.useEffect(()=>e.subscribe(t),[e])}),exit:Wa(t=>{const{custom:e,visualElement:r}=t,[n,i]=S$(),s=C.useContext(P1);C.useEffect(()=>{r.isPresent=n;const o=r.animationState&&r.animationState.setActive(mt.Exit,!n,{custom:s&&s.custom||e});o&&!n&&o.then(i)},[n])})},l_=(t,e)=>Math.abs(t-e);function Iee(t,e){const r=l_(t.x,e.x),n=l_(t.y,e.y);return Math.sqrt(r**2+n**2)}class X${constructor(e,r,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const l=g2(this.lastMoveEventInfo,this.history),u=this.startEvent!==null,f=Iee(l.offset,{x:0,y:0})>=3;if(!u&&!f)return;const{point:d}=l,{timestamp:h}=Do;this.history.push({...d,timestamp:h});const{onStart:p,onMove:v}=this.handlers;u||(p&&p(this.lastMoveEvent,l),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,l)},this.handlePointerMove=(l,u)=>{this.lastMoveEvent=l,this.lastMoveEventInfo=y2(u,this.transformPagePoint),xn.update(this.updatePoint,!0)},this.handlePointerUp=(l,u)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:f,onSessionEnd:d}=this.handlers,h=g2(l.type==="pointercancel"?this.lastMoveEventInfo:y2(u,this.transformPagePoint),this.history);this.startEvent&&f&&f(l,h),d&&d(l,h)},!g$(e))return;this.handlers=r,this.transformPagePoint=n;const i=k3(e),s=y2(i,this.transformPagePoint),{point:o}=s,{timestamp:a}=Do;this.history=[{...o,timestamp:a}];const{onSessionStart:c}=r;c&&c(e,g2(s,this.history)),this.removeListeners=Rg(ff(window,"pointermove",this.handlePointerMove),ff(window,"pointerup",this.handlePointerUp),ff(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),lc.update(this.updatePoint)}}function y2(t,e){return e?{point:e(t.point)}:t}function u_(t,e){return{x:t.x-e.x,y:t.y-e.y}}function g2({point:t},e){return{point:t,delta:u_(t,Z$(e)),offset:u_(t,Oee(e)),velocity:Ree(e,.1)}}function Oee(t){return t[0]}function Z$(t){return t[t.length-1]}function Ree(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=Z$(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>Rv(e)));)r--;if(!n)return{x:0,y:0};const s=(i.timestamp-n.timestamp)/1e3;if(s===0)return{x:0,y:0};const o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function wi(t){return t.max-t.min}function zx(t,e=0,r=.01){return Math.abs(t-e)<=r}function f_(t,e,r,n=.5){t.origin=n,t.originPoint=vr(e.min,e.max,t.origin),t.scale=wi(r)/wi(e),(zx(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=vr(r.min,r.max,t.origin)-t.originPoint,(zx(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Dh(t,e,r,n){f_(t.x,e.x,r.x,n==null?void 0:n.originX),f_(t.y,e.y,r.y,n==null?void 0:n.originY)}function d_(t,e,r){t.min=r.min+e.min,t.max=t.min+wi(e)}function Mee(t,e,r){d_(t.x,e.x,r.x),d_(t.y,e.y,r.y)}function h_(t,e,r){t.min=e.min-r.min,t.max=t.min+wi(e)}function Lh(t,e,r){h_(t.x,e.x,r.x),h_(t.y,e.y,r.y)}function $ee(t,{min:e,max:r},n){return e!==void 0&&tr&&(t=n?vr(r,t,n.max):Math.min(t,r)),t}function p_(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function Nee(t,{top:e,left:r,bottom:n,right:i}){return{x:p_(t.x,r,i),y:p_(t.y,e,n)}}function v_(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.minn?r=Ym(e.min,e.max-n,t.min):n>i&&(r=Ym(t.min,t.max-i,e.min)),Nf(0,1,r)}function Bee(t,e){const r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}const Wx=.35;function Fee(t=Wx){return t===!1?t=0:t===!0&&(t=Wx),{x:m_(t,"left","right"),y:m_(t,"top","bottom")}}function m_(t,e,r){return{min:y_(t,e),max:y_(t,r)}}function y_(t,e){return typeof t=="number"?t:t[e]||0}const g_=()=>({translate:0,scale:1,origin:0,originPoint:0}),Bh=()=>({x:g_(),y:g_()}),b_=()=>({min:0,max:0}),Ir=()=>({x:b_(),y:b_()});function Fs(t){return[t("x"),t("y")]}function eN({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function jee({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Uee(t,e){if(!e)return t;const r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function b2(t){return t===void 0||t===1}function Hx({scale:t,scaleX:e,scaleY:r}){return!b2(t)||!b2(e)||!b2(r)}function tl(t){return Hx(t)||tN(t)||t.z||t.rotate||t.rotateX||t.rotateY}function tN(t){return w_(t.x)||w_(t.y)}function w_(t){return t&&t!=="0%"}function Xm(t,e,r){const n=t-r,i=e*n;return r+i}function E_(t,e,r,n,i){return i!==void 0&&(t=Xm(t,i,n)),Xm(t,r,n)+e}function qx(t,e=0,r=1,n,i){t.min=E_(t.min,e,r,n,i),t.max=E_(t.max,e,r,n,i)}function rN(t,{x:e,y:r}){qx(t.x,e.translate,e.scale,e.originPoint),qx(t.y,r.translate,r.scale,r.originPoint)}function zee(t,e,r,n=!1){var i,s;const o=r.length;if(!o)return;e.x=e.y=1;let a,c;for(let l=0;l1.0000000000001||t<.999999999999?t:1}function Oa(t,e){t.min=t.min+e,t.max=t.max+e}function C_(t,e,[r,n,i]){const s=e[i]!==void 0?e[i]:.5,o=vr(t.min,t.max,s);qx(t,e[r],e[n],o,e.scale)}const Wee=["x","scaleX","originX"],Hee=["y","scaleY","originY"];function Qu(t,e){C_(t.x,e,Wee),C_(t.y,e,Hee)}function nN(t,e){return eN(Uee(t.getBoundingClientRect(),e))}function qee(t,e,r){const n=nN(t,r),{scroll:i}=e;return i&&(Oa(n.x,i.offset.x),Oa(n.y,i.offset.y)),n}const Vee=new WeakMap;class Gee{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ir(),this.visualElement=e}start(e,{snapToCursor:r=!1}={}){if(this.visualElement.isPresent===!1)return;const n=a=>{this.stopAnimation(),r&&this.snapToCursor(k3(a,"page").point)},i=(a,c)=>{var l;const{drag:u,dragPropagation:f,onDragStart:d}=this.getProps();u&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=E$(u),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Fs(h=>{var p,v;let b=this.getAxisMotionValue(h).get()||0;if(io.test(b)){const y=(v=(p=this.visualElement.projection)===null||p===void 0?void 0:p.layout)===null||v===void 0?void 0:v.layoutBox[h];y&&(b=wi(y)*(parseFloat(b)/100))}this.originPoint[h]=b}),d==null||d(a,c),(l=this.visualElement.animationState)===null||l===void 0||l.setActive(mt.Drag,!0))},s=(a,c)=>{const{dragPropagation:l,dragDirectionLock:u,onDirectionLock:f,onDrag:d}=this.getProps();if(!l&&!this.openGlobalLock)return;const{offset:h}=c;if(u&&this.currentDirection===null){this.currentDirection=Kee(h),this.currentDirection!==null&&(f==null||f(this.currentDirection));return}this.updateAxis("x",c.point,h),this.updateAxis("y",c.point,h),this.visualElement.render(),d==null||d(a,c)},o=(a,c)=>this.stop(a,c);this.panSession=new X$(e,{onSessionStart:n,onStart:i,onMove:s,onSessionEnd:o},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,r){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s==null||s(e,r)}cancel(){var e,r;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(e=this.panSession)===null||e===void 0||e.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(r=this.visualElement.animationState)===null||r===void 0||r.setActive(mt.Drag,!1)}updateAxis(e,r,n){const{drag:i}=this.getProps();if(!n||!Bp(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=$ee(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:r}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;e&&Gu(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=Nee(n.layoutBox,e):this.constraints=!1,this.elastic=Fee(r),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Fs(s=>{this.getAxisMotionValue(s)&&(this.constraints[s]=Bee(n.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!Gu(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=qee(n,i.root,this.visualElement.getTransformPagePoint());let o=Dee(i.layout.layoutBox,s);if(r){const a=r(jee(o));this.hasMutatedConstraints=!!a,a&&(o=eN(a))}return o}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Fs(u=>{if(!Bp(u,r,this.currentDirection))return;let f=(c==null?void 0:c[u])||{};o&&(f={min:0,max:0});const d=i?200:1e6,h=i?40:1e7,p={type:"inertia",velocity:n?e[u]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(u,p)});return Promise.all(l).then(a)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return n.start(U3(e,n,0,r))}stopAnimation(){Fs(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){var r;const n="_drag"+e.toUpperCase(),i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(e,((r=this.visualElement.getProps().initial)===null||r===void 0?void 0:r[e])||0)}snapToCursor(e){Fs(r=>{const{drag:n}=this.getProps();if(!Bp(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[r];s.set(e[r]-vr(o,a,.5))}})}scalePositionWithinConstraints(){var e;if(!this.visualElement.current)return;const{drag:r,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Gu(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Fs(a=>{const c=this.getAxisMotionValue(a);if(c){const l=c.get();s[a]=Lee({min:l,max:l},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",(e=i.root)===null||e===void 0||e.updateScroll(),i.updateLayout(),this.resolveConstraints(),Fs(a=>{if(!Bp(a,r,null))return;const c=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];c.set(vr(l,u,s[a]))})}addListeners(){var e;if(!this.visualElement.current)return;Vee.set(this.visualElement,this);const r=this.visualElement.current,n=ff(r,"pointerdown",l=>{const{drag:u,dragListener:f=!0}=this.getProps();u&&f&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();Gu(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&((e=s.root)===null||e===void 0||e.updateScroll(),s.updateLayout()),i();const a=Og(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Fs(f=>{const d=this.getAxisMotionValue(f);d&&(this.originPoint[f]+=l[f].translate,d.set(d.get()+l[f].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),c==null||c()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Wx,dragMomentum:a=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Bp(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function Kee(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}function Qee(t){const{dragControls:e,visualElement:r}=t,n=Ig(()=>new Gee(r));C.useEffect(()=>e&&e.subscribe(n),[n,e]),C.useEffect(()=>n.addListeners(),[n])}function Yee({onPan:t,onPanStart:e,onPanEnd:r,onPanSessionStart:n,visualElement:i}){const s=t||e||r||n,o=C.useRef(null),{transformPagePoint:a}=C.useContext(v3),c={onSessionStart:n,onStart:e,onMove:t,onEnd:(u,f)=>{o.current=null,r&&r(u,f)}};C.useEffect(()=>{o.current!==null&&o.current.updateHandlers(c)});function l(u){o.current=new X$(u,c,{transformPagePoint:a})}Vm(i,"pointerdown",s&&l),A3(()=>o.current&&o.current.end())}const Jee={pan:Wa(Yee),drag:Wa(Qee)};function Vx(t){return typeof t=="string"&&t.startsWith("var(--")}const iN=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Xee(t){const e=iN.exec(t);if(!e)return[,];const[,r,n]=e;return[r,n]}function Gx(t,e,r=1){const[n,i]=Xee(t);if(!n)return;const s=window.getComputedStyle(e).getPropertyValue(n);return s?s.trim():Vx(i)?Gx(i,e,r+1):i}function Zee(t,{...e},r){const n=t.current;if(!(n instanceof Element))return{target:e,transitionEnd:r};r&&(r={...r}),t.values.forEach(i=>{const s=i.get();if(!Vx(s))return;const o=Gx(s,n);o&&i.set(o)});for(const i in e){const s=e[i];if(!Vx(s))continue;const o=Gx(s,n);o&&(e[i]=o,r&&r[i]===void 0&&(r[i]=s))}return{target:e,transitionEnd:r}}const ete=new Set(["width","height","top","left","right","bottom","x","y"]),sN=t=>ete.has(t),tte=t=>Object.keys(t).some(sN),S_=t=>t===eu||t===we;var k_;(function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"})(k_||(k_={}));const A_=(t,e)=>parseFloat(t.split(", ")[e]),__=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/);if(i)return A_(i[1],e);{const s=n.match(/^matrix\((.+)\)$/);return s?A_(s[1],t):0}},rte=new Set(["x","y","z"]),nte=Wm.filter(t=>!rte.has(t));function ite(t){const e=[];return nte.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e.length&&t.render(),e}const P_={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:__(4,13),y:__(5,14)},ste=(t,e,r)=>{const n=e.measureViewportBox(),i=e.current,s=getComputedStyle(i),{display:o}=s,a={};o==="none"&&e.setStaticValue("display",t.display||"block"),r.forEach(l=>{a[l]=P_[l](n,s)}),e.render();const c=e.measureViewportBox();return r.forEach(l=>{const u=e.getValue(l);u&&u.jump(a[l]),t[l]=P_[l](c,s)}),t},ote=(t,e,r={},n={})=>{e={...e},n={...n};const i=Object.keys(e).filter(sN);let s=[],o=!1;const a=[];if(i.forEach(c=>{const l=t.getValue(c);if(!t.hasValue(c))return;let u=r[c],f=Qd(u);const d=e[c];let h;if(qm(d)){const p=d.length,v=d[0]===null?1:0;u=d[v],f=Qd(u);for(let b=v;b=0?window.pageYOffset:null,l=ste(e,t,a);return s.length&&s.forEach(([u,f])=>{t.getValue(u).set(f)}),t.render(),_g&&c!==null&&window.scrollTo({top:c}),{target:l,transitionEnd:n}}else return{target:e,transitionEnd:n}};function ate(t,e,r,n){return tte(e)?ote(t,e,r,n):{target:e,transitionEnd:n}}const cte=(t,e,r,n)=>{const i=Zee(t,e,n);return e=i.target,n=i.transitionEnd,ate(t,e,r,n)},Kx={current:null},oN={current:!1};function lte(){if(oN.current=!0,!!_g)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Kx.current=t.matches;t.addListener(e),e()}else Kx.current=!1}function ute(t,e,r){const{willChange:n}=e;for(const i in e){const s=e[i],o=r[i];if(ni(s))t.addValue(i,s),Km(n)&&n.add(i);else if(ni(o))t.addValue(i,Df(s,{owner:t})),Km(n)&&n.remove(i);else if(o!==s)if(t.hasValue(i)){const a=t.getValue(i);!a.hasAnimated&&a.set(s)}else{const a=t.getStaticValue(i);t.addValue(i,Df(a!==void 0?a:s,{owner:t}))}}for(const i in r)e[i]===void 0&&t.removeValue(i);return e}const aN=Object.keys(P0),fte=aN.length,T_=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class dte{constructor({parent:e,props:r,reducedMotionConfig:n,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>xn.render(this.render,!1,!0);const{latestValues:o,renderState:a}=i;this.latestValues=o,this.baseTarget={...o},this.initialValues=r.initial?{...o}:{},this.renderState=a,this.parent=e,this.props=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=s,this.isControllingVariants=Tg(r),this.isVariantNode=s$(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...l}=this.scrapeMotionValuesFromProps(r,{});for(const u in l){const f=l[u];o[u]!==void 0&&ni(f)&&(f.set(o[u],!1),Km(c)&&c.add(u))}}scrapeMotionValuesFromProps(e,r){return{}}mount(e){var r;this.current=e,this.projection&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=(r=this.parent)===null||r===void 0?void 0:r.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),oN.current||lte(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Kx.current,this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var e,r,n;(e=this.projection)===null||e===void 0||e.unmount(),lc.update(this.notifyUpdate),lc.render(this.render),this.valueSubscriptions.forEach(i=>i()),(r=this.removeFromVariantTree)===null||r===void 0||r.call(this),(n=this.parent)===null||n===void 0||n.children.delete(this);for(const i in this.events)this.events[i].clear();this.current=null}bindToMotionValue(e,r){const n=ad.has(e),i=r.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&xn.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=r.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{i(),s()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...r},n,i,s,o,a){const c=[];for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,layoutScroll:h,layoutRoot:p})}return c}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ir()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r}makeTargetAnimatable(e,r=!0){return this.makeTargetAnimatableFromInstance(e,this.props,r)}setProps(e){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender();const r=this.props;this.props=e;for(let n=0;nn.variantChildren.delete(e)}addValue(e,r){r!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,r)),this.values.set(e,r),this.latestValues[e]=r.get()}removeValue(e){var r;this.values.delete(e),(r=this.valueSubscriptions.get(e))===null||r===void 0||r(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&r!==void 0&&(n=Df(r,{owner:this}),this.addValue(e,n)),n}readValue(e){return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,r){this.baseTarget[e]=r}getBaseTarget(e){var r;const{initial:n}=this.props,i=typeof n=="string"||typeof n=="object"?(r=S3(this.props,n))===null||r===void 0?void 0:r[e]:void 0;if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!ni(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new T3),this.events[e].add(r)}notify(e,...r){var n;(n=this.events[e])===null||n===void 0||n.notify(...r)}}const cN=["initial",...z3],hte=cN.length;class lN extends dte{sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){var n;return(n=e.style)===null||n===void 0?void 0:n[r]}removeValueFromRenderState(e,{vars:r,style:n}){delete r[e],delete n[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:r,...n},{transformValues:i},s){let o=xZ(n,e||{},this);if(i&&(r&&(r=i(r)),n&&(n=i(n)),o&&(o=i(o))),s){wZ(this,n,o);const a=cte(this,n,o,r);r=a.transitionEnd,n=a.target}return{transition:e,transitionEnd:r,...n}}}function pte(t){return window.getComputedStyle(t)}class vte extends lN{readValueFromInstance(e,r){if(ad.has(r)){const n=R3(r);return n&&n.default||0}else{const n=pte(e),i=(c$(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return nN(e,r)}build(e,r,n,i){g3(e,r,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,r){return C3(e,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ni(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}renderInstance(e,r,n,i){h$(e,r,n,i)}}class mte extends lN{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){var n;return ad.has(r)?((n=R3(r))===null||n===void 0?void 0:n.default)||0:(r=p$.has(r)?r:x3(r),e.getAttribute(r))}measureInstanceViewportBox(){return Ir()}scrapeMotionValuesFromProps(e,r){return m$(e,r)}build(e,r,n,i){w3(e,r,n,this.isSVGTag,i.transformTemplate)}renderInstance(e,r,n,i){v$(e,r,n,i)}mount(e){this.isSVGTag=E3(e.tagName),super.mount(e)}}const yte=(t,e)=>y3(t)?new mte(e,{enableHardwareAcceleration:!1}):new vte(e,{enableHardwareAcceleration:!0});function I_(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Yd={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(we.test(t))t=parseFloat(t);else return t;const r=I_(t,e.target.x),n=I_(t,e.target.y);return`${r}% ${n}%`}},O_="_$css",gte={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=t.includes("var("),s=[];i&&(t=t.replace(iN,h=>(s.push(h),O_)));const o=uc.parse(t);if(o.length>5)return n;const a=uc.createTransformer(t),c=typeof o[0]!="number"?1:0,l=r.x.scale*e.x,u=r.y.scale*e.y;o[0+c]/=l,o[1+c]/=u;const f=vr(l,u,.5);typeof o[2+c]=="number"&&(o[2+c]/=f),typeof o[3+c]=="number"&&(o[3+c]/=f);let d=a(o);if(i){let h=0;d=d.replace(O_,()=>{const p=s[h];return h++,p})}return d}};class bte extends x.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=e;lX(Ete),s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Mh.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==r||r===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||xn.postRender(()=>{var a;!((a=o.getStack())===null||a===void 0)&&a.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),r!=null&&r.group&&r.group.remove(i),n!=null&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e==null||e()}render(){return null}}function wte(t){const[e,r]=S$(),n=C.useContext(m3);return x.createElement(bte,{...t,layoutGroup:n,switchLayoutGroup:C.useContext(o$),isPresent:e,safeToRemove:r})}const Ete={borderRadius:{...Yd,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Yd,borderTopRightRadius:Yd,borderBottomLeftRadius:Yd,borderBottomRightRadius:Yd,boxShadow:gte},xte={measureLayout:wte};function Cte(t,e,r={}){const n=ni(t)?t:Df(t);return n.start(U3("",n,e,r)),{stop:()=>n.stop(),isAnimating:()=>n.isAnimating()}}const uN=["TopLeft","TopRight","BottomLeft","BottomRight"],Ste=uN.length,R_=t=>typeof t=="string"?parseFloat(t):t,M_=t=>typeof t=="number"||we.test(t);function kte(t,e,r,n,i,s){i?(t.opacity=vr(0,r.opacity!==void 0?r.opacity:1,Ate(n)),t.opacityExit=vr(e.opacity!==void 0?e.opacity:1,0,_te(n))):s&&(t.opacity=vr(e.opacity!==void 0?e.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;one?1:r(Ym(t,e,n))}function N_(t,e){t.min=e.min,t.max=e.max}function ts(t,e){N_(t.x,e.x),N_(t.y,e.y)}function D_(t,e,r,n,i){return t-=e,t=Xm(t,1/r,n),i!==void 0&&(t=Xm(t,1/i,n)),t}function Pte(t,e=0,r=1,n=.5,i,s=t,o=t){if(io.test(e)&&(e=parseFloat(e),e=vr(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=vr(s.min,s.max,n);t===s&&(a-=e),t.min=D_(t.min,e,r,a,i),t.max=D_(t.max,e,r,a,i)}function L_(t,e,[r,n,i],s,o){Pte(t,e[r],e[n],e[i],e.scale,s,o)}const Tte=["x","scaleX","originX"],Ite=["y","scaleY","originY"];function B_(t,e,r,n){L_(t.x,e,Tte,r==null?void 0:r.x,n==null?void 0:n.x),L_(t.y,e,Ite,r==null?void 0:r.y,n==null?void 0:n.y)}function F_(t){return t.translate===0&&t.scale===1}function dN(t){return F_(t.x)&&F_(t.y)}function hN(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function j_(t){return wi(t.x)/wi(t.y)}class Ote{constructor(){this.members=[]}add(e){_3(this.members,e),e.scheduleRender()}remove(e){if(P3(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(e){const r=this.members.findIndex(i=>e===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){n=s;break}}return n?(this.promote(n),!0):!1}promote(e,r){var n;const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,r&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),!((n=e.root)===null||n===void 0)&&n.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:s}=e.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var r,n,i,s,o;(n=(r=e.options).onExitComplete)===null||n===void 0||n.call(r),(o=(i=e.resumingFrom)===null||i===void 0?void 0:(s=i.options).onExitComplete)===null||o===void 0||o.call(s)})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function U_(t,e,r){let n="";const i=t.x.translate/e.x,s=t.y.translate/e.y;if((i||s)&&(n=`translate3d(${i}px, ${s}px, 0) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),r){const{rotate:c,rotateX:l,rotateY:u}=r;c&&(n+=`rotate(${c}deg) `),l&&(n+=`rotateX(${l}deg) `),u&&(n+=`rotateY(${u}deg) `)}const o=t.x.scale*e.x,a=t.y.scale*e.y;return(o!==1||a!==1)&&(n+=`scale(${o}, ${a})`),n||"none"}const Rte=(t,e)=>t.depth-e.depth;class Mte{constructor(){this.children=[],this.isDirty=!1}add(e){_3(this.children,e),this.isDirty=!0}remove(e){P3(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Rte),this.isDirty=!1,this.children.forEach(e)}}const z_=["","X","Y","Z"],W_=1e3;let $te=0;function pN({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o,a={},c=e==null?void 0:e()){this.id=$te++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Lte),this.nodes.forEach(jte),this.nodes.forEach(Ute)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=o,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0,o&&this.root.registerPotentialNode(o,this);for(let l=0;lthis.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=Q$(h,250),Mh.hasAnimatedSinceResize&&(Mh.hasAnimatedSinceResize=!1,this.nodes.forEach(q_))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&f&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:v})=>{var b,y,m,g,S;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const P=(y=(b=this.options.transition)!==null&&b!==void 0?b:f.getDefaultTransition())!==null&&y!==void 0?y:Vte,{onLayoutAnimationStart:T,onLayoutAnimationComplete:w}=f.getProps(),I=!this.targetLayout||!hN(this.targetLayout,v)||p,B=!h&&p;if(this.options.layoutRoot||!((m=this.resumeFrom)===null||m===void 0)&&m.instance||B||h&&(I||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,B);const j={...Y$(P,"layout"),onPlay:T,onComplete:w};(f.shouldReduceMotion||this.options.layoutRoot)&&(j.delay=0,j.type=!1),this.startAnimation(j)}else!h&&this.animationProgress===0&&q_(this),this.isLead()&&((S=(g=this.options).onExitComplete)===null||S===void 0||S.call(g));this.targetLayout=v})}unmount(){var o,a;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(o=this.getStack())===null||o===void 0||o.remove(this),(a=this.parent)===null||a===void 0||a.children.delete(this),this.instance=void 0,lc.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var o;return this.isAnimationBlocked||((o=this.parent)===null||o===void 0?void 0:o.isTreeAnimationBlocked())||!1}startUpdate(){var o;this.isUpdateBlocked()||(this.isUpdating=!0,(o=this.nodes)===null||o===void 0||o.forEach(zte),this.animationId++)}getTransformTemplate(){var o;return(o=this.options.visualElement)===null||o===void 0?void 0:o.getProps().transformTemplate}willUpdate(o=!0){var a,c,l;if(this.root.isUpdateBlocked()){(c=(a=this.options).onExitComplete)===null||c===void 0||c.call(a);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){var o;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{var g;const S=m/1e3;V_(h.x,o.x,S),V_(h.y,o.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(!((g=this.relativeParent)===null||g===void 0)&&g.layout)&&(Lh(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Hte(this.relativeTarget,this.relativeTargetOrigin,p,S)),v&&(this.animationValues=d,kte(d,f,this.latestValues,S,y,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)===null||a===void 0||a.stop(),this.resumingFrom&&((c=this.resumingFrom.currentAnimation)===null||c===void 0||c.stop()),this.pendingAnimation&&(lc.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=xn.update(()=>{Mh.hasAnimatedSinceResize=!0,this.currentAnimation=Cte(0,W_,{...o,onUpdate:l=>{var u;this.mixTargetDelta(l),(u=o.onUpdate)===null||u===void 0||u.call(o,l)},onComplete:()=>{var l;(l=o.onComplete)===null||l===void 0||l.call(o),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var o;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(o=this.getStack())===null||o===void 0||o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var o;this.currentAnimation&&((o=this.mixTargetDelta)===null||o===void 0||o.call(this,W_),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&vN(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||Ir();const f=wi(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const d=wi(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+d}ts(a,c),Qu(a,u),Dh(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){var c,l,u;this.sharedNodes.has(o)||this.sharedNodes.set(o,new Ote),this.sharedNodes.get(o).add(a),a.promote({transition:(c=a.options.initialPromotionConfig)===null||c===void 0?void 0:c.transition,preserveFollowOpacity:(u=(l=a.options.initialPromotionConfig)===null||l===void 0?void 0:l.shouldPreserveFollowOpacity)===null||u===void 0?void 0:u.call(l,a)})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.rotate||c.rotateX||c.rotateY||c.rotateZ)&&(a=!0),!a)return;const l={};for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(H_),this.root.sharedNodes.clear()}}}function Nte(t){t.updateLayout()}function Dte(t){var e,r,n;const i=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:o}=t.layout,{animationType:a}=t.options,c=i.source!==t.layout.source;a==="size"?Fs(h=>{const p=c?i.measuredBox[h]:i.layoutBox[h],v=wi(p);p.min=s[h].min,p.max=p.min+v}):vN(a,i.layoutBox,s)&&Fs(h=>{const p=c?i.measuredBox[h]:i.layoutBox[h],v=wi(s[h]);p.max=p.min+v});const l=Bh();Dh(l,s,i.layoutBox);const u=Bh();c?Dh(u,t.applyTransform(o,!0),i.measuredBox):Dh(u,s,i.layoutBox);const f=!dN(l);let d=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:p,layout:v}=h;if(p&&v){const b=Ir();Lh(b,i.layoutBox,p.layoutBox);const y=Ir();Lh(y,s,v.layoutBox),hN(b,y)||(d=!0),h.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=b,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:i,delta:u,layoutDelta:l,hasLayoutChanged:f,hasRelativeTargetChanged:d})}else t.isLead()&&((n=(r=t.options).onExitComplete)===null||n===void 0||n.call(r));t.options.transition=void 0}function Lte(t){t.isProjectionDirty||(t.isProjectionDirty=!!(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=!!(t.parent&&t.parent.isTransformDirty))}function Bte(t){t.clearSnapshot()}function H_(t){t.clearMeasurements()}function Fte(t){const{visualElement:e}=t.options;e!=null&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function q_(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function jte(t){t.resolveTargetDelta()}function Ute(t){t.calcProjection()}function zte(t){t.resetRotation()}function Wte(t){t.removeLeadSnapshot()}function V_(t,e,r){t.translate=vr(e.translate,0,r),t.scale=vr(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function G_(t,e,r,n){t.min=vr(e.min,r.min,n),t.max=vr(e.max,r.max,n)}function Hte(t,e,r,n){G_(t.x,e.x,r.x,n),G_(t.y,e.y,r.y,n)}function qte(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Vte={duration:.45,ease:[.4,0,.1,1]};function Gte(t,e){let r=t.root;for(let s=t.path.length-1;s>=0;s--)if(t.path[s].instance){r=t.path[s];break}const i=(r&&r!==t.root?r.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function K_(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function Kte(t){K_(t.x),K_(t.y)}function vN(t,e,r){return t==="position"||t==="preserve-aspect"&&!zx(j_(e),j_(r),.2)}const Qte=pN({attachResizeListener:(t,e)=>Og(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),w2={current:void 0},Yte=pN({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!w2.current){const t=new Qte(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),w2.current=t}return w2.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Jte={...Tee,...KX,...Jee,...xte},O0=aX((t,e)=>NX(t,e,Jte,yte,Yte));function mN(){const t=C.useRef(!1);return Um(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Xte(){const t=mN(),[e,r]=C.useState(0),n=C.useCallback(()=>{t.current&&r(e+1)},[e]);return[C.useCallback(()=>xn.postRender(n),[n]),e]}class Zte extends C.Component{getSnapshotBeforeUpdate(e){const r=this.props.childRef.current;if(r&&e.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=r.offsetHeight||0,n.width=r.offsetWidth||0,n.top=r.offsetTop,n.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function ere({children:t,isPresent:e}){const r=C.useId(),n=C.useRef(null),i=C.useRef({width:0,height:0,top:0,left:0});return C.useInsertionEffect(()=>{const{width:s,height:o,top:a,left:c}=i.current;if(e||!n.current||!s||!o)return;n.current.dataset.motionPopId=r;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(` +`)}static register(e,r){r||(r=e.locale)}}const nJ="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo";let Nh=null;function O4(t){if(Nh==null&&(Nh=nJ.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),P1.check(t)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw Nh=null,new Error("BIP39 Wordlist for en (English) FAILED")}class iJ extends P1{constructor(){super("en")}getWord(e){return O4(this),Nh[e]}getWordIndex(e){return O4(this),Nh.indexOf(e)}}const z$=new iJ;P1.register(z$);const R4={en:z$},sJ="hdnode/5.7.0",P0=new ee(sJ),oJ=J.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),aJ=wt("Bitcoin seed"),Pu=2147483648;function W$(t){return(1<=256)throw new Error("Depth too large!");return $4(qt([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",te(this.depth),this.parentFingerprint,dt(te(this.index),4),this.chainCode,this.privateKey!=null?qt(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Co(pu,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(e&~Pu));const n=new Uint8Array(37);if(e&Pu){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(re(this.privateKey),1),r&&(r+="'")}else n.set(re(this.publicKey));for(let f=24;f>=0;f-=8)n[33+(f>>3)]=e>>24-f&255;const i=re(_0(Nf.sha512,this.chainCode,n)),s=i.slice(0,32),o=i.slice(32);let a=null,c=null;this.privateKey?a=Np(J.from(s).add(this.privateKey).mod(oJ)):c=new jm(te(s))._addPoint(this.publicKey);let l=r;const u=this.mnemonic;return u&&(l=Object.freeze({phrase:u.phrase,path:r,locale:u.locale||"en"})),new Co(pu,a,c,this.fingerprint,Np(o),e,this.depth+1,l)}derivePath(e){const r=e.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);r[0]==="m"&&r.shift();let n=this;for(let i=0;i=Pu)throw new Error("invalid path index - "+s);n=n._derive(Pu+o)}else if(s.match(/^[0-9]+$/)){const o=parseInt(s);if(o>=Pu)throw new Error("invalid path index - "+s);n=n._derive(o)}else throw new Error("invalid path component - "+s)}return n}static _fromSeed(e,r){const n=re(e);if(n.length<16||n.length>64)throw new Error("invalid seed");const i=re(_0(Nf.sha512,aJ,n));return new Co(pu,Np(i.slice(0,32)),null,"0x00000000",Np(i.slice(32)),0,0,r)}static fromMnemonic(e,r,n){return n=b3(n),e=q$(w3(e,n),n),Co._fromSeed(H$(e,r),{phrase:e,path:"m",locale:n.locale})}static fromSeed(e){return Co._fromSeed(e,null)}static fromExtendedKey(e){const r=Mf.decode(e);(r.length!==82||$4(r.slice(0,78))!==e)&&P0.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const n=r[4],i=te(r.slice(5,9)),s=parseInt(te(r.slice(9,13)).substring(2),16),o=te(r.slice(13,45)),a=r.slice(45,78);switch(te(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Co(pu,null,te(a),i,o,s,n,null);case"0x0488ade4":case"0x04358394 ":if(a[0]!==0)break;return new Co(pu,te(a.slice(1)),null,i,o,s,n,null)}return P0.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function H$(t,e){e||(e="");const r=wt("mnemonic"+e,Ho.NFKD);return eJ(wt(t,Ho.NFKD),r,2048,64,"sha512")}function w3(t,e){e=b3(e),P0.checkNormalize();const r=e.split(t);if(r.length%3!==0)throw new Error("invalid mnemonic");const n=re(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let l=0;l>3]|=1<<7-i%8),i++}const s=32*r.length/3,o=r.length/3,a=W$(o);if((re(Go(n.slice(0,s/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return te(n.slice(0,s/8))}function q$(t,e){if(e=b3(e),t=re(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&cJ(8-n)),n+=3);const i=t.length/4,s=re(Go(t))[0]&W$(i);return r[r.length-1]<<=i,r[r.length-1]|=s>>8-i,e.join(r.map(o=>e.getWord(o)))}function uJ(t,e){try{return w3(t,e),!0}catch{}return!1}function fJ(t){return(typeof t!="number"||t<0||t>=Pu||t%1)&&P0.throwArgumentError("invalid account index","index",t),`m/44'/60'/${t}'/0/0`}const dJ="random/5.7.0",Rx=new ee(dJ);function hJ(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const M4=hJ();let Mv=M4.crypto||M4.msCrypto;(!Mv||!Mv.getRandomValues)&&(Rx.warn("WARNING: Missing strong random number source"),Mv={getRandomValues:function(t){return Rx.throwError("no secure random source avaialble",ee.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function T1(t){(t<=0||t>1024||t%1||t!=t)&&Rx.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return Mv.getRandomValues(e),re(e)}function V$(t){t=t.slice();for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}function pJ(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return e.encseed&&e.ethaddr}function vJ(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return!(!e.version||parseInt(e.version)!==e.version||parseInt(e.version)!==3)}function mJ(t){if(pJ(t))try{return Ve(JSON.parse(t).ethaddr)}catch{return null}if(vJ(t))try{return Ve(JSON.parse(t).address)}catch{return null}return null}globalThis&&globalThis.__awaiter;function G$(t,e){return Fl(f3(t),e)}function yJ(t,e,r,n){return Fl(qr.hash(t,e,r),n)}const gJ="networks/5.7.1",N4=new ee(gJ);function bJ(t){return t&&typeof t.renetwork=="function"}function Po(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const s=["goerli","ropsten","rinkeby","sepolia"];try{const o=new r.PocketProvider(t,n.pocket);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const s=["ropsten"],o=new r.AnkrProvider(t,n.ankr);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let s=1;return n.quorum!=null?s=n.quorum:t==="homestead"&&(s=2),new r.FallbackProvider(i,s)}return i[0]};return e.renetwork=function(r){return Po(r)},e}function zm(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return zm(t,n)},r}const D4={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Po("homestead")},L4={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Po("ropsten")},F4={chainId:63,name:"classicMordor",_defaultProvider:zm("https://www.ethercluster.com/mordor","classicMordor")},Dp={unspecified:{chainId:0,name:"unspecified"},homestead:D4,mainnet:D4,morden:{chainId:2,name:"morden"},ropsten:L4,testnet:L4,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Po("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Po("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Po("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Po("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:zm("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:F4,classicTestnet:F4,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:zm("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Po("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Po("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 wJ(t){if(t==null)return null;if(typeof t=="number"){for(const n in Dp){const i=Dp[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=Dp[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=Dp[t.name];if(!e)return typeof t.chainId!="number"&&N4.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&N4.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(bJ(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}const EJ="web/5.7.1";var xJ=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};function CJ(t,e){return xJ(this,void 0,void 0,function*(){e==null&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};if(e.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),e.fetchOptions!=null){const o=e.fetchOptions;o.mode&&(r.mode=o.mode),o.cache&&(r.cache=o.cache),o.credentials&&(r.credentials=o.credentials),o.redirect&&(r.redirect=o.redirect),o.referrer&&(r.referrer=o.referrer)}const n=yield fetch(t,r),i=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach((o,a)=>{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:re(new Uint8Array(i))}})}var SJ=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const os=new ee(EJ);function B4(t){return new Promise(e=>{setTimeout(e,t)})}function Sa(t,e){if(t==null)return null;if(typeof t=="string")return t;if(Wo(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return ua(t)}catch{}return te(t)}return t}function kJ(t){return wt(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function K$(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;os.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;os.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};let c=null;const l={method:"GET"};let u=!1,f=2*60*1e3;if(typeof t=="string")c=t;else if(typeof t=="object"){if((t==null||t.url==null)&&os.throwArgumentError("missing URL","connection.url",t),c=t.url,typeof t.timeout=="number"&&t.timeout>0&&(f=t.timeout),t.headers)for(const y in t.headers)a[y.toLowerCase()]={key:y,value:String(t.headers[y])},["if-none-match","if-modified-since"].indexOf(y.toLowerCase())>=0&&(u=!0);if(l.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){c.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&os.throwError("basic authentication requires a secure https url",ee.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:t.user,password:"[REDACTED]"});const y=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+l3(wt(y))}}t.skipFetchSetup!=null&&(l.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(l.fetchOptions=Vt(t.fetchOptions))}const d=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=c?c.match(d):null;if(h)try{const y={statusCode:200,statusMessage:"OK",headers:{"content-type":h[1]||"text/plain"},body:h[2]?c3(h[3]):kJ(h[3])};let m=y.body;return r&&(m=r(y.body,y)),Promise.resolve(m)}catch(y){os.throwError("processing response error",ee.errors.SERVER_ERROR,{body:Sa(h[1],h[2]),error:y,requestBody:null,requestMethod:"GET",url:c})}e&&(l.method="POST",l.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const p={};Object.keys(a).forEach(y=>{const m=a[y];p[m.key]=m.value}),l.headers=p;const v=function(){let y=null;return{promise:new Promise(function(S,P){f&&(y=setTimeout(()=>{y!=null&&(y=null,P(os.makeError("timeout",ee.errors.TIMEOUT,{requestBody:Sa(l.body,p["content-type"]),requestMethod:l.method,timeout:f,url:c})))},f))}),cancel:function(){y!=null&&(clearTimeout(y),y=null)}}}(),b=function(){return SJ(this,void 0,void 0,function*(){for(let y=0;y=300)&&(v.cancel(),os.throwError("bad response",ee.errors.SERVER_ERROR,{status:m.statusCode,headers:m.headers,body:Sa(g,m.headers?m.headers["content-type"]:null),requestBody:Sa(l.body,p["content-type"]),requestMethod:l.method,url:c})),r)try{const S=yield r(g,m);return v.cancel(),S}catch(S){if(S.throttleRetry&&y{let a=null;if(s!=null)try{a=JSON.parse(ua(s))}catch(c){os.throwError("invalid JSON",ee.errors.SERVER_ERROR,{body:s,error:c})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=wt(e);const s=typeof t=="string"?{url:t}:Vt(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=Vt(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return K$(t,i,n)}function Wa(t,e){return e||(e={}),e=Vt(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let c=0;function l(){return t().then(function(u){if(u!==void 0)o()&&r(u);else if(e.oncePoll)e.oncePoll.once("poll",l);else if(e.onceBlock)e.onceBlock.once("block",l);else if(!s){if(c++,c>a){o()&&n(new Error("retry limit reached"));return}let f=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));fe.ceiling&&(f=e.ceiling),setTimeout(l,f)}return null},function(u){o()&&n(u)})}l()})}var Wm="qpzry9x8gf2tvdw0s3jn54khce6mua7l",$x={};for(var Lp=0;Lp>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function Q$(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=df(e)^n>>5}for(e=df(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=Q$(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s>5)throw new Error("Non 5-bit word");n=df(n)^o,i+=Wm.charAt(o)}for(s=0;s<6;++s)n=df(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=Wm.charAt(a)}return i}function Y$(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=Q$(s);if(typeof a=="string")return a;for(var c=[],l=0;l=o.length)&&c.push(f)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:c}}function _J(){var t=Y$.apply(null,arguments);if(typeof t=="object")return t}function PJ(t){var e=Y$.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function Ig(t,e,r,n){for(var i=0,s=0,o=(1<=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<=e)return"Excess padding";if(i<this.data(f,!0);return e.transaction={hash:o,type:l,accessList:de.allowNull(this.accessList.bind(this),null),blockHash:de.allowNull(o,null),blockNumber:de.allowNull(c,null),transactionIndex:de.allowNull(c,null),confirmations:de.allowNull(c,null),from:r,gasPrice:de.allowNull(n),maxPriorityFeePerGas:de.allowNull(n),maxFeePerGas:de.allowNull(n),gasLimit:n,to:de.allowNull(r,null),value:n,nonce:c,data:s,r:de.allowNull(this.uint256),s:de.allowNull(this.uint256),v:de.allowNull(c),creates:de.allowNull(r,null),raw:de.allowNull(s)},e.transactionRequest={from:de.allowNull(r),nonce:de.allowNull(c),gasLimit:de.allowNull(n),gasPrice:de.allowNull(n),maxPriorityFeePerGas:de.allowNull(n),maxFeePerGas:de.allowNull(n),to:de.allowNull(r),value:de.allowNull(n),data:de.allowNull(u),type:de.allowNull(c),accessList:de.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:o,address:r,topics:de.arrayOf(o),data:s,logIndex:c,blockHash:o},e.receipt={to:de.allowNull(this.address,null),from:de.allowNull(this.address,null),contractAddress:de.allowNull(r,null),transactionIndex:c,root:de.allowNull(a),gasUsed:n,logsBloom:de.allowNull(s),blockHash:o,transactionHash:o,logs:de.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:de.allowNull(c,null),cumulativeGasUsed:n,effectiveGasPrice:de.allowNull(n),status:de.allowNull(c),type:l},e.block={hash:de.allowNull(o),parentHash:o,number:c,timestamp:c,nonce:de.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:de.allowNull(r),extraData:s,transactions:de.allowNull(de.arrayOf(o)),baseFeePerGas:de.allowNull(n)},e.blockWithTransactions=Vt(e.block),e.blockWithTransactions.transactions=de.allowNull(de.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:de.allowNull(i,void 0),toBlock:de.allowNull(i,void 0),blockHash:de.allowNull(o,void 0),address:de.allowNull(r,void 0),topics:de.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:de.allowNull(c),blockHash:de.allowNull(o),transactionIndex:c,removed:de.allowNull(this.boolean.bind(this)),address:r,data:de.allowFalsish(s,"0x"),topics:de.arrayOf(o),transactionHash:o,logIndex:c},e}accessList(e){return eu(e||[])}number(e){return e==="0x"?0:J.from(e).toNumber()}type(e){return e==="0x"||e==null?0:J.from(e).toNumber()}bigNumber(e){return J.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),je(e))?e.toLowerCase():Kd.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return Ve(e)}callAddress(e){if(!je(e,32))return null;const r=Ve(br(e,12));return r===lr?null:r}contractAddress(e){return n3(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||je(e))return Es(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return lo(n)!==32?Kd.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=J.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!je(e))throw new Error("invalid uint256");return dt(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=de.check(r,e);return i._difficulty=n==null?null:J.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return de.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&J.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=de.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;je(n)&&(n=J.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),je(n)&&(n=J.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return L$(e)}receiptLog(e){return de.check(this.formats.receiptLog,e)}receipt(e){const r=de.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=J.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&Kd.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):Kd.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&Kd.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return de.check(this.formats.filter,e)}filterLog(e){return de.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}function MJ(t){return t&&typeof t.isCommunityResource=="function"}function U4(t){return MJ(t)&&t.isCommunityResource()}var Se=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const qe=new ee(ld),NJ=10;function z4(t){return t==null?"null":(lo(t)!==32&&qe.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function W4(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[z4(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return z4(e)}).join("&")}function DJ(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function vu(t){if(typeof t=="string"){if(t=t.toLowerCase(),lo(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+W4(t);if(KK.isForkEvent(t))throw qe.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+W4(t.topics||[])}throw new Error("invalid event - "+t)}function Qd(){return new Date().getTime()}function H4(t){return new Promise(e=>{setTimeout(e,t)})}const LJ=["block","network","pending","poll"];let FJ=class{constructor(e,r,n){ie(this,"tag",e),ie(this,"listener",r),ie(this,"once",n),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(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=DJ(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||LJ.indexOf(this.tag)>=0}};const BJ={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 h2(t){return dt(J.from(t).toHexString(),32)}function q4(t){return Mf.encode(qt([t,br(Go(Go(t)),0,4)]))}const J$=new RegExp("^(ipfs)://(.*)$","i"),V4=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),J$,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Nv(t,e){try{return ua(T0(t,e))}catch{}return null}function T0(t,e){if(t==="0x")return null;const r=J.from(br(t,e,e+32)).toNumber(),n=J.from(br(t,r,r+32)).toNumber();return br(t,r+32,r+32+n)}function p2(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):qe.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function G4(t){const e=re(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function jJ(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function X$(t){const e=[];let r=0;for(let n=0;nJ.from(e).eq(1)).catch(e=>{if(e.code===ee.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return Se(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:Rn([e,Mh(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=Rn(["0x9061b923",X$([n$(this.name),n.data])]));try{let s=yield this.provider.call(n);return re(s).length%32===4&&qe.throwError("resolver threw error",ee.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=T0(s,0)),s}catch(s){if(s.code===ee.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return Se(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?T0(n,0):null})}_getAddress(e,r){const n=BJ[String(e)];if(n==null&&qe.throwError(`unsupported coin type: ${e}`,ee.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=re(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return q4(qt([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return q4(qt([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=j4.toWords(i.slice(2));return a.unshift(o),j4.encode(n.prefix,a)}}return null}getAddress(e){return Se(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===Mm?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===ee.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",h2(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&qe.throwError("invalid or unsupported coin data",ee.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return Se(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;no[c])}return qe.throwError("invalid or unsupported content hash data",ee.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return Se(this,void 0,void 0,function*(){let r=wt(e);r=qt([h2(64),h2(r.length),r]),r.length%32!==0&&(r=qt([r,dt("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",te(r));return n==null||n==="0x"?null:ua(n)})}}let v2=null,UJ=1;class Og extends Tc{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),ie(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=vs(new.target,"getNetwork")(e);r?(ie(this,"_network",r),this.emit("network",r,null)):qe.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Se(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||qe.throwError("no network detected",ee.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:ie(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return Wa(()=>this._ready().then(e=>e,e=>{if(!(e.code===ee.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return v2==null&&(v2=new de),v2}static getNetwork(e){return wJ(e??"homestead")}ccipReadFetch(e,r,n){return Se(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=0?null:JSON.stringify({data:s,sender:i}),f=yield I1({url:l,errorPassThrough:!0},u,(h,p)=>(h.status=p.statusCode,h));if(f.data)return f.data;const d=f.message||"unknown error";if(f.status>=400&&f.status<500)return qe.throwError(`response not found during CCIP fetch: ${d}`,ee.errors.SERVER_ERROR,{url:c,errorMessage:d});o.push(d)}return qe.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,ee.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(e){return Se(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(Qd()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=Qd(),n=vt({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=Qd();return i=J.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return Se(this,void 0,void 0,function*(){const e=UJ++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)qe.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",qe.makeError("network block skew detected",ee.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).then(c=>{i._inflight=!1,c.length!==0&&c.forEach(l=>{l.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=l.blockNumber),this._emitted["b:"+l.blockHash]=l.blockNumber,this._emitted["t:"+l.transactionHash]=l.blockNumber,this.emit(s,l)})}).catch(c=>{this.emit("error",c),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Se(this,void 0,void 0,function*(){return qe.throwError("provider does not support network detection",ee.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return Se(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,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",r,e),yield H4(0),this._network;const n=qe.makeError("underlying network changed",ee.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}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(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=Qd();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return Se(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return Se(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const c=[];let l=!1;const u=function(){return l?!0:(l=!0,c.forEach(d=>{d()}),!1)},f=d=>{d.confirmations{this.removeListener(e,f)}),i){let d=i.startBlock,h=null;const p=v=>Se(this,void 0,void 0,function*(){l||(yield H4(1e3),this.getTransactionCount(i.from).then(b=>Se(this,void 0,void 0,function*(){if(!l){if(b<=i.nonce)d=v;else{{const y=yield this.getTransaction(e);if(y&&y.blockNumber!=null)return}for(h==null&&(h=d-3,h{l||this.once("block",p)}))});if(l)return;this.once("block",p),c.push(()=>{this.removeListener("block",p)})}if(typeof n=="number"&&n>0){const d=setTimeout(()=>{u()||a(qe.makeError("timeout exceeded",ee.errors.TIMEOUT,{timeout:n}))},n);d.unref&&d.unref(),c.push(()=>{clearTimeout(d)})}})})}getBlockNumber(){return Se(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return Se(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return J.from(e)}catch(r){return qe.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return Se(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield vt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return J.from(i)}catch(s){return qe.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return Se(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield vt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return J.from(i).toNumber()}catch(s){return qe.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return Se(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield vt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return te(i)}catch(s){return qe.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return Se(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield vt({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>Es(o))}),s=yield this.perform("getStorageAt",i);try{return te(s)}catch(o){return qe.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&lo(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&qe.throwError("Transaction hash mismatch from Provider.sendTransaction.",ee.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>Se(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const c=yield this._waitForTransaction(e.hash,s,o,a);return c==null&&s===0?null:(this._emitted["t:"+e.hash]=c.blockNumber,c.status===0&&qe.throwError("transaction failed",ee.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:c}),c)}),i}sendTransaction(e){return Se(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>te(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return Se(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?J.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?te(s):null))}),this.formatter.transactionRequest(yield vt(n))})}_getFilter(e){return Se(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield vt(r))})}_call(e,r,n){return Se(this,void 0,void 0,function*(){n>=NJ&&qe.throwError("CCIP read exceeded maximum redirections",ee.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&lo(s)%32===4)try{const o=br(s,4),a=br(o,0,32);J.from(a).eq(i)||qe.throwError("CCIP Read sender did not match",ee.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const c=[],l=J.from(br(o,32,64)).toNumber(),u=J.from(br(o,l,l+32)).toNumber(),f=br(o,l+32);for(let y=0;ySe(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let c=0;cthis._wrapTransaction(c)),a}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Se(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Wa(()=>Se(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return Se(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Wa(()=>Se(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return Se(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield vt({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),de.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return Se(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return Se(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&qe.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return Se(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new Mx(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return Se(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||qe.throwError("network does not support ENS",ee.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+Mh(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return Se(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(je(e))throw n}typeof e!="string"&&qe.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return Se(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=Nv(yield this.call({to:n,data:"0x691f3431"+Mh(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return Se(this,void 0,void 0,function*(){let r=null;if(je(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new Mx(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==ee.errors.CALL_EXCEPTION)throw a}try{const a=Nv(yield this.call({to:o,data:"0x691f3431"+Mh(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==ee.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return qe.throwError(e+" not implemented",ee.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new FJ(vu(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=vu(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=vu(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=vu(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=vu(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=vu(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var So=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const kr=new ee(ld),zJ=["call","estimateGas"];function Dh(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=je(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=Dh(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return Dh(JSON.parse(t),e)}catch{}return null}function Z$(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=Dh(e,!0);if(s)return s.data;kr.throwError("missing revert data in call exception; Transaction reverted without a reason string",ee.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=Dh(e.body,!1);s==null&&(s=Dh(e,!1)),s&&kr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ee.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===ee.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&kr.throwError("insufficient funds for intrinsic transaction cost",ee.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&kr.throwError("nonce has already been used",ee.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&kr.throwError("replacement fee too low",ee.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&kr.throwError("legacy pre-eip-155 transactions not supported",ee.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),zJ.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&kr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ee.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function K4(t){return new Promise(function(e){setTimeout(e,t)})}function WJ(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function Yd(t){return t&&t.toLowerCase()}const Nx={};class eM extends Dl{constructor(e,r,n){if(super(),e!==Nx)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");ie(this,"provider",r),n==null&&(n=0),typeof n=="string"?(ie(this,"_address",this.provider.formatter.address(n)),ie(this,"_index",null)):typeof n=="number"?(ie(this,"_index",n),ie(this,"_address",null)):kr.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return kr.throwError("cannot alter JSON-RPC Signer connection",ee.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new HJ(Nx,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&&kr.throwError("unknown account #"+this._index,ee.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=Vt(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=Vt(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>So(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&kr.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),vt({tx:vt(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&kr.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&kr.throwError("user rejected transaction",ee.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),Z$("sendTransaction",o,s)))})}signTransaction(e){return kr.throwError("signing transactions is unsupported",ee.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return So(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield Wa(()=>So(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return So(this,void 0,void 0,function*(){const r=typeof e=="string"?wt(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[te(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&kr.throwError("user rejected signing",ee.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return So(this,void 0,void 0,function*(){const r=typeof e=="string"?wt(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),te(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&kr.throwError("user rejected signing",ee.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return So(this,void 0,void 0,function*(){const i=yield qr.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(qr.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&kr.throwError("user rejected signing",ee.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return So(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class HJ extends eM{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const qJ={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};let Ko=class extends Og{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=vs(this.constructor,"defaultUrl")()),typeof e=="string"?ie(this,"connection",Object.freeze({url:e})):ie(this,"connection",Object.freeze(Vt(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(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 So(this,void 0,void 0,function*(){yield K4(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=vs(this.constructor,"getNetwork");try{return r(J.from(e).toNumber())}catch(n){return kr.throwError("could not detect network",ee.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return kr.throwError("could not detect network",ee.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new eM(Nx,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:mi(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=I1(this.connection,JSON.stringify(n),WJ).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Yd(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Yd(r.address),r.blockTag]];case"getCode":return["eth_getCode",[Yd(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Yd(r.address),dt(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[vs(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[vs(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=Yd(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return So(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&J.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=Vt(r),r.transaction=Vt(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&kr.throwError(e+" not implemented",ee.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return Z$(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(c){return e.emit("pending",c),null})})}),o.then(function(){return K4(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=Vt(qJ);if(r)for(const s in r)r[s]&&(n[s]=!0);e3(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=Es(J.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=te(e[s]))}),e.accessList&&(i.accessList=eu(e.accessList)),i}};var VJ=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const GJ=new ee(ld);class Hm extends Ko{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return VJ(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||GJ.throwError("no network detected",ee.errors.UNKNOWN_ERROR,{}),this._network==null&&(ie(this,"_network",r),this.emit("network",r,null))),r})}}var qm=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const il=new ee(ld);function Fp(){return new Date().getTime()}function Q4(t){let e=null;for(let r=0;re?null:(n+i)/2}function Ku(t){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return JSON.stringify(t);if(typeof t=="string")return t;if(J.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map(e=>Ku(e)));if(typeof t=="object"){const e=Object.keys(t);return e.sort(),"{"+e.map(r=>{let n=t[r];return typeof n=="function"?n="[function]":n=Ku(n),JSON.stringify(r)+":"+n}).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}let KJ=1;function J4(t){let e=null,r=null,n=new Promise(o=>{e=function(){r&&(clearTimeout(r),r=null),o()},r=setTimeout(e,t)});const i=o=>(n=n.then(o),n);function s(){return n}return{cancel:e,getPromise:s,wait:i}}const QJ=[ee.errors.CALL_EXCEPTION,ee.errors.INSUFFICIENT_FUNDS,ee.errors.NONCE_EXPIRED,ee.errors.REPLACEMENT_UNDERPRICED,ee.errors.UNPREDICTABLE_GAS_LIMIT],YJ=["address","args","errorArgs","errorSignature","method","transaction"];function Bp(t,e){const r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function JJ(t,e){return function(r){const n={};r.forEach(s=>{const o=t(s.result);n[o]||(n[o]={count:0,result:s.result}),n[o].count++});const i=Object.keys(n);for(let s=0;s=e)return o.result}}}function XJ(t,e,r){let n=Ku;switch(e){case"getBlockNumber":return function(i){const s=i.map(a=>a.result);let o=Y4(i.map(a=>a.result),2);if(o!=null)return o=Math.ceil(o),s.indexOf(o+1)>=0&&o++,o>=t._highestBlockNumber&&(t._highestBlockNumber=o),t._highestBlockNumber};case"getGasPrice":return function(i){const s=i.map(o=>o.result);return s.sort(),s[Math.floor(s.length/2)]};case"getEtherPrice":return function(i){return Y4(i.map(s=>s.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(i){return i==null?null:(i=Vt(i),i.confirmations=-1,Ku(i))};break;case"getBlock":r.includeTransactions?n=function(i){return i==null?null:(i=Vt(i),i.transactions=i.transactions.map(s=>(s=Vt(s),s.confirmations=-1,s)),Ku(i))}:n=function(i){return i==null?null:Ku(i)};break;default:throw new Error("unknown method: "+e)}return JJ(n,t.quorum)}function Jd(t,e){return qm(this,void 0,void 0,function*(){const r=t.provider;return r.blockNumber!=null&&r.blockNumber>=e||e===-1?r:Wa(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}function ZJ(t,e,r,n){return qm(this,void 0,void 0,function*(){let i=t.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&&je(n.blockTag)&&(i=yield Jd(t,e)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&je(n.blockTag)&&(i=yield Jd(t,e)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&je(n.blockTag)&&(i=yield Jd(t,e)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&je(n.blockTag)&&(i=yield Jd(t,e)),r==="call"&&n.blockTag?i[r](n.transaction,n.blockTag):i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let s=n.filter;return(s.fromBlock&&je(s.fromBlock)||s.toBlock&&je(s.toBlock))&&(i=yield Jd(t,e)),i.getLogs(s)}}return il.throwError("unknown method error",ee.errors.UNKNOWN_ERROR,{method:r,params:n})})}class eX extends Og{constructor(e,r){e.length===0&&il.throwArgumentError("missing providers","providers",e);const n=e.map((o,a)=>{if(Tc.isProvider(o)){const u=U4(o)?2e3:750;return Object.freeze({provider:o,weight:1,stallTimeout:u,priority:1})}const c=Vt(o);c.priority==null&&(c.priority=1),c.stallTimeout==null&&(c.stallTimeout=U4(o)?2e3:750),c.weight==null&&(c.weight=1);const l=c.weight;return(l%1||l>512||l<1)&&il.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${a}].weight`,l),Object.freeze(c)}),i=n.reduce((o,a)=>o+a.weight,0);r==null?r=i/2:r>i&&il.throwArgumentError("quorum will always fail; larger than total weight","quorum",r);let s=Q4(n.map(o=>o.provider.network));s==null&&(s=new Promise((o,a)=>{setTimeout(()=>{this.detectNetwork().then(o,a)},0)})),super(s),ie(this,"providerConfigs",Object.freeze(n)),ie(this,"quorum",r),this._highestBlockNumber=-1}detectNetwork(){return qm(this,void 0,void 0,function*(){const e=yield Promise.all(this.providerConfigs.map(r=>r.provider.getNetwork()));return Q4(e)})}perform(e,r){return qm(this,void 0,void 0,function*(){if(e==="sendTransaction"){const c=yield Promise.all(this.providerConfigs.map(l=>l.provider.sendTransaction(r.signedTransaction).then(u=>u.hash,u=>u)));for(let l=0;lc.priority-l.priority);const s=this._highestBlockNumber;let o=0,a=!0;for(;;){const c=Fp();let l=i.filter(h=>h.runner&&c-h.starth+p.weight,0);for(;l{h.staller=null}),h.runner=ZJ(h,s,e,r).then(v=>{h.done=!0,h.result=v,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:Bp(h,Fp()),request:{method:e,params:mi(r)},provider:this})},v=>{h.done=!0,h.error=v,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:Bp(h,Fp()),request:{method:e,params:mi(r)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:Bp(h,null),request:{method:e,params:mi(r)},provider:this}),l+=h.weight}const u=[];i.forEach(h=>{h.done||!h.runner||(u.push(h.runner),h.staller&&u.push(h.staller.getPromise()))}),u.length&&(yield Promise.race(u));const f=i.filter(h=>h.done&&h.error==null);if(f.length>=this.quorum){const h=n(f);if(h!==void 0)return i.forEach(p=>{p.staller&&p.staller.cancel(),p.cancelled=!0}),h;a||(yield J4(100).getPromise()),a=!1}const d=i.reduce((h,p)=>{if(!p.done||p.error==null)return h;const v=p.error.code;return QJ.indexOf(v)>=0&&(h[v]||(h[v]={error:p.error,weight:0}),h[v].weight+=p.weight),h},{});if(Object.keys(d).forEach(h=>{const p=d[h];if(p.weight{y.staller&&y.staller.cancel(),y.cancelled=!0});const v=p.error,b={};YJ.forEach(y=>{v[y]!=null&&(b[y]=v[y])}),il.throwError(v.reason||v.message,h,b)}),i.filter(h=>!h.done).length===0)break}return i.forEach(c=>{c.staller&&c.staller.cancel(),c.cancelled=!0}),il.throwError("failed to meet quorum",ee.errors.SERVER_ERROR,{method:e,params:r,results:i.map(c=>Bp(c)),provider:this})})}}const X4=new ee(ld);let tX=1;function Z4(t,e){const r="Web3LegacyFetcher";return function(n,i){const s={method:n,params:i,id:tX++,jsonrpc:"2.0"};return new Promise((o,a)=>{this.emit("debug",{action:"request",fetcher:r,request:mi(s),provider:this}),e(s,(c,l)=>{if(c)return this.emit("debug",{action:"response",fetcher:r,error:c,request:s,provider:this}),a(c);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:l,provider:this}),l.error){const u=new Error(l.error.message);return u.code=l.error.code,u.data=l.error.data,a(u)}o(l.result)})})}}function rX(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:mi(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class tM extends Ko{constructor(e,r){e==null&&X4.throwArgumentError("missing provider","provider",e);let n=null,i=null,s=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(n===""&&(n="eip-1193:"),i=rX(e)):e.sendAsync?i=Z4(e,e.sendAsync.bind(e)):e.send?i=Z4(e,e.send.bind(e)):X4.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),ie(this,"jsonRpcFetchFunc",i),ie(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}const nX="solidity/5.7.0",iX=new RegExp("^bytes([0-9]+)$"),sX=new RegExp("^(u?int)([0-9]*)$"),oX=new RegExp("^(.*)\\[([0-9]*)\\]$"),aX="0000000000000000000000000000000000000000000000000000000000000000",Tu=new ee(nX);function rM(t,e,r){switch(t){case"address":return r?Oh(e,32):re(e);case"string":return wt(e);case"bytes":return re(e);case"bool":return e=e?"0x01":"0x00",r?Oh(e,32):re(e)}let n=t.match(sX);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!==0||i===0||i>256)&&Tu.throwArgumentError("invalid number type","type",t),r&&(i=256),e=J.from(e).toTwos(i),Oh(e,i/8)}if(n=t.match(iX),n){const i=parseInt(n[1]);return(String(i)!==n[1]||i===0||i>32)&&Tu.throwArgumentError("invalid bytes type","type",t),re(e).byteLength!==i&&Tu.throwArgumentError(`invalid value for ${t}`,"value",e),r?re((e+aX).substring(0,66)):e}if(n=t.match(oX),n&&Array.isArray(e)){const i=n[1];parseInt(n[2]||String(e.length))!=e.length&&Tu.throwArgumentError(`invalid array length for ${t}`,"value",e);const o=[];return e.forEach(function(a){o.push(rM(i,a,!0))}),qt(o)}return Tu.throwArgumentError("invalid type","type",t)}function He(t,e){t.length!=e.length&&Tu.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach(function(n,i){r.push(rM(n,e[i]))}),te(qt(r))}function tc(t,e){return Be(He(t,e))}function cX(t,e){return Go(He(t,e))}const lX="units/5.7.0",nM=new ee(lX),iM=["wei","kwei","mwei","gwei","szabo","finney","ether"];function uX(t){const e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||t==="."||t==="-.")&&nM.throwArgumentError("invalid value","value",t);let r=e[0],n="";for(r.substring(0,1)==="-"&&(n="-",r=r.substring(1));r.substring(0,1)==="0";)r=r.substring(1);r===""&&(r="0");let i="";for(e.length===2&&(i="."+(e[1]||"0"));i.length>2&&i[i.length-1]==="0";)i=i.substring(0,i.length-1);const s=[];for(;r.length;)if(r.length<=3){s.unshift(r);break}else{const o=r.length-3;s.unshift(r.substring(o)),r=r.substring(0,o)}return n+s.join(",")+i}function xr(t,e){if(typeof e=="string"){const r=iM.indexOf(e);r!==-1&&(e=3*r)}return Tv(t,e??18)}function Df(t,e){if(typeof t!="string"&&nM.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=iM.indexOf(e);r!==-1&&(e=3*r)}return Fs(t,e??18)}function fX(t){return xr(t,18)}function dX(t){return Df(t,18)}const hX=Object.freeze(Object.defineProperty({__proto__:null,AbiCoder:a3,ConstructorFragment:hs,ErrorFragment:Io,EventFragment:Ks,FormatTypes:tt,Fragment:Ys,FunctionFragment:ps,HDNode:Co,Indexed:Lm,Interface:jr,LogDescription:a$,Logger:ee,ParamType:Lr,RLP:AG,SigningKey:jm,get SupportedAlgorithm(){return Nf},TransactionDescription:c$,get TransactionTypes(){return Ox},get UnicodeNormalizationForm(){return Ho},Utf8ErrorFuncs:QR,get Utf8ErrorReason(){return Gn},_TypedDataEncoder:qr,_fetchData:K$,_toEscapedUtf8String:qG,accessListify:eu,arrayify:re,base58:Mf,base64:uK,checkProperties:e3,checkResultErrors:DR,commify:uX,computeAddress:g3,computeHmac:_0,computePublicKey:m3,concat:qt,deepCopy:mi,defaultAbiCoder:Bn,defaultPath:lJ,defineReadOnly:ie,dnsEncode:n$,entropyToMnemonic:q$,fetchJson:I1,formatBytes32String:VG,formatEther:fX,formatUnits:xr,getAccountPath:fJ,getAddress:Ve,getContractAddress:n3,getCreate2Address:OG,getIcapAddress:IG,getJsonWalletAddress:mJ,getStatic:vs,hashMessage:f3,hexConcat:Rn,hexDataLength:lo,hexDataSlice:br,hexStripZeros:_R,hexValue:Es,hexZeroPad:dt,hexlify:te,id:za,isAddress:UR,isBytes:ca,isBytesLike:Wo,isHexString:je,isValidMnemonic:uJ,isValidName:MK,joinSignature:lG,keccak256:Be,mnemonicToEntropy:w3,mnemonicToSeed:H$,namehash:Mh,nameprep:oK,parseBytes32String:GG,parseEther:dX,parseTransaction:L$,parseUnits:Df,poll:Wa,randomBytes:T1,recoverAddress:Fl,recoverPublicKey:R$,resolveProperties:vt,ripemd160:U$,serializeTransaction:jY,sha256:Go,sha512:ZY,shallowCopy:Vt,shuffled:V$,solidityKeccak256:tc,solidityPack:He,soliditySha256:cX,splitSignature:Xl,stripZeros:to,toUtf8Bytes:wt,toUtf8CodePoints:Nm,toUtf8String:ua,verifyMessage:G$,verifyTypedData:yJ,zeroPad:Oh},Symbol.toStringTag,{value:"Module"})),sM="%[a-f0-9]{2}",e_=new RegExp("("+sM+")|([^%]+?)","gi"),t_=new RegExp("("+sM+")+","gi");function Dx(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;const r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],Dx(r),Dx(n))}function pX(t){try{return decodeURIComponent(t)}catch{let e=t.match(e_)||[];for(let r=1;rt==null,bX=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Lx=Symbol("encodeFragmentIdentifier");function wX(t){switch(t.arrayFormat){case"index":return e=>(r,n)=>{const i=r.length;return n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[Sr(e,t),"[",i,"]"].join("")]:[...r,[Sr(e,t),"[",Sr(i,t),"]=",Sr(n,t)].join("")]};case"bracket":return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[Sr(e,t),"[]"].join("")]:[...r,[Sr(e,t),"[]=",Sr(n,t)].join("")];case"colon-list-separator":return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[Sr(e,t),":list="].join("")]:[...r,[Sr(e,t),":list=",Sr(n,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e=t.arrayFormat==="bracket-separator"?"[]=":"=";return r=>(n,i)=>i===void 0||t.skipNull&&i===null||t.skipEmptyString&&i===""?n:(i=i===null?"":i,n.length===0?[[Sr(r,t),e,Sr(i,t)].join("")]:[[n,Sr(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,Sr(e,t)]:[...r,[Sr(e,t),"=",Sr(n,t)].join("")]}}function EX(t){let e;switch(t.arrayFormat){case"index":return(r,n,i)=>{if(e=/\[(\d*)]$/.exec(r),r=r.replace(/\[\d*]$/,""),!e){i[r]=n;return}i[r]===void 0&&(i[r]={}),i[r][e[1]]=n};case"bracket":return(r,n,i)=>{if(e=/(\[])$/.exec(r),r=r.replace(/\[]$/,""),!e){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[...i[r],n]};case"colon-list-separator":return(r,n,i)=>{if(e=/(:list)$/.exec(r),r=r.replace(/:list$/,""),!e){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[...i[r],n]};case"comma":case"separator":return(r,n,i)=>{const s=typeof n=="string"&&n.includes(t.arrayFormatSeparator),o=typeof n=="string"&&!s&&To(n,t).includes(t.arrayFormatSeparator);n=o?To(n,t):n;const a=s||o?n.split(t.arrayFormatSeparator).map(c=>To(c,t)):n===null?n:To(n,t);i[r]=a};case"bracket-separator":return(r,n,i)=>{const s=/(\[])$/.test(r);if(r=r.replace(/\[]$/,""),!s){i[r]=n&&To(n,t);return}const o=n===null?[]:n.split(t.arrayFormatSeparator).map(a=>To(a,t));if(i[r]===void 0){i[r]=o;return}i[r]=[...i[r],...o]};default:return(r,n,i)=>{if(i[r]===void 0){i[r]=n;return}i[r]=[...[i[r]].flat(),n]}}}function aM(t){if(typeof t!="string"||t.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Sr(t,e){return e.encode?e.strict?bX(t):encodeURIComponent(t):t}function To(t,e){return e.decode?mX(t):t}function cM(t){return Array.isArray(t)?t.sort():typeof t=="object"?cM(Object.keys(t)).sort((e,r)=>Number(e)-Number(r)).map(e=>t[e]):t}function lM(t){const e=t.indexOf("#");return e!==-1&&(t=t.slice(0,e)),t}function xX(t){let e="";const r=t.indexOf("#");return r!==-1&&(e=t.slice(r)),e}function r_(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&typeof t=="string"&&t.trim()!==""?t=Number(t):e.parseBooleans&&t!==null&&(t.toLowerCase()==="true"||t.toLowerCase()==="false")&&(t=t.toLowerCase()==="true"),t}function E3(t){t=lM(t);const e=t.indexOf("?");return e===-1?"":t.slice(e+1)}function x3(t,e){e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e},aM(e.arrayFormatSeparator);const r=EX(e),n=Object.create(null);if(typeof t!="string"||(t=t.trim().replace(/^[?#&]/,""),!t))return n;for(const i of t.split("&")){if(i==="")continue;const s=e.decode?i.replace(/\+/g," "):i;let[o,a]=oM(s,"=");o===void 0&&(o=s),a=a===void 0?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:To(a,e),r(To(o,e),a,n)}for(const[i,s]of Object.entries(n))if(typeof s=="object"&&s!==null)for(const[o,a]of Object.entries(s))s[o]=r_(a,e);else n[i]=r_(s,e);return e.sort===!1?n:(e.sort===!0?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce((i,s)=>{const o=n[s];return o&&typeof o=="object"&&!Array.isArray(o)?i[s]=cM(o):i[s]=o,i},Object.create(null))}function uM(t,e){if(!t)return"";e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e},aM(e.arrayFormatSeparator);const r=o=>e.skipNull&&gX(t[o])||e.skipEmptyString&&t[o]==="",n=wX(e),i={};for(const[o,a]of Object.entries(t))r(o)||(i[o]=a);const s=Object.keys(i);return e.sort!==!1&&s.sort(e.sort),s.map(o=>{const a=t[o];return a===void 0?"":a===null?Sr(o,e):Array.isArray(a)?a.length===0&&e.arrayFormat==="bracket-separator"?Sr(o,e)+"[]":a.reduce(n(o),[]).join("&"):Sr(o,e)+"="+Sr(a,e)}).filter(o=>o.length>0).join("&")}function fM(t,e){var i;e={decode:!0,...e};let[r,n]=oM(t,"#");return r===void 0&&(r=t),{url:((i=r==null?void 0:r.split("?"))==null?void 0:i[0])??"",query:x3(E3(t),e),...e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:To(n,e)}:{}}}function dM(t,e){e={encode:!0,strict:!0,[Lx]:!0,...e};const r=lM(t.url).split("?")[0]||"",n=E3(t.url),i={...x3(n,{sort:!1}),...t.query};let s=uM(i,e);s&&(s=`?${s}`);let o=xX(t.url);if(t.fragmentIdentifier){const a=new URL(r);a.hash=t.fragmentIdentifier,o=e[Lx]?a.hash:`#${t.fragmentIdentifier}`}return`${r}${s}${o}`}function hM(t,e,r){r={parseFragmentIdentifier:!0,[Lx]:!1,...r};const{url:n,query:i,fragmentIdentifier:s}=fM(t,r);return dM({url:n,query:yX(i,e),fragmentIdentifier:s},r)}function CX(t,e,r){const n=Array.isArray(e)?i=>!e.includes(i):(i,s)=>!e(i,s);return hM(t,n,r)}const pM=Object.freeze(Object.defineProperty({__proto__:null,exclude:CX,extract:E3,parse:x3,parseUrl:fM,pick:hM,stringify:uM,stringifyUrl:dM},Symbol.toStringTag,{value:"Module"})),C3=C.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Rg=C.createContext({});function SX(){return C.useContext(Rg).visualElement}const O1=C.createContext(null),$g=typeof document<"u",Vm=$g?C.useLayoutEffect:C.useEffect,vM=C.createContext({strict:!1});function kX(t,e,r,n){const i=SX(),s=C.useContext(vM),o=C.useContext(O1),a=C.useContext(C3).reducedMotion,c=C.useRef();n=n||s.renderer,!c.current&&n&&(c.current=n(t,{visualState:e,parent:i,props:r,presenceId:o?o.id:void 0,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const l=c.current;return Vm(()=>{l&&l.render()}),(window.HandoffAppearAnimations?Vm:C.useEffect)(()=>{l&&l.animationState&&l.animationState.animateChanges()}),l}function Qu(t){return typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function AX(t,e,r){return C.useCallback(n=>{n&&t.mount&&t.mount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):Qu(r)&&(r.current=n))},[e])}function I0(t){return typeof t=="string"||Array.isArray(t)}function Mg(t){return typeof t=="object"&&typeof t.start=="function"}const _X=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function Ng(t){return Mg(t.animate)||_X.some(e=>I0(t[e]))}function mM(t){return!!(Ng(t)||t.variants)}function PX(t,e){if(Ng(t)){const{initial:r,animate:n}=t;return{initial:r===!1||I0(r)?r:void 0,animate:I0(n)?n:void 0}}return t.inherit!==!1?e:{}}function TX(t){const{initial:e,animate:r}=PX(t,C.useContext(Rg));return C.useMemo(()=>({initial:e,animate:r}),[n_(e),n_(r)])}function n_(t){return Array.isArray(t)?t.join(" "):t}const wo=t=>({isEnabled:e=>t.some(r=>!!e[r])}),O0={measureLayout:wo(["layout","layoutId","drag"]),animation:wo(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:wo(["exit"]),drag:wo(["drag","dragControls"]),focus:wo(["whileFocus"]),hover:wo(["whileHover","onHoverStart","onHoverEnd"]),tap:wo(["whileTap","onTap","onTapStart","onTapCancel"]),pan:wo(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:wo(["whileInView","onViewportEnter","onViewportLeave"])};function IX(t){for(const e in t)e==="projectionNodeConstructor"?O0.projectionNodeConstructor=t[e]:O0[e].Component=t[e]}function Dg(t){const e=C.useRef(null);return e.current===null&&(e.current=t()),e.current}const Lh={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let OX=1;function RX(){return Dg(()=>{if(Lh.hasEverUpdated)return OX++})}const S3=C.createContext({});class $X extends x.Component{getSnapshotBeforeUpdate(){const{visualElement:e,props:r}=this.props;return e&&e.setProps(r),null}componentDidUpdate(){}render(){return this.props.children}}const yM=C.createContext({}),MX=Symbol.for("motionComponentSymbol");function NX({preloadedFeatures:t,createVisualElement:e,projectionNodeConstructor:r,useRender:n,useVisualState:i,Component:s}){t&&IX(t);function o(c,l){const u={...C.useContext(C3),...c,layoutId:DX(c)},{isStatic:f}=u;let d=null;const h=TX(c),p=f?void 0:RX(),v=i(c,f);if(!f&&$g){h.visualElement=kX(s,v,u,e);const b=C.useContext(vM).strict,y=C.useContext(yM);h.visualElement&&(d=h.visualElement.loadFeatures(u,b,t,p,r||O0.projectionNodeConstructor,y))}return C.createElement($X,{visualElement:h.visualElement,props:u},d,C.createElement(Rg.Provider,{value:h},n(s,c,p,AX(v,h.visualElement,l),v,f,h.visualElement)))}const a=C.forwardRef(o);return a[MX]=s,a}function DX({layoutId:t}){const e=C.useContext(S3).id;return e&&t!==void 0?e+"-"+t:t}function LX(t){function e(n,i={}){return NX(t(n,i))}if(typeof Proxy>"u")return e;const r=new Map;return new Proxy(e,{get:(n,i)=>(r.has(i)||r.set(i,e(i)),r.get(i))})}const FX=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function k3(t){return typeof t!="string"||t.includes("-")?!1:!!(FX.indexOf(t)>-1||/[A-Z]/.test(t))}const Gm={};function BX(t){Object.assign(Gm,t)}const Km=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ud=new Set(Km);function gM(t,{layout:e,layoutId:r}){return ud.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!Gm[t]||t==="opacity")}const ii=t=>!!(t!=null&&t.getVelocity),jX={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},UX=(t,e)=>Km.indexOf(t)-Km.indexOf(e);function zX({transform:t,transformKeys:e},{enableHardwareAcceleration:r=!0,allowTransformNone:n=!0},i,s){let o="";e.sort(UX);for(const a of e)o+=`${jX[a]||a}(${t[a]}) `;return r&&!t.z&&(o+="translateZ(0)"),o=o.trim(),s?o=s(t,i?"":o):n&&i&&(o="none"),o}function bM(t){return t.startsWith("--")}const WX=(t,e)=>e&&typeof t=="number"?e.transform(t):t,Lf=(t,e,r)=>Math.min(Math.max(r,t),e),tu={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Fh={...tu,transform:t=>Lf(0,1,t)},jp={...tu,default:1},Bh=t=>Math.round(t*1e5)/1e5,R0=/(-)?([\d]*\.?[\d])+/g,Fx=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,HX=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function R1(t){return typeof t=="string"}const $1=t=>({test:e=>R1(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ka=$1("deg"),so=$1("%"),we=$1("px"),qX=$1("vh"),VX=$1("vw"),i_={...so,parse:t=>so.parse(t)/100,transform:t=>so.transform(t*100)},s_={...tu,transform:Math.round},wM={borderWidth:we,borderTopWidth:we,borderRightWidth:we,borderBottomWidth:we,borderLeftWidth:we,borderRadius:we,radius:we,borderTopLeftRadius:we,borderTopRightRadius:we,borderBottomRightRadius:we,borderBottomLeftRadius:we,width:we,maxWidth:we,height:we,maxHeight:we,size:we,top:we,right:we,bottom:we,left:we,padding:we,paddingTop:we,paddingRight:we,paddingBottom:we,paddingLeft:we,margin:we,marginTop:we,marginRight:we,marginBottom:we,marginLeft:we,rotate:ka,rotateX:ka,rotateY:ka,rotateZ:ka,scale:jp,scaleX:jp,scaleY:jp,scaleZ:jp,skew:ka,skewX:ka,skewY:ka,distance:we,translateX:we,translateY:we,translateZ:we,x:we,y:we,z:we,perspective:we,transformPerspective:we,opacity:Fh,originX:i_,originY:i_,originZ:we,zIndex:s_,fillOpacity:Fh,strokeOpacity:Fh,numOctaves:s_};function A3(t,e,r,n){const{style:i,vars:s,transform:o,transformKeys:a,transformOrigin:c}=t;a.length=0;let l=!1,u=!1,f=!0;for(const d in e){const h=e[d];if(bM(d)){s[d]=h;continue}const p=wM[d],v=WX(h,p);if(ud.has(d)){if(l=!0,o[d]=v,a.push(d),!f)continue;h!==(p.default||0)&&(f=!1)}else d.startsWith("origin")?(u=!0,c[d]=v):i[d]=v}if(e.transform||(l||n?i.transform=zX(t,r,f,n):i.transform&&(i.transform="none")),u){const{originX:d="50%",originY:h="50%",originZ:p=0}=c;i.transformOrigin=`${d} ${h} ${p}`}}const _3=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function EM(t,e,r){for(const n in e)!ii(e[n])&&!gM(n,r)&&(t[n]=e[n])}function GX({transformTemplate:t},e,r){return C.useMemo(()=>{const n=_3();return A3(n,e,{enableHardwareAcceleration:!r},t),Object.assign({},n.vars,n.style)},[e])}function KX(t,e,r){const n=t.style||{},i={};return EM(i,n,t),Object.assign(i,GX(t,e,r)),t.transformValues?t.transformValues(i):i}function QX(t,e,r){const n={},i=KX(t,e,r);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),n.style=i,n}const YX=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","viewport"]);function Qm(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||YX.has(t)}let xM=t=>!Qm(t);function JX(t){t&&(xM=e=>e.startsWith("on")?!Qm(e):t(e))}try{JX(require("@emotion/is-prop-valid").default)}catch{}function XX(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(xM(i)||r===!0&&Qm(i)||!e&&!Qm(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function o_(t,e,r){return typeof t=="string"?t:we.transform(e+r*t)}function ZX(t,e,r){const n=o_(e,t.x,t.width),i=o_(r,t.y,t.height);return`${n} ${i}`}const eZ={offset:"stroke-dashoffset",array:"stroke-dasharray"},tZ={offset:"strokeDashoffset",array:"strokeDasharray"};function rZ(t,e,r=1,n=0,i=!0){t.pathLength=1;const s=i?eZ:tZ;t[s.offset]=we.transform(-n);const o=we.transform(e),a=we.transform(r);t[s.array]=`${o} ${a}`}function P3(t,{attrX:e,attrY:r,originX:n,originY:i,pathLength:s,pathSpacing:o=1,pathOffset:a=0,...c},l,u,f){if(A3(t,c,l,f),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:h,dimensions:p}=t;d.transform&&(p&&(h.transform=d.transform),delete d.transform),p&&(n!==void 0||i!==void 0||h.transform)&&(h.transformOrigin=ZX(p,n!==void 0?n:.5,i!==void 0?i:.5)),e!==void 0&&(d.x=e),r!==void 0&&(d.y=r),s!==void 0&&rZ(d,s,o,a,!1)}const CM=()=>({..._3(),attrs:{}}),T3=t=>typeof t=="string"&&t.toLowerCase()==="svg";function nZ(t,e,r,n){const i=C.useMemo(()=>{const s=CM();return P3(s,e,{enableHardwareAcceleration:!1},T3(n),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};EM(s,t.style,t),i.style={...s,...i.style}}return i}function iZ(t=!1){return(r,n,i,s,{latestValues:o},a)=>{const l=(k3(r)?nZ:QX)(n,o,a,r),f={...XX(n,typeof r=="string",t),...l,ref:s},{children:d}=n,h=C.useMemo(()=>ii(d)?d.get():d,[d]);return i&&(f["data-projection-id"]=i),C.createElement(r,{...f,children:h})}}const I3=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function SM(t,{style:e,vars:r},n,i){Object.assign(t.style,e,i&&i.getProjectionStyles(n));for(const s in r)t.style.setProperty(s,r[s])}const kM=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function AM(t,e,r,n){SM(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(kM.has(i)?i:I3(i),e.attrs[i])}function O3(t,e){const{style:r}=t,n={};for(const i in r)(ii(r[i])||e.style&&ii(e.style[i])||gM(i,t))&&(n[i]=r[i]);return n}function _M(t,e){const r=O3(t,e);for(const n in t)if(ii(t[n])||ii(e[n])){const i=n==="x"||n==="y"?"attr"+n.toUpperCase():n;r[i]=t[n]}return r}function R3(t,e,r,n={},i={}){return typeof e=="function"&&(e=e(r!==void 0?r:t.custom,n,i)),typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"&&(e=e(r!==void 0?r:t.custom,n,i)),e}const Ym=t=>Array.isArray(t),sZ=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),oZ=t=>Ym(t)?t[t.length-1]||0:t;function Dv(t){const e=ii(t)?t.get():t;return sZ(e)?e.toValue():e}function aZ({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:r},n,i,s){const o={latestValues:cZ(n,i,s,t),renderState:e()};return r&&(o.mount=a=>r(n,a,o)),o}const PM=t=>(e,r)=>{const n=C.useContext(Rg),i=C.useContext(O1),s=()=>aZ(t,e,n,i);return r?s():Dg(s)};function cZ(t,e,r,n){const i={},s=n(t,{});for(const d in s)i[d]=Dv(s[d]);let{initial:o,animate:a}=t;const c=Ng(t),l=mM(t);e&&l&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=r?r.initial===!1:!1;u=u||o===!1;const f=u?a:o;return f&&typeof f!="boolean"&&!Mg(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=R3(t,h);if(!p)return;const{transitionEnd:v,transition:b,...y}=p;for(const m in y){let g=y[m];if(Array.isArray(g)){const S=u?g.length-1:0;g=g[S]}g!==null&&(i[m]=g)}for(const m in v)i[m]=v[m]}),i}const lZ={useVisualState:PM({scrapeMotionValuesFromProps:_M,createRenderState:CM,onMount:(t,e,{renderState:r,latestValues:n})=>{try{r.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}P3(r,n,{enableHardwareAcceleration:!1},T3(e.tagName),t.transformTemplate),AM(e,r)}})},uZ={useVisualState:PM({scrapeMotionValuesFromProps:O3,createRenderState:_3})};function fZ(t,{forwardMotionProps:e=!1},r,n,i){return{...k3(t)?lZ:uZ,preloadedFeatures:r,useRender:iZ(e),createVisualElement:n,projectionNodeConstructor:i,Component:t}}var mt;(function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"})(mt||(mt={}));function Lg(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}function Bx(t,e,r,n){C.useEffect(()=>{const i=t.current;if(r&&i)return Lg(i,e,r,n)},[t,e,r,n])}function dZ({whileFocus:t,visualElement:e}){const{animationState:r}=e,n=C.useCallback(()=>{r&&r.setActive(mt.Focus,!0)},[r]),i=C.useCallback(()=>{r&&r.setActive(mt.Focus,!1)},[r]);Bx(e,"focus",t?n:void 0),Bx(e,"blur",t?i:void 0)}const TM=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function $3(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const IM=t=>e=>TM(e)&&t(e,$3(e));function hf(t,e,r,n){return Lg(t,e,IM(r),n)}function Jm(t,e,r,n){return Bx(t,e,r&&IM(r),n)}function OM(t){let e=null;return()=>{const r=()=>{e=null};return e===null?(e=t,r):!1}}const a_=OM("dragHorizontal"),c_=OM("dragVertical");function RM(t){let e=!1;if(t==="y")e=c_();else if(t==="x")e=a_();else{const r=a_(),n=c_();r&&n?e=()=>{r(),n()}:(r&&r(),n&&n())}return e}function $M(){const t=RM(!0);return t?(t(),!1):!0}function l_(t,e,r,n){return(i,s)=>{i.type==="touch"||$M()||(r&&t.animationState&&t.animationState.setActive(mt.Hover,e),n&&n(i,s))}}function hZ({onHoverStart:t,onHoverEnd:e,whileHover:r,visualElement:n}){Jm(n,"pointerenter",C.useMemo(()=>t||r?l_(n,!0,!!r,t):void 0,[t,!!r,n]),{passive:!t}),Jm(n,"pointerleave",C.useMemo(()=>e||r?l_(n,!1,!!r,e):void 0,[t,!!r,n]),{passive:!e})}const MM=(t,e)=>e?t===e?!0:MM(t,e.parentElement):!1;function M3(t){return C.useEffect(()=>()=>t(),[])}const pZ=(t,e)=>r=>e(t(r)),Fg=(...t)=>t.reduce(pZ);function vZ({onTap:t,onTapStart:e,onTapCancel:r,whileTap:n,visualElement:i,...s}){const o=t||e||r||n,a=C.useRef(!1),c=C.useRef(null),l={passive:!(e||t||r||s.onPointerDown)};function u(){c.current&&c.current(),c.current=null}function f(){return u(),a.current=!1,i.getProps().whileTap&&i.animationState&&i.animationState.setActive(mt.Tap,!1),!$M()}function d(v,b){var y,m,g,S;f()&&(MM(i.current,v.target)?(S=(g=i.getProps()).onTap)===null||S===void 0||S.call(g,v,b):(m=(y=i.getProps()).onTapCancel)===null||m===void 0||m.call(y,v,b))}function h(v,b){var y,m;f()&&((m=(y=i.getProps()).onTapCancel)===null||m===void 0||m.call(y,v,b))}const p=C.useCallback((v,b)=>{var y;if(u(),a.current)return;a.current=!0,c.current=Fg(hf(window,"pointerup",d,l),hf(window,"pointercancel",h,l));const m=i.getProps();m.whileTap&&i.animationState&&i.animationState.setActive(mt.Tap,!0),(y=m.onTapStart)===null||y===void 0||y.call(m,v,b)},[!!e,i]);Jm(i,"pointerdown",o?p:void 0,l),M3(u)}const jx=new WeakMap,m2=new WeakMap,mZ=t=>{const e=jx.get(t.target);e&&e(t)},yZ=t=>{t.forEach(mZ)};function gZ({root:t,...e}){const r=t||document;m2.has(r)||m2.set(r,{});const n=m2.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(yZ,{root:t,...e})),n[i]}function bZ(t,e,r){const n=gZ(e);return jx.set(t,r),n.observe(t),()=>{jx.delete(t),n.unobserve(t)}}function wZ({visualElement:t,whileInView:e,onViewportEnter:r,onViewportLeave:n,viewport:i={}}){const s=C.useRef({hasEnteredView:!1,isInView:!1});let o=!!(e||r||n);i.once&&s.current.hasEnteredView&&(o=!1),(typeof IntersectionObserver>"u"?CZ:xZ)(o,s.current,t,i)}const EZ={some:0,all:1};function xZ(t,e,r,{root:n,margin:i,amount:s="some",once:o}){C.useEffect(()=>{if(!t||!r.current)return;const a={root:n==null?void 0:n.current,rootMargin:i,threshold:typeof s=="number"?s:EZ[s]},c=l=>{const{isIntersecting:u}=l;if(e.isInView===u||(e.isInView=u,o&&!u&&e.hasEnteredView))return;u&&(e.hasEnteredView=!0),r.animationState&&r.animationState.setActive(mt.InView,u);const f=r.getProps(),d=u?f.onViewportEnter:f.onViewportLeave;d&&d(l)};return bZ(r.current,a,c)},[t,n,i,s])}function CZ(t,e,r,{fallback:n=!0}){C.useEffect(()=>{!t||!n||requestAnimationFrame(()=>{e.hasEnteredView=!0;const{onViewportEnter:i}=r.getProps();i&&i(null),r.animationState&&r.animationState.setActive(mt.InView,!0)})},[t])}const Ha=t=>e=>(t(e),null),SZ={inView:Ha(wZ),tap:Ha(vZ),focus:Ha(dZ),hover:Ha(hZ)};function NM(){const t=C.useContext(O1);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:r,register:n}=t,i=C.useId();return C.useEffect(()=>n(i),[]),!e&&r?[!1,()=>r&&r(i)]:[!0]}function DM(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;n/^\-?\d*\.?\d+$/.test(t),AZ=t=>/^0[^.\s]+$/.test(t),Do={delta:0,timestamp:0},LM=1/60*1e3,_Z=typeof performance<"u"?()=>performance.now():()=>Date.now(),FM=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(_Z()),LM);function PZ(t){let e=[],r=[],n=0,i=!1,s=!1;const o=new WeakSet,a={schedule:(c,l=!1,u=!1)=>{const f=u&&i,d=f?e:r;return l&&o.add(c),d.indexOf(c)===-1&&(d.push(c),f&&i&&(n=e.length)),c},cancel:c=>{const l=r.indexOf(c);l!==-1&&r.splice(l,1),o.delete(c)},process:c=>{if(i){s=!0;return}if(i=!0,[e,r]=[r,e],r.length=0,n=e.length,n)for(let l=0;l(t[e]=PZ(()=>$0=!0),t),{}),xn=M1.reduce((t,e)=>{const r=Bg[e];return t[e]=(n,i=!1,s=!1)=>($0||OZ(),r.schedule(n,i,s)),t},{}),uc=M1.reduce((t,e)=>(t[e]=Bg[e].cancel,t),{}),y2=M1.reduce((t,e)=>(t[e]=()=>Bg[e].process(Do),t),{}),IZ=t=>Bg[t].process(Do),BM=t=>{$0=!1,Do.delta=Ux?LM:Math.max(Math.min(t-Do.timestamp,TZ),1),Do.timestamp=t,zx=!0,M1.forEach(IZ),zx=!1,$0&&(Ux=!1,FM(BM))},OZ=()=>{$0=!0,Ux=!0,zx||FM(BM)};function N3(t,e){t.indexOf(e)===-1&&t.push(e)}function D3(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}class L3{constructor(){this.subscriptions=[]}add(e){return N3(this.subscriptions,e),()=>D3(this.subscriptions,e)}notify(e,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,n);else for(let s=0;s!isNaN(parseFloat(t));class $Z{constructor(e,r={}){this.version="8.5.5",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(n,i=!0)=>{this.prev=this.current,this.current=n;const{delta:s,timestamp:o}=Do;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,xn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>xn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=RZ(this.current),this.owner=r.owner}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new L3);const n=this.events[e].add(r);return e==="change"?()=>{n(),xn.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e,r=!0){!r||!this.passiveEffect?this.updateAndNotify(e,r):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,r,n){this.set(r),this.prev=e,this.timeDelta=n}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?F3(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r)||null,this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ff(t,e){return new $Z(t,e)}const B3=(t,e)=>r=>!!(R1(r)&&HX.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),jM=(t,e,r)=>n=>{if(!R1(n))return n;const[i,s,o,a]=n.match(R0);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},MZ=t=>Lf(0,255,t),g2={...tu,transform:t=>Math.round(MZ(t))},pl={test:B3("rgb","red"),parse:jM("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+g2.transform(t)+", "+g2.transform(e)+", "+g2.transform(r)+", "+Bh(Fh.transform(n))+")"};function NZ(t){let e="",r="",n="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const Wx={test:B3("#"),parse:NZ,transform:pl.transform},Yu={test:B3("hsl","hue"),parse:jM("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+so.transform(Bh(e))+", "+so.transform(Bh(r))+", "+Bh(Fh.transform(n))+")"},In={test:t=>pl.test(t)||Wx.test(t)||Yu.test(t),parse:t=>pl.test(t)?pl.parse(t):Yu.test(t)?Yu.parse(t):Wx.parse(t),transform:t=>R1(t)?t:t.hasOwnProperty("red")?pl.transform(t):Yu.transform(t)},UM="${c}",zM="${n}";function DZ(t){var e,r;return isNaN(t)&&R1(t)&&(((e=t.match(R0))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(Fx))===null||r===void 0?void 0:r.length)||0)>0}function Xm(t){typeof t=="number"&&(t=`${t}`);const e=[];let r=0,n=0;const i=t.match(Fx);i&&(r=i.length,t=t.replace(Fx,UM),e.push(...i.map(In.parse)));const s=t.match(R0);return s&&(n=s.length,t=t.replace(R0,zM),e.push(...s.map(tu.parse))),{values:e,numColors:r,numNumbers:n,tokenised:t}}function WM(t){return Xm(t).values}function HM(t){const{values:e,numColors:r,tokenised:n}=Xm(t),i=e.length;return s=>{let o=n;for(let a=0;atypeof t=="number"?0:t;function FZ(t){const e=WM(t);return HM(t)(e.map(LZ))}const fc={test:DZ,parse:WM,createTransformer:HM,getAnimatableNone:FZ},BZ=new Set(["brightness","contrast","saturate","opacity"]);function jZ(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(R0)||[];if(!n)return t;const i=r.replace(n,"");let s=BZ.has(e)?1:0;return n!==r&&(s*=100),e+"("+s+i+")"}const UZ=/([a-z-]*)\(.*?\)/g,Hx={...fc,getAnimatableNone:t=>{const e=t.match(UZ);return e?e.map(jZ).join(" "):t}},zZ={...wM,color:In,backgroundColor:In,outlineColor:In,fill:In,stroke:In,borderColor:In,borderTopColor:In,borderRightColor:In,borderBottomColor:In,borderLeftColor:In,filter:Hx,WebkitFilter:Hx},j3=t=>zZ[t];function U3(t,e){var r;let n=j3(t);return n!==Hx&&(n=fc),(r=n.getAnimatableNone)===null||r===void 0?void 0:r.call(n,e)}const qM=t=>e=>e.test(t),WZ={test:t=>t==="auto",parse:t=>t},VM=[tu,we,so,ka,VX,qX,WZ],Xd=t=>VM.find(qM(t)),HZ=[...VM,In,fc],qZ=t=>HZ.find(qM(t));function VZ(t){const e={};return t.values.forEach((r,n)=>e[n]=r.get()),e}function GZ(t){const e={};return t.values.forEach((r,n)=>e[n]=r.getVelocity()),e}function jg(t,e,r){const n=t.getProps();return R3(n,e,r!==void 0?r:n.custom,VZ(t),GZ(t))}function KZ(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,Ff(r))}function QZ(t,e){const r=jg(t,e);let{transitionEnd:n={},transition:i={},...s}=r?t.makeTargetAnimatable(r,!1):{};s={...s,...n};for(const o in s){const a=oZ(s[o]);KZ(t,o,a)}}function YZ(t,e,r){var n,i;const s=Object.keys(e).filter(a=>!t.hasValue(a)),o=s.length;if(o)for(let a=0;at*1e3,ree={current:!1},z3=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,W3=t=>e=>1-t(1-e),H3=t=>t*t,nee=W3(H3),q3=z3(H3),vr=(t,e,r)=>-r*t+r*e+t;function b2(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function iee({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{const a=r<.5?r*(1+e):r+e-r*e,c=2*r-a;i=b2(c,a,t+1/3),s=b2(c,a,t),o=b2(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}const w2=(t,e,r)=>{const n=t*t;return Math.sqrt(Math.max(0,r*(e*e-n)+n))},see=[Wx,pl,Yu],oee=t=>see.find(e=>e.test(t));function u_(t){const e=oee(t);let r=e.parse(t);return e===Yu&&(r=iee(r)),r}const GM=(t,e)=>{const r=u_(t),n=u_(e),i={...r};return s=>(i.red=w2(r.red,n.red,s),i.green=w2(r.green,n.green,s),i.blue=w2(r.blue,n.blue,s),i.alpha=vr(r.alpha,n.alpha,s),pl.transform(i))};function KM(t,e){return typeof t=="number"?r=>vr(t,e,r):In.test(t)?GM(t,e):YM(t,e)}const QM=(t,e)=>{const r=[...t],n=r.length,i=t.map((s,o)=>KM(s,e[o]));return s=>{for(let o=0;o{const r={...t,...e},n={};for(const i in r)t[i]!==void 0&&e[i]!==void 0&&(n[i]=KM(t[i],e[i]));return i=>{for(const s in n)r[s]=n[s](i);return r}},YM=(t,e)=>{const r=fc.createTransformer(e),n=Xm(t),i=Xm(e);return n.numColors===i.numColors&&n.numNumbers>=i.numNumbers?Fg(QM(n.values,i.values),r):o=>`${o>0?e:t}`},ty=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},f_=(t,e)=>r=>vr(t,e,r);function cee(t){return typeof t=="number"?f_:typeof t=="string"?In.test(t)?GM:YM:Array.isArray(t)?QM:typeof t=="object"?aee:f_}function lee(t,e,r){const n=[],i=r||cee(t[0]),s=t.length-1;for(let o=0;ot[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=lee(e,n,i),a=o.length,c=l=>{let u=0;if(a>1)for(;uc(Lf(t[0],t[s-1],l)):c}const V3=t=>t,XM=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,uee=1e-7,fee=12;function dee(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=XM(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>uee&&++adee(s,0,1,t,r);return s=>s===0||s===1?s:XM(i(s),e,n)}const eN=t=>1-Math.sin(Math.acos(t)),G3=W3(eN),hee=z3(G3),tN=ZM(.33,1.53,.69,.99),K3=W3(tN),pee=z3(K3),vee=t=>(t*=2)<1?.5*K3(t):.5*(2-Math.pow(2,-10*(t-1))),mee={linear:V3,easeIn:H3,easeInOut:q3,easeOut:nee,circIn:eN,circInOut:hee,circOut:G3,backIn:K3,backInOut:pee,backOut:tN,anticipate:vee},d_=t=>{if(Array.isArray(t)){ey(t.length===4);const[e,r,n,i]=t;return ZM(e,r,n,i)}else if(typeof t=="string")return mee[t];return t},yee=t=>Array.isArray(t)&&typeof t[0]!="number";function gee(t,e){return t.map(()=>e||q3).splice(0,t.length-1)}function bee(t){const e=t.length;return t.map((r,n)=>n!==0?n/(e-1):0)}function wee(t,e){return t.map(r=>r*e)}function qx({keyframes:t,ease:e=q3,times:r,duration:n=300}){t=[...t];const i=yee(e)?e.map(d_):d_(e),s={done:!1,value:t[0]},o=wee(r&&r.length===t.length?r:bee(t),n);function a(){return JM(o,t,{ease:Array.isArray(i)?i:gee(t,i)})}let c=a();return{next:l=>(s.value=c(l),s.done=l>=n,s),flipTarget:()=>{t.reverse(),c=a()}}}const E2=.001,Eee=.01,h_=10,xee=.05,Cee=1;function See({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s;tee(t<=h_*1e3);let o=1-e;o=Lf(xee,Cee,o),t=Lf(Eee,h_,t/1e3),o<1?(i=l=>{const u=l*o,f=u*t,d=u-r,h=Vx(l,o),p=Math.exp(-f);return E2-d/h*p},s=l=>{const f=l*o*t,d=f*r+r,h=Math.pow(o,2)*Math.pow(l,2)*t,p=Math.exp(-f),v=Vx(Math.pow(l,2),o);return(-i(l)+E2>0?-1:1)*((d-h)*p)/v}):(i=l=>{const u=Math.exp(-l*t),f=(l-r)*t+1;return-E2+u*f},s=l=>{const u=Math.exp(-l*t),f=(r-l)*(t*t);return u*f});const a=5/t,c=Aee(i,s,a);if(t=t*1e3,isNaN(c))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(c,2)*n;return{stiffness:l,damping:o*2*Math.sqrt(n*l),duration:t}}}const kee=12;function Aee(t,e,r){let n=r;for(let i=1;it[r]!==void 0)}function Tee(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!p_(t,Pee)&&p_(t,_ee)){const r=See(t);e={...e,...r,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}const Iee=5;function rN({keyframes:t,restDelta:e,restSpeed:r,...n}){let i=t[0],s=t[t.length-1];const o={done:!1,value:i},{stiffness:a,damping:c,mass:l,velocity:u,duration:f,isResolvedFromDuration:d}=Tee(n);let h=Oee,p=u?-(u/1e3):0;const v=c/(2*Math.sqrt(a*l));function b(){const y=s-i,m=Math.sqrt(a/l)/1e3,g=Math.abs(y)<5;if(r||(r=g?.01:2),e||(e=g?.005:.5),v<1){const S=Vx(m,v);h=P=>{const T=Math.exp(-v*m*P);return s-T*((p+v*m*y)/S*Math.sin(S*P)+y*Math.cos(S*P))}}else if(v===1)h=S=>s-Math.exp(-m*S)*(y+(p+m*y)*S);else{const S=m*Math.sqrt(v*v-1);h=P=>{const T=Math.exp(-v*m*P),w=Math.min(S*P,300);return s-T*((p+v*m*y)*Math.sinh(w)+S*y*Math.cosh(w))/S}}}return b(),{next:y=>{const m=h(y);if(d)o.done=y>=f;else{let g=p;if(y!==0)if(v<1){const T=Math.max(0,y-Iee);g=F3(m-h(T),y-T)}else g=0;const S=Math.abs(g)<=r,P=Math.abs(s-m)<=e;o.done=S&&P}return o.value=o.done?s:m,o},flipTarget:()=>{p=-p,[i,s]=[s,i],b()}}}rN.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";const Oee=t=>0;function Ree({keyframes:t=[0],velocity:e=0,power:r=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){const o=t[0],a={done:!1,value:o};let c=r*e;const l=o+c,u=s===void 0?l:s(l);return u!==l&&(c=u-o),{next:f=>{const d=-c*Math.exp(-f/n);return a.done=!(d>i||d<-i),a.value=a.done?u:u+d,a},flipTarget:()=>{}}}const $ee={decay:Ree,keyframes:qx,tween:qx,spring:rN};function nN(t,e,r=0){return t-e-r}function Mee(t,e=0,r=0,n=!0){return n?nN(e+-t,e,r):e-(t-e)+r}function Nee(t,e,r,n){return n?t>=e+r:t<=-r}const Dee=t=>{const e=({delta:r})=>t(r);return{start:()=>xn.update(e,!0),stop:()=>uc.update(e)}};function ry({duration:t,driver:e=Dee,elapsed:r=0,repeat:n=0,repeatType:i="loop",repeatDelay:s=0,keyframes:o,autoplay:a=!0,onPlay:c,onStop:l,onComplete:u,onRepeat:f,onUpdate:d,type:h="keyframes",...p}){var v,b;const y=r;let m,g=0,S=t,P=!1,T=!0,w;const I=$ee[o.length>2?"keyframes":h]||qx,F=o[0],j=o[o.length-1];let H={done:!1,value:F};!((b=(v=I).needsInterpolation)===null||b===void 0)&&b.call(v,F,j)&&(w=JM([0,100],[F,j],{clamp:!1}),o=[0,100]);const K=I({...p,duration:t,keyframes:o});function B(){g++,i==="reverse"?(T=g%2===0,r=Mee(r,S,s,T)):(r=nN(r,S,s),i==="mirror"&&K.flipTarget()),P=!1,f&&f()}function E(){m&&m.stop(),u&&u()}function _(N){T||(N=-N),r+=N,P||(H=K.next(Math.max(0,r)),w&&(H.value=w(H.value)),P=T?H.done:r<=0),d&&d(H.value),P&&(g===0&&(S=S!==void 0?S:r),g{l&&l(),m&&m.stop()},set currentTime(N){r=y,_(N)},sample:N=>{r=y;const k=t&&typeof t=="number"?Math.max(t*.5,50):50;let $=0;for(_(0);$<=N;){const L=N-$;_(Math.min(L,k)),$+=k}return H}}}function Lee(t){return!t||Array.isArray(t)||typeof t=="string"&&iN[t]}const vh=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`,iN={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:vh([0,.65,.55,1]),circOut:vh([.55,0,1,.45]),backIn:vh([.31,.01,.66,-.59]),backOut:vh([.33,1.53,.69,.99])};function Fee(t){if(t)return Array.isArray(t)?vh(t):iN[t]}function Bee(t,e,r,{delay:n=0,duration:i,repeat:s=0,repeatType:o="loop",ease:a,times:c}={}){return t.animate({[e]:r,offset:c},{delay:n,duration:i,easing:Fee(a),fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const v_={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},x2={},sN={};for(const t in v_)sN[t]=()=>(x2[t]===void 0&&(x2[t]=v_[t]()),x2[t]);function jee(t,{repeat:e,repeatType:r="loop"}){const n=e&&r!=="loop"&&e%2===1?0:t.length-1;return t[n]}const Uee=new Set(["opacity"]),Up=10;function zee(t,e,{onUpdate:r,onComplete:n,...i}){if(!(sN.waapi()&&Uee.has(e)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0))return!1;let{keyframes:o,duration:a=300,elapsed:c=0,ease:l}=i;if(i.type==="spring"||!Lee(i.ease)){if(i.repeat===1/0)return;const f=ry({...i,elapsed:0});let d={done:!1,value:o[0]};const h=[];let p=0;for(;!d.done&&p<2e4;)d=f.sample(p),h.push(d.value),p+=Up;o=h,a=p-Up,l="linear"}const u=Bee(t.owner.current,e,o,{...i,delay:-c,duration:a,ease:l});return u.onfinish=()=>{t.set(jee(o,i)),xn.update(()=>u.cancel()),n&&n()},{get currentTime(){return u.currentTime||0},set currentTime(f){u.currentTime=f},stop:()=>{const{currentTime:f}=u;if(f){const d=ry({...i,autoplay:!1});t.setWithVelocity(d.sample(f-Up).value,d.sample(f).value,Up)}xn.update(()=>u.cancel())}}}function oN(t,e){const r=performance.now(),n=({timestamp:i})=>{const s=i-r;s>=e&&(uc.read(n),t(s-e))};return xn.read(n,!0),()=>uc.read(n)}function Wee({keyframes:t,elapsed:e,onUpdate:r,onComplete:n}){const i=()=>{r&&r(t[t.length-1]),n&&n()};return e?{stop:oN(i,-e)}:i()}function Hee({keyframes:t,velocity:e=0,min:r,max:n,power:i=.8,timeConstant:s=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:c=1,modifyTarget:l,driver:u,onUpdate:f,onComplete:d,onStop:h}){const p=t[0];let v;function b(S){return r!==void 0&&Sn}function y(S){return r===void 0?n:n===void 0||Math.abs(r-S){var T;f==null||f(P),(T=S.onUpdate)===null||T===void 0||T.call(S,P)},onComplete:d,onStop:h})}function g(S){m({type:"spring",stiffness:o,damping:a,restDelta:c,...S})}if(b(p))g({velocity:e,keyframes:[p,y(p)]});else{let S=i*e+p;typeof l<"u"&&(S=l(S));const P=y(S),T=P===r?-1:1;let w,I;const F=j=>{w=I,I=j,e=F3(j-w,Do.delta),(T===1&&j>P||T===-1&&jv==null?void 0:v.stop()}}const Qc=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),zp=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),C2=()=>({type:"keyframes",ease:"linear",duration:.3}),qee={type:"keyframes",duration:.8},m_={x:Qc,y:Qc,z:Qc,rotate:Qc,rotateX:Qc,rotateY:Qc,rotateZ:Qc,scaleX:zp,scaleY:zp,scale:zp,opacity:C2,backgroundColor:C2,color:C2,default:zp},Vee=(t,{keyframes:e})=>e.length>2?qee:(m_[t]||m_.default)(e[1]),Gx=(t,e)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&fc.test(e)&&!e.startsWith("url("));function Gee({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}function y_(t){return t===0||typeof t=="string"&&parseFloat(t)===0&&t.indexOf(" ")===-1}function g_(t){return typeof t=="number"?0:U3("",t)}function aN(t,e){return t[e]||t.default||t}function Kee(t,e,r,n){const i=Gx(e,r);let s=n.from!==void 0?n.from:t.get();return s==="none"&&i&&typeof r=="string"?s=U3(e,r):y_(s)&&typeof r=="string"?s=g_(r):!Array.isArray(r)&&y_(r)&&typeof s=="string"&&(r=g_(s)),Array.isArray(r)?(r[0]===null&&(r[0]=s),r):[s,r]}const Q3=(t,e,r,n={})=>i=>{const s=aN(n,t)||{},o=s.delay||n.delay||0;let{elapsed:a=0}=n;a=a-Lv(o);const c=Kee(e,t,r,s),l=c[0],u=c[c.length-1],f=Gx(t,l),d=Gx(t,u);let h={keyframes:c,velocity:e.getVelocity(),...s,elapsed:a,onUpdate:b=>{e.set(b),s.onUpdate&&s.onUpdate(b)},onComplete:()=>{i(),s.onComplete&&s.onComplete()}};if(!f||!d||ree.current||s.type===!1)return Wee(h);if(s.type==="inertia")return Hee(h);Gee(s)||(h={...h,...Vee(t,h)}),h.duration&&(h.duration=Lv(h.duration)),h.repeatDelay&&(h.repeatDelay=Lv(h.repeatDelay));const p=e.owner,v=p&&p.current;if(p&&v instanceof HTMLElement&&!(p!=null&&p.getProps().onUpdate)){const b=zee(e,t,h);if(b)return b}return ry(h)};function Qee(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(s=>Kx(t,s,r));n=Promise.all(i)}else if(typeof e=="string")n=Kx(t,e,r);else{const i=typeof e=="function"?jg(t,e,r.custom):e;n=cN(t,i,r)}return n.then(()=>t.notify("AnimationComplete",e))}function Kx(t,e,r={}){var n;const i=jg(t,e,r.custom);let{transition:s=t.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(s=r.transitionOverride);const o=i?()=>cN(t,i,r):()=>Promise.resolve(),a=!((n=t.variantChildren)===null||n===void 0)&&n.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:d}=s;return Yee(t,e,u+l,f,d,r)}:()=>Promise.resolve(),{when:c}=s;if(c){const[l,u]=c==="beforeChildren"?[o,a]:[a,o];return l().then(u)}else return Promise.all([o(),a(r.delay)])}function cN(t,e,{delay:r=0,transitionOverride:n,type:i}={}){var s;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...c}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");n&&(o=n);const u=[],f=i&&((s=t.animationState)===null||s===void 0?void 0:s.getState()[i]);for(const d in c){const h=t.getValue(d),p=c[d];if(!h||p===void 0||f&&Xee(f,d))continue;const v={delay:r,elapsed:0,...o};if(window.HandoffAppearAnimations&&!h.hasAnimated){const y=t.getProps()[eee];y&&(v.elapsed=window.HandoffAppearAnimations(y,d,h,xn))}let b=h.start(Q3(d,h,p,t.shouldReduceMotion&&ud.has(d)?{type:!1}:v));Zm(l)&&(l.add(d),b=b.then(()=>l.remove(d))),u.push(b)}return Promise.all(u).then(()=>{a&&QZ(t,a)})}function Yee(t,e,r=0,n=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*n,c=i===1?(l=0)=>l*n:(l=0)=>a-l*n;return Array.from(t.variantChildren).sort(Jee).forEach((l,u)=>{l.notify("AnimationStart",e),o.push(Kx(l,e,{...s,delay:r+c(u)}).then(()=>l.notify("AnimationComplete",e)))}),Promise.all(o)}function Jee(t,e){return t.sortNodePosition(e)}function Xee({protectedKeys:t,needsAnimating:e},r){const n=t.hasOwnProperty(r)&&e[r]!==!0;return e[r]=!1,n}const Y3=[mt.Animate,mt.InView,mt.Focus,mt.Hover,mt.Tap,mt.Drag,mt.Exit],Zee=[...Y3].reverse(),ete=Y3.length;function tte(t){return e=>Promise.all(e.map(({animation:r,options:n})=>Qee(t,r,n)))}function rte(t){let e=tte(t);const r=ite();let n=!0;const i=(c,l)=>{const u=jg(t,l);if(u){const{transition:f,transitionEnd:d,...h}=u;c={...c,...h,...d}}return c};function s(c){e=c(t)}function o(c,l){const u=t.getProps(),f=t.getVariantContext(!0)||{},d=[],h=new Set;let p={},v=1/0;for(let y=0;yv&&P;const j=Array.isArray(S)?S:[S];let H=j.reduce(i,{});T===!1&&(H={});const{prevResolvedValues:K={}}=g,B={...K,...H},E=_=>{F=!0,h.delete(_),g.needsAnimating[_]=!0};for(const _ in B){const O=H[_],N=K[_];p.hasOwnProperty(_)||(O!==N?Ym(O)&&Ym(N)?!DM(O,N)||I?E(_):g.protectedKeys[_]=!0:O!==void 0?E(_):h.add(_):O!==void 0&&h.has(_)?E(_):g.protectedKeys[_]=!0)}g.prevProp=S,g.prevResolvedValues=H,g.isActive&&(p={...p,...H}),n&&t.blockInitialAnimation&&(F=!1),F&&!w&&d.push(...j.map(_=>({animation:_,options:{type:m,...c}})))}if(h.size){const y={};h.forEach(m=>{const g=t.getBaseTarget(m);g!==void 0&&(y[m]=g)}),d.push({animation:y})}let b=!!d.length;return n&&u.initial===!1&&!t.manuallyAnimateOnMount&&(b=!1),n=!1,b?e(d):Promise.resolve()}function a(c,l,u){var f;if(r[c].isActive===l)return Promise.resolve();(f=t.variantChildren)===null||f===void 0||f.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(c,l)}),r[c].isActive=l;const d=o(u,c);for(const h in r)r[h].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>r}}function nte(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!DM(e,t):!1}function Yc(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ite(){return{[mt.Animate]:Yc(!0),[mt.InView]:Yc(),[mt.Hover]:Yc(),[mt.Tap]:Yc(),[mt.Drag]:Yc(),[mt.Focus]:Yc(),[mt.Exit]:Yc()}}const ste={animation:Ha(({visualElement:t,animate:e})=>{t.animationState||(t.animationState=rte(t)),Mg(e)&&C.useEffect(()=>e.subscribe(t),[e])}),exit:Ha(t=>{const{custom:e,visualElement:r}=t,[n,i]=NM(),s=C.useContext(O1);C.useEffect(()=>{r.isPresent=n;const o=r.animationState&&r.animationState.setActive(mt.Exit,!n,{custom:s&&s.custom||e});o&&!n&&o.then(i)},[n])})},b_=(t,e)=>Math.abs(t-e);function ote(t,e){const r=b_(t.x,e.x),n=b_(t.y,e.y);return Math.sqrt(r**2+n**2)}class lN{constructor(e,r,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const l=k2(this.lastMoveEventInfo,this.history),u=this.startEvent!==null,f=ote(l.offset,{x:0,y:0})>=3;if(!u&&!f)return;const{point:d}=l,{timestamp:h}=Do;this.history.push({...d,timestamp:h});const{onStart:p,onMove:v}=this.handlers;u||(p&&p(this.lastMoveEvent,l),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,l)},this.handlePointerMove=(l,u)=>{this.lastMoveEvent=l,this.lastMoveEventInfo=S2(u,this.transformPagePoint),xn.update(this.updatePoint,!0)},this.handlePointerUp=(l,u)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:f,onSessionEnd:d}=this.handlers,h=k2(l.type==="pointercancel"?this.lastMoveEventInfo:S2(u,this.transformPagePoint),this.history);this.startEvent&&f&&f(l,h),d&&d(l,h)},!TM(e))return;this.handlers=r,this.transformPagePoint=n;const i=$3(e),s=S2(i,this.transformPagePoint),{point:o}=s,{timestamp:a}=Do;this.history=[{...o,timestamp:a}];const{onSessionStart:c}=r;c&&c(e,k2(s,this.history)),this.removeListeners=Fg(hf(window,"pointermove",this.handlePointerMove),hf(window,"pointerup",this.handlePointerUp),hf(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),uc.update(this.updatePoint)}}function S2(t,e){return e?{point:e(t.point)}:t}function w_(t,e){return{x:t.x-e.x,y:t.y-e.y}}function k2({point:t},e){return{point:t,delta:w_(t,uN(e)),offset:w_(t,ate(e)),velocity:cte(e,.1)}}function ate(t){return t[0]}function uN(t){return t[t.length-1]}function cte(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=uN(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>Lv(e)));)r--;if(!n)return{x:0,y:0};const s=(i.timestamp-n.timestamp)/1e3;if(s===0)return{x:0,y:0};const o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Ei(t){return t.max-t.min}function Qx(t,e=0,r=.01){return Math.abs(t-e)<=r}function E_(t,e,r,n=.5){t.origin=n,t.originPoint=vr(e.min,e.max,t.origin),t.scale=Ei(r)/Ei(e),(Qx(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=vr(r.min,r.max,t.origin)-t.originPoint,(Qx(t.translate)||isNaN(t.translate))&&(t.translate=0)}function jh(t,e,r,n){E_(t.x,e.x,r.x,n==null?void 0:n.originX),E_(t.y,e.y,r.y,n==null?void 0:n.originY)}function x_(t,e,r){t.min=r.min+e.min,t.max=t.min+Ei(e)}function lte(t,e,r){x_(t.x,e.x,r.x),x_(t.y,e.y,r.y)}function C_(t,e,r){t.min=e.min-r.min,t.max=t.min+Ei(e)}function Uh(t,e,r){C_(t.x,e.x,r.x),C_(t.y,e.y,r.y)}function ute(t,{min:e,max:r},n){return e!==void 0&&tr&&(t=n?vr(r,t,n.max):Math.min(t,r)),t}function S_(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function fte(t,{top:e,left:r,bottom:n,right:i}){return{x:S_(t.x,r,i),y:S_(t.y,e,n)}}function k_(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.minn?r=ty(e.min,e.max-n,t.min):n>i&&(r=ty(t.min,t.max-i,e.min)),Lf(0,1,r)}function pte(t,e){const r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}const Yx=.35;function vte(t=Yx){return t===!1?t=0:t===!0&&(t=Yx),{x:A_(t,"left","right"),y:A_(t,"top","bottom")}}function A_(t,e,r){return{min:__(t,e),max:__(t,r)}}function __(t,e){return typeof t=="number"?t:t[e]||0}const P_=()=>({translate:0,scale:1,origin:0,originPoint:0}),zh=()=>({x:P_(),y:P_()}),T_=()=>({min:0,max:0}),Or=()=>({x:T_(),y:T_()});function Us(t){return[t("x"),t("y")]}function fN({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function mte({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function yte(t,e){if(!e)return t;const r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function A2(t){return t===void 0||t===1}function Jx({scale:t,scaleX:e,scaleY:r}){return!A2(t)||!A2(e)||!A2(r)}function tl(t){return Jx(t)||dN(t)||t.z||t.rotate||t.rotateX||t.rotateY}function dN(t){return I_(t.x)||I_(t.y)}function I_(t){return t&&t!=="0%"}function ny(t,e,r){const n=t-r,i=e*n;return r+i}function O_(t,e,r,n,i){return i!==void 0&&(t=ny(t,i,n)),ny(t,r,n)+e}function Xx(t,e=0,r=1,n,i){t.min=O_(t.min,e,r,n,i),t.max=O_(t.max,e,r,n,i)}function hN(t,{x:e,y:r}){Xx(t.x,e.translate,e.scale,e.originPoint),Xx(t.y,r.translate,r.scale,r.originPoint)}function gte(t,e,r,n=!1){var i,s;const o=r.length;if(!o)return;e.x=e.y=1;let a,c;for(let l=0;l1.0000000000001||t<.999999999999?t:1}function Ra(t,e){t.min=t.min+e,t.max=t.max+e}function $_(t,e,[r,n,i]){const s=e[i]!==void 0?e[i]:.5,o=vr(t.min,t.max,s);Xx(t,e[r],e[n],o,e.scale)}const bte=["x","scaleX","originX"],wte=["y","scaleY","originY"];function Ju(t,e){$_(t.x,e,bte),$_(t.y,e,wte)}function pN(t,e){return fN(yte(t.getBoundingClientRect(),e))}function Ete(t,e,r){const n=pN(t,r),{scroll:i}=e;return i&&(Ra(n.x,i.offset.x),Ra(n.y,i.offset.y)),n}const xte=new WeakMap;class Cte{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Or(),this.visualElement=e}start(e,{snapToCursor:r=!1}={}){if(this.visualElement.isPresent===!1)return;const n=a=>{this.stopAnimation(),r&&this.snapToCursor($3(a,"page").point)},i=(a,c)=>{var l;const{drag:u,dragPropagation:f,onDragStart:d}=this.getProps();u&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=RM(u),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Us(h=>{var p,v;let b=this.getAxisMotionValue(h).get()||0;if(so.test(b)){const y=(v=(p=this.visualElement.projection)===null||p===void 0?void 0:p.layout)===null||v===void 0?void 0:v.layoutBox[h];y&&(b=Ei(y)*(parseFloat(b)/100))}this.originPoint[h]=b}),d==null||d(a,c),(l=this.visualElement.animationState)===null||l===void 0||l.setActive(mt.Drag,!0))},s=(a,c)=>{const{dragPropagation:l,dragDirectionLock:u,onDirectionLock:f,onDrag:d}=this.getProps();if(!l&&!this.openGlobalLock)return;const{offset:h}=c;if(u&&this.currentDirection===null){this.currentDirection=Ste(h),this.currentDirection!==null&&(f==null||f(this.currentDirection));return}this.updateAxis("x",c.point,h),this.updateAxis("y",c.point,h),this.visualElement.render(),d==null||d(a,c)},o=(a,c)=>this.stop(a,c);this.panSession=new lN(e,{onSessionStart:n,onStart:i,onMove:s,onSessionEnd:o},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,r){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s==null||s(e,r)}cancel(){var e,r;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(e=this.panSession)===null||e===void 0||e.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(r=this.visualElement.animationState)===null||r===void 0||r.setActive(mt.Drag,!1)}updateAxis(e,r,n){const{drag:i}=this.getProps();if(!n||!Wp(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=ute(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:r}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;e&&Qu(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=fte(n.layoutBox,e):this.constraints=!1,this.elastic=vte(r),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Us(s=>{this.getAxisMotionValue(s)&&(this.constraints[s]=pte(n.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!Qu(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Ete(n,i.root,this.visualElement.getTransformPagePoint());let o=dte(i.layout.layoutBox,s);if(r){const a=r(mte(o));this.hasMutatedConstraints=!!a,a&&(o=fN(a))}return o}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Us(u=>{if(!Wp(u,r,this.currentDirection))return;let f=(c==null?void 0:c[u])||{};o&&(f={min:0,max:0});const d=i?200:1e6,h=i?40:1e7,p={type:"inertia",velocity:n?e[u]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(u,p)});return Promise.all(l).then(a)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return n.start(Q3(e,n,0,r))}stopAnimation(){Us(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){var r;const n="_drag"+e.toUpperCase(),i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(e,((r=this.visualElement.getProps().initial)===null||r===void 0?void 0:r[e])||0)}snapToCursor(e){Us(r=>{const{drag:n}=this.getProps();if(!Wp(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[r];s.set(e[r]-vr(o,a,.5))}})}scalePositionWithinConstraints(){var e;if(!this.visualElement.current)return;const{drag:r,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Qu(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Us(a=>{const c=this.getAxisMotionValue(a);if(c){const l=c.get();s[a]=hte({min:l,max:l},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",(e=i.root)===null||e===void 0||e.updateScroll(),i.updateLayout(),this.resolveConstraints(),Us(a=>{if(!Wp(a,r,null))return;const c=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];c.set(vr(l,u,s[a]))})}addListeners(){var e;if(!this.visualElement.current)return;xte.set(this.visualElement,this);const r=this.visualElement.current,n=hf(r,"pointerdown",l=>{const{drag:u,dragListener:f=!0}=this.getProps();u&&f&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();Qu(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&((e=s.root)===null||e===void 0||e.updateScroll(),s.updateLayout()),i();const a=Lg(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Us(f=>{const d=this.getAxisMotionValue(f);d&&(this.originPoint[f]+=l[f].translate,d.set(d.get()+l[f].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),c==null||c()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Yx,dragMomentum:a=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Wp(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function Ste(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}function kte(t){const{dragControls:e,visualElement:r}=t,n=Dg(()=>new Cte(r));C.useEffect(()=>e&&e.subscribe(n),[n,e]),C.useEffect(()=>n.addListeners(),[n])}function Ate({onPan:t,onPanStart:e,onPanEnd:r,onPanSessionStart:n,visualElement:i}){const s=t||e||r||n,o=C.useRef(null),{transformPagePoint:a}=C.useContext(C3),c={onSessionStart:n,onStart:e,onMove:t,onEnd:(u,f)=>{o.current=null,r&&r(u,f)}};C.useEffect(()=>{o.current!==null&&o.current.updateHandlers(c)});function l(u){o.current=new lN(u,c,{transformPagePoint:a})}Jm(i,"pointerdown",s&&l),M3(()=>o.current&&o.current.end())}const _te={pan:Ha(Ate),drag:Ha(kte)};function Zx(t){return typeof t=="string"&&t.startsWith("var(--")}const vN=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Pte(t){const e=vN.exec(t);if(!e)return[,];const[,r,n]=e;return[r,n]}function eC(t,e,r=1){const[n,i]=Pte(t);if(!n)return;const s=window.getComputedStyle(e).getPropertyValue(n);return s?s.trim():Zx(i)?eC(i,e,r+1):i}function Tte(t,{...e},r){const n=t.current;if(!(n instanceof Element))return{target:e,transitionEnd:r};r&&(r={...r}),t.values.forEach(i=>{const s=i.get();if(!Zx(s))return;const o=eC(s,n);o&&i.set(o)});for(const i in e){const s=e[i];if(!Zx(s))continue;const o=eC(s,n);o&&(e[i]=o,r&&r[i]===void 0&&(r[i]=s))}return{target:e,transitionEnd:r}}const Ite=new Set(["width","height","top","left","right","bottom","x","y"]),mN=t=>Ite.has(t),Ote=t=>Object.keys(t).some(mN),M_=t=>t===tu||t===we;var N_;(function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"})(N_||(N_={}));const D_=(t,e)=>parseFloat(t.split(", ")[e]),L_=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/);if(i)return D_(i[1],e);{const s=n.match(/^matrix\((.+)\)$/);return s?D_(s[1],t):0}},Rte=new Set(["x","y","z"]),$te=Km.filter(t=>!Rte.has(t));function Mte(t){const e=[];return $te.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e.length&&t.render(),e}const F_={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:L_(4,13),y:L_(5,14)},Nte=(t,e,r)=>{const n=e.measureViewportBox(),i=e.current,s=getComputedStyle(i),{display:o}=s,a={};o==="none"&&e.setStaticValue("display",t.display||"block"),r.forEach(l=>{a[l]=F_[l](n,s)}),e.render();const c=e.measureViewportBox();return r.forEach(l=>{const u=e.getValue(l);u&&u.jump(a[l]),t[l]=F_[l](c,s)}),t},Dte=(t,e,r={},n={})=>{e={...e},n={...n};const i=Object.keys(e).filter(mN);let s=[],o=!1;const a=[];if(i.forEach(c=>{const l=t.getValue(c);if(!t.hasValue(c))return;let u=r[c],f=Xd(u);const d=e[c];let h;if(Ym(d)){const p=d.length,v=d[0]===null?1:0;u=d[v],f=Xd(u);for(let b=v;b=0?window.pageYOffset:null,l=Nte(e,t,a);return s.length&&s.forEach(([u,f])=>{t.getValue(u).set(f)}),t.render(),$g&&c!==null&&window.scrollTo({top:c}),{target:l,transitionEnd:n}}else return{target:e,transitionEnd:n}};function Lte(t,e,r,n){return Ote(e)?Dte(t,e,r,n):{target:e,transitionEnd:n}}const Fte=(t,e,r,n)=>{const i=Tte(t,e,n);return e=i.target,n=i.transitionEnd,Lte(t,e,r,n)},tC={current:null},yN={current:!1};function Bte(){if(yN.current=!0,!!$g)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>tC.current=t.matches;t.addListener(e),e()}else tC.current=!1}function jte(t,e,r){const{willChange:n}=e;for(const i in e){const s=e[i],o=r[i];if(ii(s))t.addValue(i,s),Zm(n)&&n.add(i);else if(ii(o))t.addValue(i,Ff(s,{owner:t})),Zm(n)&&n.remove(i);else if(o!==s)if(t.hasValue(i)){const a=t.getValue(i);!a.hasAnimated&&a.set(s)}else{const a=t.getStaticValue(i);t.addValue(i,Ff(a!==void 0?a:s,{owner:t}))}}for(const i in r)e[i]===void 0&&t.removeValue(i);return e}const gN=Object.keys(O0),Ute=gN.length,B_=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class zte{constructor({parent:e,props:r,reducedMotionConfig:n,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>xn.render(this.render,!1,!0);const{latestValues:o,renderState:a}=i;this.latestValues=o,this.baseTarget={...o},this.initialValues=r.initial?{...o}:{},this.renderState=a,this.parent=e,this.props=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=s,this.isControllingVariants=Ng(r),this.isVariantNode=mM(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...l}=this.scrapeMotionValuesFromProps(r,{});for(const u in l){const f=l[u];o[u]!==void 0&&ii(f)&&(f.set(o[u],!1),Zm(c)&&c.add(u))}}scrapeMotionValuesFromProps(e,r){return{}}mount(e){var r;this.current=e,this.projection&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=(r=this.parent)===null||r===void 0?void 0:r.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),yN.current||Bte(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:tC.current,this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var e,r,n;(e=this.projection)===null||e===void 0||e.unmount(),uc.update(this.notifyUpdate),uc.render(this.render),this.valueSubscriptions.forEach(i=>i()),(r=this.removeFromVariantTree)===null||r===void 0||r.call(this),(n=this.parent)===null||n===void 0||n.children.delete(this);for(const i in this.events)this.events[i].clear();this.current=null}bindToMotionValue(e,r){const n=ud.has(e),i=r.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&xn.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=r.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{i(),s()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...r},n,i,s,o,a){const c=[];for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,layoutScroll:h,layoutRoot:p})}return c}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Or()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r}makeTargetAnimatable(e,r=!0){return this.makeTargetAnimatableFromInstance(e,this.props,r)}setProps(e){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender();const r=this.props;this.props=e;for(let n=0;nn.variantChildren.delete(e)}addValue(e,r){r!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,r)),this.values.set(e,r),this.latestValues[e]=r.get()}removeValue(e){var r;this.values.delete(e),(r=this.valueSubscriptions.get(e))===null||r===void 0||r(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&r!==void 0&&(n=Ff(r,{owner:this}),this.addValue(e,n)),n}readValue(e){return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,r){this.baseTarget[e]=r}getBaseTarget(e){var r;const{initial:n}=this.props,i=typeof n=="string"||typeof n=="object"?(r=R3(this.props,n))===null||r===void 0?void 0:r[e]:void 0;if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!ii(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new L3),this.events[e].add(r)}notify(e,...r){var n;(n=this.events[e])===null||n===void 0||n.notify(...r)}}const bN=["initial",...Y3],Wte=bN.length;class wN extends zte{sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){var n;return(n=e.style)===null||n===void 0?void 0:n[r]}removeValueFromRenderState(e,{vars:r,style:n}){delete r[e],delete n[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:r,...n},{transformValues:i},s){let o=XZ(n,e||{},this);if(i&&(r&&(r=i(r)),n&&(n=i(n)),o&&(o=i(o))),s){YZ(this,n,o);const a=Fte(this,n,o,r);r=a.transitionEnd,n=a.target}return{transition:e,transitionEnd:r,...n}}}function Hte(t){return window.getComputedStyle(t)}class qte extends wN{readValueFromInstance(e,r){if(ud.has(r)){const n=j3(r);return n&&n.default||0}else{const n=Hte(e),i=(bM(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return pN(e,r)}build(e,r,n,i){A3(e,r,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,r){return O3(e,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ii(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}renderInstance(e,r,n,i){SM(e,r,n,i)}}class Vte extends wN{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){var n;return ud.has(r)?((n=j3(r))===null||n===void 0?void 0:n.default)||0:(r=kM.has(r)?r:I3(r),e.getAttribute(r))}measureInstanceViewportBox(){return Or()}scrapeMotionValuesFromProps(e,r){return _M(e,r)}build(e,r,n,i){P3(e,r,n,this.isSVGTag,i.transformTemplate)}renderInstance(e,r,n,i){AM(e,r,n,i)}mount(e){this.isSVGTag=T3(e.tagName),super.mount(e)}}const Gte=(t,e)=>k3(t)?new Vte(e,{enableHardwareAcceleration:!1}):new qte(e,{enableHardwareAcceleration:!0});function j_(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Zd={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(we.test(t))t=parseFloat(t);else return t;const r=j_(t,e.target.x),n=j_(t,e.target.y);return`${r}% ${n}%`}},U_="_$css",Kte={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=t.includes("var("),s=[];i&&(t=t.replace(vN,h=>(s.push(h),U_)));const o=fc.parse(t);if(o.length>5)return n;const a=fc.createTransformer(t),c=typeof o[0]!="number"?1:0,l=r.x.scale*e.x,u=r.y.scale*e.y;o[0+c]/=l,o[1+c]/=u;const f=vr(l,u,.5);typeof o[2+c]=="number"&&(o[2+c]/=f),typeof o[3+c]=="number"&&(o[3+c]/=f);let d=a(o);if(i){let h=0;d=d.replace(U_,()=>{const p=s[h];return h++,p})}return d}};class Qte extends x.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=e;BX(Jte),s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Lh.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==r||r===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||xn.postRender(()=>{var a;!((a=o.getStack())===null||a===void 0)&&a.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),r!=null&&r.group&&r.group.remove(i),n!=null&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e==null||e()}render(){return null}}function Yte(t){const[e,r]=NM(),n=C.useContext(S3);return x.createElement(Qte,{...t,layoutGroup:n,switchLayoutGroup:C.useContext(yM),isPresent:e,safeToRemove:r})}const Jte={borderRadius:{...Zd,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Zd,borderTopRightRadius:Zd,borderBottomLeftRadius:Zd,borderBottomRightRadius:Zd,boxShadow:Kte},Xte={measureLayout:Yte};function Zte(t,e,r={}){const n=ii(t)?t:Ff(t);return n.start(Q3("",n,e,r)),{stop:()=>n.stop(),isAnimating:()=>n.isAnimating()}}const EN=["TopLeft","TopRight","BottomLeft","BottomRight"],ere=EN.length,z_=t=>typeof t=="string"?parseFloat(t):t,W_=t=>typeof t=="number"||we.test(t);function tre(t,e,r,n,i,s){i?(t.opacity=vr(0,r.opacity!==void 0?r.opacity:1,rre(n)),t.opacityExit=vr(e.opacity!==void 0?e.opacity:1,0,nre(n))):s&&(t.opacity=vr(e.opacity!==void 0?e.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;one?1:r(ty(t,e,n))}function q_(t,e){t.min=e.min,t.max=e.max}function ns(t,e){q_(t.x,e.x),q_(t.y,e.y)}function V_(t,e,r,n,i){return t-=e,t=ny(t,1/r,n),i!==void 0&&(t=ny(t,1/i,n)),t}function ire(t,e=0,r=1,n=.5,i,s=t,o=t){if(so.test(e)&&(e=parseFloat(e),e=vr(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=vr(s.min,s.max,n);t===s&&(a-=e),t.min=V_(t.min,e,r,a,i),t.max=V_(t.max,e,r,a,i)}function G_(t,e,[r,n,i],s,o){ire(t,e[r],e[n],e[i],e.scale,s,o)}const sre=["x","scaleX","originX"],ore=["y","scaleY","originY"];function K_(t,e,r,n){G_(t.x,e,sre,r==null?void 0:r.x,n==null?void 0:n.x),G_(t.y,e,ore,r==null?void 0:r.y,n==null?void 0:n.y)}function Q_(t){return t.translate===0&&t.scale===1}function CN(t){return Q_(t.x)&&Q_(t.y)}function SN(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function Y_(t){return Ei(t.x)/Ei(t.y)}class are{constructor(){this.members=[]}add(e){N3(this.members,e),e.scheduleRender()}remove(e){if(D3(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(e){const r=this.members.findIndex(i=>e===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){n=s;break}}return n?(this.promote(n),!0):!1}promote(e,r){var n;const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,r&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),!((n=e.root)===null||n===void 0)&&n.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:s}=e.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var r,n,i,s,o;(n=(r=e.options).onExitComplete)===null||n===void 0||n.call(r),(o=(i=e.resumingFrom)===null||i===void 0?void 0:(s=i.options).onExitComplete)===null||o===void 0||o.call(s)})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function J_(t,e,r){let n="";const i=t.x.translate/e.x,s=t.y.translate/e.y;if((i||s)&&(n=`translate3d(${i}px, ${s}px, 0) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),r){const{rotate:c,rotateX:l,rotateY:u}=r;c&&(n+=`rotate(${c}deg) `),l&&(n+=`rotateX(${l}deg) `),u&&(n+=`rotateY(${u}deg) `)}const o=t.x.scale*e.x,a=t.y.scale*e.y;return(o!==1||a!==1)&&(n+=`scale(${o}, ${a})`),n||"none"}const cre=(t,e)=>t.depth-e.depth;class lre{constructor(){this.children=[],this.isDirty=!1}add(e){N3(this.children,e),this.isDirty=!0}remove(e){D3(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(cre),this.isDirty=!1,this.children.forEach(e)}}const X_=["","X","Y","Z"],Z_=1e3;let ure=0;function kN({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o,a={},c=e==null?void 0:e()){this.id=ure++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(hre),this.nodes.forEach(mre),this.nodes.forEach(yre)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=o,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0,o&&this.root.registerPotentialNode(o,this);for(let l=0;lthis.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=oN(h,250),Lh.hasAnimatedSinceResize&&(Lh.hasAnimatedSinceResize=!1,this.nodes.forEach(tP))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&f&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:v})=>{var b,y,m,g,S;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const P=(y=(b=this.options.transition)!==null&&b!==void 0?b:f.getDefaultTransition())!==null&&y!==void 0?y:xre,{onLayoutAnimationStart:T,onLayoutAnimationComplete:w}=f.getProps(),I=!this.targetLayout||!SN(this.targetLayout,v)||p,F=!h&&p;if(this.options.layoutRoot||!((m=this.resumeFrom)===null||m===void 0)&&m.instance||F||h&&(I||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,F);const j={...aN(P,"layout"),onPlay:T,onComplete:w};(f.shouldReduceMotion||this.options.layoutRoot)&&(j.delay=0,j.type=!1),this.startAnimation(j)}else!h&&this.animationProgress===0&&tP(this),this.isLead()&&((S=(g=this.options).onExitComplete)===null||S===void 0||S.call(g));this.targetLayout=v})}unmount(){var o,a;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(o=this.getStack())===null||o===void 0||o.remove(this),(a=this.parent)===null||a===void 0||a.children.delete(this),this.instance=void 0,uc.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var o;return this.isAnimationBlocked||((o=this.parent)===null||o===void 0?void 0:o.isTreeAnimationBlocked())||!1}startUpdate(){var o;this.isUpdateBlocked()||(this.isUpdating=!0,(o=this.nodes)===null||o===void 0||o.forEach(gre),this.animationId++)}getTransformTemplate(){var o;return(o=this.options.visualElement)===null||o===void 0?void 0:o.getProps().transformTemplate}willUpdate(o=!0){var a,c,l;if(this.root.isUpdateBlocked()){(c=(a=this.options).onExitComplete)===null||c===void 0||c.call(a);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){var o;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{var g;const S=m/1e3;rP(h.x,o.x,S),rP(h.y,o.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(!((g=this.relativeParent)===null||g===void 0)&&g.layout)&&(Uh(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),wre(this.relativeTarget,this.relativeTargetOrigin,p,S)),v&&(this.animationValues=d,tre(d,f,this.latestValues,S,y,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)===null||a===void 0||a.stop(),this.resumingFrom&&((c=this.resumingFrom.currentAnimation)===null||c===void 0||c.stop()),this.pendingAnimation&&(uc.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=xn.update(()=>{Lh.hasAnimatedSinceResize=!0,this.currentAnimation=Zte(0,Z_,{...o,onUpdate:l=>{var u;this.mixTargetDelta(l),(u=o.onUpdate)===null||u===void 0||u.call(o,l)},onComplete:()=>{var l;(l=o.onComplete)===null||l===void 0||l.call(o),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var o;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(o=this.getStack())===null||o===void 0||o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var o;this.currentAnimation&&((o=this.mixTargetDelta)===null||o===void 0||o.call(this,Z_),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&AN(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||Or();const f=Ei(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const d=Ei(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+d}ns(a,c),Ju(a,u),jh(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){var c,l,u;this.sharedNodes.has(o)||this.sharedNodes.set(o,new are),this.sharedNodes.get(o).add(a),a.promote({transition:(c=a.options.initialPromotionConfig)===null||c===void 0?void 0:c.transition,preserveFollowOpacity:(u=(l=a.options.initialPromotionConfig)===null||l===void 0?void 0:l.shouldPreserveFollowOpacity)===null||u===void 0?void 0:u.call(l,a)})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.rotate||c.rotateX||c.rotateY||c.rotateZ)&&(a=!0),!a)return;const l={};for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(eP),this.root.sharedNodes.clear()}}}function fre(t){t.updateLayout()}function dre(t){var e,r,n;const i=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:o}=t.layout,{animationType:a}=t.options,c=i.source!==t.layout.source;a==="size"?Us(h=>{const p=c?i.measuredBox[h]:i.layoutBox[h],v=Ei(p);p.min=s[h].min,p.max=p.min+v}):AN(a,i.layoutBox,s)&&Us(h=>{const p=c?i.measuredBox[h]:i.layoutBox[h],v=Ei(s[h]);p.max=p.min+v});const l=zh();jh(l,s,i.layoutBox);const u=zh();c?jh(u,t.applyTransform(o,!0),i.measuredBox):jh(u,s,i.layoutBox);const f=!CN(l);let d=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:p,layout:v}=h;if(p&&v){const b=Or();Uh(b,i.layoutBox,p.layoutBox);const y=Or();Uh(y,s,v.layoutBox),SN(b,y)||(d=!0),h.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=b,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:i,delta:u,layoutDelta:l,hasLayoutChanged:f,hasRelativeTargetChanged:d})}else t.isLead()&&((n=(r=t.options).onExitComplete)===null||n===void 0||n.call(r));t.options.transition=void 0}function hre(t){t.isProjectionDirty||(t.isProjectionDirty=!!(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=!!(t.parent&&t.parent.isTransformDirty))}function pre(t){t.clearSnapshot()}function eP(t){t.clearMeasurements()}function vre(t){const{visualElement:e}=t.options;e!=null&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function tP(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function mre(t){t.resolveTargetDelta()}function yre(t){t.calcProjection()}function gre(t){t.resetRotation()}function bre(t){t.removeLeadSnapshot()}function rP(t,e,r){t.translate=vr(e.translate,0,r),t.scale=vr(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function nP(t,e,r,n){t.min=vr(e.min,r.min,n),t.max=vr(e.max,r.max,n)}function wre(t,e,r,n){nP(t.x,e.x,r.x,n),nP(t.y,e.y,r.y,n)}function Ere(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const xre={duration:.45,ease:[.4,0,.1,1]};function Cre(t,e){let r=t.root;for(let s=t.path.length-1;s>=0;s--)if(t.path[s].instance){r=t.path[s];break}const i=(r&&r!==t.root?r.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function iP(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function Sre(t){iP(t.x),iP(t.y)}function AN(t,e,r){return t==="position"||t==="preserve-aspect"&&!Qx(Y_(e),Y_(r),.2)}const kre=kN({attachResizeListener:(t,e)=>Lg(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),_2={current:void 0},Are=kN({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!_2.current){const t=new kre(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),_2.current=t}return _2.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),_re={...ste,...SZ,..._te,...Xte},M0=LX((t,e)=>fZ(t,e,_re,Gte,Are));function _N(){const t=C.useRef(!1);return Vm(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Pre(){const t=_N(),[e,r]=C.useState(0),n=C.useCallback(()=>{t.current&&r(e+1)},[e]);return[C.useCallback(()=>xn.postRender(n),[n]),e]}class Tre extends C.Component{getSnapshotBeforeUpdate(e){const r=this.props.childRef.current;if(r&&e.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=r.offsetHeight||0,n.width=r.offsetWidth||0,n.top=r.offsetTop,n.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Ire({children:t,isPresent:e}){const r=C.useId(),n=C.useRef(null),i=C.useRef({width:0,height:0,top:0,left:0});return C.useInsertionEffect(()=>{const{width:s,height:o,top:a,left:c}=i.current;if(e||!n.current||!s||!o)return;n.current.dataset.motionPopId=r;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(` [data-motion-pop-id="${r}"] { position: absolute !important; width: ${s}px !important; @@ -55,12 +55,12 @@ Error generating stack: `+s.message+` top: ${a}px !important; left: ${c}px !important; } - `),()=>{document.head.removeChild(l)}},[e]),C.createElement(Zte,{isPresent:e,childRef:n,sizeRef:i},C.cloneElement(t,{ref:n}))}const E2=({children:t,initial:e,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=Ig(tre),c=C.useId(),l=C.useMemo(()=>({id:c,initial:e,isPresent:r,custom:i,onExitComplete:u=>{a.set(u,!0);for(const f of a.values())if(!f)return;n&&n()},register:u=>(a.set(u,!1),()=>a.delete(u))}),s?void 0:[r]);return C.useMemo(()=>{a.forEach((u,f)=>a.set(f,!1))},[r]),C.useEffect(()=>{!r&&!a.size&&n&&n()},[r]),o==="popLayout"&&(t=C.createElement(ere,{isPresent:r},t)),C.createElement(P1.Provider,{value:l},t)};function tre(){return new Map}const Tu=t=>t.key||"";function rre(t,e){t.forEach(r=>{const n=Tu(r);e.set(n,r)})}function nre(t){const e=[];return C.Children.forEach(t,r=>{C.isValidElement(r)&&e.push(r)}),e}const Ng=({children:t,custom:e,initial:r=!0,onExitComplete:n,exitBeforeEnter:i,presenceAffectsLayout:s=!0,mode:o="sync"})=>{i&&(o="wait");let[a]=Xte();const c=C.useContext(m3).forceRender;c&&(a=c);const l=mN(),u=nre(t);let f=u;const d=new Set,h=C.useRef(f),p=C.useRef(new Map).current,v=C.useRef(!0);if(Um(()=>{v.current=!1,rre(u,p),h.current=f}),A3(()=>{v.current=!0,p.clear(),d.clear()}),v.current)return C.createElement(C.Fragment,null,f.map(g=>C.createElement(E2,{key:Tu(g),isPresent:!0,initial:r?void 0:!1,presenceAffectsLayout:s,mode:o},g)));f=[...f];const b=h.current.map(Tu),y=u.map(Tu),m=b.length;for(let g=0;g{if(y.indexOf(g)!==-1)return;const S=p.get(g);if(!S)return;const P=b.indexOf(g),T=()=>{p.delete(g),d.delete(g);const w=h.current.findIndex(I=>I.key===g);if(h.current.splice(w,1),!d.size){if(h.current=u,l.current===!1)return;a(),n&&n()}};f.splice(P,0,C.createElement(E2,{key:Tu(S),isPresent:!1,onExitComplete:T,custom:e,presenceAffectsLayout:s,mode:o},S))}),f=f.map(g=>{const S=g.key;return d.has(S)?g:C.createElement(E2,{key:Tu(g),isPresent:!0,presenceAffectsLayout:s,mode:o},g)}),C.createElement(C.Fragment,null,d.size?f:f.map(g=>C.cloneElement(g)))};var Gs=function(){return Gs=Object.assign||function(e){for(var r,n=1,i=arguments.length;n{document.head.removeChild(l)}},[e]),C.createElement(Tre,{isPresent:e,childRef:n,sizeRef:i},C.cloneElement(t,{ref:n}))}const P2=({children:t,initial:e,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=Dg(Ore),c=C.useId(),l=C.useMemo(()=>({id:c,initial:e,isPresent:r,custom:i,onExitComplete:u=>{a.set(u,!0);for(const f of a.values())if(!f)return;n&&n()},register:u=>(a.set(u,!1),()=>a.delete(u))}),s?void 0:[r]);return C.useMemo(()=>{a.forEach((u,f)=>a.set(f,!1))},[r]),C.useEffect(()=>{!r&&!a.size&&n&&n()},[r]),o==="popLayout"&&(t=C.createElement(Ire,{isPresent:r},t)),C.createElement(O1.Provider,{value:l},t)};function Ore(){return new Map}const Iu=t=>t.key||"";function Rre(t,e){t.forEach(r=>{const n=Iu(r);e.set(n,r)})}function $re(t){const e=[];return C.Children.forEach(t,r=>{C.isValidElement(r)&&e.push(r)}),e}const Ug=({children:t,custom:e,initial:r=!0,onExitComplete:n,exitBeforeEnter:i,presenceAffectsLayout:s=!0,mode:o="sync"})=>{i&&(o="wait");let[a]=Pre();const c=C.useContext(S3).forceRender;c&&(a=c);const l=_N(),u=$re(t);let f=u;const d=new Set,h=C.useRef(f),p=C.useRef(new Map).current,v=C.useRef(!0);if(Vm(()=>{v.current=!1,Rre(u,p),h.current=f}),M3(()=>{v.current=!0,p.clear(),d.clear()}),v.current)return C.createElement(C.Fragment,null,f.map(g=>C.createElement(P2,{key:Iu(g),isPresent:!0,initial:r?void 0:!1,presenceAffectsLayout:s,mode:o},g)));f=[...f];const b=h.current.map(Iu),y=u.map(Iu),m=b.length;for(let g=0;g{if(y.indexOf(g)!==-1)return;const S=p.get(g);if(!S)return;const P=b.indexOf(g),T=()=>{p.delete(g),d.delete(g);const w=h.current.findIndex(I=>I.key===g);if(h.current.splice(w,1),!d.size){if(h.current=u,l.current===!1)return;a(),n&&n()}};f.splice(P,0,C.createElement(P2,{key:Iu(S),isPresent:!1,onExitComplete:T,custom:e,presenceAffectsLayout:s,mode:o},S))}),f=f.map(g=>{const S=g.key;return d.has(S)?g:C.createElement(P2,{key:Iu(g),isPresent:!0,presenceAffectsLayout:s,mode:o},g)}),C.createElement(C.Fragment,null,d.size?f:f.map(g=>C.cloneElement(g)))};var rC=function(t,e){return rC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},rC(t,e)};function PN(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");rC(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Di=function(){return Di=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function IN(t,e){return function(r,n){e(r,n,t)}}function Mre(t,e,r,n,i,s){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f,d=!1,h=r.length-1;h>=0;h--){var p={};for(var v in n)p[v]=v==="access"?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(y){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(y||null))};var b=(0,r[h])(a==="accessor"?{get:u.get,set:u.set}:u[c],p);if(a==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(f=o(b.get))&&(u.get=f),(f=o(b.set))&&(u.set=f),(f=o(b.init))&&i.unshift(f)}else(f=o(b))&&(a==="field"?i.unshift(f):u[c]=f)}l&&Object.defineProperty(l,n.name,u),d=!0}function Nre(t,e,r){for(var n=arguments.length>2,i=0;i0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function J3(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function NN(){for(var t=[],e=0;e1||a(d,h)})})}function a(d,h){try{c(n[d](h))}catch(p){f(s[0][3],p)}}function c(d){d.value instanceof Bf?Promise.resolve(d.value.v).then(l,u):f(s[0][2],d)}function l(d){a("next",d)}function u(d){a("throw",d)}function f(d,h){d(h),s.shift(),s.length&&a(s[0][0],s[0][1])}}function FN(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:Bf(t[i](o)),done:!1}:s?s(o):o}:s}}function BN(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof iy=="function"?iy(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function jN(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var Fre=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function UN(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Wg(e,t,r);return Fre(e,t),e}function zN(t){return t&&t.__esModule?t:{default:t}}function WN(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function HN(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function qN(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function VN(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var Bre=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function GN(t){function e(n){t.error=t.hasError?new Bre(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(s){return e(s),r()})}catch(s){e(s)}}if(t.hasError)throw t.error}return r()}const jre={__extends:PN,__assign:Di,__rest:zg,__decorate:TN,__param:IN,__metadata:ON,__awaiter:RN,__generator:$N,__createBinding:Wg,__exportStar:MN,__values:iy,__read:J3,__spread:NN,__spreadArrays:DN,__spreadArray:X3,__await:Bf,__asyncGenerator:LN,__asyncDelegator:FN,__asyncValues:BN,__makeTemplateObject:jN,__importStar:UN,__importDefault:zN,__classPrivateFieldGet:WN,__classPrivateFieldSet:HN,__classPrivateFieldIn:qN,__addDisposableResource:VN,__disposeResources:GN},XPe=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:VN,get __assign(){return Di},__asyncDelegator:FN,__asyncGenerator:LN,__asyncValues:BN,__await:Bf,__awaiter:RN,__classPrivateFieldGet:WN,__classPrivateFieldIn:qN,__classPrivateFieldSet:HN,__createBinding:Wg,__decorate:TN,__disposeResources:GN,__esDecorate:Mre,__exportStar:MN,__extends:PN,__generator:$N,__importDefault:zN,__importStar:UN,__makeTemplateObject:jN,__metadata:ON,__param:IN,__propKey:Dre,__read:J3,__rest:zg,__runInitializers:Nre,__setFunctionName:Lre,__spread:NN,__spreadArray:X3,__spreadArrays:DN,__values:iy,default:jre},Symbol.toStringTag,{value:"Module"})),KN={black:"#000000",white:"#ffffff",inherit:"inherit",transparent:"transparent",positive:"#1FC266",negative:"#C2501F",info:"#0076CC",warning:"#F4B03E",gradientBackdrop:`linear-gradient( 243.18deg, rgba(86, 52, 189, 0.85) 0%, rgba(49, 41, 223, 0.85) 63.54%, rgba(7, 98, 149, 0.85) 100% - )`,gradientPrimary:"linear-gradient(89.69deg, #4411E1 0.27%, #7537F9 99.73%)",gradientSecondary:"linear-gradient(32.51deg, #951990 -15.23%, #3A35B1 48.55%, #20A8B0 100%)",arbitrumDark:"#212D44",arbitrumLight:"#93D4FF",avalanceDark:"#810C0C",avalanceLight:"#FF8080",bscDark:"#584508",bscLight:"#FCCF43",ethereumDark:"#132362",ethereumLight:"#AABBFF",gnosisDark:"#084246",gnosisLight:"#8CF6FD",polygonDark:"#350881",polygonLight:"#C7A6FF"},sre={...gN,text100:"rgba(255, 255, 255, 1)",text80:"rgba(255, 255, 255, 0.8)",text50:"rgba(255, 255, 255, 0.5)",textInverse100:"rgba(0, 0, 0, 1)",backgroundPrimary:"rgba(0, 0, 0, 1)",backgroundSecondary:"rgba(255, 255, 255, 0.1)",backgroundContrast:"rgba(0, 0, 0, 0.5)",backgroundMuted:"rgba(255, 255, 255, 0.05)",backgroundControl:"rgba(255, 255, 255, 0.25)",backgroundInverse:"rgba(255, 255, 255, 1)",backgroundBackdrop:"rgba(34, 34, 34, 0.9)",backgroundOverlay:"rgba(0, 0, 0, 0.7)",backgroundRaised:"rgba(54, 54, 54, 0.7)",buttonGlass:"rgba(255, 255, 255, 0.15)",buttonEmphasis:"rgba(0, 0, 0, 0.5)",buttonInverse:"rgba(255, 255, 255, 0.8)",borderNormal:"rgba(255, 255, 255, 0.25)",borderFocus:"rgba(255, 255, 255, 0.5)"},ore={...gN,text100:"rgba(0, 0, 0, 1)",text80:"rgba(0, 0, 0, 0.8)",text50:"rgba(0, 0, 0, 0.5)",textInverse100:"rgba(255, 255, 255, 1)",backgroundPrimary:"rgba(244, 244, 244, 1)",backgroundSecondary:"rgba(0, 0, 0, 0.1)",backgroundContrast:"rgba(244, 244, 244, 0.5)",backgroundMuted:"rgba(0, 0, 0, 0.05)",backgroundControl:"rgba(0, 0, 0, 0.25)",backgroundInverse:"rgba(0, 0, 0, 1)",backgroundBackdrop:"rgba(221, 221, 221, 0.9)",backgroundOverlay:"rgba(244, 244, 244, 0.7)",backgroundRaised:"rgba(192, 192, 192, 0.7)",buttonGlass:"rgba(0, 0, 0, 0.15)",buttonEmphasis:"rgba(255, 255, 255, 0.5)",buttonInverse:"rgba(0, 0, 0, 0.8)",borderNormal:"rgba(0, 0, 0, 0.25)",borderFocus:"rgba(0, 0, 0, 0.5)"},are={dark:sre,light:ore},cre={inherit:{fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit",fontWeight:"inherit"},xlarge:{fontFamily:"body",fontSize:"xlarge",lineHeight:"9",letterSpacing:"none",fontWeight:"bold"},large:{fontFamily:"body",fontSize:"large",lineHeight:"7",letterSpacing:"normal",fontWeight:"semibold"},medium:{fontFamily:"body",fontSize:"medium",lineHeight:"6",letterSpacing:"normal",fontWeight:"bold"},normal:{fontFamily:"body",fontSize:"normal",lineHeight:"5",letterSpacing:"wide",fontWeight:"normal"},small:{fontFamily:"body",fontSize:"small",lineHeight:"4",letterSpacing:"wide",fontWeight:"medium"},xsmall:{fontFamily:"body",fontSize:"xsmall",lineHeight:"4",letterSpacing:"wide",fontWeight:"bold"},code:{fontFamily:"mono",fontSize:"normal",lineHeight:"5",letterSpacing:"none",fontWeight:"normal"}},Q_={sm:0,md:480,lg:769,xl:1281};var Y_={colors:{black:"var(--colors-black)",white:"var(--colors-white)",inherit:"var(--colors-inherit)",transparent:"var(--colors-transparent)",positive:"var(--colors-positive)",negative:"var(--colors-negative)",info:"var(--colors-info)",warning:"var(--colors-warning)",gradientBackdrop:"var(--colors-gradient-backdrop)",gradientPrimary:"var(--colors-gradient-primary)",gradientSecondary:"var(--colors-gradient-secondary)",arbitrumDark:"var(--colors-arbitrum-dark)",arbitrumLight:"var(--colors-arbitrum-light)",avalanceDark:"var(--colors-avalance-dark)",avalanceLight:"var(--colors-avalance-light)",bscDark:"var(--colors-bsc-dark)",bscLight:"var(--colors-bsc-light)",ethereumDark:"var(--colors-ethereum-dark)",ethereumLight:"var(--colors-ethereum-light)",gnosisDark:"var(--colors-gnosis-dark)",gnosisLight:"var(--colors-gnosis-light)",polygonDark:"var(--colors-polygon-dark)",polygonLight:"var(--colors-polygon-light)",text100:"var(--colors-text100)",text80:"var(--colors-text80)",text50:"var(--colors-text50)",textInverse100:"var(--colors-text-inverse100)",backgroundPrimary:"var(--colors-background-primary)",backgroundSecondary:"var(--colors-background-secondary)",backgroundContrast:"var(--colors-background-contrast)",backgroundMuted:"var(--colors-background-muted)",backgroundControl:"var(--colors-background-control)",backgroundInverse:"var(--colors-background-inverse)",backgroundBackdrop:"var(--colors-background-backdrop)",backgroundOverlay:"var(--colors-background-overlay)",backgroundRaised:"var(--colors-background-raised)",buttonGlass:"var(--colors-button-glass)",buttonEmphasis:"var(--colors-button-emphasis)",buttonInverse:"var(--colors-button-inverse)",borderNormal:"var(--colors-border-normal)",borderFocus:"var(--colors-border-focus)"}},ve={blur:{blur:"var(--blur-blur)",none:"var(--blur-none)"},borderWidths:{none:"var(--border-widths-none)",thin:"var(--border-widths-thin)",thick:"var(--border-widths-thick)"},fonts:{inherit:"var(--fonts-inherit)",body:"var(--fonts-body)",mono:"var(--fonts-mono)"},fontSizes:{inherit:"var(--font-sizes-inherit)",xsmall:"var(--font-sizes-xsmall)",small:"var(--font-sizes-small)",normal:"var(--font-sizes-normal)",medium:"var(--font-sizes-medium)",large:"var(--font-sizes-large)",xlarge:"var(--font-sizes-xlarge)"},fontWeights:{inherit:"var(--font-weights-inherit)",normal:"var(--font-weights-normal)",medium:"var(--font-weights-medium)",semibold:"var(--font-weights-semibold)",bold:"var(--font-weights-bold)"},letterSpacings:{inherit:"var(--letter-spacings-inherit)",none:"var(--letter-spacings-none)",normal:"var(--letter-spacings-normal)",wide:"var(--letter-spacings-wide)"},lineHeights:{4:"var(--line-heights-4)",5:"var(--line-heights-5)",6:"var(--line-heights-6)",7:"var(--line-heights-7)",9:"var(--line-heights-9)",inherit:"var(--line-heights-inherit)"},opacity:{0:"var(--opacity-0)",50:"var(--opacity-50)",80:"var(--opacity-80)",100:"var(--opacity-100)"},radii:{none:"var(--radii-none)",xs:"var(--radii-xs)",sm:"var(--radii-sm)",md:"var(--radii-md)",lg:"var(--radii-lg)",circle:"var(--radii-circle)"},space:{0:"var(--space-0)",1:"var(--space-1)",2:"var(--space-2)",3:"var(--space-3)",4:"var(--space-4)",5:"var(--space-5)",6:"var(--space-6)",7:"var(--space-7)",8:"var(--space-8)",9:"var(--space-9)",10:"var(--space-10)",12:"var(--space-12)",14:"var(--space-14)",16:"var(--space-16)","0.25":"var(--space-0_25)","0.5":"var(--space-0_5)","1.5":"var(--space-1_5)"},colors:{black:"var(--colors-black)",white:"var(--colors-white)",inherit:"var(--colors-inherit)",transparent:"var(--colors-transparent)",positive:"var(--colors-positive)",negative:"var(--colors-negative)",info:"var(--colors-info)",warning:"var(--colors-warning)",gradientBackdrop:"var(--colors-gradient-backdrop)",gradientPrimary:"var(--colors-gradient-primary)",gradientSecondary:"var(--colors-gradient-secondary)",arbitrumDark:"var(--colors-arbitrum-dark)",arbitrumLight:"var(--colors-arbitrum-light)",avalanceDark:"var(--colors-avalance-dark)",avalanceLight:"var(--colors-avalance-light)",bscDark:"var(--colors-bsc-dark)",bscLight:"var(--colors-bsc-light)",ethereumDark:"var(--colors-ethereum-dark)",ethereumLight:"var(--colors-ethereum-light)",gnosisDark:"var(--colors-gnosis-dark)",gnosisLight:"var(--colors-gnosis-light)",polygonDark:"var(--colors-polygon-dark)",polygonLight:"var(--colors-polygon-light)",text100:"var(--colors-text100)",text80:"var(--colors-text80)",text50:"var(--colors-text50)",textInverse100:"var(--colors-text-inverse100)",backgroundPrimary:"var(--colors-background-primary)",backgroundSecondary:"var(--colors-background-secondary)",backgroundContrast:"var(--colors-background-contrast)",backgroundMuted:"var(--colors-background-muted)",backgroundControl:"var(--colors-background-control)",backgroundInverse:"var(--colors-background-inverse)",backgroundBackdrop:"var(--colors-background-backdrop)",backgroundOverlay:"var(--colors-background-overlay)",backgroundRaised:"var(--colors-background-raised)",buttonGlass:"var(--colors-button-glass)",buttonEmphasis:"var(--colors-button-emphasis)",buttonInverse:"var(--colors-button-inverse)",borderNormal:"var(--colors-border-normal)",borderFocus:"var(--colors-border-focus)"}};function lre(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ure(t){var e=lre(t,"string");return typeof e=="symbol"?e:String(e)}function fre(t,e,r){return e=ure(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function J_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function x2(t){for(var e=1;efunction(){for(var e=arguments.length,r=new Array(e),n=0;nc.styles)),s=Object.keys(i),o=s.filter(c=>"mappings"in i[c]),a=c=>{var l=[],u={},f=x2({},c),d=!1;for(var h of o){var p=c[h];if(p!=null){var v=i[h];d=!0;for(var b of v.mappings)u[b]=p,f[b]==null&&delete f[b]}}var y=d?x2(x2({},u),f):c,m=function(){var T=y[g],w=i[g];try{if(w.mappings)return"continue";if(typeof T=="string"||typeof T=="number")l.push(w.values[T].defaultClass);else if(Array.isArray(T))for(var I=0;It,pre=function(){return dre(hre)(...arguments)},bN=pre({conditions:{defaultCondition:"sm",conditionNames:["sm","md","lg","xl"],responsiveArray:void 0},styles:{borderWidth:{mappings:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"]},borderRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderLeftRadius:{mappings:["borderBottomLeftRadius","borderTopLeftRadius"]},borderRightRadius:{mappings:["borderBottomRightRadius","borderTopRightRadius"]},borderTopRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius"]},borderBottomRadius:{mappings:["borderBottomLeftRadius","borderBottomRightRadius"]},margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},overflow:{mappings:["overflowX","overflowY"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},placeItems:{mappings:["justifyContent","alignItems"]},inset:{mappings:["top","bottom","left","right"]},width:{values:{0:{conditions:{sm:"fyvr10",md:"fyvr11",lg:"fyvr12",xl:"fyvr13"},defaultClass:"fyvr10"},1:{conditions:{sm:"fyvr14",md:"fyvr15",lg:"fyvr16",xl:"fyvr17"},defaultClass:"fyvr14"},2:{conditions:{sm:"fyvr18",md:"fyvr19",lg:"fyvr1a",xl:"fyvr1b"},defaultClass:"fyvr18"},3:{conditions:{sm:"fyvr1c",md:"fyvr1d",lg:"fyvr1e",xl:"fyvr1f"},defaultClass:"fyvr1c"},4:{conditions:{sm:"fyvr1g",md:"fyvr1h",lg:"fyvr1i",xl:"fyvr1j"},defaultClass:"fyvr1g"},5:{conditions:{sm:"fyvr1k",md:"fyvr1l",lg:"fyvr1m",xl:"fyvr1n"},defaultClass:"fyvr1k"},6:{conditions:{sm:"fyvr1o",md:"fyvr1p",lg:"fyvr1q",xl:"fyvr1r"},defaultClass:"fyvr1o"},7:{conditions:{sm:"fyvr1s",md:"fyvr1t",lg:"fyvr1u",xl:"fyvr1v"},defaultClass:"fyvr1s"},8:{conditions:{sm:"fyvr1w",md:"fyvr1x",lg:"fyvr1y",xl:"fyvr1z"},defaultClass:"fyvr1w"},9:{conditions:{sm:"fyvr110",md:"fyvr111",lg:"fyvr112",xl:"fyvr113"},defaultClass:"fyvr110"},10:{conditions:{sm:"fyvr114",md:"fyvr115",lg:"fyvr116",xl:"fyvr117"},defaultClass:"fyvr114"},12:{conditions:{sm:"fyvr118",md:"fyvr119",lg:"fyvr11a",xl:"fyvr11b"},defaultClass:"fyvr118"},14:{conditions:{sm:"fyvr11c",md:"fyvr11d",lg:"fyvr11e",xl:"fyvr11f"},defaultClass:"fyvr11c"},16:{conditions:{sm:"fyvr11g",md:"fyvr11h",lg:"fyvr11i",xl:"fyvr11j"},defaultClass:"fyvr11g"},"0.25":{conditions:{sm:"fyvr11k",md:"fyvr11l",lg:"fyvr11m",xl:"fyvr11n"},defaultClass:"fyvr11k"},"0.5":{conditions:{sm:"fyvr11o",md:"fyvr11p",lg:"fyvr11q",xl:"fyvr11r"},defaultClass:"fyvr11o"},"1.5":{conditions:{sm:"fyvr11s",md:"fyvr11t",lg:"fyvr11u",xl:"fyvr11v"},defaultClass:"fyvr11s"},none:{conditions:{sm:"fyvr11w",md:"fyvr11x",lg:"fyvr11y",xl:"fyvr11z"},defaultClass:"fyvr11w"},px:{conditions:{sm:"fyvr120",md:"fyvr121",lg:"fyvr122",xl:"fyvr123"},defaultClass:"fyvr120"},auto:{conditions:{sm:"fyvr124",md:"fyvr125",lg:"fyvr126",xl:"fyvr127"},defaultClass:"fyvr124"},full:{conditions:{sm:"fyvr128",md:"fyvr129",lg:"fyvr12a",xl:"fyvr12b"},defaultClass:"fyvr128"},"1/2":{conditions:{sm:"fyvr12c",md:"fyvr12d",lg:"fyvr12e",xl:"fyvr12f"},defaultClass:"fyvr12c"},"1/3":{conditions:{sm:"fyvr12g",md:"fyvr12h",lg:"fyvr12i",xl:"fyvr12j"},defaultClass:"fyvr12g"},"2/3":{conditions:{sm:"fyvr12k",md:"fyvr12l",lg:"fyvr12m",xl:"fyvr12n"},defaultClass:"fyvr12k"},"1/4":{conditions:{sm:"fyvr12o",md:"fyvr12p",lg:"fyvr12q",xl:"fyvr12r"},defaultClass:"fyvr12o"},"3/4":{conditions:{sm:"fyvr12s",md:"fyvr12t",lg:"fyvr12u",xl:"fyvr12v"},defaultClass:"fyvr12s"},fit:{conditions:{sm:"fyvr12w",md:"fyvr12x",lg:"fyvr12y",xl:"fyvr12z"},defaultClass:"fyvr12w"},max:{conditions:{sm:"fyvr130",md:"fyvr131",lg:"fyvr132",xl:"fyvr133"},defaultClass:"fyvr130"},min:{conditions:{sm:"fyvr134",md:"fyvr135",lg:"fyvr136",xl:"fyvr137"},defaultClass:"fyvr134"},vw:{conditions:{sm:"fyvr138",md:"fyvr139",lg:"fyvr13a",xl:"fyvr13b"},defaultClass:"fyvr138"},vh:{conditions:{sm:"fyvr13c",md:"fyvr13d",lg:"fyvr13e",xl:"fyvr13f"},defaultClass:"fyvr13c"}}},height:{values:{0:{conditions:{sm:"fyvr13g",md:"fyvr13h",lg:"fyvr13i",xl:"fyvr13j"},defaultClass:"fyvr13g"},1:{conditions:{sm:"fyvr13k",md:"fyvr13l",lg:"fyvr13m",xl:"fyvr13n"},defaultClass:"fyvr13k"},2:{conditions:{sm:"fyvr13o",md:"fyvr13p",lg:"fyvr13q",xl:"fyvr13r"},defaultClass:"fyvr13o"},3:{conditions:{sm:"fyvr13s",md:"fyvr13t",lg:"fyvr13u",xl:"fyvr13v"},defaultClass:"fyvr13s"},4:{conditions:{sm:"fyvr13w",md:"fyvr13x",lg:"fyvr13y",xl:"fyvr13z"},defaultClass:"fyvr13w"},5:{conditions:{sm:"fyvr140",md:"fyvr141",lg:"fyvr142",xl:"fyvr143"},defaultClass:"fyvr140"},6:{conditions:{sm:"fyvr144",md:"fyvr145",lg:"fyvr146",xl:"fyvr147"},defaultClass:"fyvr144"},7:{conditions:{sm:"fyvr148",md:"fyvr149",lg:"fyvr14a",xl:"fyvr14b"},defaultClass:"fyvr148"},8:{conditions:{sm:"fyvr14c",md:"fyvr14d",lg:"fyvr14e",xl:"fyvr14f"},defaultClass:"fyvr14c"},9:{conditions:{sm:"fyvr14g",md:"fyvr14h",lg:"fyvr14i",xl:"fyvr14j"},defaultClass:"fyvr14g"},10:{conditions:{sm:"fyvr14k",md:"fyvr14l",lg:"fyvr14m",xl:"fyvr14n"},defaultClass:"fyvr14k"},12:{conditions:{sm:"fyvr14o",md:"fyvr14p",lg:"fyvr14q",xl:"fyvr14r"},defaultClass:"fyvr14o"},14:{conditions:{sm:"fyvr14s",md:"fyvr14t",lg:"fyvr14u",xl:"fyvr14v"},defaultClass:"fyvr14s"},16:{conditions:{sm:"fyvr14w",md:"fyvr14x",lg:"fyvr14y",xl:"fyvr14z"},defaultClass:"fyvr14w"},"0.25":{conditions:{sm:"fyvr150",md:"fyvr151",lg:"fyvr152",xl:"fyvr153"},defaultClass:"fyvr150"},"0.5":{conditions:{sm:"fyvr154",md:"fyvr155",lg:"fyvr156",xl:"fyvr157"},defaultClass:"fyvr154"},"1.5":{conditions:{sm:"fyvr158",md:"fyvr159",lg:"fyvr15a",xl:"fyvr15b"},defaultClass:"fyvr158"},none:{conditions:{sm:"fyvr15c",md:"fyvr15d",lg:"fyvr15e",xl:"fyvr15f"},defaultClass:"fyvr15c"},px:{conditions:{sm:"fyvr15g",md:"fyvr15h",lg:"fyvr15i",xl:"fyvr15j"},defaultClass:"fyvr15g"},auto:{conditions:{sm:"fyvr15k",md:"fyvr15l",lg:"fyvr15m",xl:"fyvr15n"},defaultClass:"fyvr15k"},full:{conditions:{sm:"fyvr15o",md:"fyvr15p",lg:"fyvr15q",xl:"fyvr15r"},defaultClass:"fyvr15o"},"1/2":{conditions:{sm:"fyvr15s",md:"fyvr15t",lg:"fyvr15u",xl:"fyvr15v"},defaultClass:"fyvr15s"},"1/3":{conditions:{sm:"fyvr15w",md:"fyvr15x",lg:"fyvr15y",xl:"fyvr15z"},defaultClass:"fyvr15w"},"2/3":{conditions:{sm:"fyvr160",md:"fyvr161",lg:"fyvr162",xl:"fyvr163"},defaultClass:"fyvr160"},"1/4":{conditions:{sm:"fyvr164",md:"fyvr165",lg:"fyvr166",xl:"fyvr167"},defaultClass:"fyvr164"},"3/4":{conditions:{sm:"fyvr168",md:"fyvr169",lg:"fyvr16a",xl:"fyvr16b"},defaultClass:"fyvr168"},fit:{conditions:{sm:"fyvr16c",md:"fyvr16d",lg:"fyvr16e",xl:"fyvr16f"},defaultClass:"fyvr16c"},max:{conditions:{sm:"fyvr16g",md:"fyvr16h",lg:"fyvr16i",xl:"fyvr16j"},defaultClass:"fyvr16g"},min:{conditions:{sm:"fyvr16k",md:"fyvr16l",lg:"fyvr16m",xl:"fyvr16n"},defaultClass:"fyvr16k"},vw:{conditions:{sm:"fyvr16o",md:"fyvr16p",lg:"fyvr16q",xl:"fyvr16r"},defaultClass:"fyvr16o"},vh:{conditions:{sm:"fyvr16s",md:"fyvr16t",lg:"fyvr16u",xl:"fyvr16v"},defaultClass:"fyvr16s"}}},maxWidth:{values:{0:{conditions:{sm:"fyvr16w",md:"fyvr16x",lg:"fyvr16y",xl:"fyvr16z"},defaultClass:"fyvr16w"},1:{conditions:{sm:"fyvr170",md:"fyvr171",lg:"fyvr172",xl:"fyvr173"},defaultClass:"fyvr170"},2:{conditions:{sm:"fyvr174",md:"fyvr175",lg:"fyvr176",xl:"fyvr177"},defaultClass:"fyvr174"},3:{conditions:{sm:"fyvr178",md:"fyvr179",lg:"fyvr17a",xl:"fyvr17b"},defaultClass:"fyvr178"},4:{conditions:{sm:"fyvr17c",md:"fyvr17d",lg:"fyvr17e",xl:"fyvr17f"},defaultClass:"fyvr17c"},5:{conditions:{sm:"fyvr17g",md:"fyvr17h",lg:"fyvr17i",xl:"fyvr17j"},defaultClass:"fyvr17g"},6:{conditions:{sm:"fyvr17k",md:"fyvr17l",lg:"fyvr17m",xl:"fyvr17n"},defaultClass:"fyvr17k"},7:{conditions:{sm:"fyvr17o",md:"fyvr17p",lg:"fyvr17q",xl:"fyvr17r"},defaultClass:"fyvr17o"},8:{conditions:{sm:"fyvr17s",md:"fyvr17t",lg:"fyvr17u",xl:"fyvr17v"},defaultClass:"fyvr17s"},9:{conditions:{sm:"fyvr17w",md:"fyvr17x",lg:"fyvr17y",xl:"fyvr17z"},defaultClass:"fyvr17w"},10:{conditions:{sm:"fyvr180",md:"fyvr181",lg:"fyvr182",xl:"fyvr183"},defaultClass:"fyvr180"},12:{conditions:{sm:"fyvr184",md:"fyvr185",lg:"fyvr186",xl:"fyvr187"},defaultClass:"fyvr184"},14:{conditions:{sm:"fyvr188",md:"fyvr189",lg:"fyvr18a",xl:"fyvr18b"},defaultClass:"fyvr188"},16:{conditions:{sm:"fyvr18c",md:"fyvr18d",lg:"fyvr18e",xl:"fyvr18f"},defaultClass:"fyvr18c"},"0.25":{conditions:{sm:"fyvr18g",md:"fyvr18h",lg:"fyvr18i",xl:"fyvr18j"},defaultClass:"fyvr18g"},"0.5":{conditions:{sm:"fyvr18k",md:"fyvr18l",lg:"fyvr18m",xl:"fyvr18n"},defaultClass:"fyvr18k"},"1.5":{conditions:{sm:"fyvr18o",md:"fyvr18p",lg:"fyvr18q",xl:"fyvr18r"},defaultClass:"fyvr18o"},none:{conditions:{sm:"fyvr18s",md:"fyvr18t",lg:"fyvr18u",xl:"fyvr18v"},defaultClass:"fyvr18s"},px:{conditions:{sm:"fyvr18w",md:"fyvr18x",lg:"fyvr18y",xl:"fyvr18z"},defaultClass:"fyvr18w"},auto:{conditions:{sm:"fyvr190",md:"fyvr191",lg:"fyvr192",xl:"fyvr193"},defaultClass:"fyvr190"},full:{conditions:{sm:"fyvr194",md:"fyvr195",lg:"fyvr196",xl:"fyvr197"},defaultClass:"fyvr194"},"1/2":{conditions:{sm:"fyvr198",md:"fyvr199",lg:"fyvr19a",xl:"fyvr19b"},defaultClass:"fyvr198"},"1/3":{conditions:{sm:"fyvr19c",md:"fyvr19d",lg:"fyvr19e",xl:"fyvr19f"},defaultClass:"fyvr19c"},"2/3":{conditions:{sm:"fyvr19g",md:"fyvr19h",lg:"fyvr19i",xl:"fyvr19j"},defaultClass:"fyvr19g"},"1/4":{conditions:{sm:"fyvr19k",md:"fyvr19l",lg:"fyvr19m",xl:"fyvr19n"},defaultClass:"fyvr19k"},"3/4":{conditions:{sm:"fyvr19o",md:"fyvr19p",lg:"fyvr19q",xl:"fyvr19r"},defaultClass:"fyvr19o"},fit:{conditions:{sm:"fyvr19s",md:"fyvr19t",lg:"fyvr19u",xl:"fyvr19v"},defaultClass:"fyvr19s"},max:{conditions:{sm:"fyvr19w",md:"fyvr19x",lg:"fyvr19y",xl:"fyvr19z"},defaultClass:"fyvr19w"},min:{conditions:{sm:"fyvr1a0",md:"fyvr1a1",lg:"fyvr1a2",xl:"fyvr1a3"},defaultClass:"fyvr1a0"},vw:{conditions:{sm:"fyvr1a4",md:"fyvr1a5",lg:"fyvr1a6",xl:"fyvr1a7"},defaultClass:"fyvr1a4"},vh:{conditions:{sm:"fyvr1a8",md:"fyvr1a9",lg:"fyvr1aa",xl:"fyvr1ab"},defaultClass:"fyvr1a8"}}},maxHeight:{values:{0:{conditions:{sm:"fyvr1ac",md:"fyvr1ad",lg:"fyvr1ae",xl:"fyvr1af"},defaultClass:"fyvr1ac"},1:{conditions:{sm:"fyvr1ag",md:"fyvr1ah",lg:"fyvr1ai",xl:"fyvr1aj"},defaultClass:"fyvr1ag"},2:{conditions:{sm:"fyvr1ak",md:"fyvr1al",lg:"fyvr1am",xl:"fyvr1an"},defaultClass:"fyvr1ak"},3:{conditions:{sm:"fyvr1ao",md:"fyvr1ap",lg:"fyvr1aq",xl:"fyvr1ar"},defaultClass:"fyvr1ao"},4:{conditions:{sm:"fyvr1as",md:"fyvr1at",lg:"fyvr1au",xl:"fyvr1av"},defaultClass:"fyvr1as"},5:{conditions:{sm:"fyvr1aw",md:"fyvr1ax",lg:"fyvr1ay",xl:"fyvr1az"},defaultClass:"fyvr1aw"},6:{conditions:{sm:"fyvr1b0",md:"fyvr1b1",lg:"fyvr1b2",xl:"fyvr1b3"},defaultClass:"fyvr1b0"},7:{conditions:{sm:"fyvr1b4",md:"fyvr1b5",lg:"fyvr1b6",xl:"fyvr1b7"},defaultClass:"fyvr1b4"},8:{conditions:{sm:"fyvr1b8",md:"fyvr1b9",lg:"fyvr1ba",xl:"fyvr1bb"},defaultClass:"fyvr1b8"},9:{conditions:{sm:"fyvr1bc",md:"fyvr1bd",lg:"fyvr1be",xl:"fyvr1bf"},defaultClass:"fyvr1bc"},10:{conditions:{sm:"fyvr1bg",md:"fyvr1bh",lg:"fyvr1bi",xl:"fyvr1bj"},defaultClass:"fyvr1bg"},12:{conditions:{sm:"fyvr1bk",md:"fyvr1bl",lg:"fyvr1bm",xl:"fyvr1bn"},defaultClass:"fyvr1bk"},14:{conditions:{sm:"fyvr1bo",md:"fyvr1bp",lg:"fyvr1bq",xl:"fyvr1br"},defaultClass:"fyvr1bo"},16:{conditions:{sm:"fyvr1bs",md:"fyvr1bt",lg:"fyvr1bu",xl:"fyvr1bv"},defaultClass:"fyvr1bs"},"0.25":{conditions:{sm:"fyvr1bw",md:"fyvr1bx",lg:"fyvr1by",xl:"fyvr1bz"},defaultClass:"fyvr1bw"},"0.5":{conditions:{sm:"fyvr1c0",md:"fyvr1c1",lg:"fyvr1c2",xl:"fyvr1c3"},defaultClass:"fyvr1c0"},"1.5":{conditions:{sm:"fyvr1c4",md:"fyvr1c5",lg:"fyvr1c6",xl:"fyvr1c7"},defaultClass:"fyvr1c4"},none:{conditions:{sm:"fyvr1c8",md:"fyvr1c9",lg:"fyvr1ca",xl:"fyvr1cb"},defaultClass:"fyvr1c8"},px:{conditions:{sm:"fyvr1cc",md:"fyvr1cd",lg:"fyvr1ce",xl:"fyvr1cf"},defaultClass:"fyvr1cc"},auto:{conditions:{sm:"fyvr1cg",md:"fyvr1ch",lg:"fyvr1ci",xl:"fyvr1cj"},defaultClass:"fyvr1cg"},full:{conditions:{sm:"fyvr1ck",md:"fyvr1cl",lg:"fyvr1cm",xl:"fyvr1cn"},defaultClass:"fyvr1ck"},"1/2":{conditions:{sm:"fyvr1co",md:"fyvr1cp",lg:"fyvr1cq",xl:"fyvr1cr"},defaultClass:"fyvr1co"},"1/3":{conditions:{sm:"fyvr1cs",md:"fyvr1ct",lg:"fyvr1cu",xl:"fyvr1cv"},defaultClass:"fyvr1cs"},"2/3":{conditions:{sm:"fyvr1cw",md:"fyvr1cx",lg:"fyvr1cy",xl:"fyvr1cz"},defaultClass:"fyvr1cw"},"1/4":{conditions:{sm:"fyvr1d0",md:"fyvr1d1",lg:"fyvr1d2",xl:"fyvr1d3"},defaultClass:"fyvr1d0"},"3/4":{conditions:{sm:"fyvr1d4",md:"fyvr1d5",lg:"fyvr1d6",xl:"fyvr1d7"},defaultClass:"fyvr1d4"},fit:{conditions:{sm:"fyvr1d8",md:"fyvr1d9",lg:"fyvr1da",xl:"fyvr1db"},defaultClass:"fyvr1d8"},max:{conditions:{sm:"fyvr1dc",md:"fyvr1dd",lg:"fyvr1de",xl:"fyvr1df"},defaultClass:"fyvr1dc"},min:{conditions:{sm:"fyvr1dg",md:"fyvr1dh",lg:"fyvr1di",xl:"fyvr1dj"},defaultClass:"fyvr1dg"},vw:{conditions:{sm:"fyvr1dk",md:"fyvr1dl",lg:"fyvr1dm",xl:"fyvr1dn"},defaultClass:"fyvr1dk"},vh:{conditions:{sm:"fyvr1do",md:"fyvr1dp",lg:"fyvr1dq",xl:"fyvr1dr"},defaultClass:"fyvr1do"}}},minWidth:{values:{0:{conditions:{sm:"fyvr1ds",md:"fyvr1dt",lg:"fyvr1du",xl:"fyvr1dv"},defaultClass:"fyvr1ds"},1:{conditions:{sm:"fyvr1dw",md:"fyvr1dx",lg:"fyvr1dy",xl:"fyvr1dz"},defaultClass:"fyvr1dw"},2:{conditions:{sm:"fyvr1e0",md:"fyvr1e1",lg:"fyvr1e2",xl:"fyvr1e3"},defaultClass:"fyvr1e0"},3:{conditions:{sm:"fyvr1e4",md:"fyvr1e5",lg:"fyvr1e6",xl:"fyvr1e7"},defaultClass:"fyvr1e4"},4:{conditions:{sm:"fyvr1e8",md:"fyvr1e9",lg:"fyvr1ea",xl:"fyvr1eb"},defaultClass:"fyvr1e8"},5:{conditions:{sm:"fyvr1ec",md:"fyvr1ed",lg:"fyvr1ee",xl:"fyvr1ef"},defaultClass:"fyvr1ec"},6:{conditions:{sm:"fyvr1eg",md:"fyvr1eh",lg:"fyvr1ei",xl:"fyvr1ej"},defaultClass:"fyvr1eg"},7:{conditions:{sm:"fyvr1ek",md:"fyvr1el",lg:"fyvr1em",xl:"fyvr1en"},defaultClass:"fyvr1ek"},8:{conditions:{sm:"fyvr1eo",md:"fyvr1ep",lg:"fyvr1eq",xl:"fyvr1er"},defaultClass:"fyvr1eo"},9:{conditions:{sm:"fyvr1es",md:"fyvr1et",lg:"fyvr1eu",xl:"fyvr1ev"},defaultClass:"fyvr1es"},10:{conditions:{sm:"fyvr1ew",md:"fyvr1ex",lg:"fyvr1ey",xl:"fyvr1ez"},defaultClass:"fyvr1ew"},12:{conditions:{sm:"fyvr1f0",md:"fyvr1f1",lg:"fyvr1f2",xl:"fyvr1f3"},defaultClass:"fyvr1f0"},14:{conditions:{sm:"fyvr1f4",md:"fyvr1f5",lg:"fyvr1f6",xl:"fyvr1f7"},defaultClass:"fyvr1f4"},16:{conditions:{sm:"fyvr1f8",md:"fyvr1f9",lg:"fyvr1fa",xl:"fyvr1fb"},defaultClass:"fyvr1f8"},"0.25":{conditions:{sm:"fyvr1fc",md:"fyvr1fd",lg:"fyvr1fe",xl:"fyvr1ff"},defaultClass:"fyvr1fc"},"0.5":{conditions:{sm:"fyvr1fg",md:"fyvr1fh",lg:"fyvr1fi",xl:"fyvr1fj"},defaultClass:"fyvr1fg"},"1.5":{conditions:{sm:"fyvr1fk",md:"fyvr1fl",lg:"fyvr1fm",xl:"fyvr1fn"},defaultClass:"fyvr1fk"},none:{conditions:{sm:"fyvr1fo",md:"fyvr1fp",lg:"fyvr1fq",xl:"fyvr1fr"},defaultClass:"fyvr1fo"},px:{conditions:{sm:"fyvr1fs",md:"fyvr1ft",lg:"fyvr1fu",xl:"fyvr1fv"},defaultClass:"fyvr1fs"},auto:{conditions:{sm:"fyvr1fw",md:"fyvr1fx",lg:"fyvr1fy",xl:"fyvr1fz"},defaultClass:"fyvr1fw"},full:{conditions:{sm:"fyvr1g0",md:"fyvr1g1",lg:"fyvr1g2",xl:"fyvr1g3"},defaultClass:"fyvr1g0"},"1/2":{conditions:{sm:"fyvr1g4",md:"fyvr1g5",lg:"fyvr1g6",xl:"fyvr1g7"},defaultClass:"fyvr1g4"},"1/3":{conditions:{sm:"fyvr1g8",md:"fyvr1g9",lg:"fyvr1ga",xl:"fyvr1gb"},defaultClass:"fyvr1g8"},"2/3":{conditions:{sm:"fyvr1gc",md:"fyvr1gd",lg:"fyvr1ge",xl:"fyvr1gf"},defaultClass:"fyvr1gc"},"1/4":{conditions:{sm:"fyvr1gg",md:"fyvr1gh",lg:"fyvr1gi",xl:"fyvr1gj"},defaultClass:"fyvr1gg"},"3/4":{conditions:{sm:"fyvr1gk",md:"fyvr1gl",lg:"fyvr1gm",xl:"fyvr1gn"},defaultClass:"fyvr1gk"},fit:{conditions:{sm:"fyvr1go",md:"fyvr1gp",lg:"fyvr1gq",xl:"fyvr1gr"},defaultClass:"fyvr1go"},max:{conditions:{sm:"fyvr1gs",md:"fyvr1gt",lg:"fyvr1gu",xl:"fyvr1gv"},defaultClass:"fyvr1gs"},min:{conditions:{sm:"fyvr1gw",md:"fyvr1gx",lg:"fyvr1gy",xl:"fyvr1gz"},defaultClass:"fyvr1gw"},vw:{conditions:{sm:"fyvr1h0",md:"fyvr1h1",lg:"fyvr1h2",xl:"fyvr1h3"},defaultClass:"fyvr1h0"},vh:{conditions:{sm:"fyvr1h4",md:"fyvr1h5",lg:"fyvr1h6",xl:"fyvr1h7"},defaultClass:"fyvr1h4"}}},minHeight:{values:{0:{conditions:{sm:"fyvr1h8",md:"fyvr1h9",lg:"fyvr1ha",xl:"fyvr1hb"},defaultClass:"fyvr1h8"},1:{conditions:{sm:"fyvr1hc",md:"fyvr1hd",lg:"fyvr1he",xl:"fyvr1hf"},defaultClass:"fyvr1hc"},2:{conditions:{sm:"fyvr1hg",md:"fyvr1hh",lg:"fyvr1hi",xl:"fyvr1hj"},defaultClass:"fyvr1hg"},3:{conditions:{sm:"fyvr1hk",md:"fyvr1hl",lg:"fyvr1hm",xl:"fyvr1hn"},defaultClass:"fyvr1hk"},4:{conditions:{sm:"fyvr1ho",md:"fyvr1hp",lg:"fyvr1hq",xl:"fyvr1hr"},defaultClass:"fyvr1ho"},5:{conditions:{sm:"fyvr1hs",md:"fyvr1ht",lg:"fyvr1hu",xl:"fyvr1hv"},defaultClass:"fyvr1hs"},6:{conditions:{sm:"fyvr1hw",md:"fyvr1hx",lg:"fyvr1hy",xl:"fyvr1hz"},defaultClass:"fyvr1hw"},7:{conditions:{sm:"fyvr1i0",md:"fyvr1i1",lg:"fyvr1i2",xl:"fyvr1i3"},defaultClass:"fyvr1i0"},8:{conditions:{sm:"fyvr1i4",md:"fyvr1i5",lg:"fyvr1i6",xl:"fyvr1i7"},defaultClass:"fyvr1i4"},9:{conditions:{sm:"fyvr1i8",md:"fyvr1i9",lg:"fyvr1ia",xl:"fyvr1ib"},defaultClass:"fyvr1i8"},10:{conditions:{sm:"fyvr1ic",md:"fyvr1id",lg:"fyvr1ie",xl:"fyvr1if"},defaultClass:"fyvr1ic"},12:{conditions:{sm:"fyvr1ig",md:"fyvr1ih",lg:"fyvr1ii",xl:"fyvr1ij"},defaultClass:"fyvr1ig"},14:{conditions:{sm:"fyvr1ik",md:"fyvr1il",lg:"fyvr1im",xl:"fyvr1in"},defaultClass:"fyvr1ik"},16:{conditions:{sm:"fyvr1io",md:"fyvr1ip",lg:"fyvr1iq",xl:"fyvr1ir"},defaultClass:"fyvr1io"},"0.25":{conditions:{sm:"fyvr1is",md:"fyvr1it",lg:"fyvr1iu",xl:"fyvr1iv"},defaultClass:"fyvr1is"},"0.5":{conditions:{sm:"fyvr1iw",md:"fyvr1ix",lg:"fyvr1iy",xl:"fyvr1iz"},defaultClass:"fyvr1iw"},"1.5":{conditions:{sm:"fyvr1j0",md:"fyvr1j1",lg:"fyvr1j2",xl:"fyvr1j3"},defaultClass:"fyvr1j0"},none:{conditions:{sm:"fyvr1j4",md:"fyvr1j5",lg:"fyvr1j6",xl:"fyvr1j7"},defaultClass:"fyvr1j4"},px:{conditions:{sm:"fyvr1j8",md:"fyvr1j9",lg:"fyvr1ja",xl:"fyvr1jb"},defaultClass:"fyvr1j8"},auto:{conditions:{sm:"fyvr1jc",md:"fyvr1jd",lg:"fyvr1je",xl:"fyvr1jf"},defaultClass:"fyvr1jc"},full:{conditions:{sm:"fyvr1jg",md:"fyvr1jh",lg:"fyvr1ji",xl:"fyvr1jj"},defaultClass:"fyvr1jg"},"1/2":{conditions:{sm:"fyvr1jk",md:"fyvr1jl",lg:"fyvr1jm",xl:"fyvr1jn"},defaultClass:"fyvr1jk"},"1/3":{conditions:{sm:"fyvr1jo",md:"fyvr1jp",lg:"fyvr1jq",xl:"fyvr1jr"},defaultClass:"fyvr1jo"},"2/3":{conditions:{sm:"fyvr1js",md:"fyvr1jt",lg:"fyvr1ju",xl:"fyvr1jv"},defaultClass:"fyvr1js"},"1/4":{conditions:{sm:"fyvr1jw",md:"fyvr1jx",lg:"fyvr1jy",xl:"fyvr1jz"},defaultClass:"fyvr1jw"},"3/4":{conditions:{sm:"fyvr1k0",md:"fyvr1k1",lg:"fyvr1k2",xl:"fyvr1k3"},defaultClass:"fyvr1k0"},fit:{conditions:{sm:"fyvr1k4",md:"fyvr1k5",lg:"fyvr1k6",xl:"fyvr1k7"},defaultClass:"fyvr1k4"},max:{conditions:{sm:"fyvr1k8",md:"fyvr1k9",lg:"fyvr1ka",xl:"fyvr1kb"},defaultClass:"fyvr1k8"},min:{conditions:{sm:"fyvr1kc",md:"fyvr1kd",lg:"fyvr1ke",xl:"fyvr1kf"},defaultClass:"fyvr1kc"},vw:{conditions:{sm:"fyvr1kg",md:"fyvr1kh",lg:"fyvr1ki",xl:"fyvr1kj"},defaultClass:"fyvr1kg"},vh:{conditions:{sm:"fyvr1kk",md:"fyvr1kl",lg:"fyvr1km",xl:"fyvr1kn"},defaultClass:"fyvr1kk"}}},top:{values:{0:{conditions:{sm:"fyvr1ko",md:"fyvr1kp",lg:"fyvr1kq",xl:"fyvr1kr"},defaultClass:"fyvr1ko"},1:{conditions:{sm:"fyvr1ks",md:"fyvr1kt",lg:"fyvr1ku",xl:"fyvr1kv"},defaultClass:"fyvr1ks"},2:{conditions:{sm:"fyvr1kw",md:"fyvr1kx",lg:"fyvr1ky",xl:"fyvr1kz"},defaultClass:"fyvr1kw"},3:{conditions:{sm:"fyvr1l0",md:"fyvr1l1",lg:"fyvr1l2",xl:"fyvr1l3"},defaultClass:"fyvr1l0"},4:{conditions:{sm:"fyvr1l4",md:"fyvr1l5",lg:"fyvr1l6",xl:"fyvr1l7"},defaultClass:"fyvr1l4"},5:{conditions:{sm:"fyvr1l8",md:"fyvr1l9",lg:"fyvr1la",xl:"fyvr1lb"},defaultClass:"fyvr1l8"},6:{conditions:{sm:"fyvr1lc",md:"fyvr1ld",lg:"fyvr1le",xl:"fyvr1lf"},defaultClass:"fyvr1lc"},7:{conditions:{sm:"fyvr1lg",md:"fyvr1lh",lg:"fyvr1li",xl:"fyvr1lj"},defaultClass:"fyvr1lg"},8:{conditions:{sm:"fyvr1lk",md:"fyvr1ll",lg:"fyvr1lm",xl:"fyvr1ln"},defaultClass:"fyvr1lk"},9:{conditions:{sm:"fyvr1lo",md:"fyvr1lp",lg:"fyvr1lq",xl:"fyvr1lr"},defaultClass:"fyvr1lo"},10:{conditions:{sm:"fyvr1ls",md:"fyvr1lt",lg:"fyvr1lu",xl:"fyvr1lv"},defaultClass:"fyvr1ls"},12:{conditions:{sm:"fyvr1lw",md:"fyvr1lx",lg:"fyvr1ly",xl:"fyvr1lz"},defaultClass:"fyvr1lw"},14:{conditions:{sm:"fyvr1m0",md:"fyvr1m1",lg:"fyvr1m2",xl:"fyvr1m3"},defaultClass:"fyvr1m0"},16:{conditions:{sm:"fyvr1m4",md:"fyvr1m5",lg:"fyvr1m6",xl:"fyvr1m7"},defaultClass:"fyvr1m4"},"0.25":{conditions:{sm:"fyvr1m8",md:"fyvr1m9",lg:"fyvr1ma",xl:"fyvr1mb"},defaultClass:"fyvr1m8"},"0.5":{conditions:{sm:"fyvr1mc",md:"fyvr1md",lg:"fyvr1me",xl:"fyvr1mf"},defaultClass:"fyvr1mc"},"1.5":{conditions:{sm:"fyvr1mg",md:"fyvr1mh",lg:"fyvr1mi",xl:"fyvr1mj"},defaultClass:"fyvr1mg"},auto:{conditions:{sm:"fyvr1mk",md:"fyvr1ml",lg:"fyvr1mm",xl:"fyvr1mn"},defaultClass:"fyvr1mk"}}},bottom:{values:{0:{conditions:{sm:"fyvr1mo",md:"fyvr1mp",lg:"fyvr1mq",xl:"fyvr1mr"},defaultClass:"fyvr1mo"},1:{conditions:{sm:"fyvr1ms",md:"fyvr1mt",lg:"fyvr1mu",xl:"fyvr1mv"},defaultClass:"fyvr1ms"},2:{conditions:{sm:"fyvr1mw",md:"fyvr1mx",lg:"fyvr1my",xl:"fyvr1mz"},defaultClass:"fyvr1mw"},3:{conditions:{sm:"fyvr1n0",md:"fyvr1n1",lg:"fyvr1n2",xl:"fyvr1n3"},defaultClass:"fyvr1n0"},4:{conditions:{sm:"fyvr1n4",md:"fyvr1n5",lg:"fyvr1n6",xl:"fyvr1n7"},defaultClass:"fyvr1n4"},5:{conditions:{sm:"fyvr1n8",md:"fyvr1n9",lg:"fyvr1na",xl:"fyvr1nb"},defaultClass:"fyvr1n8"},6:{conditions:{sm:"fyvr1nc",md:"fyvr1nd",lg:"fyvr1ne",xl:"fyvr1nf"},defaultClass:"fyvr1nc"},7:{conditions:{sm:"fyvr1ng",md:"fyvr1nh",lg:"fyvr1ni",xl:"fyvr1nj"},defaultClass:"fyvr1ng"},8:{conditions:{sm:"fyvr1nk",md:"fyvr1nl",lg:"fyvr1nm",xl:"fyvr1nn"},defaultClass:"fyvr1nk"},9:{conditions:{sm:"fyvr1no",md:"fyvr1np",lg:"fyvr1nq",xl:"fyvr1nr"},defaultClass:"fyvr1no"},10:{conditions:{sm:"fyvr1ns",md:"fyvr1nt",lg:"fyvr1nu",xl:"fyvr1nv"},defaultClass:"fyvr1ns"},12:{conditions:{sm:"fyvr1nw",md:"fyvr1nx",lg:"fyvr1ny",xl:"fyvr1nz"},defaultClass:"fyvr1nw"},14:{conditions:{sm:"fyvr1o0",md:"fyvr1o1",lg:"fyvr1o2",xl:"fyvr1o3"},defaultClass:"fyvr1o0"},16:{conditions:{sm:"fyvr1o4",md:"fyvr1o5",lg:"fyvr1o6",xl:"fyvr1o7"},defaultClass:"fyvr1o4"},"0.25":{conditions:{sm:"fyvr1o8",md:"fyvr1o9",lg:"fyvr1oa",xl:"fyvr1ob"},defaultClass:"fyvr1o8"},"0.5":{conditions:{sm:"fyvr1oc",md:"fyvr1od",lg:"fyvr1oe",xl:"fyvr1of"},defaultClass:"fyvr1oc"},"1.5":{conditions:{sm:"fyvr1og",md:"fyvr1oh",lg:"fyvr1oi",xl:"fyvr1oj"},defaultClass:"fyvr1og"},auto:{conditions:{sm:"fyvr1ok",md:"fyvr1ol",lg:"fyvr1om",xl:"fyvr1on"},defaultClass:"fyvr1ok"}}},left:{values:{0:{conditions:{sm:"fyvr1oo",md:"fyvr1op",lg:"fyvr1oq",xl:"fyvr1or"},defaultClass:"fyvr1oo"},1:{conditions:{sm:"fyvr1os",md:"fyvr1ot",lg:"fyvr1ou",xl:"fyvr1ov"},defaultClass:"fyvr1os"},2:{conditions:{sm:"fyvr1ow",md:"fyvr1ox",lg:"fyvr1oy",xl:"fyvr1oz"},defaultClass:"fyvr1ow"},3:{conditions:{sm:"fyvr1p0",md:"fyvr1p1",lg:"fyvr1p2",xl:"fyvr1p3"},defaultClass:"fyvr1p0"},4:{conditions:{sm:"fyvr1p4",md:"fyvr1p5",lg:"fyvr1p6",xl:"fyvr1p7"},defaultClass:"fyvr1p4"},5:{conditions:{sm:"fyvr1p8",md:"fyvr1p9",lg:"fyvr1pa",xl:"fyvr1pb"},defaultClass:"fyvr1p8"},6:{conditions:{sm:"fyvr1pc",md:"fyvr1pd",lg:"fyvr1pe",xl:"fyvr1pf"},defaultClass:"fyvr1pc"},7:{conditions:{sm:"fyvr1pg",md:"fyvr1ph",lg:"fyvr1pi",xl:"fyvr1pj"},defaultClass:"fyvr1pg"},8:{conditions:{sm:"fyvr1pk",md:"fyvr1pl",lg:"fyvr1pm",xl:"fyvr1pn"},defaultClass:"fyvr1pk"},9:{conditions:{sm:"fyvr1po",md:"fyvr1pp",lg:"fyvr1pq",xl:"fyvr1pr"},defaultClass:"fyvr1po"},10:{conditions:{sm:"fyvr1ps",md:"fyvr1pt",lg:"fyvr1pu",xl:"fyvr1pv"},defaultClass:"fyvr1ps"},12:{conditions:{sm:"fyvr1pw",md:"fyvr1px",lg:"fyvr1py",xl:"fyvr1pz"},defaultClass:"fyvr1pw"},14:{conditions:{sm:"fyvr1q0",md:"fyvr1q1",lg:"fyvr1q2",xl:"fyvr1q3"},defaultClass:"fyvr1q0"},16:{conditions:{sm:"fyvr1q4",md:"fyvr1q5",lg:"fyvr1q6",xl:"fyvr1q7"},defaultClass:"fyvr1q4"},"0.25":{conditions:{sm:"fyvr1q8",md:"fyvr1q9",lg:"fyvr1qa",xl:"fyvr1qb"},defaultClass:"fyvr1q8"},"0.5":{conditions:{sm:"fyvr1qc",md:"fyvr1qd",lg:"fyvr1qe",xl:"fyvr1qf"},defaultClass:"fyvr1qc"},"1.5":{conditions:{sm:"fyvr1qg",md:"fyvr1qh",lg:"fyvr1qi",xl:"fyvr1qj"},defaultClass:"fyvr1qg"},auto:{conditions:{sm:"fyvr1qk",md:"fyvr1ql",lg:"fyvr1qm",xl:"fyvr1qn"},defaultClass:"fyvr1qk"}}},right:{values:{0:{conditions:{sm:"fyvr1qo",md:"fyvr1qp",lg:"fyvr1qq",xl:"fyvr1qr"},defaultClass:"fyvr1qo"},1:{conditions:{sm:"fyvr1qs",md:"fyvr1qt",lg:"fyvr1qu",xl:"fyvr1qv"},defaultClass:"fyvr1qs"},2:{conditions:{sm:"fyvr1qw",md:"fyvr1qx",lg:"fyvr1qy",xl:"fyvr1qz"},defaultClass:"fyvr1qw"},3:{conditions:{sm:"fyvr1r0",md:"fyvr1r1",lg:"fyvr1r2",xl:"fyvr1r3"},defaultClass:"fyvr1r0"},4:{conditions:{sm:"fyvr1r4",md:"fyvr1r5",lg:"fyvr1r6",xl:"fyvr1r7"},defaultClass:"fyvr1r4"},5:{conditions:{sm:"fyvr1r8",md:"fyvr1r9",lg:"fyvr1ra",xl:"fyvr1rb"},defaultClass:"fyvr1r8"},6:{conditions:{sm:"fyvr1rc",md:"fyvr1rd",lg:"fyvr1re",xl:"fyvr1rf"},defaultClass:"fyvr1rc"},7:{conditions:{sm:"fyvr1rg",md:"fyvr1rh",lg:"fyvr1ri",xl:"fyvr1rj"},defaultClass:"fyvr1rg"},8:{conditions:{sm:"fyvr1rk",md:"fyvr1rl",lg:"fyvr1rm",xl:"fyvr1rn"},defaultClass:"fyvr1rk"},9:{conditions:{sm:"fyvr1ro",md:"fyvr1rp",lg:"fyvr1rq",xl:"fyvr1rr"},defaultClass:"fyvr1ro"},10:{conditions:{sm:"fyvr1rs",md:"fyvr1rt",lg:"fyvr1ru",xl:"fyvr1rv"},defaultClass:"fyvr1rs"},12:{conditions:{sm:"fyvr1rw",md:"fyvr1rx",lg:"fyvr1ry",xl:"fyvr1rz"},defaultClass:"fyvr1rw"},14:{conditions:{sm:"fyvr1s0",md:"fyvr1s1",lg:"fyvr1s2",xl:"fyvr1s3"},defaultClass:"fyvr1s0"},16:{conditions:{sm:"fyvr1s4",md:"fyvr1s5",lg:"fyvr1s6",xl:"fyvr1s7"},defaultClass:"fyvr1s4"},"0.25":{conditions:{sm:"fyvr1s8",md:"fyvr1s9",lg:"fyvr1sa",xl:"fyvr1sb"},defaultClass:"fyvr1s8"},"0.5":{conditions:{sm:"fyvr1sc",md:"fyvr1sd",lg:"fyvr1se",xl:"fyvr1sf"},defaultClass:"fyvr1sc"},"1.5":{conditions:{sm:"fyvr1sg",md:"fyvr1sh",lg:"fyvr1si",xl:"fyvr1sj"},defaultClass:"fyvr1sg"},auto:{conditions:{sm:"fyvr1sk",md:"fyvr1sl",lg:"fyvr1sm",xl:"fyvr1sn"},defaultClass:"fyvr1sk"}}},paddingTop:{values:{0:{conditions:{sm:"fyvr1so",md:"fyvr1sp",lg:"fyvr1sq",xl:"fyvr1sr"},defaultClass:"fyvr1so"},1:{conditions:{sm:"fyvr1ss",md:"fyvr1st",lg:"fyvr1su",xl:"fyvr1sv"},defaultClass:"fyvr1ss"},2:{conditions:{sm:"fyvr1sw",md:"fyvr1sx",lg:"fyvr1sy",xl:"fyvr1sz"},defaultClass:"fyvr1sw"},3:{conditions:{sm:"fyvr1t0",md:"fyvr1t1",lg:"fyvr1t2",xl:"fyvr1t3"},defaultClass:"fyvr1t0"},4:{conditions:{sm:"fyvr1t4",md:"fyvr1t5",lg:"fyvr1t6",xl:"fyvr1t7"},defaultClass:"fyvr1t4"},5:{conditions:{sm:"fyvr1t8",md:"fyvr1t9",lg:"fyvr1ta",xl:"fyvr1tb"},defaultClass:"fyvr1t8"},6:{conditions:{sm:"fyvr1tc",md:"fyvr1td",lg:"fyvr1te",xl:"fyvr1tf"},defaultClass:"fyvr1tc"},7:{conditions:{sm:"fyvr1tg",md:"fyvr1th",lg:"fyvr1ti",xl:"fyvr1tj"},defaultClass:"fyvr1tg"},8:{conditions:{sm:"fyvr1tk",md:"fyvr1tl",lg:"fyvr1tm",xl:"fyvr1tn"},defaultClass:"fyvr1tk"},9:{conditions:{sm:"fyvr1to",md:"fyvr1tp",lg:"fyvr1tq",xl:"fyvr1tr"},defaultClass:"fyvr1to"},10:{conditions:{sm:"fyvr1ts",md:"fyvr1tt",lg:"fyvr1tu",xl:"fyvr1tv"},defaultClass:"fyvr1ts"},12:{conditions:{sm:"fyvr1tw",md:"fyvr1tx",lg:"fyvr1ty",xl:"fyvr1tz"},defaultClass:"fyvr1tw"},14:{conditions:{sm:"fyvr1u0",md:"fyvr1u1",lg:"fyvr1u2",xl:"fyvr1u3"},defaultClass:"fyvr1u0"},16:{conditions:{sm:"fyvr1u4",md:"fyvr1u5",lg:"fyvr1u6",xl:"fyvr1u7"},defaultClass:"fyvr1u4"},"0.25":{conditions:{sm:"fyvr1u8",md:"fyvr1u9",lg:"fyvr1ua",xl:"fyvr1ub"},defaultClass:"fyvr1u8"},"0.5":{conditions:{sm:"fyvr1uc",md:"fyvr1ud",lg:"fyvr1ue",xl:"fyvr1uf"},defaultClass:"fyvr1uc"},"1.5":{conditions:{sm:"fyvr1ug",md:"fyvr1uh",lg:"fyvr1ui",xl:"fyvr1uj"},defaultClass:"fyvr1ug"}}},paddingBottom:{values:{0:{conditions:{sm:"fyvr1uk",md:"fyvr1ul",lg:"fyvr1um",xl:"fyvr1un"},defaultClass:"fyvr1uk"},1:{conditions:{sm:"fyvr1uo",md:"fyvr1up",lg:"fyvr1uq",xl:"fyvr1ur"},defaultClass:"fyvr1uo"},2:{conditions:{sm:"fyvr1us",md:"fyvr1ut",lg:"fyvr1uu",xl:"fyvr1uv"},defaultClass:"fyvr1us"},3:{conditions:{sm:"fyvr1uw",md:"fyvr1ux",lg:"fyvr1uy",xl:"fyvr1uz"},defaultClass:"fyvr1uw"},4:{conditions:{sm:"fyvr1v0",md:"fyvr1v1",lg:"fyvr1v2",xl:"fyvr1v3"},defaultClass:"fyvr1v0"},5:{conditions:{sm:"fyvr1v4",md:"fyvr1v5",lg:"fyvr1v6",xl:"fyvr1v7"},defaultClass:"fyvr1v4"},6:{conditions:{sm:"fyvr1v8",md:"fyvr1v9",lg:"fyvr1va",xl:"fyvr1vb"},defaultClass:"fyvr1v8"},7:{conditions:{sm:"fyvr1vc",md:"fyvr1vd",lg:"fyvr1ve",xl:"fyvr1vf"},defaultClass:"fyvr1vc"},8:{conditions:{sm:"fyvr1vg",md:"fyvr1vh",lg:"fyvr1vi",xl:"fyvr1vj"},defaultClass:"fyvr1vg"},9:{conditions:{sm:"fyvr1vk",md:"fyvr1vl",lg:"fyvr1vm",xl:"fyvr1vn"},defaultClass:"fyvr1vk"},10:{conditions:{sm:"fyvr1vo",md:"fyvr1vp",lg:"fyvr1vq",xl:"fyvr1vr"},defaultClass:"fyvr1vo"},12:{conditions:{sm:"fyvr1vs",md:"fyvr1vt",lg:"fyvr1vu",xl:"fyvr1vv"},defaultClass:"fyvr1vs"},14:{conditions:{sm:"fyvr1vw",md:"fyvr1vx",lg:"fyvr1vy",xl:"fyvr1vz"},defaultClass:"fyvr1vw"},16:{conditions:{sm:"fyvr1w0",md:"fyvr1w1",lg:"fyvr1w2",xl:"fyvr1w3"},defaultClass:"fyvr1w0"},"0.25":{conditions:{sm:"fyvr1w4",md:"fyvr1w5",lg:"fyvr1w6",xl:"fyvr1w7"},defaultClass:"fyvr1w4"},"0.5":{conditions:{sm:"fyvr1w8",md:"fyvr1w9",lg:"fyvr1wa",xl:"fyvr1wb"},defaultClass:"fyvr1w8"},"1.5":{conditions:{sm:"fyvr1wc",md:"fyvr1wd",lg:"fyvr1we",xl:"fyvr1wf"},defaultClass:"fyvr1wc"}}},paddingLeft:{values:{0:{conditions:{sm:"fyvr1wg",md:"fyvr1wh",lg:"fyvr1wi",xl:"fyvr1wj"},defaultClass:"fyvr1wg"},1:{conditions:{sm:"fyvr1wk",md:"fyvr1wl",lg:"fyvr1wm",xl:"fyvr1wn"},defaultClass:"fyvr1wk"},2:{conditions:{sm:"fyvr1wo",md:"fyvr1wp",lg:"fyvr1wq",xl:"fyvr1wr"},defaultClass:"fyvr1wo"},3:{conditions:{sm:"fyvr1ws",md:"fyvr1wt",lg:"fyvr1wu",xl:"fyvr1wv"},defaultClass:"fyvr1ws"},4:{conditions:{sm:"fyvr1ww",md:"fyvr1wx",lg:"fyvr1wy",xl:"fyvr1wz"},defaultClass:"fyvr1ww"},5:{conditions:{sm:"fyvr1x0",md:"fyvr1x1",lg:"fyvr1x2",xl:"fyvr1x3"},defaultClass:"fyvr1x0"},6:{conditions:{sm:"fyvr1x4",md:"fyvr1x5",lg:"fyvr1x6",xl:"fyvr1x7"},defaultClass:"fyvr1x4"},7:{conditions:{sm:"fyvr1x8",md:"fyvr1x9",lg:"fyvr1xa",xl:"fyvr1xb"},defaultClass:"fyvr1x8"},8:{conditions:{sm:"fyvr1xc",md:"fyvr1xd",lg:"fyvr1xe",xl:"fyvr1xf"},defaultClass:"fyvr1xc"},9:{conditions:{sm:"fyvr1xg",md:"fyvr1xh",lg:"fyvr1xi",xl:"fyvr1xj"},defaultClass:"fyvr1xg"},10:{conditions:{sm:"fyvr1xk",md:"fyvr1xl",lg:"fyvr1xm",xl:"fyvr1xn"},defaultClass:"fyvr1xk"},12:{conditions:{sm:"fyvr1xo",md:"fyvr1xp",lg:"fyvr1xq",xl:"fyvr1xr"},defaultClass:"fyvr1xo"},14:{conditions:{sm:"fyvr1xs",md:"fyvr1xt",lg:"fyvr1xu",xl:"fyvr1xv"},defaultClass:"fyvr1xs"},16:{conditions:{sm:"fyvr1xw",md:"fyvr1xx",lg:"fyvr1xy",xl:"fyvr1xz"},defaultClass:"fyvr1xw"},"0.25":{conditions:{sm:"fyvr1y0",md:"fyvr1y1",lg:"fyvr1y2",xl:"fyvr1y3"},defaultClass:"fyvr1y0"},"0.5":{conditions:{sm:"fyvr1y4",md:"fyvr1y5",lg:"fyvr1y6",xl:"fyvr1y7"},defaultClass:"fyvr1y4"},"1.5":{conditions:{sm:"fyvr1y8",md:"fyvr1y9",lg:"fyvr1ya",xl:"fyvr1yb"},defaultClass:"fyvr1y8"}}},paddingRight:{values:{0:{conditions:{sm:"fyvr1yc",md:"fyvr1yd",lg:"fyvr1ye",xl:"fyvr1yf"},defaultClass:"fyvr1yc"},1:{conditions:{sm:"fyvr1yg",md:"fyvr1yh",lg:"fyvr1yi",xl:"fyvr1yj"},defaultClass:"fyvr1yg"},2:{conditions:{sm:"fyvr1yk",md:"fyvr1yl",lg:"fyvr1ym",xl:"fyvr1yn"},defaultClass:"fyvr1yk"},3:{conditions:{sm:"fyvr1yo",md:"fyvr1yp",lg:"fyvr1yq",xl:"fyvr1yr"},defaultClass:"fyvr1yo"},4:{conditions:{sm:"fyvr1ys",md:"fyvr1yt",lg:"fyvr1yu",xl:"fyvr1yv"},defaultClass:"fyvr1ys"},5:{conditions:{sm:"fyvr1yw",md:"fyvr1yx",lg:"fyvr1yy",xl:"fyvr1yz"},defaultClass:"fyvr1yw"},6:{conditions:{sm:"fyvr1z0",md:"fyvr1z1",lg:"fyvr1z2",xl:"fyvr1z3"},defaultClass:"fyvr1z0"},7:{conditions:{sm:"fyvr1z4",md:"fyvr1z5",lg:"fyvr1z6",xl:"fyvr1z7"},defaultClass:"fyvr1z4"},8:{conditions:{sm:"fyvr1z8",md:"fyvr1z9",lg:"fyvr1za",xl:"fyvr1zb"},defaultClass:"fyvr1z8"},9:{conditions:{sm:"fyvr1zc",md:"fyvr1zd",lg:"fyvr1ze",xl:"fyvr1zf"},defaultClass:"fyvr1zc"},10:{conditions:{sm:"fyvr1zg",md:"fyvr1zh",lg:"fyvr1zi",xl:"fyvr1zj"},defaultClass:"fyvr1zg"},12:{conditions:{sm:"fyvr1zk",md:"fyvr1zl",lg:"fyvr1zm",xl:"fyvr1zn"},defaultClass:"fyvr1zk"},14:{conditions:{sm:"fyvr1zo",md:"fyvr1zp",lg:"fyvr1zq",xl:"fyvr1zr"},defaultClass:"fyvr1zo"},16:{conditions:{sm:"fyvr1zs",md:"fyvr1zt",lg:"fyvr1zu",xl:"fyvr1zv"},defaultClass:"fyvr1zs"},"0.25":{conditions:{sm:"fyvr1zw",md:"fyvr1zx",lg:"fyvr1zy",xl:"fyvr1zz"},defaultClass:"fyvr1zw"},"0.5":{conditions:{sm:"fyvr1100",md:"fyvr1101",lg:"fyvr1102",xl:"fyvr1103"},defaultClass:"fyvr1100"},"1.5":{conditions:{sm:"fyvr1104",md:"fyvr1105",lg:"fyvr1106",xl:"fyvr1107"},defaultClass:"fyvr1104"}}},marginTop:{values:{0:{conditions:{sm:"fyvr1108",md:"fyvr1109",lg:"fyvr110a",xl:"fyvr110b"},defaultClass:"fyvr1108"},1:{conditions:{sm:"fyvr110c",md:"fyvr110d",lg:"fyvr110e",xl:"fyvr110f"},defaultClass:"fyvr110c"},2:{conditions:{sm:"fyvr110g",md:"fyvr110h",lg:"fyvr110i",xl:"fyvr110j"},defaultClass:"fyvr110g"},3:{conditions:{sm:"fyvr110k",md:"fyvr110l",lg:"fyvr110m",xl:"fyvr110n"},defaultClass:"fyvr110k"},4:{conditions:{sm:"fyvr110o",md:"fyvr110p",lg:"fyvr110q",xl:"fyvr110r"},defaultClass:"fyvr110o"},5:{conditions:{sm:"fyvr110s",md:"fyvr110t",lg:"fyvr110u",xl:"fyvr110v"},defaultClass:"fyvr110s"},6:{conditions:{sm:"fyvr110w",md:"fyvr110x",lg:"fyvr110y",xl:"fyvr110z"},defaultClass:"fyvr110w"},7:{conditions:{sm:"fyvr1110",md:"fyvr1111",lg:"fyvr1112",xl:"fyvr1113"},defaultClass:"fyvr1110"},8:{conditions:{sm:"fyvr1114",md:"fyvr1115",lg:"fyvr1116",xl:"fyvr1117"},defaultClass:"fyvr1114"},9:{conditions:{sm:"fyvr1118",md:"fyvr1119",lg:"fyvr111a",xl:"fyvr111b"},defaultClass:"fyvr1118"},10:{conditions:{sm:"fyvr111c",md:"fyvr111d",lg:"fyvr111e",xl:"fyvr111f"},defaultClass:"fyvr111c"},12:{conditions:{sm:"fyvr111g",md:"fyvr111h",lg:"fyvr111i",xl:"fyvr111j"},defaultClass:"fyvr111g"},14:{conditions:{sm:"fyvr111k",md:"fyvr111l",lg:"fyvr111m",xl:"fyvr111n"},defaultClass:"fyvr111k"},16:{conditions:{sm:"fyvr111o",md:"fyvr111p",lg:"fyvr111q",xl:"fyvr111r"},defaultClass:"fyvr111o"},"0.25":{conditions:{sm:"fyvr111s",md:"fyvr111t",lg:"fyvr111u",xl:"fyvr111v"},defaultClass:"fyvr111s"},"0.5":{conditions:{sm:"fyvr111w",md:"fyvr111x",lg:"fyvr111y",xl:"fyvr111z"},defaultClass:"fyvr111w"},"1.5":{conditions:{sm:"fyvr1120",md:"fyvr1121",lg:"fyvr1122",xl:"fyvr1123"},defaultClass:"fyvr1120"},auto:{conditions:{sm:"fyvr1124",md:"fyvr1125",lg:"fyvr1126",xl:"fyvr1127"},defaultClass:"fyvr1124"}}},marginBottom:{values:{0:{conditions:{sm:"fyvr1128",md:"fyvr1129",lg:"fyvr112a",xl:"fyvr112b"},defaultClass:"fyvr1128"},1:{conditions:{sm:"fyvr112c",md:"fyvr112d",lg:"fyvr112e",xl:"fyvr112f"},defaultClass:"fyvr112c"},2:{conditions:{sm:"fyvr112g",md:"fyvr112h",lg:"fyvr112i",xl:"fyvr112j"},defaultClass:"fyvr112g"},3:{conditions:{sm:"fyvr112k",md:"fyvr112l",lg:"fyvr112m",xl:"fyvr112n"},defaultClass:"fyvr112k"},4:{conditions:{sm:"fyvr112o",md:"fyvr112p",lg:"fyvr112q",xl:"fyvr112r"},defaultClass:"fyvr112o"},5:{conditions:{sm:"fyvr112s",md:"fyvr112t",lg:"fyvr112u",xl:"fyvr112v"},defaultClass:"fyvr112s"},6:{conditions:{sm:"fyvr112w",md:"fyvr112x",lg:"fyvr112y",xl:"fyvr112z"},defaultClass:"fyvr112w"},7:{conditions:{sm:"fyvr1130",md:"fyvr1131",lg:"fyvr1132",xl:"fyvr1133"},defaultClass:"fyvr1130"},8:{conditions:{sm:"fyvr1134",md:"fyvr1135",lg:"fyvr1136",xl:"fyvr1137"},defaultClass:"fyvr1134"},9:{conditions:{sm:"fyvr1138",md:"fyvr1139",lg:"fyvr113a",xl:"fyvr113b"},defaultClass:"fyvr1138"},10:{conditions:{sm:"fyvr113c",md:"fyvr113d",lg:"fyvr113e",xl:"fyvr113f"},defaultClass:"fyvr113c"},12:{conditions:{sm:"fyvr113g",md:"fyvr113h",lg:"fyvr113i",xl:"fyvr113j"},defaultClass:"fyvr113g"},14:{conditions:{sm:"fyvr113k",md:"fyvr113l",lg:"fyvr113m",xl:"fyvr113n"},defaultClass:"fyvr113k"},16:{conditions:{sm:"fyvr113o",md:"fyvr113p",lg:"fyvr113q",xl:"fyvr113r"},defaultClass:"fyvr113o"},"0.25":{conditions:{sm:"fyvr113s",md:"fyvr113t",lg:"fyvr113u",xl:"fyvr113v"},defaultClass:"fyvr113s"},"0.5":{conditions:{sm:"fyvr113w",md:"fyvr113x",lg:"fyvr113y",xl:"fyvr113z"},defaultClass:"fyvr113w"},"1.5":{conditions:{sm:"fyvr1140",md:"fyvr1141",lg:"fyvr1142",xl:"fyvr1143"},defaultClass:"fyvr1140"},auto:{conditions:{sm:"fyvr1144",md:"fyvr1145",lg:"fyvr1146",xl:"fyvr1147"},defaultClass:"fyvr1144"}}},marginLeft:{values:{0:{conditions:{sm:"fyvr1148",md:"fyvr1149",lg:"fyvr114a",xl:"fyvr114b"},defaultClass:"fyvr1148"},1:{conditions:{sm:"fyvr114c",md:"fyvr114d",lg:"fyvr114e",xl:"fyvr114f"},defaultClass:"fyvr114c"},2:{conditions:{sm:"fyvr114g",md:"fyvr114h",lg:"fyvr114i",xl:"fyvr114j"},defaultClass:"fyvr114g"},3:{conditions:{sm:"fyvr114k",md:"fyvr114l",lg:"fyvr114m",xl:"fyvr114n"},defaultClass:"fyvr114k"},4:{conditions:{sm:"fyvr114o",md:"fyvr114p",lg:"fyvr114q",xl:"fyvr114r"},defaultClass:"fyvr114o"},5:{conditions:{sm:"fyvr114s",md:"fyvr114t",lg:"fyvr114u",xl:"fyvr114v"},defaultClass:"fyvr114s"},6:{conditions:{sm:"fyvr114w",md:"fyvr114x",lg:"fyvr114y",xl:"fyvr114z"},defaultClass:"fyvr114w"},7:{conditions:{sm:"fyvr1150",md:"fyvr1151",lg:"fyvr1152",xl:"fyvr1153"},defaultClass:"fyvr1150"},8:{conditions:{sm:"fyvr1154",md:"fyvr1155",lg:"fyvr1156",xl:"fyvr1157"},defaultClass:"fyvr1154"},9:{conditions:{sm:"fyvr1158",md:"fyvr1159",lg:"fyvr115a",xl:"fyvr115b"},defaultClass:"fyvr1158"},10:{conditions:{sm:"fyvr115c",md:"fyvr115d",lg:"fyvr115e",xl:"fyvr115f"},defaultClass:"fyvr115c"},12:{conditions:{sm:"fyvr115g",md:"fyvr115h",lg:"fyvr115i",xl:"fyvr115j"},defaultClass:"fyvr115g"},14:{conditions:{sm:"fyvr115k",md:"fyvr115l",lg:"fyvr115m",xl:"fyvr115n"},defaultClass:"fyvr115k"},16:{conditions:{sm:"fyvr115o",md:"fyvr115p",lg:"fyvr115q",xl:"fyvr115r"},defaultClass:"fyvr115o"},"0.25":{conditions:{sm:"fyvr115s",md:"fyvr115t",lg:"fyvr115u",xl:"fyvr115v"},defaultClass:"fyvr115s"},"0.5":{conditions:{sm:"fyvr115w",md:"fyvr115x",lg:"fyvr115y",xl:"fyvr115z"},defaultClass:"fyvr115w"},"1.5":{conditions:{sm:"fyvr1160",md:"fyvr1161",lg:"fyvr1162",xl:"fyvr1163"},defaultClass:"fyvr1160"},auto:{conditions:{sm:"fyvr1164",md:"fyvr1165",lg:"fyvr1166",xl:"fyvr1167"},defaultClass:"fyvr1164"}}},marginRight:{values:{0:{conditions:{sm:"fyvr1168",md:"fyvr1169",lg:"fyvr116a",xl:"fyvr116b"},defaultClass:"fyvr1168"},1:{conditions:{sm:"fyvr116c",md:"fyvr116d",lg:"fyvr116e",xl:"fyvr116f"},defaultClass:"fyvr116c"},2:{conditions:{sm:"fyvr116g",md:"fyvr116h",lg:"fyvr116i",xl:"fyvr116j"},defaultClass:"fyvr116g"},3:{conditions:{sm:"fyvr116k",md:"fyvr116l",lg:"fyvr116m",xl:"fyvr116n"},defaultClass:"fyvr116k"},4:{conditions:{sm:"fyvr116o",md:"fyvr116p",lg:"fyvr116q",xl:"fyvr116r"},defaultClass:"fyvr116o"},5:{conditions:{sm:"fyvr116s",md:"fyvr116t",lg:"fyvr116u",xl:"fyvr116v"},defaultClass:"fyvr116s"},6:{conditions:{sm:"fyvr116w",md:"fyvr116x",lg:"fyvr116y",xl:"fyvr116z"},defaultClass:"fyvr116w"},7:{conditions:{sm:"fyvr1170",md:"fyvr1171",lg:"fyvr1172",xl:"fyvr1173"},defaultClass:"fyvr1170"},8:{conditions:{sm:"fyvr1174",md:"fyvr1175",lg:"fyvr1176",xl:"fyvr1177"},defaultClass:"fyvr1174"},9:{conditions:{sm:"fyvr1178",md:"fyvr1179",lg:"fyvr117a",xl:"fyvr117b"},defaultClass:"fyvr1178"},10:{conditions:{sm:"fyvr117c",md:"fyvr117d",lg:"fyvr117e",xl:"fyvr117f"},defaultClass:"fyvr117c"},12:{conditions:{sm:"fyvr117g",md:"fyvr117h",lg:"fyvr117i",xl:"fyvr117j"},defaultClass:"fyvr117g"},14:{conditions:{sm:"fyvr117k",md:"fyvr117l",lg:"fyvr117m",xl:"fyvr117n"},defaultClass:"fyvr117k"},16:{conditions:{sm:"fyvr117o",md:"fyvr117p",lg:"fyvr117q",xl:"fyvr117r"},defaultClass:"fyvr117o"},"0.25":{conditions:{sm:"fyvr117s",md:"fyvr117t",lg:"fyvr117u",xl:"fyvr117v"},defaultClass:"fyvr117s"},"0.5":{conditions:{sm:"fyvr117w",md:"fyvr117x",lg:"fyvr117y",xl:"fyvr117z"},defaultClass:"fyvr117w"},"1.5":{conditions:{sm:"fyvr1180",md:"fyvr1181",lg:"fyvr1182",xl:"fyvr1183"},defaultClass:"fyvr1180"},auto:{conditions:{sm:"fyvr1184",md:"fyvr1185",lg:"fyvr1186",xl:"fyvr1187"},defaultClass:"fyvr1184"}}},gap:{values:{0:{conditions:{sm:"fyvr1188",md:"fyvr1189",lg:"fyvr118a",xl:"fyvr118b"},defaultClass:"fyvr1188"},1:{conditions:{sm:"fyvr118c",md:"fyvr118d",lg:"fyvr118e",xl:"fyvr118f"},defaultClass:"fyvr118c"},2:{conditions:{sm:"fyvr118g",md:"fyvr118h",lg:"fyvr118i",xl:"fyvr118j"},defaultClass:"fyvr118g"},3:{conditions:{sm:"fyvr118k",md:"fyvr118l",lg:"fyvr118m",xl:"fyvr118n"},defaultClass:"fyvr118k"},4:{conditions:{sm:"fyvr118o",md:"fyvr118p",lg:"fyvr118q",xl:"fyvr118r"},defaultClass:"fyvr118o"},5:{conditions:{sm:"fyvr118s",md:"fyvr118t",lg:"fyvr118u",xl:"fyvr118v"},defaultClass:"fyvr118s"},6:{conditions:{sm:"fyvr118w",md:"fyvr118x",lg:"fyvr118y",xl:"fyvr118z"},defaultClass:"fyvr118w"},7:{conditions:{sm:"fyvr1190",md:"fyvr1191",lg:"fyvr1192",xl:"fyvr1193"},defaultClass:"fyvr1190"},8:{conditions:{sm:"fyvr1194",md:"fyvr1195",lg:"fyvr1196",xl:"fyvr1197"},defaultClass:"fyvr1194"},9:{conditions:{sm:"fyvr1198",md:"fyvr1199",lg:"fyvr119a",xl:"fyvr119b"},defaultClass:"fyvr1198"},10:{conditions:{sm:"fyvr119c",md:"fyvr119d",lg:"fyvr119e",xl:"fyvr119f"},defaultClass:"fyvr119c"},12:{conditions:{sm:"fyvr119g",md:"fyvr119h",lg:"fyvr119i",xl:"fyvr119j"},defaultClass:"fyvr119g"},14:{conditions:{sm:"fyvr119k",md:"fyvr119l",lg:"fyvr119m",xl:"fyvr119n"},defaultClass:"fyvr119k"},16:{conditions:{sm:"fyvr119o",md:"fyvr119p",lg:"fyvr119q",xl:"fyvr119r"},defaultClass:"fyvr119o"},"0.25":{conditions:{sm:"fyvr119s",md:"fyvr119t",lg:"fyvr119u",xl:"fyvr119v"},defaultClass:"fyvr119s"},"0.5":{conditions:{sm:"fyvr119w",md:"fyvr119x",lg:"fyvr119y",xl:"fyvr119z"},defaultClass:"fyvr119w"},"1.5":{conditions:{sm:"fyvr11a0",md:"fyvr11a1",lg:"fyvr11a2",xl:"fyvr11a3"},defaultClass:"fyvr11a0"}}},borderBottomWidth:{values:{none:{conditions:{sm:"fyvr11a4",md:"fyvr11a5",lg:"fyvr11a6",xl:"fyvr11a7"},defaultClass:"fyvr11a4"},thin:{conditions:{sm:"fyvr11a8",md:"fyvr11a9",lg:"fyvr11aa",xl:"fyvr11ab"},defaultClass:"fyvr11a8"},thick:{conditions:{sm:"fyvr11ac",md:"fyvr11ad",lg:"fyvr11ae",xl:"fyvr11af"},defaultClass:"fyvr11ac"}}},borderLeftWidth:{values:{none:{conditions:{sm:"fyvr11ag",md:"fyvr11ah",lg:"fyvr11ai",xl:"fyvr11aj"},defaultClass:"fyvr11ag"},thin:{conditions:{sm:"fyvr11ak",md:"fyvr11al",lg:"fyvr11am",xl:"fyvr11an"},defaultClass:"fyvr11ak"},thick:{conditions:{sm:"fyvr11ao",md:"fyvr11ap",lg:"fyvr11aq",xl:"fyvr11ar"},defaultClass:"fyvr11ao"}}},borderRightWidth:{values:{none:{conditions:{sm:"fyvr11as",md:"fyvr11at",lg:"fyvr11au",xl:"fyvr11av"},defaultClass:"fyvr11as"},thin:{conditions:{sm:"fyvr11aw",md:"fyvr11ax",lg:"fyvr11ay",xl:"fyvr11az"},defaultClass:"fyvr11aw"},thick:{conditions:{sm:"fyvr11b0",md:"fyvr11b1",lg:"fyvr11b2",xl:"fyvr11b3"},defaultClass:"fyvr11b0"}}},borderTopWidth:{values:{none:{conditions:{sm:"fyvr11b4",md:"fyvr11b5",lg:"fyvr11b6",xl:"fyvr11b7"},defaultClass:"fyvr11b4"},thin:{conditions:{sm:"fyvr11b8",md:"fyvr11b9",lg:"fyvr11ba",xl:"fyvr11bb"},defaultClass:"fyvr11b8"},thick:{conditions:{sm:"fyvr11bc",md:"fyvr11bd",lg:"fyvr11be",xl:"fyvr11bf"},defaultClass:"fyvr11bc"}}},borderBottomLeftRadius:{values:{none:{conditions:{sm:"fyvr11bg",md:"fyvr11bh",lg:"fyvr11bi",xl:"fyvr11bj"},defaultClass:"fyvr11bg"},xs:{conditions:{sm:"fyvr11bk",md:"fyvr11bl",lg:"fyvr11bm",xl:"fyvr11bn"},defaultClass:"fyvr11bk"},sm:{conditions:{sm:"fyvr11bo",md:"fyvr11bp",lg:"fyvr11bq",xl:"fyvr11br"},defaultClass:"fyvr11bo"},md:{conditions:{sm:"fyvr11bs",md:"fyvr11bt",lg:"fyvr11bu",xl:"fyvr11bv"},defaultClass:"fyvr11bs"},lg:{conditions:{sm:"fyvr11bw",md:"fyvr11bx",lg:"fyvr11by",xl:"fyvr11bz"},defaultClass:"fyvr11bw"},circle:{conditions:{sm:"fyvr11c0",md:"fyvr11c1",lg:"fyvr11c2",xl:"fyvr11c3"},defaultClass:"fyvr11c0"}}},borderBottomRightRadius:{values:{none:{conditions:{sm:"fyvr11c4",md:"fyvr11c5",lg:"fyvr11c6",xl:"fyvr11c7"},defaultClass:"fyvr11c4"},xs:{conditions:{sm:"fyvr11c8",md:"fyvr11c9",lg:"fyvr11ca",xl:"fyvr11cb"},defaultClass:"fyvr11c8"},sm:{conditions:{sm:"fyvr11cc",md:"fyvr11cd",lg:"fyvr11ce",xl:"fyvr11cf"},defaultClass:"fyvr11cc"},md:{conditions:{sm:"fyvr11cg",md:"fyvr11ch",lg:"fyvr11ci",xl:"fyvr11cj"},defaultClass:"fyvr11cg"},lg:{conditions:{sm:"fyvr11ck",md:"fyvr11cl",lg:"fyvr11cm",xl:"fyvr11cn"},defaultClass:"fyvr11ck"},circle:{conditions:{sm:"fyvr11co",md:"fyvr11cp",lg:"fyvr11cq",xl:"fyvr11cr"},defaultClass:"fyvr11co"}}},borderTopLeftRadius:{values:{none:{conditions:{sm:"fyvr11cs",md:"fyvr11ct",lg:"fyvr11cu",xl:"fyvr11cv"},defaultClass:"fyvr11cs"},xs:{conditions:{sm:"fyvr11cw",md:"fyvr11cx",lg:"fyvr11cy",xl:"fyvr11cz"},defaultClass:"fyvr11cw"},sm:{conditions:{sm:"fyvr11d0",md:"fyvr11d1",lg:"fyvr11d2",xl:"fyvr11d3"},defaultClass:"fyvr11d0"},md:{conditions:{sm:"fyvr11d4",md:"fyvr11d5",lg:"fyvr11d6",xl:"fyvr11d7"},defaultClass:"fyvr11d4"},lg:{conditions:{sm:"fyvr11d8",md:"fyvr11d9",lg:"fyvr11da",xl:"fyvr11db"},defaultClass:"fyvr11d8"},circle:{conditions:{sm:"fyvr11dc",md:"fyvr11dd",lg:"fyvr11de",xl:"fyvr11df"},defaultClass:"fyvr11dc"}}},borderTopRightRadius:{values:{none:{conditions:{sm:"fyvr11dg",md:"fyvr11dh",lg:"fyvr11di",xl:"fyvr11dj"},defaultClass:"fyvr11dg"},xs:{conditions:{sm:"fyvr11dk",md:"fyvr11dl",lg:"fyvr11dm",xl:"fyvr11dn"},defaultClass:"fyvr11dk"},sm:{conditions:{sm:"fyvr11do",md:"fyvr11dp",lg:"fyvr11dq",xl:"fyvr11dr"},defaultClass:"fyvr11do"},md:{conditions:{sm:"fyvr11ds",md:"fyvr11dt",lg:"fyvr11du",xl:"fyvr11dv"},defaultClass:"fyvr11ds"},lg:{conditions:{sm:"fyvr11dw",md:"fyvr11dx",lg:"fyvr11dy",xl:"fyvr11dz"},defaultClass:"fyvr11dw"},circle:{conditions:{sm:"fyvr11e0",md:"fyvr11e1",lg:"fyvr11e2",xl:"fyvr11e3"},defaultClass:"fyvr11e0"}}},fontSize:{values:{inherit:{conditions:{sm:"fyvr11e4",md:"fyvr11e5",lg:"fyvr11e6",xl:"fyvr11e7"},defaultClass:"fyvr11e4"},xsmall:{conditions:{sm:"fyvr11e8",md:"fyvr11e9",lg:"fyvr11ea",xl:"fyvr11eb"},defaultClass:"fyvr11e8"},small:{conditions:{sm:"fyvr11ec",md:"fyvr11ed",lg:"fyvr11ee",xl:"fyvr11ef"},defaultClass:"fyvr11ec"},normal:{conditions:{sm:"fyvr11eg",md:"fyvr11eh",lg:"fyvr11ei",xl:"fyvr11ej"},defaultClass:"fyvr11eg"},medium:{conditions:{sm:"fyvr11ek",md:"fyvr11el",lg:"fyvr11em",xl:"fyvr11en"},defaultClass:"fyvr11ek"},large:{conditions:{sm:"fyvr11eo",md:"fyvr11ep",lg:"fyvr11eq",xl:"fyvr11er"},defaultClass:"fyvr11eo"},xlarge:{conditions:{sm:"fyvr11es",md:"fyvr11et",lg:"fyvr11eu",xl:"fyvr11ev"},defaultClass:"fyvr11es"}}},fontWeight:{values:{inherit:{conditions:{sm:"fyvr11ew",md:"fyvr11ex",lg:"fyvr11ey",xl:"fyvr11ez"},defaultClass:"fyvr11ew"},normal:{conditions:{sm:"fyvr11f0",md:"fyvr11f1",lg:"fyvr11f2",xl:"fyvr11f3"},defaultClass:"fyvr11f0"},medium:{conditions:{sm:"fyvr11f4",md:"fyvr11f5",lg:"fyvr11f6",xl:"fyvr11f7"},defaultClass:"fyvr11f4"},semibold:{conditions:{sm:"fyvr11f8",md:"fyvr11f9",lg:"fyvr11fa",xl:"fyvr11fb"},defaultClass:"fyvr11f8"},bold:{conditions:{sm:"fyvr11fc",md:"fyvr11fd",lg:"fyvr11fe",xl:"fyvr11ff"},defaultClass:"fyvr11fc"}}},letterSpacing:{values:{inherit:{conditions:{sm:"fyvr11fg",md:"fyvr11fh",lg:"fyvr11fi",xl:"fyvr11fj"},defaultClass:"fyvr11fg"},none:{conditions:{sm:"fyvr11fk",md:"fyvr11fl",lg:"fyvr11fm",xl:"fyvr11fn"},defaultClass:"fyvr11fk"},normal:{conditions:{sm:"fyvr11fo",md:"fyvr11fp",lg:"fyvr11fq",xl:"fyvr11fr"},defaultClass:"fyvr11fo"},wide:{conditions:{sm:"fyvr11fs",md:"fyvr11ft",lg:"fyvr11fu",xl:"fyvr11fv"},defaultClass:"fyvr11fs"}}},lineHeight:{values:{4:{conditions:{sm:"fyvr11fw",md:"fyvr11fx",lg:"fyvr11fy",xl:"fyvr11fz"},defaultClass:"fyvr11fw"},5:{conditions:{sm:"fyvr11g0",md:"fyvr11g1",lg:"fyvr11g2",xl:"fyvr11g3"},defaultClass:"fyvr11g0"},6:{conditions:{sm:"fyvr11g4",md:"fyvr11g5",lg:"fyvr11g6",xl:"fyvr11g7"},defaultClass:"fyvr11g4"},7:{conditions:{sm:"fyvr11g8",md:"fyvr11g9",lg:"fyvr11ga",xl:"fyvr11gb"},defaultClass:"fyvr11g8"},9:{conditions:{sm:"fyvr11gc",md:"fyvr11gd",lg:"fyvr11ge",xl:"fyvr11gf"},defaultClass:"fyvr11gc"},inherit:{conditions:{sm:"fyvr11gg",md:"fyvr11gh",lg:"fyvr11gi",xl:"fyvr11gj"},defaultClass:"fyvr11gg"}}},textAlign:{values:{center:{conditions:{sm:"fyvr11gk",md:"fyvr11gl",lg:"fyvr11gm",xl:"fyvr11gn"},defaultClass:"fyvr11gk"},left:{conditions:{sm:"fyvr11go",md:"fyvr11gp",lg:"fyvr11gq",xl:"fyvr11gr"},defaultClass:"fyvr11go"},right:{conditions:{sm:"fyvr11gs",md:"fyvr11gt",lg:"fyvr11gu",xl:"fyvr11gv"},defaultClass:"fyvr11gs"}}},display:{values:{block:{conditions:{sm:"fyvr11gw",md:"fyvr11gx",lg:"fyvr11gy",xl:"fyvr11gz"},defaultClass:"fyvr11gw"},flex:{conditions:{sm:"fyvr11h0",md:"fyvr11h1",lg:"fyvr11h2",xl:"fyvr11h3"},defaultClass:"fyvr11h0"},grid:{conditions:{sm:"fyvr11h4",md:"fyvr11h5",lg:"fyvr11h6",xl:"fyvr11h7"},defaultClass:"fyvr11h4"},"inline-block":{conditions:{sm:"fyvr11h8",md:"fyvr11h9",lg:"fyvr11ha",xl:"fyvr11hb"},defaultClass:"fyvr11h8"},"inline-flex":{conditions:{sm:"fyvr11hc",md:"fyvr11hd",lg:"fyvr11he",xl:"fyvr11hf"},defaultClass:"fyvr11hc"},none:{conditions:{sm:"fyvr11hg",md:"fyvr11hh",lg:"fyvr11hi",xl:"fyvr11hj"},defaultClass:"fyvr11hg"},contents:{conditions:{sm:"fyvr11hk",md:"fyvr11hl",lg:"fyvr11hm",xl:"fyvr11hn"},defaultClass:"fyvr11hk"}}},position:{values:{absolute:{conditions:{sm:"fyvr11ho",md:"fyvr11hp",lg:"fyvr11hq",xl:"fyvr11hr"},defaultClass:"fyvr11ho"},fixed:{conditions:{sm:"fyvr11hs",md:"fyvr11ht",lg:"fyvr11hu",xl:"fyvr11hv"},defaultClass:"fyvr11hs"},relative:{conditions:{sm:"fyvr11hw",md:"fyvr11hx",lg:"fyvr11hy",xl:"fyvr11hz"},defaultClass:"fyvr11hw"},sticky:{conditions:{sm:"fyvr11i0",md:"fyvr11i1",lg:"fyvr11i2",xl:"fyvr11i3"},defaultClass:"fyvr11i0"}}},flexDirection:{values:{column:{conditions:{sm:"fyvr11i4",md:"fyvr11i5",lg:"fyvr11i6",xl:"fyvr11i7"},defaultClass:"fyvr11i4"},"column-reverse":{conditions:{sm:"fyvr11i8",md:"fyvr11i9",lg:"fyvr11ia",xl:"fyvr11ib"},defaultClass:"fyvr11i8"},row:{conditions:{sm:"fyvr11ic",md:"fyvr11id",lg:"fyvr11ie",xl:"fyvr11if"},defaultClass:"fyvr11ic"},"row-reverse":{conditions:{sm:"fyvr11ig",md:"fyvr11ih",lg:"fyvr11ii",xl:"fyvr11ij"},defaultClass:"fyvr11ig"}}},flexShrink:{values:{0:{conditions:{sm:"fyvr11ik",md:"fyvr11il",lg:"fyvr11im",xl:"fyvr11in"},defaultClass:"fyvr11ik"},1:{conditions:{sm:"fyvr11io",md:"fyvr11ip",lg:"fyvr11iq",xl:"fyvr11ir"},defaultClass:"fyvr11io"}}},flexGrow:{values:{0:{conditions:{sm:"fyvr11is",md:"fyvr11it",lg:"fyvr11iu",xl:"fyvr11iv"},defaultClass:"fyvr11is"},1:{conditions:{sm:"fyvr11iw",md:"fyvr11ix",lg:"fyvr11iy",xl:"fyvr11iz"},defaultClass:"fyvr11iw"}}},flexWrap:{values:{nowrap:{conditions:{sm:"fyvr11j0",md:"fyvr11j1",lg:"fyvr11j2",xl:"fyvr11j3"},defaultClass:"fyvr11j0"},wrap:{conditions:{sm:"fyvr11j4",md:"fyvr11j5",lg:"fyvr11j6",xl:"fyvr11j7"},defaultClass:"fyvr11j4"},"wrap-reverse":{conditions:{sm:"fyvr11j8",md:"fyvr11j9",lg:"fyvr11ja",xl:"fyvr11jb"},defaultClass:"fyvr11j8"}}},justifyContent:{values:{"flex-start":{conditions:{sm:"fyvr11jc",md:"fyvr11jd",lg:"fyvr11je",xl:"fyvr11jf"},defaultClass:"fyvr11jc"},center:{conditions:{sm:"fyvr11jg",md:"fyvr11jh",lg:"fyvr11ji",xl:"fyvr11jj"},defaultClass:"fyvr11jg"},"flex-end":{conditions:{sm:"fyvr11jk",md:"fyvr11jl",lg:"fyvr11jm",xl:"fyvr11jn"},defaultClass:"fyvr11jk"},stretch:{conditions:{sm:"fyvr11jo",md:"fyvr11jp",lg:"fyvr11jq",xl:"fyvr11jr"},defaultClass:"fyvr11jo"},"space-around":{conditions:{sm:"fyvr11js",md:"fyvr11jt",lg:"fyvr11ju",xl:"fyvr11jv"},defaultClass:"fyvr11js"},"space-between":{conditions:{sm:"fyvr11jw",md:"fyvr11jx",lg:"fyvr11jy",xl:"fyvr11jz"},defaultClass:"fyvr11jw"},"space-evenly":{conditions:{sm:"fyvr11k0",md:"fyvr11k1",lg:"fyvr11k2",xl:"fyvr11k3"},defaultClass:"fyvr11k0"}}},justifySelf:{values:{"flex-start":{conditions:{sm:"fyvr11k4",md:"fyvr11k5",lg:"fyvr11k6",xl:"fyvr11k7"},defaultClass:"fyvr11k4"},center:{conditions:{sm:"fyvr11k8",md:"fyvr11k9",lg:"fyvr11ka",xl:"fyvr11kb"},defaultClass:"fyvr11k8"},"flex-end":{conditions:{sm:"fyvr11kc",md:"fyvr11kd",lg:"fyvr11ke",xl:"fyvr11kf"},defaultClass:"fyvr11kc"},stretch:{conditions:{sm:"fyvr11kg",md:"fyvr11kh",lg:"fyvr11ki",xl:"fyvr11kj"},defaultClass:"fyvr11kg"}}},alignItems:{values:{"flex-start":{conditions:{sm:"fyvr11kk",md:"fyvr11kl",lg:"fyvr11km",xl:"fyvr11kn"},defaultClass:"fyvr11kk"},center:{conditions:{sm:"fyvr11ko",md:"fyvr11kp",lg:"fyvr11kq",xl:"fyvr11kr"},defaultClass:"fyvr11ko"},"flex-end":{conditions:{sm:"fyvr11ks",md:"fyvr11kt",lg:"fyvr11ku",xl:"fyvr11kv"},defaultClass:"fyvr11ks"},stretch:{conditions:{sm:"fyvr11kw",md:"fyvr11kx",lg:"fyvr11ky",xl:"fyvr11kz"},defaultClass:"fyvr11kw"},baseline:{conditions:{sm:"fyvr11l0",md:"fyvr11l1",lg:"fyvr11l2",xl:"fyvr11l3"},defaultClass:"fyvr11l0"}}},alignSelf:{values:{"flex-start":{conditions:{sm:"fyvr11l4",md:"fyvr11l5",lg:"fyvr11l6",xl:"fyvr11l7"},defaultClass:"fyvr11l4"},center:{conditions:{sm:"fyvr11l8",md:"fyvr11l9",lg:"fyvr11la",xl:"fyvr11lb"},defaultClass:"fyvr11l8"},"flex-end":{conditions:{sm:"fyvr11lc",md:"fyvr11ld",lg:"fyvr11le",xl:"fyvr11lf"},defaultClass:"fyvr11lc"},stretch:{conditions:{sm:"fyvr11lg",md:"fyvr11lh",lg:"fyvr11li",xl:"fyvr11lj"},defaultClass:"fyvr11lg"},baseline:{conditions:{sm:"fyvr11lk",md:"fyvr11ll",lg:"fyvr11lm",xl:"fyvr11ln"},defaultClass:"fyvr11lk"}}},overflowX:{values:{auto:{conditions:{sm:"fyvr11lo",md:"fyvr11lp",lg:"fyvr11lq",xl:"fyvr11lr"},defaultClass:"fyvr11lo"},hidden:{conditions:{sm:"fyvr11ls",md:"fyvr11lt",lg:"fyvr11lu",xl:"fyvr11lv"},defaultClass:"fyvr11ls"},scroll:{conditions:{sm:"fyvr11lw",md:"fyvr11lx",lg:"fyvr11ly",xl:"fyvr11lz"},defaultClass:"fyvr11lw"},visible:{conditions:{sm:"fyvr11m0",md:"fyvr11m1",lg:"fyvr11m2",xl:"fyvr11m3"},defaultClass:"fyvr11m0"}}},overflowY:{values:{auto:{conditions:{sm:"fyvr11m4",md:"fyvr11m5",lg:"fyvr11m6",xl:"fyvr11m7"},defaultClass:"fyvr11m4"},hidden:{conditions:{sm:"fyvr11m8",md:"fyvr11m9",lg:"fyvr11ma",xl:"fyvr11mb"},defaultClass:"fyvr11m8"},scroll:{conditions:{sm:"fyvr11mc",md:"fyvr11md",lg:"fyvr11me",xl:"fyvr11mf"},defaultClass:"fyvr11mc"},visible:{conditions:{sm:"fyvr11mg",md:"fyvr11mh",lg:"fyvr11mi",xl:"fyvr11mj"},defaultClass:"fyvr11mg"}}},visibility:{values:{hidden:{conditions:{sm:"fyvr11mk",md:"fyvr11ml",lg:"fyvr11mm",xl:"fyvr11mn"},defaultClass:"fyvr11mk"},visible:{conditions:{sm:"fyvr11mo",md:"fyvr11mp",lg:"fyvr11mq",xl:"fyvr11mr"},defaultClass:"fyvr11mo"}}}}},{conditions:void 0,styles:{backdropFilter:{values:{blur:{defaultClass:"fyvr11ms"},none:{defaultClass:"fyvr11mt"}}},fontFamily:{values:{inherit:{defaultClass:"fyvr11mu"},body:{defaultClass:"fyvr11mv"},mono:{defaultClass:"fyvr11mw"}}},textOverflow:{values:{ellipsis:{defaultClass:"fyvr11mx"},clip:{defaultClass:"fyvr11my"}}},textTransform:{values:{capitalize:{defaultClass:"fyvr11mz"},lowercase:{defaultClass:"fyvr11n0"},uppercase:{defaultClass:"fyvr11n1"}}},userSelect:{values:{none:{defaultClass:"fyvr11n2"},text:{defaultClass:"fyvr11n3"},all:{defaultClass:"fyvr11n4"},auto:{defaultClass:"fyvr11n5"}}},whiteSpace:{values:{normal:{defaultClass:"fyvr11n6"},nowrap:{defaultClass:"fyvr11n7"},initial:{defaultClass:"fyvr11n8"},inherit:{defaultClass:"fyvr11n9"}}},wordBreak:{values:{"break-word":{defaultClass:"fyvr11na"}}},wordWrap:{values:{normal:{defaultClass:"fyvr11nb"},"break-word":{defaultClass:"fyvr11nc"},initial:{defaultClass:"fyvr11nd"},inherit:{defaultClass:"fyvr11ne"}}},zIndex:{values:{0:{defaultClass:"fyvr11nf"},1:{defaultClass:"fyvr11ng"},10:{defaultClass:"fyvr11nh"},20:{defaultClass:"fyvr11ni"},30:{defaultClass:"fyvr11nj"},40:{defaultClass:"fyvr11nk"},50:{defaultClass:"fyvr11nl"},"-1":{defaultClass:"fyvr11nm"},auto:{defaultClass:"fyvr11nn"}}},aspectRatio:{values:{"1/1":{defaultClass:"fyvr11no"},"16/9":{defaultClass:"fyvr11np"},"4/3":{defaultClass:"fyvr11nq"},"3/1":{defaultClass:"fyvr11nr"},auto:{defaultClass:"fyvr11ns"}}}}},{conditions:{defaultCondition:"base",conditionNames:["base","active","disabled","focus","hover","checked"],responsiveArray:void 0},styles:{borderColor:{mappings:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]},borderStyle:{mappings:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"]},focusRing:{mappings:["boxShadow","outline"]},background:{values:{black:{conditions:{base:"fyvr11nt",active:"fyvr11nu",disabled:"fyvr11nv",focus:"fyvr11nw",hover:"fyvr11nx",checked:"fyvr11ny"},defaultClass:"fyvr11nt"},white:{conditions:{base:"fyvr11nz",active:"fyvr11o0",disabled:"fyvr11o1",focus:"fyvr11o2",hover:"fyvr11o3",checked:"fyvr11o4"},defaultClass:"fyvr11nz"},inherit:{conditions:{base:"fyvr11o5",active:"fyvr11o6",disabled:"fyvr11o7",focus:"fyvr11o8",hover:"fyvr11o9",checked:"fyvr11oa"},defaultClass:"fyvr11o5"},transparent:{conditions:{base:"fyvr11ob",active:"fyvr11oc",disabled:"fyvr11od",focus:"fyvr11oe",hover:"fyvr11of",checked:"fyvr11og"},defaultClass:"fyvr11ob"},positive:{conditions:{base:"fyvr11oh",active:"fyvr11oi",disabled:"fyvr11oj",focus:"fyvr11ok",hover:"fyvr11ol",checked:"fyvr11om"},defaultClass:"fyvr11oh"},negative:{conditions:{base:"fyvr11on",active:"fyvr11oo",disabled:"fyvr11op",focus:"fyvr11oq",hover:"fyvr11or",checked:"fyvr11os"},defaultClass:"fyvr11on"},info:{conditions:{base:"fyvr11ot",active:"fyvr11ou",disabled:"fyvr11ov",focus:"fyvr11ow",hover:"fyvr11ox",checked:"fyvr11oy"},defaultClass:"fyvr11ot"},warning:{conditions:{base:"fyvr11oz",active:"fyvr11p0",disabled:"fyvr11p1",focus:"fyvr11p2",hover:"fyvr11p3",checked:"fyvr11p4"},defaultClass:"fyvr11oz"},gradientBackdrop:{conditions:{base:"fyvr11p5",active:"fyvr11p6",disabled:"fyvr11p7",focus:"fyvr11p8",hover:"fyvr11p9",checked:"fyvr11pa"},defaultClass:"fyvr11p5"},gradientPrimary:{conditions:{base:"fyvr11pb",active:"fyvr11pc",disabled:"fyvr11pd",focus:"fyvr11pe",hover:"fyvr11pf",checked:"fyvr11pg"},defaultClass:"fyvr11pb"},gradientSecondary:{conditions:{base:"fyvr11ph",active:"fyvr11pi",disabled:"fyvr11pj",focus:"fyvr11pk",hover:"fyvr11pl",checked:"fyvr11pm"},defaultClass:"fyvr11ph"},arbitrumDark:{conditions:{base:"fyvr11pn",active:"fyvr11po",disabled:"fyvr11pp",focus:"fyvr11pq",hover:"fyvr11pr",checked:"fyvr11ps"},defaultClass:"fyvr11pn"},arbitrumLight:{conditions:{base:"fyvr11pt",active:"fyvr11pu",disabled:"fyvr11pv",focus:"fyvr11pw",hover:"fyvr11px",checked:"fyvr11py"},defaultClass:"fyvr11pt"},avalanceDark:{conditions:{base:"fyvr11pz",active:"fyvr11q0",disabled:"fyvr11q1",focus:"fyvr11q2",hover:"fyvr11q3",checked:"fyvr11q4"},defaultClass:"fyvr11pz"},avalanceLight:{conditions:{base:"fyvr11q5",active:"fyvr11q6",disabled:"fyvr11q7",focus:"fyvr11q8",hover:"fyvr11q9",checked:"fyvr11qa"},defaultClass:"fyvr11q5"},bscDark:{conditions:{base:"fyvr11qb",active:"fyvr11qc",disabled:"fyvr11qd",focus:"fyvr11qe",hover:"fyvr11qf",checked:"fyvr11qg"},defaultClass:"fyvr11qb"},bscLight:{conditions:{base:"fyvr11qh",active:"fyvr11qi",disabled:"fyvr11qj",focus:"fyvr11qk",hover:"fyvr11ql",checked:"fyvr11qm"},defaultClass:"fyvr11qh"},ethereumDark:{conditions:{base:"fyvr11qn",active:"fyvr11qo",disabled:"fyvr11qp",focus:"fyvr11qq",hover:"fyvr11qr",checked:"fyvr11qs"},defaultClass:"fyvr11qn"},ethereumLight:{conditions:{base:"fyvr11qt",active:"fyvr11qu",disabled:"fyvr11qv",focus:"fyvr11qw",hover:"fyvr11qx",checked:"fyvr11qy"},defaultClass:"fyvr11qt"},gnosisDark:{conditions:{base:"fyvr11qz",active:"fyvr11r0",disabled:"fyvr11r1",focus:"fyvr11r2",hover:"fyvr11r3",checked:"fyvr11r4"},defaultClass:"fyvr11qz"},gnosisLight:{conditions:{base:"fyvr11r5",active:"fyvr11r6",disabled:"fyvr11r7",focus:"fyvr11r8",hover:"fyvr11r9",checked:"fyvr11ra"},defaultClass:"fyvr11r5"},polygonDark:{conditions:{base:"fyvr11rb",active:"fyvr11rc",disabled:"fyvr11rd",focus:"fyvr11re",hover:"fyvr11rf",checked:"fyvr11rg"},defaultClass:"fyvr11rb"},polygonLight:{conditions:{base:"fyvr11rh",active:"fyvr11ri",disabled:"fyvr11rj",focus:"fyvr11rk",hover:"fyvr11rl",checked:"fyvr11rm"},defaultClass:"fyvr11rh"},text100:{conditions:{base:"fyvr11rn",active:"fyvr11ro",disabled:"fyvr11rp",focus:"fyvr11rq",hover:"fyvr11rr",checked:"fyvr11rs"},defaultClass:"fyvr11rn"},text80:{conditions:{base:"fyvr11rt",active:"fyvr11ru",disabled:"fyvr11rv",focus:"fyvr11rw",hover:"fyvr11rx",checked:"fyvr11ry"},defaultClass:"fyvr11rt"},text50:{conditions:{base:"fyvr11rz",active:"fyvr11s0",disabled:"fyvr11s1",focus:"fyvr11s2",hover:"fyvr11s3",checked:"fyvr11s4"},defaultClass:"fyvr11rz"},textInverse100:{conditions:{base:"fyvr11s5",active:"fyvr11s6",disabled:"fyvr11s7",focus:"fyvr11s8",hover:"fyvr11s9",checked:"fyvr11sa"},defaultClass:"fyvr11s5"},backgroundPrimary:{conditions:{base:"fyvr11sb",active:"fyvr11sc",disabled:"fyvr11sd",focus:"fyvr11se",hover:"fyvr11sf",checked:"fyvr11sg"},defaultClass:"fyvr11sb"},backgroundSecondary:{conditions:{base:"fyvr11sh",active:"fyvr11si",disabled:"fyvr11sj",focus:"fyvr11sk",hover:"fyvr11sl",checked:"fyvr11sm"},defaultClass:"fyvr11sh"},backgroundContrast:{conditions:{base:"fyvr11sn",active:"fyvr11so",disabled:"fyvr11sp",focus:"fyvr11sq",hover:"fyvr11sr",checked:"fyvr11ss"},defaultClass:"fyvr11sn"},backgroundMuted:{conditions:{base:"fyvr11st",active:"fyvr11su",disabled:"fyvr11sv",focus:"fyvr11sw",hover:"fyvr11sx",checked:"fyvr11sy"},defaultClass:"fyvr11st"},backgroundControl:{conditions:{base:"fyvr11sz",active:"fyvr11t0",disabled:"fyvr11t1",focus:"fyvr11t2",hover:"fyvr11t3",checked:"fyvr11t4"},defaultClass:"fyvr11sz"},backgroundInverse:{conditions:{base:"fyvr11t5",active:"fyvr11t6",disabled:"fyvr11t7",focus:"fyvr11t8",hover:"fyvr11t9",checked:"fyvr11ta"},defaultClass:"fyvr11t5"},backgroundBackdrop:{conditions:{base:"fyvr11tb",active:"fyvr11tc",disabled:"fyvr11td",focus:"fyvr11te",hover:"fyvr11tf",checked:"fyvr11tg"},defaultClass:"fyvr11tb"},backgroundOverlay:{conditions:{base:"fyvr11th",active:"fyvr11ti",disabled:"fyvr11tj",focus:"fyvr11tk",hover:"fyvr11tl",checked:"fyvr11tm"},defaultClass:"fyvr11th"},backgroundRaised:{conditions:{base:"fyvr11tn",active:"fyvr11to",disabled:"fyvr11tp",focus:"fyvr11tq",hover:"fyvr11tr",checked:"fyvr11ts"},defaultClass:"fyvr11tn"},buttonGlass:{conditions:{base:"fyvr11tt",active:"fyvr11tu",disabled:"fyvr11tv",focus:"fyvr11tw",hover:"fyvr11tx",checked:"fyvr11ty"},defaultClass:"fyvr11tt"},buttonEmphasis:{conditions:{base:"fyvr11tz",active:"fyvr11u0",disabled:"fyvr11u1",focus:"fyvr11u2",hover:"fyvr11u3",checked:"fyvr11u4"},defaultClass:"fyvr11tz"},buttonInverse:{conditions:{base:"fyvr11u5",active:"fyvr11u6",disabled:"fyvr11u7",focus:"fyvr11u8",hover:"fyvr11u9",checked:"fyvr11ua"},defaultClass:"fyvr11u5"},borderNormal:{conditions:{base:"fyvr11ub",active:"fyvr11uc",disabled:"fyvr11ud",focus:"fyvr11ue",hover:"fyvr11uf",checked:"fyvr11ug"},defaultClass:"fyvr11ub"},borderFocus:{conditions:{base:"fyvr11uh",active:"fyvr11ui",disabled:"fyvr11uj",focus:"fyvr11uk",hover:"fyvr11ul",checked:"fyvr11um"},defaultClass:"fyvr11uh"}}},borderBottomColor:{values:{black:{conditions:{base:"fyvr11un",active:"fyvr11uo",disabled:"fyvr11up",focus:"fyvr11uq",hover:"fyvr11ur",checked:"fyvr11us"},defaultClass:"fyvr11un"},white:{conditions:{base:"fyvr11ut",active:"fyvr11uu",disabled:"fyvr11uv",focus:"fyvr11uw",hover:"fyvr11ux",checked:"fyvr11uy"},defaultClass:"fyvr11ut"},inherit:{conditions:{base:"fyvr11uz",active:"fyvr11v0",disabled:"fyvr11v1",focus:"fyvr11v2",hover:"fyvr11v3",checked:"fyvr11v4"},defaultClass:"fyvr11uz"},transparent:{conditions:{base:"fyvr11v5",active:"fyvr11v6",disabled:"fyvr11v7",focus:"fyvr11v8",hover:"fyvr11v9",checked:"fyvr11va"},defaultClass:"fyvr11v5"},positive:{conditions:{base:"fyvr11vb",active:"fyvr11vc",disabled:"fyvr11vd",focus:"fyvr11ve",hover:"fyvr11vf",checked:"fyvr11vg"},defaultClass:"fyvr11vb"},negative:{conditions:{base:"fyvr11vh",active:"fyvr11vi",disabled:"fyvr11vj",focus:"fyvr11vk",hover:"fyvr11vl",checked:"fyvr11vm"},defaultClass:"fyvr11vh"},info:{conditions:{base:"fyvr11vn",active:"fyvr11vo",disabled:"fyvr11vp",focus:"fyvr11vq",hover:"fyvr11vr",checked:"fyvr11vs"},defaultClass:"fyvr11vn"},warning:{conditions:{base:"fyvr11vt",active:"fyvr11vu",disabled:"fyvr11vv",focus:"fyvr11vw",hover:"fyvr11vx",checked:"fyvr11vy"},defaultClass:"fyvr11vt"},gradientBackdrop:{conditions:{base:"fyvr11vz",active:"fyvr11w0",disabled:"fyvr11w1",focus:"fyvr11w2",hover:"fyvr11w3",checked:"fyvr11w4"},defaultClass:"fyvr11vz"},gradientPrimary:{conditions:{base:"fyvr11w5",active:"fyvr11w6",disabled:"fyvr11w7",focus:"fyvr11w8",hover:"fyvr11w9",checked:"fyvr11wa"},defaultClass:"fyvr11w5"},gradientSecondary:{conditions:{base:"fyvr11wb",active:"fyvr11wc",disabled:"fyvr11wd",focus:"fyvr11we",hover:"fyvr11wf",checked:"fyvr11wg"},defaultClass:"fyvr11wb"},arbitrumDark:{conditions:{base:"fyvr11wh",active:"fyvr11wi",disabled:"fyvr11wj",focus:"fyvr11wk",hover:"fyvr11wl",checked:"fyvr11wm"},defaultClass:"fyvr11wh"},arbitrumLight:{conditions:{base:"fyvr11wn",active:"fyvr11wo",disabled:"fyvr11wp",focus:"fyvr11wq",hover:"fyvr11wr",checked:"fyvr11ws"},defaultClass:"fyvr11wn"},avalanceDark:{conditions:{base:"fyvr11wt",active:"fyvr11wu",disabled:"fyvr11wv",focus:"fyvr11ww",hover:"fyvr11wx",checked:"fyvr11wy"},defaultClass:"fyvr11wt"},avalanceLight:{conditions:{base:"fyvr11wz",active:"fyvr11x0",disabled:"fyvr11x1",focus:"fyvr11x2",hover:"fyvr11x3",checked:"fyvr11x4"},defaultClass:"fyvr11wz"},bscDark:{conditions:{base:"fyvr11x5",active:"fyvr11x6",disabled:"fyvr11x7",focus:"fyvr11x8",hover:"fyvr11x9",checked:"fyvr11xa"},defaultClass:"fyvr11x5"},bscLight:{conditions:{base:"fyvr11xb",active:"fyvr11xc",disabled:"fyvr11xd",focus:"fyvr11xe",hover:"fyvr11xf",checked:"fyvr11xg"},defaultClass:"fyvr11xb"},ethereumDark:{conditions:{base:"fyvr11xh",active:"fyvr11xi",disabled:"fyvr11xj",focus:"fyvr11xk",hover:"fyvr11xl",checked:"fyvr11xm"},defaultClass:"fyvr11xh"},ethereumLight:{conditions:{base:"fyvr11xn",active:"fyvr11xo",disabled:"fyvr11xp",focus:"fyvr11xq",hover:"fyvr11xr",checked:"fyvr11xs"},defaultClass:"fyvr11xn"},gnosisDark:{conditions:{base:"fyvr11xt",active:"fyvr11xu",disabled:"fyvr11xv",focus:"fyvr11xw",hover:"fyvr11xx",checked:"fyvr11xy"},defaultClass:"fyvr11xt"},gnosisLight:{conditions:{base:"fyvr11xz",active:"fyvr11y0",disabled:"fyvr11y1",focus:"fyvr11y2",hover:"fyvr11y3",checked:"fyvr11y4"},defaultClass:"fyvr11xz"},polygonDark:{conditions:{base:"fyvr11y5",active:"fyvr11y6",disabled:"fyvr11y7",focus:"fyvr11y8",hover:"fyvr11y9",checked:"fyvr11ya"},defaultClass:"fyvr11y5"},polygonLight:{conditions:{base:"fyvr11yb",active:"fyvr11yc",disabled:"fyvr11yd",focus:"fyvr11ye",hover:"fyvr11yf",checked:"fyvr11yg"},defaultClass:"fyvr11yb"},text100:{conditions:{base:"fyvr11yh",active:"fyvr11yi",disabled:"fyvr11yj",focus:"fyvr11yk",hover:"fyvr11yl",checked:"fyvr11ym"},defaultClass:"fyvr11yh"},text80:{conditions:{base:"fyvr11yn",active:"fyvr11yo",disabled:"fyvr11yp",focus:"fyvr11yq",hover:"fyvr11yr",checked:"fyvr11ys"},defaultClass:"fyvr11yn"},text50:{conditions:{base:"fyvr11yt",active:"fyvr11yu",disabled:"fyvr11yv",focus:"fyvr11yw",hover:"fyvr11yx",checked:"fyvr11yy"},defaultClass:"fyvr11yt"},textInverse100:{conditions:{base:"fyvr11yz",active:"fyvr11z0",disabled:"fyvr11z1",focus:"fyvr11z2",hover:"fyvr11z3",checked:"fyvr11z4"},defaultClass:"fyvr11yz"},backgroundPrimary:{conditions:{base:"fyvr11z5",active:"fyvr11z6",disabled:"fyvr11z7",focus:"fyvr11z8",hover:"fyvr11z9",checked:"fyvr11za"},defaultClass:"fyvr11z5"},backgroundSecondary:{conditions:{base:"fyvr11zb",active:"fyvr11zc",disabled:"fyvr11zd",focus:"fyvr11ze",hover:"fyvr11zf",checked:"fyvr11zg"},defaultClass:"fyvr11zb"},backgroundContrast:{conditions:{base:"fyvr11zh",active:"fyvr11zi",disabled:"fyvr11zj",focus:"fyvr11zk",hover:"fyvr11zl",checked:"fyvr11zm"},defaultClass:"fyvr11zh"},backgroundMuted:{conditions:{base:"fyvr11zn",active:"fyvr11zo",disabled:"fyvr11zp",focus:"fyvr11zq",hover:"fyvr11zr",checked:"fyvr11zs"},defaultClass:"fyvr11zn"},backgroundControl:{conditions:{base:"fyvr11zt",active:"fyvr11zu",disabled:"fyvr11zv",focus:"fyvr11zw",hover:"fyvr11zx",checked:"fyvr11zy"},defaultClass:"fyvr11zt"},backgroundInverse:{conditions:{base:"fyvr11zz",active:"fyvr1200",disabled:"fyvr1201",focus:"fyvr1202",hover:"fyvr1203",checked:"fyvr1204"},defaultClass:"fyvr11zz"},backgroundBackdrop:{conditions:{base:"fyvr1205",active:"fyvr1206",disabled:"fyvr1207",focus:"fyvr1208",hover:"fyvr1209",checked:"fyvr120a"},defaultClass:"fyvr1205"},backgroundOverlay:{conditions:{base:"fyvr120b",active:"fyvr120c",disabled:"fyvr120d",focus:"fyvr120e",hover:"fyvr120f",checked:"fyvr120g"},defaultClass:"fyvr120b"},backgroundRaised:{conditions:{base:"fyvr120h",active:"fyvr120i",disabled:"fyvr120j",focus:"fyvr120k",hover:"fyvr120l",checked:"fyvr120m"},defaultClass:"fyvr120h"},buttonGlass:{conditions:{base:"fyvr120n",active:"fyvr120o",disabled:"fyvr120p",focus:"fyvr120q",hover:"fyvr120r",checked:"fyvr120s"},defaultClass:"fyvr120n"},buttonEmphasis:{conditions:{base:"fyvr120t",active:"fyvr120u",disabled:"fyvr120v",focus:"fyvr120w",hover:"fyvr120x",checked:"fyvr120y"},defaultClass:"fyvr120t"},buttonInverse:{conditions:{base:"fyvr120z",active:"fyvr1210",disabled:"fyvr1211",focus:"fyvr1212",hover:"fyvr1213",checked:"fyvr1214"},defaultClass:"fyvr120z"},borderNormal:{conditions:{base:"fyvr1215",active:"fyvr1216",disabled:"fyvr1217",focus:"fyvr1218",hover:"fyvr1219",checked:"fyvr121a"},defaultClass:"fyvr1215"},borderFocus:{conditions:{base:"fyvr121b",active:"fyvr121c",disabled:"fyvr121d",focus:"fyvr121e",hover:"fyvr121f",checked:"fyvr121g"},defaultClass:"fyvr121b"}}},borderBottomStyle:{values:{solid:{conditions:{base:"fyvr121h",active:"fyvr121i",disabled:"fyvr121j",focus:"fyvr121k",hover:"fyvr121l",checked:"fyvr121m"},defaultClass:"fyvr121h"},dashed:{conditions:{base:"fyvr121n",active:"fyvr121o",disabled:"fyvr121p",focus:"fyvr121q",hover:"fyvr121r",checked:"fyvr121s"},defaultClass:"fyvr121n"},dotted:{conditions:{base:"fyvr121t",active:"fyvr121u",disabled:"fyvr121v",focus:"fyvr121w",hover:"fyvr121x",checked:"fyvr121y"},defaultClass:"fyvr121t"}}},borderLeftColor:{values:{black:{conditions:{base:"fyvr121z",active:"fyvr1220",disabled:"fyvr1221",focus:"fyvr1222",hover:"fyvr1223",checked:"fyvr1224"},defaultClass:"fyvr121z"},white:{conditions:{base:"fyvr1225",active:"fyvr1226",disabled:"fyvr1227",focus:"fyvr1228",hover:"fyvr1229",checked:"fyvr122a"},defaultClass:"fyvr1225"},inherit:{conditions:{base:"fyvr122b",active:"fyvr122c",disabled:"fyvr122d",focus:"fyvr122e",hover:"fyvr122f",checked:"fyvr122g"},defaultClass:"fyvr122b"},transparent:{conditions:{base:"fyvr122h",active:"fyvr122i",disabled:"fyvr122j",focus:"fyvr122k",hover:"fyvr122l",checked:"fyvr122m"},defaultClass:"fyvr122h"},positive:{conditions:{base:"fyvr122n",active:"fyvr122o",disabled:"fyvr122p",focus:"fyvr122q",hover:"fyvr122r",checked:"fyvr122s"},defaultClass:"fyvr122n"},negative:{conditions:{base:"fyvr122t",active:"fyvr122u",disabled:"fyvr122v",focus:"fyvr122w",hover:"fyvr122x",checked:"fyvr122y"},defaultClass:"fyvr122t"},info:{conditions:{base:"fyvr122z",active:"fyvr1230",disabled:"fyvr1231",focus:"fyvr1232",hover:"fyvr1233",checked:"fyvr1234"},defaultClass:"fyvr122z"},warning:{conditions:{base:"fyvr1235",active:"fyvr1236",disabled:"fyvr1237",focus:"fyvr1238",hover:"fyvr1239",checked:"fyvr123a"},defaultClass:"fyvr1235"},gradientBackdrop:{conditions:{base:"fyvr123b",active:"fyvr123c",disabled:"fyvr123d",focus:"fyvr123e",hover:"fyvr123f",checked:"fyvr123g"},defaultClass:"fyvr123b"},gradientPrimary:{conditions:{base:"fyvr123h",active:"fyvr123i",disabled:"fyvr123j",focus:"fyvr123k",hover:"fyvr123l",checked:"fyvr123m"},defaultClass:"fyvr123h"},gradientSecondary:{conditions:{base:"fyvr123n",active:"fyvr123o",disabled:"fyvr123p",focus:"fyvr123q",hover:"fyvr123r",checked:"fyvr123s"},defaultClass:"fyvr123n"},arbitrumDark:{conditions:{base:"fyvr123t",active:"fyvr123u",disabled:"fyvr123v",focus:"fyvr123w",hover:"fyvr123x",checked:"fyvr123y"},defaultClass:"fyvr123t"},arbitrumLight:{conditions:{base:"fyvr123z",active:"fyvr1240",disabled:"fyvr1241",focus:"fyvr1242",hover:"fyvr1243",checked:"fyvr1244"},defaultClass:"fyvr123z"},avalanceDark:{conditions:{base:"fyvr1245",active:"fyvr1246",disabled:"fyvr1247",focus:"fyvr1248",hover:"fyvr1249",checked:"fyvr124a"},defaultClass:"fyvr1245"},avalanceLight:{conditions:{base:"fyvr124b",active:"fyvr124c",disabled:"fyvr124d",focus:"fyvr124e",hover:"fyvr124f",checked:"fyvr124g"},defaultClass:"fyvr124b"},bscDark:{conditions:{base:"fyvr124h",active:"fyvr124i",disabled:"fyvr124j",focus:"fyvr124k",hover:"fyvr124l",checked:"fyvr124m"},defaultClass:"fyvr124h"},bscLight:{conditions:{base:"fyvr124n",active:"fyvr124o",disabled:"fyvr124p",focus:"fyvr124q",hover:"fyvr124r",checked:"fyvr124s"},defaultClass:"fyvr124n"},ethereumDark:{conditions:{base:"fyvr124t",active:"fyvr124u",disabled:"fyvr124v",focus:"fyvr124w",hover:"fyvr124x",checked:"fyvr124y"},defaultClass:"fyvr124t"},ethereumLight:{conditions:{base:"fyvr124z",active:"fyvr1250",disabled:"fyvr1251",focus:"fyvr1252",hover:"fyvr1253",checked:"fyvr1254"},defaultClass:"fyvr124z"},gnosisDark:{conditions:{base:"fyvr1255",active:"fyvr1256",disabled:"fyvr1257",focus:"fyvr1258",hover:"fyvr1259",checked:"fyvr125a"},defaultClass:"fyvr1255"},gnosisLight:{conditions:{base:"fyvr125b",active:"fyvr125c",disabled:"fyvr125d",focus:"fyvr125e",hover:"fyvr125f",checked:"fyvr125g"},defaultClass:"fyvr125b"},polygonDark:{conditions:{base:"fyvr125h",active:"fyvr125i",disabled:"fyvr125j",focus:"fyvr125k",hover:"fyvr125l",checked:"fyvr125m"},defaultClass:"fyvr125h"},polygonLight:{conditions:{base:"fyvr125n",active:"fyvr125o",disabled:"fyvr125p",focus:"fyvr125q",hover:"fyvr125r",checked:"fyvr125s"},defaultClass:"fyvr125n"},text100:{conditions:{base:"fyvr125t",active:"fyvr125u",disabled:"fyvr125v",focus:"fyvr125w",hover:"fyvr125x",checked:"fyvr125y"},defaultClass:"fyvr125t"},text80:{conditions:{base:"fyvr125z",active:"fyvr1260",disabled:"fyvr1261",focus:"fyvr1262",hover:"fyvr1263",checked:"fyvr1264"},defaultClass:"fyvr125z"},text50:{conditions:{base:"fyvr1265",active:"fyvr1266",disabled:"fyvr1267",focus:"fyvr1268",hover:"fyvr1269",checked:"fyvr126a"},defaultClass:"fyvr1265"},textInverse100:{conditions:{base:"fyvr126b",active:"fyvr126c",disabled:"fyvr126d",focus:"fyvr126e",hover:"fyvr126f",checked:"fyvr126g"},defaultClass:"fyvr126b"},backgroundPrimary:{conditions:{base:"fyvr126h",active:"fyvr126i",disabled:"fyvr126j",focus:"fyvr126k",hover:"fyvr126l",checked:"fyvr126m"},defaultClass:"fyvr126h"},backgroundSecondary:{conditions:{base:"fyvr126n",active:"fyvr126o",disabled:"fyvr126p",focus:"fyvr126q",hover:"fyvr126r",checked:"fyvr126s"},defaultClass:"fyvr126n"},backgroundContrast:{conditions:{base:"fyvr126t",active:"fyvr126u",disabled:"fyvr126v",focus:"fyvr126w",hover:"fyvr126x",checked:"fyvr126y"},defaultClass:"fyvr126t"},backgroundMuted:{conditions:{base:"fyvr126z",active:"fyvr1270",disabled:"fyvr1271",focus:"fyvr1272",hover:"fyvr1273",checked:"fyvr1274"},defaultClass:"fyvr126z"},backgroundControl:{conditions:{base:"fyvr1275",active:"fyvr1276",disabled:"fyvr1277",focus:"fyvr1278",hover:"fyvr1279",checked:"fyvr127a"},defaultClass:"fyvr1275"},backgroundInverse:{conditions:{base:"fyvr127b",active:"fyvr127c",disabled:"fyvr127d",focus:"fyvr127e",hover:"fyvr127f",checked:"fyvr127g"},defaultClass:"fyvr127b"},backgroundBackdrop:{conditions:{base:"fyvr127h",active:"fyvr127i",disabled:"fyvr127j",focus:"fyvr127k",hover:"fyvr127l",checked:"fyvr127m"},defaultClass:"fyvr127h"},backgroundOverlay:{conditions:{base:"fyvr127n",active:"fyvr127o",disabled:"fyvr127p",focus:"fyvr127q",hover:"fyvr127r",checked:"fyvr127s"},defaultClass:"fyvr127n"},backgroundRaised:{conditions:{base:"fyvr127t",active:"fyvr127u",disabled:"fyvr127v",focus:"fyvr127w",hover:"fyvr127x",checked:"fyvr127y"},defaultClass:"fyvr127t"},buttonGlass:{conditions:{base:"fyvr127z",active:"fyvr1280",disabled:"fyvr1281",focus:"fyvr1282",hover:"fyvr1283",checked:"fyvr1284"},defaultClass:"fyvr127z"},buttonEmphasis:{conditions:{base:"fyvr1285",active:"fyvr1286",disabled:"fyvr1287",focus:"fyvr1288",hover:"fyvr1289",checked:"fyvr128a"},defaultClass:"fyvr1285"},buttonInverse:{conditions:{base:"fyvr128b",active:"fyvr128c",disabled:"fyvr128d",focus:"fyvr128e",hover:"fyvr128f",checked:"fyvr128g"},defaultClass:"fyvr128b"},borderNormal:{conditions:{base:"fyvr128h",active:"fyvr128i",disabled:"fyvr128j",focus:"fyvr128k",hover:"fyvr128l",checked:"fyvr128m"},defaultClass:"fyvr128h"},borderFocus:{conditions:{base:"fyvr128n",active:"fyvr128o",disabled:"fyvr128p",focus:"fyvr128q",hover:"fyvr128r",checked:"fyvr128s"},defaultClass:"fyvr128n"}}},borderLeftStyle:{values:{solid:{conditions:{base:"fyvr128t",active:"fyvr128u",disabled:"fyvr128v",focus:"fyvr128w",hover:"fyvr128x",checked:"fyvr128y"},defaultClass:"fyvr128t"},dashed:{conditions:{base:"fyvr128z",active:"fyvr1290",disabled:"fyvr1291",focus:"fyvr1292",hover:"fyvr1293",checked:"fyvr1294"},defaultClass:"fyvr128z"},dotted:{conditions:{base:"fyvr1295",active:"fyvr1296",disabled:"fyvr1297",focus:"fyvr1298",hover:"fyvr1299",checked:"fyvr129a"},defaultClass:"fyvr1295"}}},borderRightColor:{values:{black:{conditions:{base:"fyvr129b",active:"fyvr129c",disabled:"fyvr129d",focus:"fyvr129e",hover:"fyvr129f",checked:"fyvr129g"},defaultClass:"fyvr129b"},white:{conditions:{base:"fyvr129h",active:"fyvr129i",disabled:"fyvr129j",focus:"fyvr129k",hover:"fyvr129l",checked:"fyvr129m"},defaultClass:"fyvr129h"},inherit:{conditions:{base:"fyvr129n",active:"fyvr129o",disabled:"fyvr129p",focus:"fyvr129q",hover:"fyvr129r",checked:"fyvr129s"},defaultClass:"fyvr129n"},transparent:{conditions:{base:"fyvr129t",active:"fyvr129u",disabled:"fyvr129v",focus:"fyvr129w",hover:"fyvr129x",checked:"fyvr129y"},defaultClass:"fyvr129t"},positive:{conditions:{base:"fyvr129z",active:"fyvr12a0",disabled:"fyvr12a1",focus:"fyvr12a2",hover:"fyvr12a3",checked:"fyvr12a4"},defaultClass:"fyvr129z"},negative:{conditions:{base:"fyvr12a5",active:"fyvr12a6",disabled:"fyvr12a7",focus:"fyvr12a8",hover:"fyvr12a9",checked:"fyvr12aa"},defaultClass:"fyvr12a5"},info:{conditions:{base:"fyvr12ab",active:"fyvr12ac",disabled:"fyvr12ad",focus:"fyvr12ae",hover:"fyvr12af",checked:"fyvr12ag"},defaultClass:"fyvr12ab"},warning:{conditions:{base:"fyvr12ah",active:"fyvr12ai",disabled:"fyvr12aj",focus:"fyvr12ak",hover:"fyvr12al",checked:"fyvr12am"},defaultClass:"fyvr12ah"},gradientBackdrop:{conditions:{base:"fyvr12an",active:"fyvr12ao",disabled:"fyvr12ap",focus:"fyvr12aq",hover:"fyvr12ar",checked:"fyvr12as"},defaultClass:"fyvr12an"},gradientPrimary:{conditions:{base:"fyvr12at",active:"fyvr12au",disabled:"fyvr12av",focus:"fyvr12aw",hover:"fyvr12ax",checked:"fyvr12ay"},defaultClass:"fyvr12at"},gradientSecondary:{conditions:{base:"fyvr12az",active:"fyvr12b0",disabled:"fyvr12b1",focus:"fyvr12b2",hover:"fyvr12b3",checked:"fyvr12b4"},defaultClass:"fyvr12az"},arbitrumDark:{conditions:{base:"fyvr12b5",active:"fyvr12b6",disabled:"fyvr12b7",focus:"fyvr12b8",hover:"fyvr12b9",checked:"fyvr12ba"},defaultClass:"fyvr12b5"},arbitrumLight:{conditions:{base:"fyvr12bb",active:"fyvr12bc",disabled:"fyvr12bd",focus:"fyvr12be",hover:"fyvr12bf",checked:"fyvr12bg"},defaultClass:"fyvr12bb"},avalanceDark:{conditions:{base:"fyvr12bh",active:"fyvr12bi",disabled:"fyvr12bj",focus:"fyvr12bk",hover:"fyvr12bl",checked:"fyvr12bm"},defaultClass:"fyvr12bh"},avalanceLight:{conditions:{base:"fyvr12bn",active:"fyvr12bo",disabled:"fyvr12bp",focus:"fyvr12bq",hover:"fyvr12br",checked:"fyvr12bs"},defaultClass:"fyvr12bn"},bscDark:{conditions:{base:"fyvr12bt",active:"fyvr12bu",disabled:"fyvr12bv",focus:"fyvr12bw",hover:"fyvr12bx",checked:"fyvr12by"},defaultClass:"fyvr12bt"},bscLight:{conditions:{base:"fyvr12bz",active:"fyvr12c0",disabled:"fyvr12c1",focus:"fyvr12c2",hover:"fyvr12c3",checked:"fyvr12c4"},defaultClass:"fyvr12bz"},ethereumDark:{conditions:{base:"fyvr12c5",active:"fyvr12c6",disabled:"fyvr12c7",focus:"fyvr12c8",hover:"fyvr12c9",checked:"fyvr12ca"},defaultClass:"fyvr12c5"},ethereumLight:{conditions:{base:"fyvr12cb",active:"fyvr12cc",disabled:"fyvr12cd",focus:"fyvr12ce",hover:"fyvr12cf",checked:"fyvr12cg"},defaultClass:"fyvr12cb"},gnosisDark:{conditions:{base:"fyvr12ch",active:"fyvr12ci",disabled:"fyvr12cj",focus:"fyvr12ck",hover:"fyvr12cl",checked:"fyvr12cm"},defaultClass:"fyvr12ch"},gnosisLight:{conditions:{base:"fyvr12cn",active:"fyvr12co",disabled:"fyvr12cp",focus:"fyvr12cq",hover:"fyvr12cr",checked:"fyvr12cs"},defaultClass:"fyvr12cn"},polygonDark:{conditions:{base:"fyvr12ct",active:"fyvr12cu",disabled:"fyvr12cv",focus:"fyvr12cw",hover:"fyvr12cx",checked:"fyvr12cy"},defaultClass:"fyvr12ct"},polygonLight:{conditions:{base:"fyvr12cz",active:"fyvr12d0",disabled:"fyvr12d1",focus:"fyvr12d2",hover:"fyvr12d3",checked:"fyvr12d4"},defaultClass:"fyvr12cz"},text100:{conditions:{base:"fyvr12d5",active:"fyvr12d6",disabled:"fyvr12d7",focus:"fyvr12d8",hover:"fyvr12d9",checked:"fyvr12da"},defaultClass:"fyvr12d5"},text80:{conditions:{base:"fyvr12db",active:"fyvr12dc",disabled:"fyvr12dd",focus:"fyvr12de",hover:"fyvr12df",checked:"fyvr12dg"},defaultClass:"fyvr12db"},text50:{conditions:{base:"fyvr12dh",active:"fyvr12di",disabled:"fyvr12dj",focus:"fyvr12dk",hover:"fyvr12dl",checked:"fyvr12dm"},defaultClass:"fyvr12dh"},textInverse100:{conditions:{base:"fyvr12dn",active:"fyvr12do",disabled:"fyvr12dp",focus:"fyvr12dq",hover:"fyvr12dr",checked:"fyvr12ds"},defaultClass:"fyvr12dn"},backgroundPrimary:{conditions:{base:"fyvr12dt",active:"fyvr12du",disabled:"fyvr12dv",focus:"fyvr12dw",hover:"fyvr12dx",checked:"fyvr12dy"},defaultClass:"fyvr12dt"},backgroundSecondary:{conditions:{base:"fyvr12dz",active:"fyvr12e0",disabled:"fyvr12e1",focus:"fyvr12e2",hover:"fyvr12e3",checked:"fyvr12e4"},defaultClass:"fyvr12dz"},backgroundContrast:{conditions:{base:"fyvr12e5",active:"fyvr12e6",disabled:"fyvr12e7",focus:"fyvr12e8",hover:"fyvr12e9",checked:"fyvr12ea"},defaultClass:"fyvr12e5"},backgroundMuted:{conditions:{base:"fyvr12eb",active:"fyvr12ec",disabled:"fyvr12ed",focus:"fyvr12ee",hover:"fyvr12ef",checked:"fyvr12eg"},defaultClass:"fyvr12eb"},backgroundControl:{conditions:{base:"fyvr12eh",active:"fyvr12ei",disabled:"fyvr12ej",focus:"fyvr12ek",hover:"fyvr12el",checked:"fyvr12em"},defaultClass:"fyvr12eh"},backgroundInverse:{conditions:{base:"fyvr12en",active:"fyvr12eo",disabled:"fyvr12ep",focus:"fyvr12eq",hover:"fyvr12er",checked:"fyvr12es"},defaultClass:"fyvr12en"},backgroundBackdrop:{conditions:{base:"fyvr12et",active:"fyvr12eu",disabled:"fyvr12ev",focus:"fyvr12ew",hover:"fyvr12ex",checked:"fyvr12ey"},defaultClass:"fyvr12et"},backgroundOverlay:{conditions:{base:"fyvr12ez",active:"fyvr12f0",disabled:"fyvr12f1",focus:"fyvr12f2",hover:"fyvr12f3",checked:"fyvr12f4"},defaultClass:"fyvr12ez"},backgroundRaised:{conditions:{base:"fyvr12f5",active:"fyvr12f6",disabled:"fyvr12f7",focus:"fyvr12f8",hover:"fyvr12f9",checked:"fyvr12fa"},defaultClass:"fyvr12f5"},buttonGlass:{conditions:{base:"fyvr12fb",active:"fyvr12fc",disabled:"fyvr12fd",focus:"fyvr12fe",hover:"fyvr12ff",checked:"fyvr12fg"},defaultClass:"fyvr12fb"},buttonEmphasis:{conditions:{base:"fyvr12fh",active:"fyvr12fi",disabled:"fyvr12fj",focus:"fyvr12fk",hover:"fyvr12fl",checked:"fyvr12fm"},defaultClass:"fyvr12fh"},buttonInverse:{conditions:{base:"fyvr12fn",active:"fyvr12fo",disabled:"fyvr12fp",focus:"fyvr12fq",hover:"fyvr12fr",checked:"fyvr12fs"},defaultClass:"fyvr12fn"},borderNormal:{conditions:{base:"fyvr12ft",active:"fyvr12fu",disabled:"fyvr12fv",focus:"fyvr12fw",hover:"fyvr12fx",checked:"fyvr12fy"},defaultClass:"fyvr12ft"},borderFocus:{conditions:{base:"fyvr12fz",active:"fyvr12g0",disabled:"fyvr12g1",focus:"fyvr12g2",hover:"fyvr12g3",checked:"fyvr12g4"},defaultClass:"fyvr12fz"}}},borderRightStyle:{values:{solid:{conditions:{base:"fyvr12g5",active:"fyvr12g6",disabled:"fyvr12g7",focus:"fyvr12g8",hover:"fyvr12g9",checked:"fyvr12ga"},defaultClass:"fyvr12g5"},dashed:{conditions:{base:"fyvr12gb",active:"fyvr12gc",disabled:"fyvr12gd",focus:"fyvr12ge",hover:"fyvr12gf",checked:"fyvr12gg"},defaultClass:"fyvr12gb"},dotted:{conditions:{base:"fyvr12gh",active:"fyvr12gi",disabled:"fyvr12gj",focus:"fyvr12gk",hover:"fyvr12gl",checked:"fyvr12gm"},defaultClass:"fyvr12gh"}}},borderTopColor:{values:{black:{conditions:{base:"fyvr12gn",active:"fyvr12go",disabled:"fyvr12gp",focus:"fyvr12gq",hover:"fyvr12gr",checked:"fyvr12gs"},defaultClass:"fyvr12gn"},white:{conditions:{base:"fyvr12gt",active:"fyvr12gu",disabled:"fyvr12gv",focus:"fyvr12gw",hover:"fyvr12gx",checked:"fyvr12gy"},defaultClass:"fyvr12gt"},inherit:{conditions:{base:"fyvr12gz",active:"fyvr12h0",disabled:"fyvr12h1",focus:"fyvr12h2",hover:"fyvr12h3",checked:"fyvr12h4"},defaultClass:"fyvr12gz"},transparent:{conditions:{base:"fyvr12h5",active:"fyvr12h6",disabled:"fyvr12h7",focus:"fyvr12h8",hover:"fyvr12h9",checked:"fyvr12ha"},defaultClass:"fyvr12h5"},positive:{conditions:{base:"fyvr12hb",active:"fyvr12hc",disabled:"fyvr12hd",focus:"fyvr12he",hover:"fyvr12hf",checked:"fyvr12hg"},defaultClass:"fyvr12hb"},negative:{conditions:{base:"fyvr12hh",active:"fyvr12hi",disabled:"fyvr12hj",focus:"fyvr12hk",hover:"fyvr12hl",checked:"fyvr12hm"},defaultClass:"fyvr12hh"},info:{conditions:{base:"fyvr12hn",active:"fyvr12ho",disabled:"fyvr12hp",focus:"fyvr12hq",hover:"fyvr12hr",checked:"fyvr12hs"},defaultClass:"fyvr12hn"},warning:{conditions:{base:"fyvr12ht",active:"fyvr12hu",disabled:"fyvr12hv",focus:"fyvr12hw",hover:"fyvr12hx",checked:"fyvr12hy"},defaultClass:"fyvr12ht"},gradientBackdrop:{conditions:{base:"fyvr12hz",active:"fyvr12i0",disabled:"fyvr12i1",focus:"fyvr12i2",hover:"fyvr12i3",checked:"fyvr12i4"},defaultClass:"fyvr12hz"},gradientPrimary:{conditions:{base:"fyvr12i5",active:"fyvr12i6",disabled:"fyvr12i7",focus:"fyvr12i8",hover:"fyvr12i9",checked:"fyvr12ia"},defaultClass:"fyvr12i5"},gradientSecondary:{conditions:{base:"fyvr12ib",active:"fyvr12ic",disabled:"fyvr12id",focus:"fyvr12ie",hover:"fyvr12if",checked:"fyvr12ig"},defaultClass:"fyvr12ib"},arbitrumDark:{conditions:{base:"fyvr12ih",active:"fyvr12ii",disabled:"fyvr12ij",focus:"fyvr12ik",hover:"fyvr12il",checked:"fyvr12im"},defaultClass:"fyvr12ih"},arbitrumLight:{conditions:{base:"fyvr12in",active:"fyvr12io",disabled:"fyvr12ip",focus:"fyvr12iq",hover:"fyvr12ir",checked:"fyvr12is"},defaultClass:"fyvr12in"},avalanceDark:{conditions:{base:"fyvr12it",active:"fyvr12iu",disabled:"fyvr12iv",focus:"fyvr12iw",hover:"fyvr12ix",checked:"fyvr12iy"},defaultClass:"fyvr12it"},avalanceLight:{conditions:{base:"fyvr12iz",active:"fyvr12j0",disabled:"fyvr12j1",focus:"fyvr12j2",hover:"fyvr12j3",checked:"fyvr12j4"},defaultClass:"fyvr12iz"},bscDark:{conditions:{base:"fyvr12j5",active:"fyvr12j6",disabled:"fyvr12j7",focus:"fyvr12j8",hover:"fyvr12j9",checked:"fyvr12ja"},defaultClass:"fyvr12j5"},bscLight:{conditions:{base:"fyvr12jb",active:"fyvr12jc",disabled:"fyvr12jd",focus:"fyvr12je",hover:"fyvr12jf",checked:"fyvr12jg"},defaultClass:"fyvr12jb"},ethereumDark:{conditions:{base:"fyvr12jh",active:"fyvr12ji",disabled:"fyvr12jj",focus:"fyvr12jk",hover:"fyvr12jl",checked:"fyvr12jm"},defaultClass:"fyvr12jh"},ethereumLight:{conditions:{base:"fyvr12jn",active:"fyvr12jo",disabled:"fyvr12jp",focus:"fyvr12jq",hover:"fyvr12jr",checked:"fyvr12js"},defaultClass:"fyvr12jn"},gnosisDark:{conditions:{base:"fyvr12jt",active:"fyvr12ju",disabled:"fyvr12jv",focus:"fyvr12jw",hover:"fyvr12jx",checked:"fyvr12jy"},defaultClass:"fyvr12jt"},gnosisLight:{conditions:{base:"fyvr12jz",active:"fyvr12k0",disabled:"fyvr12k1",focus:"fyvr12k2",hover:"fyvr12k3",checked:"fyvr12k4"},defaultClass:"fyvr12jz"},polygonDark:{conditions:{base:"fyvr12k5",active:"fyvr12k6",disabled:"fyvr12k7",focus:"fyvr12k8",hover:"fyvr12k9",checked:"fyvr12ka"},defaultClass:"fyvr12k5"},polygonLight:{conditions:{base:"fyvr12kb",active:"fyvr12kc",disabled:"fyvr12kd",focus:"fyvr12ke",hover:"fyvr12kf",checked:"fyvr12kg"},defaultClass:"fyvr12kb"},text100:{conditions:{base:"fyvr12kh",active:"fyvr12ki",disabled:"fyvr12kj",focus:"fyvr12kk",hover:"fyvr12kl",checked:"fyvr12km"},defaultClass:"fyvr12kh"},text80:{conditions:{base:"fyvr12kn",active:"fyvr12ko",disabled:"fyvr12kp",focus:"fyvr12kq",hover:"fyvr12kr",checked:"fyvr12ks"},defaultClass:"fyvr12kn"},text50:{conditions:{base:"fyvr12kt",active:"fyvr12ku",disabled:"fyvr12kv",focus:"fyvr12kw",hover:"fyvr12kx",checked:"fyvr12ky"},defaultClass:"fyvr12kt"},textInverse100:{conditions:{base:"fyvr12kz",active:"fyvr12l0",disabled:"fyvr12l1",focus:"fyvr12l2",hover:"fyvr12l3",checked:"fyvr12l4"},defaultClass:"fyvr12kz"},backgroundPrimary:{conditions:{base:"fyvr12l5",active:"fyvr12l6",disabled:"fyvr12l7",focus:"fyvr12l8",hover:"fyvr12l9",checked:"fyvr12la"},defaultClass:"fyvr12l5"},backgroundSecondary:{conditions:{base:"fyvr12lb",active:"fyvr12lc",disabled:"fyvr12ld",focus:"fyvr12le",hover:"fyvr12lf",checked:"fyvr12lg"},defaultClass:"fyvr12lb"},backgroundContrast:{conditions:{base:"fyvr12lh",active:"fyvr12li",disabled:"fyvr12lj",focus:"fyvr12lk",hover:"fyvr12ll",checked:"fyvr12lm"},defaultClass:"fyvr12lh"},backgroundMuted:{conditions:{base:"fyvr12ln",active:"fyvr12lo",disabled:"fyvr12lp",focus:"fyvr12lq",hover:"fyvr12lr",checked:"fyvr12ls"},defaultClass:"fyvr12ln"},backgroundControl:{conditions:{base:"fyvr12lt",active:"fyvr12lu",disabled:"fyvr12lv",focus:"fyvr12lw",hover:"fyvr12lx",checked:"fyvr12ly"},defaultClass:"fyvr12lt"},backgroundInverse:{conditions:{base:"fyvr12lz",active:"fyvr12m0",disabled:"fyvr12m1",focus:"fyvr12m2",hover:"fyvr12m3",checked:"fyvr12m4"},defaultClass:"fyvr12lz"},backgroundBackdrop:{conditions:{base:"fyvr12m5",active:"fyvr12m6",disabled:"fyvr12m7",focus:"fyvr12m8",hover:"fyvr12m9",checked:"fyvr12ma"},defaultClass:"fyvr12m5"},backgroundOverlay:{conditions:{base:"fyvr12mb",active:"fyvr12mc",disabled:"fyvr12md",focus:"fyvr12me",hover:"fyvr12mf",checked:"fyvr12mg"},defaultClass:"fyvr12mb"},backgroundRaised:{conditions:{base:"fyvr12mh",active:"fyvr12mi",disabled:"fyvr12mj",focus:"fyvr12mk",hover:"fyvr12ml",checked:"fyvr12mm"},defaultClass:"fyvr12mh"},buttonGlass:{conditions:{base:"fyvr12mn",active:"fyvr12mo",disabled:"fyvr12mp",focus:"fyvr12mq",hover:"fyvr12mr",checked:"fyvr12ms"},defaultClass:"fyvr12mn"},buttonEmphasis:{conditions:{base:"fyvr12mt",active:"fyvr12mu",disabled:"fyvr12mv",focus:"fyvr12mw",hover:"fyvr12mx",checked:"fyvr12my"},defaultClass:"fyvr12mt"},buttonInverse:{conditions:{base:"fyvr12mz",active:"fyvr12n0",disabled:"fyvr12n1",focus:"fyvr12n2",hover:"fyvr12n3",checked:"fyvr12n4"},defaultClass:"fyvr12mz"},borderNormal:{conditions:{base:"fyvr12n5",active:"fyvr12n6",disabled:"fyvr12n7",focus:"fyvr12n8",hover:"fyvr12n9",checked:"fyvr12na"},defaultClass:"fyvr12n5"},borderFocus:{conditions:{base:"fyvr12nb",active:"fyvr12nc",disabled:"fyvr12nd",focus:"fyvr12ne",hover:"fyvr12nf",checked:"fyvr12ng"},defaultClass:"fyvr12nb"}}},borderTopStyle:{values:{solid:{conditions:{base:"fyvr12nh",active:"fyvr12ni",disabled:"fyvr12nj",focus:"fyvr12nk",hover:"fyvr12nl",checked:"fyvr12nm"},defaultClass:"fyvr12nh"},dashed:{conditions:{base:"fyvr12nn",active:"fyvr12no",disabled:"fyvr12np",focus:"fyvr12nq",hover:"fyvr12nr",checked:"fyvr12ns"},defaultClass:"fyvr12nn"},dotted:{conditions:{base:"fyvr12nt",active:"fyvr12nu",disabled:"fyvr12nv",focus:"fyvr12nw",hover:"fyvr12nx",checked:"fyvr12ny"},defaultClass:"fyvr12nt"}}},color:{values:{black:{conditions:{base:"fyvr12nz",active:"fyvr12o0",disabled:"fyvr12o1",focus:"fyvr12o2",hover:"fyvr12o3",checked:"fyvr12o4"},defaultClass:"fyvr12nz"},white:{conditions:{base:"fyvr12o5",active:"fyvr12o6",disabled:"fyvr12o7",focus:"fyvr12o8",hover:"fyvr12o9",checked:"fyvr12oa"},defaultClass:"fyvr12o5"},inherit:{conditions:{base:"fyvr12ob",active:"fyvr12oc",disabled:"fyvr12od",focus:"fyvr12oe",hover:"fyvr12of",checked:"fyvr12og"},defaultClass:"fyvr12ob"},transparent:{conditions:{base:"fyvr12oh",active:"fyvr12oi",disabled:"fyvr12oj",focus:"fyvr12ok",hover:"fyvr12ol",checked:"fyvr12om"},defaultClass:"fyvr12oh"},positive:{conditions:{base:"fyvr12on",active:"fyvr12oo",disabled:"fyvr12op",focus:"fyvr12oq",hover:"fyvr12or",checked:"fyvr12os"},defaultClass:"fyvr12on"},negative:{conditions:{base:"fyvr12ot",active:"fyvr12ou",disabled:"fyvr12ov",focus:"fyvr12ow",hover:"fyvr12ox",checked:"fyvr12oy"},defaultClass:"fyvr12ot"},info:{conditions:{base:"fyvr12oz",active:"fyvr12p0",disabled:"fyvr12p1",focus:"fyvr12p2",hover:"fyvr12p3",checked:"fyvr12p4"},defaultClass:"fyvr12oz"},warning:{conditions:{base:"fyvr12p5",active:"fyvr12p6",disabled:"fyvr12p7",focus:"fyvr12p8",hover:"fyvr12p9",checked:"fyvr12pa"},defaultClass:"fyvr12p5"},gradientBackdrop:{conditions:{base:"fyvr12pb",active:"fyvr12pc",disabled:"fyvr12pd",focus:"fyvr12pe",hover:"fyvr12pf",checked:"fyvr12pg"},defaultClass:"fyvr12pb"},gradientPrimary:{conditions:{base:"fyvr12ph",active:"fyvr12pi",disabled:"fyvr12pj",focus:"fyvr12pk",hover:"fyvr12pl",checked:"fyvr12pm"},defaultClass:"fyvr12ph"},gradientSecondary:{conditions:{base:"fyvr12pn",active:"fyvr12po",disabled:"fyvr12pp",focus:"fyvr12pq",hover:"fyvr12pr",checked:"fyvr12ps"},defaultClass:"fyvr12pn"},arbitrumDark:{conditions:{base:"fyvr12pt",active:"fyvr12pu",disabled:"fyvr12pv",focus:"fyvr12pw",hover:"fyvr12px",checked:"fyvr12py"},defaultClass:"fyvr12pt"},arbitrumLight:{conditions:{base:"fyvr12pz",active:"fyvr12q0",disabled:"fyvr12q1",focus:"fyvr12q2",hover:"fyvr12q3",checked:"fyvr12q4"},defaultClass:"fyvr12pz"},avalanceDark:{conditions:{base:"fyvr12q5",active:"fyvr12q6",disabled:"fyvr12q7",focus:"fyvr12q8",hover:"fyvr12q9",checked:"fyvr12qa"},defaultClass:"fyvr12q5"},avalanceLight:{conditions:{base:"fyvr12qb",active:"fyvr12qc",disabled:"fyvr12qd",focus:"fyvr12qe",hover:"fyvr12qf",checked:"fyvr12qg"},defaultClass:"fyvr12qb"},bscDark:{conditions:{base:"fyvr12qh",active:"fyvr12qi",disabled:"fyvr12qj",focus:"fyvr12qk",hover:"fyvr12ql",checked:"fyvr12qm"},defaultClass:"fyvr12qh"},bscLight:{conditions:{base:"fyvr12qn",active:"fyvr12qo",disabled:"fyvr12qp",focus:"fyvr12qq",hover:"fyvr12qr",checked:"fyvr12qs"},defaultClass:"fyvr12qn"},ethereumDark:{conditions:{base:"fyvr12qt",active:"fyvr12qu",disabled:"fyvr12qv",focus:"fyvr12qw",hover:"fyvr12qx",checked:"fyvr12qy"},defaultClass:"fyvr12qt"},ethereumLight:{conditions:{base:"fyvr12qz",active:"fyvr12r0",disabled:"fyvr12r1",focus:"fyvr12r2",hover:"fyvr12r3",checked:"fyvr12r4"},defaultClass:"fyvr12qz"},gnosisDark:{conditions:{base:"fyvr12r5",active:"fyvr12r6",disabled:"fyvr12r7",focus:"fyvr12r8",hover:"fyvr12r9",checked:"fyvr12ra"},defaultClass:"fyvr12r5"},gnosisLight:{conditions:{base:"fyvr12rb",active:"fyvr12rc",disabled:"fyvr12rd",focus:"fyvr12re",hover:"fyvr12rf",checked:"fyvr12rg"},defaultClass:"fyvr12rb"},polygonDark:{conditions:{base:"fyvr12rh",active:"fyvr12ri",disabled:"fyvr12rj",focus:"fyvr12rk",hover:"fyvr12rl",checked:"fyvr12rm"},defaultClass:"fyvr12rh"},polygonLight:{conditions:{base:"fyvr12rn",active:"fyvr12ro",disabled:"fyvr12rp",focus:"fyvr12rq",hover:"fyvr12rr",checked:"fyvr12rs"},defaultClass:"fyvr12rn"},text100:{conditions:{base:"fyvr12rt",active:"fyvr12ru",disabled:"fyvr12rv",focus:"fyvr12rw",hover:"fyvr12rx",checked:"fyvr12ry"},defaultClass:"fyvr12rt"},text80:{conditions:{base:"fyvr12rz",active:"fyvr12s0",disabled:"fyvr12s1",focus:"fyvr12s2",hover:"fyvr12s3",checked:"fyvr12s4"},defaultClass:"fyvr12rz"},text50:{conditions:{base:"fyvr12s5",active:"fyvr12s6",disabled:"fyvr12s7",focus:"fyvr12s8",hover:"fyvr12s9",checked:"fyvr12sa"},defaultClass:"fyvr12s5"},textInverse100:{conditions:{base:"fyvr12sb",active:"fyvr12sc",disabled:"fyvr12sd",focus:"fyvr12se",hover:"fyvr12sf",checked:"fyvr12sg"},defaultClass:"fyvr12sb"},backgroundPrimary:{conditions:{base:"fyvr12sh",active:"fyvr12si",disabled:"fyvr12sj",focus:"fyvr12sk",hover:"fyvr12sl",checked:"fyvr12sm"},defaultClass:"fyvr12sh"},backgroundSecondary:{conditions:{base:"fyvr12sn",active:"fyvr12so",disabled:"fyvr12sp",focus:"fyvr12sq",hover:"fyvr12sr",checked:"fyvr12ss"},defaultClass:"fyvr12sn"},backgroundContrast:{conditions:{base:"fyvr12st",active:"fyvr12su",disabled:"fyvr12sv",focus:"fyvr12sw",hover:"fyvr12sx",checked:"fyvr12sy"},defaultClass:"fyvr12st"},backgroundMuted:{conditions:{base:"fyvr12sz",active:"fyvr12t0",disabled:"fyvr12t1",focus:"fyvr12t2",hover:"fyvr12t3",checked:"fyvr12t4"},defaultClass:"fyvr12sz"},backgroundControl:{conditions:{base:"fyvr12t5",active:"fyvr12t6",disabled:"fyvr12t7",focus:"fyvr12t8",hover:"fyvr12t9",checked:"fyvr12ta"},defaultClass:"fyvr12t5"},backgroundInverse:{conditions:{base:"fyvr12tb",active:"fyvr12tc",disabled:"fyvr12td",focus:"fyvr12te",hover:"fyvr12tf",checked:"fyvr12tg"},defaultClass:"fyvr12tb"},backgroundBackdrop:{conditions:{base:"fyvr12th",active:"fyvr12ti",disabled:"fyvr12tj",focus:"fyvr12tk",hover:"fyvr12tl",checked:"fyvr12tm"},defaultClass:"fyvr12th"},backgroundOverlay:{conditions:{base:"fyvr12tn",active:"fyvr12to",disabled:"fyvr12tp",focus:"fyvr12tq",hover:"fyvr12tr",checked:"fyvr12ts"},defaultClass:"fyvr12tn"},backgroundRaised:{conditions:{base:"fyvr12tt",active:"fyvr12tu",disabled:"fyvr12tv",focus:"fyvr12tw",hover:"fyvr12tx",checked:"fyvr12ty"},defaultClass:"fyvr12tt"},buttonGlass:{conditions:{base:"fyvr12tz",active:"fyvr12u0",disabled:"fyvr12u1",focus:"fyvr12u2",hover:"fyvr12u3",checked:"fyvr12u4"},defaultClass:"fyvr12tz"},buttonEmphasis:{conditions:{base:"fyvr12u5",active:"fyvr12u6",disabled:"fyvr12u7",focus:"fyvr12u8",hover:"fyvr12u9",checked:"fyvr12ua"},defaultClass:"fyvr12u5"},buttonInverse:{conditions:{base:"fyvr12ub",active:"fyvr12uc",disabled:"fyvr12ud",focus:"fyvr12ue",hover:"fyvr12uf",checked:"fyvr12ug"},defaultClass:"fyvr12ub"},borderNormal:{conditions:{base:"fyvr12uh",active:"fyvr12ui",disabled:"fyvr12uj",focus:"fyvr12uk",hover:"fyvr12ul",checked:"fyvr12um"},defaultClass:"fyvr12uh"},borderFocus:{conditions:{base:"fyvr12un",active:"fyvr12uo",disabled:"fyvr12up",focus:"fyvr12uq",hover:"fyvr12ur",checked:"fyvr12us"},defaultClass:"fyvr12un"}}},cursor:{values:{default:{conditions:{base:"fyvr12ut",active:"fyvr12uu",disabled:"fyvr12uv",focus:"fyvr12uw",hover:"fyvr12ux",checked:"fyvr12uy"},defaultClass:"fyvr12ut"},pointer:{conditions:{base:"fyvr12uz",active:"fyvr12v0",disabled:"fyvr12v1",focus:"fyvr12v2",hover:"fyvr12v3",checked:"fyvr12v4"},defaultClass:"fyvr12uz"},text:{conditions:{base:"fyvr12v5",active:"fyvr12v6",disabled:"fyvr12v7",focus:"fyvr12v8",hover:"fyvr12v9",checked:"fyvr12va"},defaultClass:"fyvr12v5"}}},opacity:{values:{0:{conditions:{base:"fyvr12vb",active:"fyvr12vc",disabled:"fyvr12vd",focus:"fyvr12ve",hover:"fyvr12vf",checked:"fyvr12vg"},defaultClass:"fyvr12vb"},50:{conditions:{base:"fyvr12vh",active:"fyvr12vi",disabled:"fyvr12vj",focus:"fyvr12vk",hover:"fyvr12vl",checked:"fyvr12vm"},defaultClass:"fyvr12vh"},80:{conditions:{base:"fyvr12vn",active:"fyvr12vo",disabled:"fyvr12vp",focus:"fyvr12vq",hover:"fyvr12vr",checked:"fyvr12vs"},defaultClass:"fyvr12vn"},100:{conditions:{base:"fyvr12vt",active:"fyvr12vu",disabled:"fyvr12vv",focus:"fyvr12vw",hover:"fyvr12vx",checked:"fyvr12vy"},defaultClass:"fyvr12vt"}}},pointerEvents:{values:{none:{conditions:{base:"fyvr12vz",active:"fyvr12w0",disabled:"fyvr12w1",focus:"fyvr12w2",hover:"fyvr12w3",checked:"fyvr12w4"},defaultClass:"fyvr12vz"},auto:{conditions:{base:"fyvr12w5",active:"fyvr12w6",disabled:"fyvr12w7",focus:"fyvr12w8",hover:"fyvr12w9",checked:"fyvr12wa"},defaultClass:"fyvr12w5"}}},outline:{values:{none:{conditions:{base:"fyvr12wb",active:"fyvr12wc",disabled:"fyvr12wd",focus:"fyvr12we",hover:"fyvr12wf",checked:"fyvr12wg"},defaultClass:"fyvr12wb"}}},boxShadow:{values:{none:{conditions:{base:"fyvr12wh",active:"fyvr12wi",disabled:"fyvr12wj",focus:"fyvr12wk",hover:"fyvr12wl",checked:"fyvr12wm"},defaultClass:"fyvr12wh"}}}}});const vre=["alignItems","alignSelf","flexDirection","gap","justifyContent","justifySelf","placeItems"],Qx=t=>(t.display||(t.display=Object.keys(t).some(e=>vre.includes(e))?"flex":void 0),bN(t));Qx.properties=bN.properties;function wN(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e{const{as:r="div",sx:n={},className:i,...s}=t,o={},a={};for(const l in s)Qx.properties.has(l)?o[l]=s[l]:a[l]=s[l];const c=Qx({...o,...n});return C.createElement(r,{className:Si(c,i),...a,ref:e})});var EN={exports:{}},Jd={};/** + )`,gradientPrimary:"linear-gradient(89.69deg, #4411E1 0.27%, #7537F9 99.73%)",gradientSecondary:"linear-gradient(32.51deg, #951990 -15.23%, #3A35B1 48.55%, #20A8B0 100%)",arbitrumDark:"#212D44",arbitrumLight:"#93D4FF",avalanceDark:"#810C0C",avalanceLight:"#FF8080",bscDark:"#584508",bscLight:"#FCCF43",ethereumDark:"#132362",ethereumLight:"#AABBFF",gnosisDark:"#084246",gnosisLight:"#8CF6FD",polygonDark:"#350881",polygonLight:"#C7A6FF"},Ure={...KN,text100:"rgba(255, 255, 255, 1)",text80:"rgba(255, 255, 255, 0.8)",text50:"rgba(255, 255, 255, 0.5)",textInverse100:"rgba(0, 0, 0, 1)",backgroundPrimary:"rgba(0, 0, 0, 1)",backgroundSecondary:"rgba(255, 255, 255, 0.1)",backgroundContrast:"rgba(0, 0, 0, 0.5)",backgroundMuted:"rgba(255, 255, 255, 0.05)",backgroundControl:"rgba(255, 255, 255, 0.25)",backgroundInverse:"rgba(255, 255, 255, 1)",backgroundBackdrop:"rgba(34, 34, 34, 0.9)",backgroundOverlay:"rgba(0, 0, 0, 0.7)",backgroundRaised:"rgba(54, 54, 54, 0.7)",buttonGlass:"rgba(255, 255, 255, 0.15)",buttonEmphasis:"rgba(0, 0, 0, 0.5)",buttonInverse:"rgba(255, 255, 255, 0.8)",borderNormal:"rgba(255, 255, 255, 0.25)",borderFocus:"rgba(255, 255, 255, 0.5)"},zre={...KN,text100:"rgba(0, 0, 0, 1)",text80:"rgba(0, 0, 0, 0.8)",text50:"rgba(0, 0, 0, 0.5)",textInverse100:"rgba(255, 255, 255, 1)",backgroundPrimary:"rgba(244, 244, 244, 1)",backgroundSecondary:"rgba(0, 0, 0, 0.1)",backgroundContrast:"rgba(244, 244, 244, 0.5)",backgroundMuted:"rgba(0, 0, 0, 0.05)",backgroundControl:"rgba(0, 0, 0, 0.25)",backgroundInverse:"rgba(0, 0, 0, 1)",backgroundBackdrop:"rgba(221, 221, 221, 0.9)",backgroundOverlay:"rgba(244, 244, 244, 0.7)",backgroundRaised:"rgba(192, 192, 192, 0.7)",buttonGlass:"rgba(0, 0, 0, 0.15)",buttonEmphasis:"rgba(255, 255, 255, 0.5)",buttonInverse:"rgba(0, 0, 0, 0.8)",borderNormal:"rgba(0, 0, 0, 0.25)",borderFocus:"rgba(0, 0, 0, 0.5)"},Wre={dark:Ure,light:zre},Hre={inherit:{fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit",fontWeight:"inherit"},xlarge:{fontFamily:"body",fontSize:"xlarge",lineHeight:"9",letterSpacing:"none",fontWeight:"bold"},large:{fontFamily:"body",fontSize:"large",lineHeight:"7",letterSpacing:"normal",fontWeight:"semibold"},medium:{fontFamily:"body",fontSize:"medium",lineHeight:"6",letterSpacing:"normal",fontWeight:"bold"},normal:{fontFamily:"body",fontSize:"normal",lineHeight:"5",letterSpacing:"wide",fontWeight:"normal"},small:{fontFamily:"body",fontSize:"small",lineHeight:"4",letterSpacing:"wide",fontWeight:"medium"},xsmall:{fontFamily:"body",fontSize:"xsmall",lineHeight:"4",letterSpacing:"wide",fontWeight:"bold"},code:{fontFamily:"mono",fontSize:"normal",lineHeight:"5",letterSpacing:"none",fontWeight:"normal"}},sP={sm:0,md:480,lg:769,xl:1281};var oP={colors:{black:"var(--colors-black)",white:"var(--colors-white)",inherit:"var(--colors-inherit)",transparent:"var(--colors-transparent)",positive:"var(--colors-positive)",negative:"var(--colors-negative)",info:"var(--colors-info)",warning:"var(--colors-warning)",gradientBackdrop:"var(--colors-gradient-backdrop)",gradientPrimary:"var(--colors-gradient-primary)",gradientSecondary:"var(--colors-gradient-secondary)",arbitrumDark:"var(--colors-arbitrum-dark)",arbitrumLight:"var(--colors-arbitrum-light)",avalanceDark:"var(--colors-avalance-dark)",avalanceLight:"var(--colors-avalance-light)",bscDark:"var(--colors-bsc-dark)",bscLight:"var(--colors-bsc-light)",ethereumDark:"var(--colors-ethereum-dark)",ethereumLight:"var(--colors-ethereum-light)",gnosisDark:"var(--colors-gnosis-dark)",gnosisLight:"var(--colors-gnosis-light)",polygonDark:"var(--colors-polygon-dark)",polygonLight:"var(--colors-polygon-light)",text100:"var(--colors-text100)",text80:"var(--colors-text80)",text50:"var(--colors-text50)",textInverse100:"var(--colors-text-inverse100)",backgroundPrimary:"var(--colors-background-primary)",backgroundSecondary:"var(--colors-background-secondary)",backgroundContrast:"var(--colors-background-contrast)",backgroundMuted:"var(--colors-background-muted)",backgroundControl:"var(--colors-background-control)",backgroundInverse:"var(--colors-background-inverse)",backgroundBackdrop:"var(--colors-background-backdrop)",backgroundOverlay:"var(--colors-background-overlay)",backgroundRaised:"var(--colors-background-raised)",buttonGlass:"var(--colors-button-glass)",buttonEmphasis:"var(--colors-button-emphasis)",buttonInverse:"var(--colors-button-inverse)",borderNormal:"var(--colors-border-normal)",borderFocus:"var(--colors-border-focus)"}},ve={blur:{blur:"var(--blur-blur)",none:"var(--blur-none)"},borderWidths:{none:"var(--border-widths-none)",thin:"var(--border-widths-thin)",thick:"var(--border-widths-thick)"},fonts:{inherit:"var(--fonts-inherit)",body:"var(--fonts-body)",mono:"var(--fonts-mono)"},fontSizes:{inherit:"var(--font-sizes-inherit)",xsmall:"var(--font-sizes-xsmall)",small:"var(--font-sizes-small)",normal:"var(--font-sizes-normal)",medium:"var(--font-sizes-medium)",large:"var(--font-sizes-large)",xlarge:"var(--font-sizes-xlarge)"},fontWeights:{inherit:"var(--font-weights-inherit)",normal:"var(--font-weights-normal)",medium:"var(--font-weights-medium)",semibold:"var(--font-weights-semibold)",bold:"var(--font-weights-bold)"},letterSpacings:{inherit:"var(--letter-spacings-inherit)",none:"var(--letter-spacings-none)",normal:"var(--letter-spacings-normal)",wide:"var(--letter-spacings-wide)"},lineHeights:{4:"var(--line-heights-4)",5:"var(--line-heights-5)",6:"var(--line-heights-6)",7:"var(--line-heights-7)",9:"var(--line-heights-9)",inherit:"var(--line-heights-inherit)"},opacity:{0:"var(--opacity-0)",50:"var(--opacity-50)",80:"var(--opacity-80)",100:"var(--opacity-100)"},radii:{none:"var(--radii-none)",xs:"var(--radii-xs)",sm:"var(--radii-sm)",md:"var(--radii-md)",lg:"var(--radii-lg)",circle:"var(--radii-circle)"},space:{0:"var(--space-0)",1:"var(--space-1)",2:"var(--space-2)",3:"var(--space-3)",4:"var(--space-4)",5:"var(--space-5)",6:"var(--space-6)",7:"var(--space-7)",8:"var(--space-8)",9:"var(--space-9)",10:"var(--space-10)",12:"var(--space-12)",14:"var(--space-14)",16:"var(--space-16)","0.25":"var(--space-0_25)","0.5":"var(--space-0_5)","1.5":"var(--space-1_5)"},colors:{black:"var(--colors-black)",white:"var(--colors-white)",inherit:"var(--colors-inherit)",transparent:"var(--colors-transparent)",positive:"var(--colors-positive)",negative:"var(--colors-negative)",info:"var(--colors-info)",warning:"var(--colors-warning)",gradientBackdrop:"var(--colors-gradient-backdrop)",gradientPrimary:"var(--colors-gradient-primary)",gradientSecondary:"var(--colors-gradient-secondary)",arbitrumDark:"var(--colors-arbitrum-dark)",arbitrumLight:"var(--colors-arbitrum-light)",avalanceDark:"var(--colors-avalance-dark)",avalanceLight:"var(--colors-avalance-light)",bscDark:"var(--colors-bsc-dark)",bscLight:"var(--colors-bsc-light)",ethereumDark:"var(--colors-ethereum-dark)",ethereumLight:"var(--colors-ethereum-light)",gnosisDark:"var(--colors-gnosis-dark)",gnosisLight:"var(--colors-gnosis-light)",polygonDark:"var(--colors-polygon-dark)",polygonLight:"var(--colors-polygon-light)",text100:"var(--colors-text100)",text80:"var(--colors-text80)",text50:"var(--colors-text50)",textInverse100:"var(--colors-text-inverse100)",backgroundPrimary:"var(--colors-background-primary)",backgroundSecondary:"var(--colors-background-secondary)",backgroundContrast:"var(--colors-background-contrast)",backgroundMuted:"var(--colors-background-muted)",backgroundControl:"var(--colors-background-control)",backgroundInverse:"var(--colors-background-inverse)",backgroundBackdrop:"var(--colors-background-backdrop)",backgroundOverlay:"var(--colors-background-overlay)",backgroundRaised:"var(--colors-background-raised)",buttonGlass:"var(--colors-button-glass)",buttonEmphasis:"var(--colors-button-emphasis)",buttonInverse:"var(--colors-button-inverse)",borderNormal:"var(--colors-border-normal)",borderFocus:"var(--colors-border-focus)"}};function qre(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Vre(t){var e=qre(t,"string");return typeof e=="symbol"?e:String(e)}function Gre(t,e,r){return e=Vre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function aP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function T2(t){for(var e=1;efunction(){for(var e=arguments.length,r=new Array(e),n=0;nc.styles)),s=Object.keys(i),o=s.filter(c=>"mappings"in i[c]),a=c=>{var l=[],u={},f=T2({},c),d=!1;for(var h of o){var p=c[h];if(p!=null){var v=i[h];d=!0;for(var b of v.mappings)u[b]=p,f[b]==null&&delete f[b]}}var y=d?T2(T2({},u),f):c,m=function(){var T=y[g],w=i[g];try{if(w.mappings)return"continue";if(typeof T=="string"||typeof T=="number")l.push(w.values[T].defaultClass);else if(Array.isArray(T))for(var I=0;It,Yre=function(){return Kre(Qre)(...arguments)},QN=Yre({conditions:{defaultCondition:"sm",conditionNames:["sm","md","lg","xl"],responsiveArray:void 0},styles:{borderWidth:{mappings:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"]},borderRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderLeftRadius:{mappings:["borderBottomLeftRadius","borderTopLeftRadius"]},borderRightRadius:{mappings:["borderBottomRightRadius","borderTopRightRadius"]},borderTopRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius"]},borderBottomRadius:{mappings:["borderBottomLeftRadius","borderBottomRightRadius"]},margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},overflow:{mappings:["overflowX","overflowY"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},placeItems:{mappings:["justifyContent","alignItems"]},inset:{mappings:["top","bottom","left","right"]},width:{values:{0:{conditions:{sm:"fyvr10",md:"fyvr11",lg:"fyvr12",xl:"fyvr13"},defaultClass:"fyvr10"},1:{conditions:{sm:"fyvr14",md:"fyvr15",lg:"fyvr16",xl:"fyvr17"},defaultClass:"fyvr14"},2:{conditions:{sm:"fyvr18",md:"fyvr19",lg:"fyvr1a",xl:"fyvr1b"},defaultClass:"fyvr18"},3:{conditions:{sm:"fyvr1c",md:"fyvr1d",lg:"fyvr1e",xl:"fyvr1f"},defaultClass:"fyvr1c"},4:{conditions:{sm:"fyvr1g",md:"fyvr1h",lg:"fyvr1i",xl:"fyvr1j"},defaultClass:"fyvr1g"},5:{conditions:{sm:"fyvr1k",md:"fyvr1l",lg:"fyvr1m",xl:"fyvr1n"},defaultClass:"fyvr1k"},6:{conditions:{sm:"fyvr1o",md:"fyvr1p",lg:"fyvr1q",xl:"fyvr1r"},defaultClass:"fyvr1o"},7:{conditions:{sm:"fyvr1s",md:"fyvr1t",lg:"fyvr1u",xl:"fyvr1v"},defaultClass:"fyvr1s"},8:{conditions:{sm:"fyvr1w",md:"fyvr1x",lg:"fyvr1y",xl:"fyvr1z"},defaultClass:"fyvr1w"},9:{conditions:{sm:"fyvr110",md:"fyvr111",lg:"fyvr112",xl:"fyvr113"},defaultClass:"fyvr110"},10:{conditions:{sm:"fyvr114",md:"fyvr115",lg:"fyvr116",xl:"fyvr117"},defaultClass:"fyvr114"},12:{conditions:{sm:"fyvr118",md:"fyvr119",lg:"fyvr11a",xl:"fyvr11b"},defaultClass:"fyvr118"},14:{conditions:{sm:"fyvr11c",md:"fyvr11d",lg:"fyvr11e",xl:"fyvr11f"},defaultClass:"fyvr11c"},16:{conditions:{sm:"fyvr11g",md:"fyvr11h",lg:"fyvr11i",xl:"fyvr11j"},defaultClass:"fyvr11g"},"0.25":{conditions:{sm:"fyvr11k",md:"fyvr11l",lg:"fyvr11m",xl:"fyvr11n"},defaultClass:"fyvr11k"},"0.5":{conditions:{sm:"fyvr11o",md:"fyvr11p",lg:"fyvr11q",xl:"fyvr11r"},defaultClass:"fyvr11o"},"1.5":{conditions:{sm:"fyvr11s",md:"fyvr11t",lg:"fyvr11u",xl:"fyvr11v"},defaultClass:"fyvr11s"},none:{conditions:{sm:"fyvr11w",md:"fyvr11x",lg:"fyvr11y",xl:"fyvr11z"},defaultClass:"fyvr11w"},px:{conditions:{sm:"fyvr120",md:"fyvr121",lg:"fyvr122",xl:"fyvr123"},defaultClass:"fyvr120"},auto:{conditions:{sm:"fyvr124",md:"fyvr125",lg:"fyvr126",xl:"fyvr127"},defaultClass:"fyvr124"},full:{conditions:{sm:"fyvr128",md:"fyvr129",lg:"fyvr12a",xl:"fyvr12b"},defaultClass:"fyvr128"},"1/2":{conditions:{sm:"fyvr12c",md:"fyvr12d",lg:"fyvr12e",xl:"fyvr12f"},defaultClass:"fyvr12c"},"1/3":{conditions:{sm:"fyvr12g",md:"fyvr12h",lg:"fyvr12i",xl:"fyvr12j"},defaultClass:"fyvr12g"},"2/3":{conditions:{sm:"fyvr12k",md:"fyvr12l",lg:"fyvr12m",xl:"fyvr12n"},defaultClass:"fyvr12k"},"1/4":{conditions:{sm:"fyvr12o",md:"fyvr12p",lg:"fyvr12q",xl:"fyvr12r"},defaultClass:"fyvr12o"},"3/4":{conditions:{sm:"fyvr12s",md:"fyvr12t",lg:"fyvr12u",xl:"fyvr12v"},defaultClass:"fyvr12s"},fit:{conditions:{sm:"fyvr12w",md:"fyvr12x",lg:"fyvr12y",xl:"fyvr12z"},defaultClass:"fyvr12w"},max:{conditions:{sm:"fyvr130",md:"fyvr131",lg:"fyvr132",xl:"fyvr133"},defaultClass:"fyvr130"},min:{conditions:{sm:"fyvr134",md:"fyvr135",lg:"fyvr136",xl:"fyvr137"},defaultClass:"fyvr134"},vw:{conditions:{sm:"fyvr138",md:"fyvr139",lg:"fyvr13a",xl:"fyvr13b"},defaultClass:"fyvr138"},vh:{conditions:{sm:"fyvr13c",md:"fyvr13d",lg:"fyvr13e",xl:"fyvr13f"},defaultClass:"fyvr13c"}}},height:{values:{0:{conditions:{sm:"fyvr13g",md:"fyvr13h",lg:"fyvr13i",xl:"fyvr13j"},defaultClass:"fyvr13g"},1:{conditions:{sm:"fyvr13k",md:"fyvr13l",lg:"fyvr13m",xl:"fyvr13n"},defaultClass:"fyvr13k"},2:{conditions:{sm:"fyvr13o",md:"fyvr13p",lg:"fyvr13q",xl:"fyvr13r"},defaultClass:"fyvr13o"},3:{conditions:{sm:"fyvr13s",md:"fyvr13t",lg:"fyvr13u",xl:"fyvr13v"},defaultClass:"fyvr13s"},4:{conditions:{sm:"fyvr13w",md:"fyvr13x",lg:"fyvr13y",xl:"fyvr13z"},defaultClass:"fyvr13w"},5:{conditions:{sm:"fyvr140",md:"fyvr141",lg:"fyvr142",xl:"fyvr143"},defaultClass:"fyvr140"},6:{conditions:{sm:"fyvr144",md:"fyvr145",lg:"fyvr146",xl:"fyvr147"},defaultClass:"fyvr144"},7:{conditions:{sm:"fyvr148",md:"fyvr149",lg:"fyvr14a",xl:"fyvr14b"},defaultClass:"fyvr148"},8:{conditions:{sm:"fyvr14c",md:"fyvr14d",lg:"fyvr14e",xl:"fyvr14f"},defaultClass:"fyvr14c"},9:{conditions:{sm:"fyvr14g",md:"fyvr14h",lg:"fyvr14i",xl:"fyvr14j"},defaultClass:"fyvr14g"},10:{conditions:{sm:"fyvr14k",md:"fyvr14l",lg:"fyvr14m",xl:"fyvr14n"},defaultClass:"fyvr14k"},12:{conditions:{sm:"fyvr14o",md:"fyvr14p",lg:"fyvr14q",xl:"fyvr14r"},defaultClass:"fyvr14o"},14:{conditions:{sm:"fyvr14s",md:"fyvr14t",lg:"fyvr14u",xl:"fyvr14v"},defaultClass:"fyvr14s"},16:{conditions:{sm:"fyvr14w",md:"fyvr14x",lg:"fyvr14y",xl:"fyvr14z"},defaultClass:"fyvr14w"},"0.25":{conditions:{sm:"fyvr150",md:"fyvr151",lg:"fyvr152",xl:"fyvr153"},defaultClass:"fyvr150"},"0.5":{conditions:{sm:"fyvr154",md:"fyvr155",lg:"fyvr156",xl:"fyvr157"},defaultClass:"fyvr154"},"1.5":{conditions:{sm:"fyvr158",md:"fyvr159",lg:"fyvr15a",xl:"fyvr15b"},defaultClass:"fyvr158"},none:{conditions:{sm:"fyvr15c",md:"fyvr15d",lg:"fyvr15e",xl:"fyvr15f"},defaultClass:"fyvr15c"},px:{conditions:{sm:"fyvr15g",md:"fyvr15h",lg:"fyvr15i",xl:"fyvr15j"},defaultClass:"fyvr15g"},auto:{conditions:{sm:"fyvr15k",md:"fyvr15l",lg:"fyvr15m",xl:"fyvr15n"},defaultClass:"fyvr15k"},full:{conditions:{sm:"fyvr15o",md:"fyvr15p",lg:"fyvr15q",xl:"fyvr15r"},defaultClass:"fyvr15o"},"1/2":{conditions:{sm:"fyvr15s",md:"fyvr15t",lg:"fyvr15u",xl:"fyvr15v"},defaultClass:"fyvr15s"},"1/3":{conditions:{sm:"fyvr15w",md:"fyvr15x",lg:"fyvr15y",xl:"fyvr15z"},defaultClass:"fyvr15w"},"2/3":{conditions:{sm:"fyvr160",md:"fyvr161",lg:"fyvr162",xl:"fyvr163"},defaultClass:"fyvr160"},"1/4":{conditions:{sm:"fyvr164",md:"fyvr165",lg:"fyvr166",xl:"fyvr167"},defaultClass:"fyvr164"},"3/4":{conditions:{sm:"fyvr168",md:"fyvr169",lg:"fyvr16a",xl:"fyvr16b"},defaultClass:"fyvr168"},fit:{conditions:{sm:"fyvr16c",md:"fyvr16d",lg:"fyvr16e",xl:"fyvr16f"},defaultClass:"fyvr16c"},max:{conditions:{sm:"fyvr16g",md:"fyvr16h",lg:"fyvr16i",xl:"fyvr16j"},defaultClass:"fyvr16g"},min:{conditions:{sm:"fyvr16k",md:"fyvr16l",lg:"fyvr16m",xl:"fyvr16n"},defaultClass:"fyvr16k"},vw:{conditions:{sm:"fyvr16o",md:"fyvr16p",lg:"fyvr16q",xl:"fyvr16r"},defaultClass:"fyvr16o"},vh:{conditions:{sm:"fyvr16s",md:"fyvr16t",lg:"fyvr16u",xl:"fyvr16v"},defaultClass:"fyvr16s"}}},maxWidth:{values:{0:{conditions:{sm:"fyvr16w",md:"fyvr16x",lg:"fyvr16y",xl:"fyvr16z"},defaultClass:"fyvr16w"},1:{conditions:{sm:"fyvr170",md:"fyvr171",lg:"fyvr172",xl:"fyvr173"},defaultClass:"fyvr170"},2:{conditions:{sm:"fyvr174",md:"fyvr175",lg:"fyvr176",xl:"fyvr177"},defaultClass:"fyvr174"},3:{conditions:{sm:"fyvr178",md:"fyvr179",lg:"fyvr17a",xl:"fyvr17b"},defaultClass:"fyvr178"},4:{conditions:{sm:"fyvr17c",md:"fyvr17d",lg:"fyvr17e",xl:"fyvr17f"},defaultClass:"fyvr17c"},5:{conditions:{sm:"fyvr17g",md:"fyvr17h",lg:"fyvr17i",xl:"fyvr17j"},defaultClass:"fyvr17g"},6:{conditions:{sm:"fyvr17k",md:"fyvr17l",lg:"fyvr17m",xl:"fyvr17n"},defaultClass:"fyvr17k"},7:{conditions:{sm:"fyvr17o",md:"fyvr17p",lg:"fyvr17q",xl:"fyvr17r"},defaultClass:"fyvr17o"},8:{conditions:{sm:"fyvr17s",md:"fyvr17t",lg:"fyvr17u",xl:"fyvr17v"},defaultClass:"fyvr17s"},9:{conditions:{sm:"fyvr17w",md:"fyvr17x",lg:"fyvr17y",xl:"fyvr17z"},defaultClass:"fyvr17w"},10:{conditions:{sm:"fyvr180",md:"fyvr181",lg:"fyvr182",xl:"fyvr183"},defaultClass:"fyvr180"},12:{conditions:{sm:"fyvr184",md:"fyvr185",lg:"fyvr186",xl:"fyvr187"},defaultClass:"fyvr184"},14:{conditions:{sm:"fyvr188",md:"fyvr189",lg:"fyvr18a",xl:"fyvr18b"},defaultClass:"fyvr188"},16:{conditions:{sm:"fyvr18c",md:"fyvr18d",lg:"fyvr18e",xl:"fyvr18f"},defaultClass:"fyvr18c"},"0.25":{conditions:{sm:"fyvr18g",md:"fyvr18h",lg:"fyvr18i",xl:"fyvr18j"},defaultClass:"fyvr18g"},"0.5":{conditions:{sm:"fyvr18k",md:"fyvr18l",lg:"fyvr18m",xl:"fyvr18n"},defaultClass:"fyvr18k"},"1.5":{conditions:{sm:"fyvr18o",md:"fyvr18p",lg:"fyvr18q",xl:"fyvr18r"},defaultClass:"fyvr18o"},none:{conditions:{sm:"fyvr18s",md:"fyvr18t",lg:"fyvr18u",xl:"fyvr18v"},defaultClass:"fyvr18s"},px:{conditions:{sm:"fyvr18w",md:"fyvr18x",lg:"fyvr18y",xl:"fyvr18z"},defaultClass:"fyvr18w"},auto:{conditions:{sm:"fyvr190",md:"fyvr191",lg:"fyvr192",xl:"fyvr193"},defaultClass:"fyvr190"},full:{conditions:{sm:"fyvr194",md:"fyvr195",lg:"fyvr196",xl:"fyvr197"},defaultClass:"fyvr194"},"1/2":{conditions:{sm:"fyvr198",md:"fyvr199",lg:"fyvr19a",xl:"fyvr19b"},defaultClass:"fyvr198"},"1/3":{conditions:{sm:"fyvr19c",md:"fyvr19d",lg:"fyvr19e",xl:"fyvr19f"},defaultClass:"fyvr19c"},"2/3":{conditions:{sm:"fyvr19g",md:"fyvr19h",lg:"fyvr19i",xl:"fyvr19j"},defaultClass:"fyvr19g"},"1/4":{conditions:{sm:"fyvr19k",md:"fyvr19l",lg:"fyvr19m",xl:"fyvr19n"},defaultClass:"fyvr19k"},"3/4":{conditions:{sm:"fyvr19o",md:"fyvr19p",lg:"fyvr19q",xl:"fyvr19r"},defaultClass:"fyvr19o"},fit:{conditions:{sm:"fyvr19s",md:"fyvr19t",lg:"fyvr19u",xl:"fyvr19v"},defaultClass:"fyvr19s"},max:{conditions:{sm:"fyvr19w",md:"fyvr19x",lg:"fyvr19y",xl:"fyvr19z"},defaultClass:"fyvr19w"},min:{conditions:{sm:"fyvr1a0",md:"fyvr1a1",lg:"fyvr1a2",xl:"fyvr1a3"},defaultClass:"fyvr1a0"},vw:{conditions:{sm:"fyvr1a4",md:"fyvr1a5",lg:"fyvr1a6",xl:"fyvr1a7"},defaultClass:"fyvr1a4"},vh:{conditions:{sm:"fyvr1a8",md:"fyvr1a9",lg:"fyvr1aa",xl:"fyvr1ab"},defaultClass:"fyvr1a8"}}},maxHeight:{values:{0:{conditions:{sm:"fyvr1ac",md:"fyvr1ad",lg:"fyvr1ae",xl:"fyvr1af"},defaultClass:"fyvr1ac"},1:{conditions:{sm:"fyvr1ag",md:"fyvr1ah",lg:"fyvr1ai",xl:"fyvr1aj"},defaultClass:"fyvr1ag"},2:{conditions:{sm:"fyvr1ak",md:"fyvr1al",lg:"fyvr1am",xl:"fyvr1an"},defaultClass:"fyvr1ak"},3:{conditions:{sm:"fyvr1ao",md:"fyvr1ap",lg:"fyvr1aq",xl:"fyvr1ar"},defaultClass:"fyvr1ao"},4:{conditions:{sm:"fyvr1as",md:"fyvr1at",lg:"fyvr1au",xl:"fyvr1av"},defaultClass:"fyvr1as"},5:{conditions:{sm:"fyvr1aw",md:"fyvr1ax",lg:"fyvr1ay",xl:"fyvr1az"},defaultClass:"fyvr1aw"},6:{conditions:{sm:"fyvr1b0",md:"fyvr1b1",lg:"fyvr1b2",xl:"fyvr1b3"},defaultClass:"fyvr1b0"},7:{conditions:{sm:"fyvr1b4",md:"fyvr1b5",lg:"fyvr1b6",xl:"fyvr1b7"},defaultClass:"fyvr1b4"},8:{conditions:{sm:"fyvr1b8",md:"fyvr1b9",lg:"fyvr1ba",xl:"fyvr1bb"},defaultClass:"fyvr1b8"},9:{conditions:{sm:"fyvr1bc",md:"fyvr1bd",lg:"fyvr1be",xl:"fyvr1bf"},defaultClass:"fyvr1bc"},10:{conditions:{sm:"fyvr1bg",md:"fyvr1bh",lg:"fyvr1bi",xl:"fyvr1bj"},defaultClass:"fyvr1bg"},12:{conditions:{sm:"fyvr1bk",md:"fyvr1bl",lg:"fyvr1bm",xl:"fyvr1bn"},defaultClass:"fyvr1bk"},14:{conditions:{sm:"fyvr1bo",md:"fyvr1bp",lg:"fyvr1bq",xl:"fyvr1br"},defaultClass:"fyvr1bo"},16:{conditions:{sm:"fyvr1bs",md:"fyvr1bt",lg:"fyvr1bu",xl:"fyvr1bv"},defaultClass:"fyvr1bs"},"0.25":{conditions:{sm:"fyvr1bw",md:"fyvr1bx",lg:"fyvr1by",xl:"fyvr1bz"},defaultClass:"fyvr1bw"},"0.5":{conditions:{sm:"fyvr1c0",md:"fyvr1c1",lg:"fyvr1c2",xl:"fyvr1c3"},defaultClass:"fyvr1c0"},"1.5":{conditions:{sm:"fyvr1c4",md:"fyvr1c5",lg:"fyvr1c6",xl:"fyvr1c7"},defaultClass:"fyvr1c4"},none:{conditions:{sm:"fyvr1c8",md:"fyvr1c9",lg:"fyvr1ca",xl:"fyvr1cb"},defaultClass:"fyvr1c8"},px:{conditions:{sm:"fyvr1cc",md:"fyvr1cd",lg:"fyvr1ce",xl:"fyvr1cf"},defaultClass:"fyvr1cc"},auto:{conditions:{sm:"fyvr1cg",md:"fyvr1ch",lg:"fyvr1ci",xl:"fyvr1cj"},defaultClass:"fyvr1cg"},full:{conditions:{sm:"fyvr1ck",md:"fyvr1cl",lg:"fyvr1cm",xl:"fyvr1cn"},defaultClass:"fyvr1ck"},"1/2":{conditions:{sm:"fyvr1co",md:"fyvr1cp",lg:"fyvr1cq",xl:"fyvr1cr"},defaultClass:"fyvr1co"},"1/3":{conditions:{sm:"fyvr1cs",md:"fyvr1ct",lg:"fyvr1cu",xl:"fyvr1cv"},defaultClass:"fyvr1cs"},"2/3":{conditions:{sm:"fyvr1cw",md:"fyvr1cx",lg:"fyvr1cy",xl:"fyvr1cz"},defaultClass:"fyvr1cw"},"1/4":{conditions:{sm:"fyvr1d0",md:"fyvr1d1",lg:"fyvr1d2",xl:"fyvr1d3"},defaultClass:"fyvr1d0"},"3/4":{conditions:{sm:"fyvr1d4",md:"fyvr1d5",lg:"fyvr1d6",xl:"fyvr1d7"},defaultClass:"fyvr1d4"},fit:{conditions:{sm:"fyvr1d8",md:"fyvr1d9",lg:"fyvr1da",xl:"fyvr1db"},defaultClass:"fyvr1d8"},max:{conditions:{sm:"fyvr1dc",md:"fyvr1dd",lg:"fyvr1de",xl:"fyvr1df"},defaultClass:"fyvr1dc"},min:{conditions:{sm:"fyvr1dg",md:"fyvr1dh",lg:"fyvr1di",xl:"fyvr1dj"},defaultClass:"fyvr1dg"},vw:{conditions:{sm:"fyvr1dk",md:"fyvr1dl",lg:"fyvr1dm",xl:"fyvr1dn"},defaultClass:"fyvr1dk"},vh:{conditions:{sm:"fyvr1do",md:"fyvr1dp",lg:"fyvr1dq",xl:"fyvr1dr"},defaultClass:"fyvr1do"}}},minWidth:{values:{0:{conditions:{sm:"fyvr1ds",md:"fyvr1dt",lg:"fyvr1du",xl:"fyvr1dv"},defaultClass:"fyvr1ds"},1:{conditions:{sm:"fyvr1dw",md:"fyvr1dx",lg:"fyvr1dy",xl:"fyvr1dz"},defaultClass:"fyvr1dw"},2:{conditions:{sm:"fyvr1e0",md:"fyvr1e1",lg:"fyvr1e2",xl:"fyvr1e3"},defaultClass:"fyvr1e0"},3:{conditions:{sm:"fyvr1e4",md:"fyvr1e5",lg:"fyvr1e6",xl:"fyvr1e7"},defaultClass:"fyvr1e4"},4:{conditions:{sm:"fyvr1e8",md:"fyvr1e9",lg:"fyvr1ea",xl:"fyvr1eb"},defaultClass:"fyvr1e8"},5:{conditions:{sm:"fyvr1ec",md:"fyvr1ed",lg:"fyvr1ee",xl:"fyvr1ef"},defaultClass:"fyvr1ec"},6:{conditions:{sm:"fyvr1eg",md:"fyvr1eh",lg:"fyvr1ei",xl:"fyvr1ej"},defaultClass:"fyvr1eg"},7:{conditions:{sm:"fyvr1ek",md:"fyvr1el",lg:"fyvr1em",xl:"fyvr1en"},defaultClass:"fyvr1ek"},8:{conditions:{sm:"fyvr1eo",md:"fyvr1ep",lg:"fyvr1eq",xl:"fyvr1er"},defaultClass:"fyvr1eo"},9:{conditions:{sm:"fyvr1es",md:"fyvr1et",lg:"fyvr1eu",xl:"fyvr1ev"},defaultClass:"fyvr1es"},10:{conditions:{sm:"fyvr1ew",md:"fyvr1ex",lg:"fyvr1ey",xl:"fyvr1ez"},defaultClass:"fyvr1ew"},12:{conditions:{sm:"fyvr1f0",md:"fyvr1f1",lg:"fyvr1f2",xl:"fyvr1f3"},defaultClass:"fyvr1f0"},14:{conditions:{sm:"fyvr1f4",md:"fyvr1f5",lg:"fyvr1f6",xl:"fyvr1f7"},defaultClass:"fyvr1f4"},16:{conditions:{sm:"fyvr1f8",md:"fyvr1f9",lg:"fyvr1fa",xl:"fyvr1fb"},defaultClass:"fyvr1f8"},"0.25":{conditions:{sm:"fyvr1fc",md:"fyvr1fd",lg:"fyvr1fe",xl:"fyvr1ff"},defaultClass:"fyvr1fc"},"0.5":{conditions:{sm:"fyvr1fg",md:"fyvr1fh",lg:"fyvr1fi",xl:"fyvr1fj"},defaultClass:"fyvr1fg"},"1.5":{conditions:{sm:"fyvr1fk",md:"fyvr1fl",lg:"fyvr1fm",xl:"fyvr1fn"},defaultClass:"fyvr1fk"},none:{conditions:{sm:"fyvr1fo",md:"fyvr1fp",lg:"fyvr1fq",xl:"fyvr1fr"},defaultClass:"fyvr1fo"},px:{conditions:{sm:"fyvr1fs",md:"fyvr1ft",lg:"fyvr1fu",xl:"fyvr1fv"},defaultClass:"fyvr1fs"},auto:{conditions:{sm:"fyvr1fw",md:"fyvr1fx",lg:"fyvr1fy",xl:"fyvr1fz"},defaultClass:"fyvr1fw"},full:{conditions:{sm:"fyvr1g0",md:"fyvr1g1",lg:"fyvr1g2",xl:"fyvr1g3"},defaultClass:"fyvr1g0"},"1/2":{conditions:{sm:"fyvr1g4",md:"fyvr1g5",lg:"fyvr1g6",xl:"fyvr1g7"},defaultClass:"fyvr1g4"},"1/3":{conditions:{sm:"fyvr1g8",md:"fyvr1g9",lg:"fyvr1ga",xl:"fyvr1gb"},defaultClass:"fyvr1g8"},"2/3":{conditions:{sm:"fyvr1gc",md:"fyvr1gd",lg:"fyvr1ge",xl:"fyvr1gf"},defaultClass:"fyvr1gc"},"1/4":{conditions:{sm:"fyvr1gg",md:"fyvr1gh",lg:"fyvr1gi",xl:"fyvr1gj"},defaultClass:"fyvr1gg"},"3/4":{conditions:{sm:"fyvr1gk",md:"fyvr1gl",lg:"fyvr1gm",xl:"fyvr1gn"},defaultClass:"fyvr1gk"},fit:{conditions:{sm:"fyvr1go",md:"fyvr1gp",lg:"fyvr1gq",xl:"fyvr1gr"},defaultClass:"fyvr1go"},max:{conditions:{sm:"fyvr1gs",md:"fyvr1gt",lg:"fyvr1gu",xl:"fyvr1gv"},defaultClass:"fyvr1gs"},min:{conditions:{sm:"fyvr1gw",md:"fyvr1gx",lg:"fyvr1gy",xl:"fyvr1gz"},defaultClass:"fyvr1gw"},vw:{conditions:{sm:"fyvr1h0",md:"fyvr1h1",lg:"fyvr1h2",xl:"fyvr1h3"},defaultClass:"fyvr1h0"},vh:{conditions:{sm:"fyvr1h4",md:"fyvr1h5",lg:"fyvr1h6",xl:"fyvr1h7"},defaultClass:"fyvr1h4"}}},minHeight:{values:{0:{conditions:{sm:"fyvr1h8",md:"fyvr1h9",lg:"fyvr1ha",xl:"fyvr1hb"},defaultClass:"fyvr1h8"},1:{conditions:{sm:"fyvr1hc",md:"fyvr1hd",lg:"fyvr1he",xl:"fyvr1hf"},defaultClass:"fyvr1hc"},2:{conditions:{sm:"fyvr1hg",md:"fyvr1hh",lg:"fyvr1hi",xl:"fyvr1hj"},defaultClass:"fyvr1hg"},3:{conditions:{sm:"fyvr1hk",md:"fyvr1hl",lg:"fyvr1hm",xl:"fyvr1hn"},defaultClass:"fyvr1hk"},4:{conditions:{sm:"fyvr1ho",md:"fyvr1hp",lg:"fyvr1hq",xl:"fyvr1hr"},defaultClass:"fyvr1ho"},5:{conditions:{sm:"fyvr1hs",md:"fyvr1ht",lg:"fyvr1hu",xl:"fyvr1hv"},defaultClass:"fyvr1hs"},6:{conditions:{sm:"fyvr1hw",md:"fyvr1hx",lg:"fyvr1hy",xl:"fyvr1hz"},defaultClass:"fyvr1hw"},7:{conditions:{sm:"fyvr1i0",md:"fyvr1i1",lg:"fyvr1i2",xl:"fyvr1i3"},defaultClass:"fyvr1i0"},8:{conditions:{sm:"fyvr1i4",md:"fyvr1i5",lg:"fyvr1i6",xl:"fyvr1i7"},defaultClass:"fyvr1i4"},9:{conditions:{sm:"fyvr1i8",md:"fyvr1i9",lg:"fyvr1ia",xl:"fyvr1ib"},defaultClass:"fyvr1i8"},10:{conditions:{sm:"fyvr1ic",md:"fyvr1id",lg:"fyvr1ie",xl:"fyvr1if"},defaultClass:"fyvr1ic"},12:{conditions:{sm:"fyvr1ig",md:"fyvr1ih",lg:"fyvr1ii",xl:"fyvr1ij"},defaultClass:"fyvr1ig"},14:{conditions:{sm:"fyvr1ik",md:"fyvr1il",lg:"fyvr1im",xl:"fyvr1in"},defaultClass:"fyvr1ik"},16:{conditions:{sm:"fyvr1io",md:"fyvr1ip",lg:"fyvr1iq",xl:"fyvr1ir"},defaultClass:"fyvr1io"},"0.25":{conditions:{sm:"fyvr1is",md:"fyvr1it",lg:"fyvr1iu",xl:"fyvr1iv"},defaultClass:"fyvr1is"},"0.5":{conditions:{sm:"fyvr1iw",md:"fyvr1ix",lg:"fyvr1iy",xl:"fyvr1iz"},defaultClass:"fyvr1iw"},"1.5":{conditions:{sm:"fyvr1j0",md:"fyvr1j1",lg:"fyvr1j2",xl:"fyvr1j3"},defaultClass:"fyvr1j0"},none:{conditions:{sm:"fyvr1j4",md:"fyvr1j5",lg:"fyvr1j6",xl:"fyvr1j7"},defaultClass:"fyvr1j4"},px:{conditions:{sm:"fyvr1j8",md:"fyvr1j9",lg:"fyvr1ja",xl:"fyvr1jb"},defaultClass:"fyvr1j8"},auto:{conditions:{sm:"fyvr1jc",md:"fyvr1jd",lg:"fyvr1je",xl:"fyvr1jf"},defaultClass:"fyvr1jc"},full:{conditions:{sm:"fyvr1jg",md:"fyvr1jh",lg:"fyvr1ji",xl:"fyvr1jj"},defaultClass:"fyvr1jg"},"1/2":{conditions:{sm:"fyvr1jk",md:"fyvr1jl",lg:"fyvr1jm",xl:"fyvr1jn"},defaultClass:"fyvr1jk"},"1/3":{conditions:{sm:"fyvr1jo",md:"fyvr1jp",lg:"fyvr1jq",xl:"fyvr1jr"},defaultClass:"fyvr1jo"},"2/3":{conditions:{sm:"fyvr1js",md:"fyvr1jt",lg:"fyvr1ju",xl:"fyvr1jv"},defaultClass:"fyvr1js"},"1/4":{conditions:{sm:"fyvr1jw",md:"fyvr1jx",lg:"fyvr1jy",xl:"fyvr1jz"},defaultClass:"fyvr1jw"},"3/4":{conditions:{sm:"fyvr1k0",md:"fyvr1k1",lg:"fyvr1k2",xl:"fyvr1k3"},defaultClass:"fyvr1k0"},fit:{conditions:{sm:"fyvr1k4",md:"fyvr1k5",lg:"fyvr1k6",xl:"fyvr1k7"},defaultClass:"fyvr1k4"},max:{conditions:{sm:"fyvr1k8",md:"fyvr1k9",lg:"fyvr1ka",xl:"fyvr1kb"},defaultClass:"fyvr1k8"},min:{conditions:{sm:"fyvr1kc",md:"fyvr1kd",lg:"fyvr1ke",xl:"fyvr1kf"},defaultClass:"fyvr1kc"},vw:{conditions:{sm:"fyvr1kg",md:"fyvr1kh",lg:"fyvr1ki",xl:"fyvr1kj"},defaultClass:"fyvr1kg"},vh:{conditions:{sm:"fyvr1kk",md:"fyvr1kl",lg:"fyvr1km",xl:"fyvr1kn"},defaultClass:"fyvr1kk"}}},top:{values:{0:{conditions:{sm:"fyvr1ko",md:"fyvr1kp",lg:"fyvr1kq",xl:"fyvr1kr"},defaultClass:"fyvr1ko"},1:{conditions:{sm:"fyvr1ks",md:"fyvr1kt",lg:"fyvr1ku",xl:"fyvr1kv"},defaultClass:"fyvr1ks"},2:{conditions:{sm:"fyvr1kw",md:"fyvr1kx",lg:"fyvr1ky",xl:"fyvr1kz"},defaultClass:"fyvr1kw"},3:{conditions:{sm:"fyvr1l0",md:"fyvr1l1",lg:"fyvr1l2",xl:"fyvr1l3"},defaultClass:"fyvr1l0"},4:{conditions:{sm:"fyvr1l4",md:"fyvr1l5",lg:"fyvr1l6",xl:"fyvr1l7"},defaultClass:"fyvr1l4"},5:{conditions:{sm:"fyvr1l8",md:"fyvr1l9",lg:"fyvr1la",xl:"fyvr1lb"},defaultClass:"fyvr1l8"},6:{conditions:{sm:"fyvr1lc",md:"fyvr1ld",lg:"fyvr1le",xl:"fyvr1lf"},defaultClass:"fyvr1lc"},7:{conditions:{sm:"fyvr1lg",md:"fyvr1lh",lg:"fyvr1li",xl:"fyvr1lj"},defaultClass:"fyvr1lg"},8:{conditions:{sm:"fyvr1lk",md:"fyvr1ll",lg:"fyvr1lm",xl:"fyvr1ln"},defaultClass:"fyvr1lk"},9:{conditions:{sm:"fyvr1lo",md:"fyvr1lp",lg:"fyvr1lq",xl:"fyvr1lr"},defaultClass:"fyvr1lo"},10:{conditions:{sm:"fyvr1ls",md:"fyvr1lt",lg:"fyvr1lu",xl:"fyvr1lv"},defaultClass:"fyvr1ls"},12:{conditions:{sm:"fyvr1lw",md:"fyvr1lx",lg:"fyvr1ly",xl:"fyvr1lz"},defaultClass:"fyvr1lw"},14:{conditions:{sm:"fyvr1m0",md:"fyvr1m1",lg:"fyvr1m2",xl:"fyvr1m3"},defaultClass:"fyvr1m0"},16:{conditions:{sm:"fyvr1m4",md:"fyvr1m5",lg:"fyvr1m6",xl:"fyvr1m7"},defaultClass:"fyvr1m4"},"0.25":{conditions:{sm:"fyvr1m8",md:"fyvr1m9",lg:"fyvr1ma",xl:"fyvr1mb"},defaultClass:"fyvr1m8"},"0.5":{conditions:{sm:"fyvr1mc",md:"fyvr1md",lg:"fyvr1me",xl:"fyvr1mf"},defaultClass:"fyvr1mc"},"1.5":{conditions:{sm:"fyvr1mg",md:"fyvr1mh",lg:"fyvr1mi",xl:"fyvr1mj"},defaultClass:"fyvr1mg"},auto:{conditions:{sm:"fyvr1mk",md:"fyvr1ml",lg:"fyvr1mm",xl:"fyvr1mn"},defaultClass:"fyvr1mk"}}},bottom:{values:{0:{conditions:{sm:"fyvr1mo",md:"fyvr1mp",lg:"fyvr1mq",xl:"fyvr1mr"},defaultClass:"fyvr1mo"},1:{conditions:{sm:"fyvr1ms",md:"fyvr1mt",lg:"fyvr1mu",xl:"fyvr1mv"},defaultClass:"fyvr1ms"},2:{conditions:{sm:"fyvr1mw",md:"fyvr1mx",lg:"fyvr1my",xl:"fyvr1mz"},defaultClass:"fyvr1mw"},3:{conditions:{sm:"fyvr1n0",md:"fyvr1n1",lg:"fyvr1n2",xl:"fyvr1n3"},defaultClass:"fyvr1n0"},4:{conditions:{sm:"fyvr1n4",md:"fyvr1n5",lg:"fyvr1n6",xl:"fyvr1n7"},defaultClass:"fyvr1n4"},5:{conditions:{sm:"fyvr1n8",md:"fyvr1n9",lg:"fyvr1na",xl:"fyvr1nb"},defaultClass:"fyvr1n8"},6:{conditions:{sm:"fyvr1nc",md:"fyvr1nd",lg:"fyvr1ne",xl:"fyvr1nf"},defaultClass:"fyvr1nc"},7:{conditions:{sm:"fyvr1ng",md:"fyvr1nh",lg:"fyvr1ni",xl:"fyvr1nj"},defaultClass:"fyvr1ng"},8:{conditions:{sm:"fyvr1nk",md:"fyvr1nl",lg:"fyvr1nm",xl:"fyvr1nn"},defaultClass:"fyvr1nk"},9:{conditions:{sm:"fyvr1no",md:"fyvr1np",lg:"fyvr1nq",xl:"fyvr1nr"},defaultClass:"fyvr1no"},10:{conditions:{sm:"fyvr1ns",md:"fyvr1nt",lg:"fyvr1nu",xl:"fyvr1nv"},defaultClass:"fyvr1ns"},12:{conditions:{sm:"fyvr1nw",md:"fyvr1nx",lg:"fyvr1ny",xl:"fyvr1nz"},defaultClass:"fyvr1nw"},14:{conditions:{sm:"fyvr1o0",md:"fyvr1o1",lg:"fyvr1o2",xl:"fyvr1o3"},defaultClass:"fyvr1o0"},16:{conditions:{sm:"fyvr1o4",md:"fyvr1o5",lg:"fyvr1o6",xl:"fyvr1o7"},defaultClass:"fyvr1o4"},"0.25":{conditions:{sm:"fyvr1o8",md:"fyvr1o9",lg:"fyvr1oa",xl:"fyvr1ob"},defaultClass:"fyvr1o8"},"0.5":{conditions:{sm:"fyvr1oc",md:"fyvr1od",lg:"fyvr1oe",xl:"fyvr1of"},defaultClass:"fyvr1oc"},"1.5":{conditions:{sm:"fyvr1og",md:"fyvr1oh",lg:"fyvr1oi",xl:"fyvr1oj"},defaultClass:"fyvr1og"},auto:{conditions:{sm:"fyvr1ok",md:"fyvr1ol",lg:"fyvr1om",xl:"fyvr1on"},defaultClass:"fyvr1ok"}}},left:{values:{0:{conditions:{sm:"fyvr1oo",md:"fyvr1op",lg:"fyvr1oq",xl:"fyvr1or"},defaultClass:"fyvr1oo"},1:{conditions:{sm:"fyvr1os",md:"fyvr1ot",lg:"fyvr1ou",xl:"fyvr1ov"},defaultClass:"fyvr1os"},2:{conditions:{sm:"fyvr1ow",md:"fyvr1ox",lg:"fyvr1oy",xl:"fyvr1oz"},defaultClass:"fyvr1ow"},3:{conditions:{sm:"fyvr1p0",md:"fyvr1p1",lg:"fyvr1p2",xl:"fyvr1p3"},defaultClass:"fyvr1p0"},4:{conditions:{sm:"fyvr1p4",md:"fyvr1p5",lg:"fyvr1p6",xl:"fyvr1p7"},defaultClass:"fyvr1p4"},5:{conditions:{sm:"fyvr1p8",md:"fyvr1p9",lg:"fyvr1pa",xl:"fyvr1pb"},defaultClass:"fyvr1p8"},6:{conditions:{sm:"fyvr1pc",md:"fyvr1pd",lg:"fyvr1pe",xl:"fyvr1pf"},defaultClass:"fyvr1pc"},7:{conditions:{sm:"fyvr1pg",md:"fyvr1ph",lg:"fyvr1pi",xl:"fyvr1pj"},defaultClass:"fyvr1pg"},8:{conditions:{sm:"fyvr1pk",md:"fyvr1pl",lg:"fyvr1pm",xl:"fyvr1pn"},defaultClass:"fyvr1pk"},9:{conditions:{sm:"fyvr1po",md:"fyvr1pp",lg:"fyvr1pq",xl:"fyvr1pr"},defaultClass:"fyvr1po"},10:{conditions:{sm:"fyvr1ps",md:"fyvr1pt",lg:"fyvr1pu",xl:"fyvr1pv"},defaultClass:"fyvr1ps"},12:{conditions:{sm:"fyvr1pw",md:"fyvr1px",lg:"fyvr1py",xl:"fyvr1pz"},defaultClass:"fyvr1pw"},14:{conditions:{sm:"fyvr1q0",md:"fyvr1q1",lg:"fyvr1q2",xl:"fyvr1q3"},defaultClass:"fyvr1q0"},16:{conditions:{sm:"fyvr1q4",md:"fyvr1q5",lg:"fyvr1q6",xl:"fyvr1q7"},defaultClass:"fyvr1q4"},"0.25":{conditions:{sm:"fyvr1q8",md:"fyvr1q9",lg:"fyvr1qa",xl:"fyvr1qb"},defaultClass:"fyvr1q8"},"0.5":{conditions:{sm:"fyvr1qc",md:"fyvr1qd",lg:"fyvr1qe",xl:"fyvr1qf"},defaultClass:"fyvr1qc"},"1.5":{conditions:{sm:"fyvr1qg",md:"fyvr1qh",lg:"fyvr1qi",xl:"fyvr1qj"},defaultClass:"fyvr1qg"},auto:{conditions:{sm:"fyvr1qk",md:"fyvr1ql",lg:"fyvr1qm",xl:"fyvr1qn"},defaultClass:"fyvr1qk"}}},right:{values:{0:{conditions:{sm:"fyvr1qo",md:"fyvr1qp",lg:"fyvr1qq",xl:"fyvr1qr"},defaultClass:"fyvr1qo"},1:{conditions:{sm:"fyvr1qs",md:"fyvr1qt",lg:"fyvr1qu",xl:"fyvr1qv"},defaultClass:"fyvr1qs"},2:{conditions:{sm:"fyvr1qw",md:"fyvr1qx",lg:"fyvr1qy",xl:"fyvr1qz"},defaultClass:"fyvr1qw"},3:{conditions:{sm:"fyvr1r0",md:"fyvr1r1",lg:"fyvr1r2",xl:"fyvr1r3"},defaultClass:"fyvr1r0"},4:{conditions:{sm:"fyvr1r4",md:"fyvr1r5",lg:"fyvr1r6",xl:"fyvr1r7"},defaultClass:"fyvr1r4"},5:{conditions:{sm:"fyvr1r8",md:"fyvr1r9",lg:"fyvr1ra",xl:"fyvr1rb"},defaultClass:"fyvr1r8"},6:{conditions:{sm:"fyvr1rc",md:"fyvr1rd",lg:"fyvr1re",xl:"fyvr1rf"},defaultClass:"fyvr1rc"},7:{conditions:{sm:"fyvr1rg",md:"fyvr1rh",lg:"fyvr1ri",xl:"fyvr1rj"},defaultClass:"fyvr1rg"},8:{conditions:{sm:"fyvr1rk",md:"fyvr1rl",lg:"fyvr1rm",xl:"fyvr1rn"},defaultClass:"fyvr1rk"},9:{conditions:{sm:"fyvr1ro",md:"fyvr1rp",lg:"fyvr1rq",xl:"fyvr1rr"},defaultClass:"fyvr1ro"},10:{conditions:{sm:"fyvr1rs",md:"fyvr1rt",lg:"fyvr1ru",xl:"fyvr1rv"},defaultClass:"fyvr1rs"},12:{conditions:{sm:"fyvr1rw",md:"fyvr1rx",lg:"fyvr1ry",xl:"fyvr1rz"},defaultClass:"fyvr1rw"},14:{conditions:{sm:"fyvr1s0",md:"fyvr1s1",lg:"fyvr1s2",xl:"fyvr1s3"},defaultClass:"fyvr1s0"},16:{conditions:{sm:"fyvr1s4",md:"fyvr1s5",lg:"fyvr1s6",xl:"fyvr1s7"},defaultClass:"fyvr1s4"},"0.25":{conditions:{sm:"fyvr1s8",md:"fyvr1s9",lg:"fyvr1sa",xl:"fyvr1sb"},defaultClass:"fyvr1s8"},"0.5":{conditions:{sm:"fyvr1sc",md:"fyvr1sd",lg:"fyvr1se",xl:"fyvr1sf"},defaultClass:"fyvr1sc"},"1.5":{conditions:{sm:"fyvr1sg",md:"fyvr1sh",lg:"fyvr1si",xl:"fyvr1sj"},defaultClass:"fyvr1sg"},auto:{conditions:{sm:"fyvr1sk",md:"fyvr1sl",lg:"fyvr1sm",xl:"fyvr1sn"},defaultClass:"fyvr1sk"}}},paddingTop:{values:{0:{conditions:{sm:"fyvr1so",md:"fyvr1sp",lg:"fyvr1sq",xl:"fyvr1sr"},defaultClass:"fyvr1so"},1:{conditions:{sm:"fyvr1ss",md:"fyvr1st",lg:"fyvr1su",xl:"fyvr1sv"},defaultClass:"fyvr1ss"},2:{conditions:{sm:"fyvr1sw",md:"fyvr1sx",lg:"fyvr1sy",xl:"fyvr1sz"},defaultClass:"fyvr1sw"},3:{conditions:{sm:"fyvr1t0",md:"fyvr1t1",lg:"fyvr1t2",xl:"fyvr1t3"},defaultClass:"fyvr1t0"},4:{conditions:{sm:"fyvr1t4",md:"fyvr1t5",lg:"fyvr1t6",xl:"fyvr1t7"},defaultClass:"fyvr1t4"},5:{conditions:{sm:"fyvr1t8",md:"fyvr1t9",lg:"fyvr1ta",xl:"fyvr1tb"},defaultClass:"fyvr1t8"},6:{conditions:{sm:"fyvr1tc",md:"fyvr1td",lg:"fyvr1te",xl:"fyvr1tf"},defaultClass:"fyvr1tc"},7:{conditions:{sm:"fyvr1tg",md:"fyvr1th",lg:"fyvr1ti",xl:"fyvr1tj"},defaultClass:"fyvr1tg"},8:{conditions:{sm:"fyvr1tk",md:"fyvr1tl",lg:"fyvr1tm",xl:"fyvr1tn"},defaultClass:"fyvr1tk"},9:{conditions:{sm:"fyvr1to",md:"fyvr1tp",lg:"fyvr1tq",xl:"fyvr1tr"},defaultClass:"fyvr1to"},10:{conditions:{sm:"fyvr1ts",md:"fyvr1tt",lg:"fyvr1tu",xl:"fyvr1tv"},defaultClass:"fyvr1ts"},12:{conditions:{sm:"fyvr1tw",md:"fyvr1tx",lg:"fyvr1ty",xl:"fyvr1tz"},defaultClass:"fyvr1tw"},14:{conditions:{sm:"fyvr1u0",md:"fyvr1u1",lg:"fyvr1u2",xl:"fyvr1u3"},defaultClass:"fyvr1u0"},16:{conditions:{sm:"fyvr1u4",md:"fyvr1u5",lg:"fyvr1u6",xl:"fyvr1u7"},defaultClass:"fyvr1u4"},"0.25":{conditions:{sm:"fyvr1u8",md:"fyvr1u9",lg:"fyvr1ua",xl:"fyvr1ub"},defaultClass:"fyvr1u8"},"0.5":{conditions:{sm:"fyvr1uc",md:"fyvr1ud",lg:"fyvr1ue",xl:"fyvr1uf"},defaultClass:"fyvr1uc"},"1.5":{conditions:{sm:"fyvr1ug",md:"fyvr1uh",lg:"fyvr1ui",xl:"fyvr1uj"},defaultClass:"fyvr1ug"}}},paddingBottom:{values:{0:{conditions:{sm:"fyvr1uk",md:"fyvr1ul",lg:"fyvr1um",xl:"fyvr1un"},defaultClass:"fyvr1uk"},1:{conditions:{sm:"fyvr1uo",md:"fyvr1up",lg:"fyvr1uq",xl:"fyvr1ur"},defaultClass:"fyvr1uo"},2:{conditions:{sm:"fyvr1us",md:"fyvr1ut",lg:"fyvr1uu",xl:"fyvr1uv"},defaultClass:"fyvr1us"},3:{conditions:{sm:"fyvr1uw",md:"fyvr1ux",lg:"fyvr1uy",xl:"fyvr1uz"},defaultClass:"fyvr1uw"},4:{conditions:{sm:"fyvr1v0",md:"fyvr1v1",lg:"fyvr1v2",xl:"fyvr1v3"},defaultClass:"fyvr1v0"},5:{conditions:{sm:"fyvr1v4",md:"fyvr1v5",lg:"fyvr1v6",xl:"fyvr1v7"},defaultClass:"fyvr1v4"},6:{conditions:{sm:"fyvr1v8",md:"fyvr1v9",lg:"fyvr1va",xl:"fyvr1vb"},defaultClass:"fyvr1v8"},7:{conditions:{sm:"fyvr1vc",md:"fyvr1vd",lg:"fyvr1ve",xl:"fyvr1vf"},defaultClass:"fyvr1vc"},8:{conditions:{sm:"fyvr1vg",md:"fyvr1vh",lg:"fyvr1vi",xl:"fyvr1vj"},defaultClass:"fyvr1vg"},9:{conditions:{sm:"fyvr1vk",md:"fyvr1vl",lg:"fyvr1vm",xl:"fyvr1vn"},defaultClass:"fyvr1vk"},10:{conditions:{sm:"fyvr1vo",md:"fyvr1vp",lg:"fyvr1vq",xl:"fyvr1vr"},defaultClass:"fyvr1vo"},12:{conditions:{sm:"fyvr1vs",md:"fyvr1vt",lg:"fyvr1vu",xl:"fyvr1vv"},defaultClass:"fyvr1vs"},14:{conditions:{sm:"fyvr1vw",md:"fyvr1vx",lg:"fyvr1vy",xl:"fyvr1vz"},defaultClass:"fyvr1vw"},16:{conditions:{sm:"fyvr1w0",md:"fyvr1w1",lg:"fyvr1w2",xl:"fyvr1w3"},defaultClass:"fyvr1w0"},"0.25":{conditions:{sm:"fyvr1w4",md:"fyvr1w5",lg:"fyvr1w6",xl:"fyvr1w7"},defaultClass:"fyvr1w4"},"0.5":{conditions:{sm:"fyvr1w8",md:"fyvr1w9",lg:"fyvr1wa",xl:"fyvr1wb"},defaultClass:"fyvr1w8"},"1.5":{conditions:{sm:"fyvr1wc",md:"fyvr1wd",lg:"fyvr1we",xl:"fyvr1wf"},defaultClass:"fyvr1wc"}}},paddingLeft:{values:{0:{conditions:{sm:"fyvr1wg",md:"fyvr1wh",lg:"fyvr1wi",xl:"fyvr1wj"},defaultClass:"fyvr1wg"},1:{conditions:{sm:"fyvr1wk",md:"fyvr1wl",lg:"fyvr1wm",xl:"fyvr1wn"},defaultClass:"fyvr1wk"},2:{conditions:{sm:"fyvr1wo",md:"fyvr1wp",lg:"fyvr1wq",xl:"fyvr1wr"},defaultClass:"fyvr1wo"},3:{conditions:{sm:"fyvr1ws",md:"fyvr1wt",lg:"fyvr1wu",xl:"fyvr1wv"},defaultClass:"fyvr1ws"},4:{conditions:{sm:"fyvr1ww",md:"fyvr1wx",lg:"fyvr1wy",xl:"fyvr1wz"},defaultClass:"fyvr1ww"},5:{conditions:{sm:"fyvr1x0",md:"fyvr1x1",lg:"fyvr1x2",xl:"fyvr1x3"},defaultClass:"fyvr1x0"},6:{conditions:{sm:"fyvr1x4",md:"fyvr1x5",lg:"fyvr1x6",xl:"fyvr1x7"},defaultClass:"fyvr1x4"},7:{conditions:{sm:"fyvr1x8",md:"fyvr1x9",lg:"fyvr1xa",xl:"fyvr1xb"},defaultClass:"fyvr1x8"},8:{conditions:{sm:"fyvr1xc",md:"fyvr1xd",lg:"fyvr1xe",xl:"fyvr1xf"},defaultClass:"fyvr1xc"},9:{conditions:{sm:"fyvr1xg",md:"fyvr1xh",lg:"fyvr1xi",xl:"fyvr1xj"},defaultClass:"fyvr1xg"},10:{conditions:{sm:"fyvr1xk",md:"fyvr1xl",lg:"fyvr1xm",xl:"fyvr1xn"},defaultClass:"fyvr1xk"},12:{conditions:{sm:"fyvr1xo",md:"fyvr1xp",lg:"fyvr1xq",xl:"fyvr1xr"},defaultClass:"fyvr1xo"},14:{conditions:{sm:"fyvr1xs",md:"fyvr1xt",lg:"fyvr1xu",xl:"fyvr1xv"},defaultClass:"fyvr1xs"},16:{conditions:{sm:"fyvr1xw",md:"fyvr1xx",lg:"fyvr1xy",xl:"fyvr1xz"},defaultClass:"fyvr1xw"},"0.25":{conditions:{sm:"fyvr1y0",md:"fyvr1y1",lg:"fyvr1y2",xl:"fyvr1y3"},defaultClass:"fyvr1y0"},"0.5":{conditions:{sm:"fyvr1y4",md:"fyvr1y5",lg:"fyvr1y6",xl:"fyvr1y7"},defaultClass:"fyvr1y4"},"1.5":{conditions:{sm:"fyvr1y8",md:"fyvr1y9",lg:"fyvr1ya",xl:"fyvr1yb"},defaultClass:"fyvr1y8"}}},paddingRight:{values:{0:{conditions:{sm:"fyvr1yc",md:"fyvr1yd",lg:"fyvr1ye",xl:"fyvr1yf"},defaultClass:"fyvr1yc"},1:{conditions:{sm:"fyvr1yg",md:"fyvr1yh",lg:"fyvr1yi",xl:"fyvr1yj"},defaultClass:"fyvr1yg"},2:{conditions:{sm:"fyvr1yk",md:"fyvr1yl",lg:"fyvr1ym",xl:"fyvr1yn"},defaultClass:"fyvr1yk"},3:{conditions:{sm:"fyvr1yo",md:"fyvr1yp",lg:"fyvr1yq",xl:"fyvr1yr"},defaultClass:"fyvr1yo"},4:{conditions:{sm:"fyvr1ys",md:"fyvr1yt",lg:"fyvr1yu",xl:"fyvr1yv"},defaultClass:"fyvr1ys"},5:{conditions:{sm:"fyvr1yw",md:"fyvr1yx",lg:"fyvr1yy",xl:"fyvr1yz"},defaultClass:"fyvr1yw"},6:{conditions:{sm:"fyvr1z0",md:"fyvr1z1",lg:"fyvr1z2",xl:"fyvr1z3"},defaultClass:"fyvr1z0"},7:{conditions:{sm:"fyvr1z4",md:"fyvr1z5",lg:"fyvr1z6",xl:"fyvr1z7"},defaultClass:"fyvr1z4"},8:{conditions:{sm:"fyvr1z8",md:"fyvr1z9",lg:"fyvr1za",xl:"fyvr1zb"},defaultClass:"fyvr1z8"},9:{conditions:{sm:"fyvr1zc",md:"fyvr1zd",lg:"fyvr1ze",xl:"fyvr1zf"},defaultClass:"fyvr1zc"},10:{conditions:{sm:"fyvr1zg",md:"fyvr1zh",lg:"fyvr1zi",xl:"fyvr1zj"},defaultClass:"fyvr1zg"},12:{conditions:{sm:"fyvr1zk",md:"fyvr1zl",lg:"fyvr1zm",xl:"fyvr1zn"},defaultClass:"fyvr1zk"},14:{conditions:{sm:"fyvr1zo",md:"fyvr1zp",lg:"fyvr1zq",xl:"fyvr1zr"},defaultClass:"fyvr1zo"},16:{conditions:{sm:"fyvr1zs",md:"fyvr1zt",lg:"fyvr1zu",xl:"fyvr1zv"},defaultClass:"fyvr1zs"},"0.25":{conditions:{sm:"fyvr1zw",md:"fyvr1zx",lg:"fyvr1zy",xl:"fyvr1zz"},defaultClass:"fyvr1zw"},"0.5":{conditions:{sm:"fyvr1100",md:"fyvr1101",lg:"fyvr1102",xl:"fyvr1103"},defaultClass:"fyvr1100"},"1.5":{conditions:{sm:"fyvr1104",md:"fyvr1105",lg:"fyvr1106",xl:"fyvr1107"},defaultClass:"fyvr1104"}}},marginTop:{values:{0:{conditions:{sm:"fyvr1108",md:"fyvr1109",lg:"fyvr110a",xl:"fyvr110b"},defaultClass:"fyvr1108"},1:{conditions:{sm:"fyvr110c",md:"fyvr110d",lg:"fyvr110e",xl:"fyvr110f"},defaultClass:"fyvr110c"},2:{conditions:{sm:"fyvr110g",md:"fyvr110h",lg:"fyvr110i",xl:"fyvr110j"},defaultClass:"fyvr110g"},3:{conditions:{sm:"fyvr110k",md:"fyvr110l",lg:"fyvr110m",xl:"fyvr110n"},defaultClass:"fyvr110k"},4:{conditions:{sm:"fyvr110o",md:"fyvr110p",lg:"fyvr110q",xl:"fyvr110r"},defaultClass:"fyvr110o"},5:{conditions:{sm:"fyvr110s",md:"fyvr110t",lg:"fyvr110u",xl:"fyvr110v"},defaultClass:"fyvr110s"},6:{conditions:{sm:"fyvr110w",md:"fyvr110x",lg:"fyvr110y",xl:"fyvr110z"},defaultClass:"fyvr110w"},7:{conditions:{sm:"fyvr1110",md:"fyvr1111",lg:"fyvr1112",xl:"fyvr1113"},defaultClass:"fyvr1110"},8:{conditions:{sm:"fyvr1114",md:"fyvr1115",lg:"fyvr1116",xl:"fyvr1117"},defaultClass:"fyvr1114"},9:{conditions:{sm:"fyvr1118",md:"fyvr1119",lg:"fyvr111a",xl:"fyvr111b"},defaultClass:"fyvr1118"},10:{conditions:{sm:"fyvr111c",md:"fyvr111d",lg:"fyvr111e",xl:"fyvr111f"},defaultClass:"fyvr111c"},12:{conditions:{sm:"fyvr111g",md:"fyvr111h",lg:"fyvr111i",xl:"fyvr111j"},defaultClass:"fyvr111g"},14:{conditions:{sm:"fyvr111k",md:"fyvr111l",lg:"fyvr111m",xl:"fyvr111n"},defaultClass:"fyvr111k"},16:{conditions:{sm:"fyvr111o",md:"fyvr111p",lg:"fyvr111q",xl:"fyvr111r"},defaultClass:"fyvr111o"},"0.25":{conditions:{sm:"fyvr111s",md:"fyvr111t",lg:"fyvr111u",xl:"fyvr111v"},defaultClass:"fyvr111s"},"0.5":{conditions:{sm:"fyvr111w",md:"fyvr111x",lg:"fyvr111y",xl:"fyvr111z"},defaultClass:"fyvr111w"},"1.5":{conditions:{sm:"fyvr1120",md:"fyvr1121",lg:"fyvr1122",xl:"fyvr1123"},defaultClass:"fyvr1120"},auto:{conditions:{sm:"fyvr1124",md:"fyvr1125",lg:"fyvr1126",xl:"fyvr1127"},defaultClass:"fyvr1124"}}},marginBottom:{values:{0:{conditions:{sm:"fyvr1128",md:"fyvr1129",lg:"fyvr112a",xl:"fyvr112b"},defaultClass:"fyvr1128"},1:{conditions:{sm:"fyvr112c",md:"fyvr112d",lg:"fyvr112e",xl:"fyvr112f"},defaultClass:"fyvr112c"},2:{conditions:{sm:"fyvr112g",md:"fyvr112h",lg:"fyvr112i",xl:"fyvr112j"},defaultClass:"fyvr112g"},3:{conditions:{sm:"fyvr112k",md:"fyvr112l",lg:"fyvr112m",xl:"fyvr112n"},defaultClass:"fyvr112k"},4:{conditions:{sm:"fyvr112o",md:"fyvr112p",lg:"fyvr112q",xl:"fyvr112r"},defaultClass:"fyvr112o"},5:{conditions:{sm:"fyvr112s",md:"fyvr112t",lg:"fyvr112u",xl:"fyvr112v"},defaultClass:"fyvr112s"},6:{conditions:{sm:"fyvr112w",md:"fyvr112x",lg:"fyvr112y",xl:"fyvr112z"},defaultClass:"fyvr112w"},7:{conditions:{sm:"fyvr1130",md:"fyvr1131",lg:"fyvr1132",xl:"fyvr1133"},defaultClass:"fyvr1130"},8:{conditions:{sm:"fyvr1134",md:"fyvr1135",lg:"fyvr1136",xl:"fyvr1137"},defaultClass:"fyvr1134"},9:{conditions:{sm:"fyvr1138",md:"fyvr1139",lg:"fyvr113a",xl:"fyvr113b"},defaultClass:"fyvr1138"},10:{conditions:{sm:"fyvr113c",md:"fyvr113d",lg:"fyvr113e",xl:"fyvr113f"},defaultClass:"fyvr113c"},12:{conditions:{sm:"fyvr113g",md:"fyvr113h",lg:"fyvr113i",xl:"fyvr113j"},defaultClass:"fyvr113g"},14:{conditions:{sm:"fyvr113k",md:"fyvr113l",lg:"fyvr113m",xl:"fyvr113n"},defaultClass:"fyvr113k"},16:{conditions:{sm:"fyvr113o",md:"fyvr113p",lg:"fyvr113q",xl:"fyvr113r"},defaultClass:"fyvr113o"},"0.25":{conditions:{sm:"fyvr113s",md:"fyvr113t",lg:"fyvr113u",xl:"fyvr113v"},defaultClass:"fyvr113s"},"0.5":{conditions:{sm:"fyvr113w",md:"fyvr113x",lg:"fyvr113y",xl:"fyvr113z"},defaultClass:"fyvr113w"},"1.5":{conditions:{sm:"fyvr1140",md:"fyvr1141",lg:"fyvr1142",xl:"fyvr1143"},defaultClass:"fyvr1140"},auto:{conditions:{sm:"fyvr1144",md:"fyvr1145",lg:"fyvr1146",xl:"fyvr1147"},defaultClass:"fyvr1144"}}},marginLeft:{values:{0:{conditions:{sm:"fyvr1148",md:"fyvr1149",lg:"fyvr114a",xl:"fyvr114b"},defaultClass:"fyvr1148"},1:{conditions:{sm:"fyvr114c",md:"fyvr114d",lg:"fyvr114e",xl:"fyvr114f"},defaultClass:"fyvr114c"},2:{conditions:{sm:"fyvr114g",md:"fyvr114h",lg:"fyvr114i",xl:"fyvr114j"},defaultClass:"fyvr114g"},3:{conditions:{sm:"fyvr114k",md:"fyvr114l",lg:"fyvr114m",xl:"fyvr114n"},defaultClass:"fyvr114k"},4:{conditions:{sm:"fyvr114o",md:"fyvr114p",lg:"fyvr114q",xl:"fyvr114r"},defaultClass:"fyvr114o"},5:{conditions:{sm:"fyvr114s",md:"fyvr114t",lg:"fyvr114u",xl:"fyvr114v"},defaultClass:"fyvr114s"},6:{conditions:{sm:"fyvr114w",md:"fyvr114x",lg:"fyvr114y",xl:"fyvr114z"},defaultClass:"fyvr114w"},7:{conditions:{sm:"fyvr1150",md:"fyvr1151",lg:"fyvr1152",xl:"fyvr1153"},defaultClass:"fyvr1150"},8:{conditions:{sm:"fyvr1154",md:"fyvr1155",lg:"fyvr1156",xl:"fyvr1157"},defaultClass:"fyvr1154"},9:{conditions:{sm:"fyvr1158",md:"fyvr1159",lg:"fyvr115a",xl:"fyvr115b"},defaultClass:"fyvr1158"},10:{conditions:{sm:"fyvr115c",md:"fyvr115d",lg:"fyvr115e",xl:"fyvr115f"},defaultClass:"fyvr115c"},12:{conditions:{sm:"fyvr115g",md:"fyvr115h",lg:"fyvr115i",xl:"fyvr115j"},defaultClass:"fyvr115g"},14:{conditions:{sm:"fyvr115k",md:"fyvr115l",lg:"fyvr115m",xl:"fyvr115n"},defaultClass:"fyvr115k"},16:{conditions:{sm:"fyvr115o",md:"fyvr115p",lg:"fyvr115q",xl:"fyvr115r"},defaultClass:"fyvr115o"},"0.25":{conditions:{sm:"fyvr115s",md:"fyvr115t",lg:"fyvr115u",xl:"fyvr115v"},defaultClass:"fyvr115s"},"0.5":{conditions:{sm:"fyvr115w",md:"fyvr115x",lg:"fyvr115y",xl:"fyvr115z"},defaultClass:"fyvr115w"},"1.5":{conditions:{sm:"fyvr1160",md:"fyvr1161",lg:"fyvr1162",xl:"fyvr1163"},defaultClass:"fyvr1160"},auto:{conditions:{sm:"fyvr1164",md:"fyvr1165",lg:"fyvr1166",xl:"fyvr1167"},defaultClass:"fyvr1164"}}},marginRight:{values:{0:{conditions:{sm:"fyvr1168",md:"fyvr1169",lg:"fyvr116a",xl:"fyvr116b"},defaultClass:"fyvr1168"},1:{conditions:{sm:"fyvr116c",md:"fyvr116d",lg:"fyvr116e",xl:"fyvr116f"},defaultClass:"fyvr116c"},2:{conditions:{sm:"fyvr116g",md:"fyvr116h",lg:"fyvr116i",xl:"fyvr116j"},defaultClass:"fyvr116g"},3:{conditions:{sm:"fyvr116k",md:"fyvr116l",lg:"fyvr116m",xl:"fyvr116n"},defaultClass:"fyvr116k"},4:{conditions:{sm:"fyvr116o",md:"fyvr116p",lg:"fyvr116q",xl:"fyvr116r"},defaultClass:"fyvr116o"},5:{conditions:{sm:"fyvr116s",md:"fyvr116t",lg:"fyvr116u",xl:"fyvr116v"},defaultClass:"fyvr116s"},6:{conditions:{sm:"fyvr116w",md:"fyvr116x",lg:"fyvr116y",xl:"fyvr116z"},defaultClass:"fyvr116w"},7:{conditions:{sm:"fyvr1170",md:"fyvr1171",lg:"fyvr1172",xl:"fyvr1173"},defaultClass:"fyvr1170"},8:{conditions:{sm:"fyvr1174",md:"fyvr1175",lg:"fyvr1176",xl:"fyvr1177"},defaultClass:"fyvr1174"},9:{conditions:{sm:"fyvr1178",md:"fyvr1179",lg:"fyvr117a",xl:"fyvr117b"},defaultClass:"fyvr1178"},10:{conditions:{sm:"fyvr117c",md:"fyvr117d",lg:"fyvr117e",xl:"fyvr117f"},defaultClass:"fyvr117c"},12:{conditions:{sm:"fyvr117g",md:"fyvr117h",lg:"fyvr117i",xl:"fyvr117j"},defaultClass:"fyvr117g"},14:{conditions:{sm:"fyvr117k",md:"fyvr117l",lg:"fyvr117m",xl:"fyvr117n"},defaultClass:"fyvr117k"},16:{conditions:{sm:"fyvr117o",md:"fyvr117p",lg:"fyvr117q",xl:"fyvr117r"},defaultClass:"fyvr117o"},"0.25":{conditions:{sm:"fyvr117s",md:"fyvr117t",lg:"fyvr117u",xl:"fyvr117v"},defaultClass:"fyvr117s"},"0.5":{conditions:{sm:"fyvr117w",md:"fyvr117x",lg:"fyvr117y",xl:"fyvr117z"},defaultClass:"fyvr117w"},"1.5":{conditions:{sm:"fyvr1180",md:"fyvr1181",lg:"fyvr1182",xl:"fyvr1183"},defaultClass:"fyvr1180"},auto:{conditions:{sm:"fyvr1184",md:"fyvr1185",lg:"fyvr1186",xl:"fyvr1187"},defaultClass:"fyvr1184"}}},gap:{values:{0:{conditions:{sm:"fyvr1188",md:"fyvr1189",lg:"fyvr118a",xl:"fyvr118b"},defaultClass:"fyvr1188"},1:{conditions:{sm:"fyvr118c",md:"fyvr118d",lg:"fyvr118e",xl:"fyvr118f"},defaultClass:"fyvr118c"},2:{conditions:{sm:"fyvr118g",md:"fyvr118h",lg:"fyvr118i",xl:"fyvr118j"},defaultClass:"fyvr118g"},3:{conditions:{sm:"fyvr118k",md:"fyvr118l",lg:"fyvr118m",xl:"fyvr118n"},defaultClass:"fyvr118k"},4:{conditions:{sm:"fyvr118o",md:"fyvr118p",lg:"fyvr118q",xl:"fyvr118r"},defaultClass:"fyvr118o"},5:{conditions:{sm:"fyvr118s",md:"fyvr118t",lg:"fyvr118u",xl:"fyvr118v"},defaultClass:"fyvr118s"},6:{conditions:{sm:"fyvr118w",md:"fyvr118x",lg:"fyvr118y",xl:"fyvr118z"},defaultClass:"fyvr118w"},7:{conditions:{sm:"fyvr1190",md:"fyvr1191",lg:"fyvr1192",xl:"fyvr1193"},defaultClass:"fyvr1190"},8:{conditions:{sm:"fyvr1194",md:"fyvr1195",lg:"fyvr1196",xl:"fyvr1197"},defaultClass:"fyvr1194"},9:{conditions:{sm:"fyvr1198",md:"fyvr1199",lg:"fyvr119a",xl:"fyvr119b"},defaultClass:"fyvr1198"},10:{conditions:{sm:"fyvr119c",md:"fyvr119d",lg:"fyvr119e",xl:"fyvr119f"},defaultClass:"fyvr119c"},12:{conditions:{sm:"fyvr119g",md:"fyvr119h",lg:"fyvr119i",xl:"fyvr119j"},defaultClass:"fyvr119g"},14:{conditions:{sm:"fyvr119k",md:"fyvr119l",lg:"fyvr119m",xl:"fyvr119n"},defaultClass:"fyvr119k"},16:{conditions:{sm:"fyvr119o",md:"fyvr119p",lg:"fyvr119q",xl:"fyvr119r"},defaultClass:"fyvr119o"},"0.25":{conditions:{sm:"fyvr119s",md:"fyvr119t",lg:"fyvr119u",xl:"fyvr119v"},defaultClass:"fyvr119s"},"0.5":{conditions:{sm:"fyvr119w",md:"fyvr119x",lg:"fyvr119y",xl:"fyvr119z"},defaultClass:"fyvr119w"},"1.5":{conditions:{sm:"fyvr11a0",md:"fyvr11a1",lg:"fyvr11a2",xl:"fyvr11a3"},defaultClass:"fyvr11a0"}}},borderBottomWidth:{values:{none:{conditions:{sm:"fyvr11a4",md:"fyvr11a5",lg:"fyvr11a6",xl:"fyvr11a7"},defaultClass:"fyvr11a4"},thin:{conditions:{sm:"fyvr11a8",md:"fyvr11a9",lg:"fyvr11aa",xl:"fyvr11ab"},defaultClass:"fyvr11a8"},thick:{conditions:{sm:"fyvr11ac",md:"fyvr11ad",lg:"fyvr11ae",xl:"fyvr11af"},defaultClass:"fyvr11ac"}}},borderLeftWidth:{values:{none:{conditions:{sm:"fyvr11ag",md:"fyvr11ah",lg:"fyvr11ai",xl:"fyvr11aj"},defaultClass:"fyvr11ag"},thin:{conditions:{sm:"fyvr11ak",md:"fyvr11al",lg:"fyvr11am",xl:"fyvr11an"},defaultClass:"fyvr11ak"},thick:{conditions:{sm:"fyvr11ao",md:"fyvr11ap",lg:"fyvr11aq",xl:"fyvr11ar"},defaultClass:"fyvr11ao"}}},borderRightWidth:{values:{none:{conditions:{sm:"fyvr11as",md:"fyvr11at",lg:"fyvr11au",xl:"fyvr11av"},defaultClass:"fyvr11as"},thin:{conditions:{sm:"fyvr11aw",md:"fyvr11ax",lg:"fyvr11ay",xl:"fyvr11az"},defaultClass:"fyvr11aw"},thick:{conditions:{sm:"fyvr11b0",md:"fyvr11b1",lg:"fyvr11b2",xl:"fyvr11b3"},defaultClass:"fyvr11b0"}}},borderTopWidth:{values:{none:{conditions:{sm:"fyvr11b4",md:"fyvr11b5",lg:"fyvr11b6",xl:"fyvr11b7"},defaultClass:"fyvr11b4"},thin:{conditions:{sm:"fyvr11b8",md:"fyvr11b9",lg:"fyvr11ba",xl:"fyvr11bb"},defaultClass:"fyvr11b8"},thick:{conditions:{sm:"fyvr11bc",md:"fyvr11bd",lg:"fyvr11be",xl:"fyvr11bf"},defaultClass:"fyvr11bc"}}},borderBottomLeftRadius:{values:{none:{conditions:{sm:"fyvr11bg",md:"fyvr11bh",lg:"fyvr11bi",xl:"fyvr11bj"},defaultClass:"fyvr11bg"},xs:{conditions:{sm:"fyvr11bk",md:"fyvr11bl",lg:"fyvr11bm",xl:"fyvr11bn"},defaultClass:"fyvr11bk"},sm:{conditions:{sm:"fyvr11bo",md:"fyvr11bp",lg:"fyvr11bq",xl:"fyvr11br"},defaultClass:"fyvr11bo"},md:{conditions:{sm:"fyvr11bs",md:"fyvr11bt",lg:"fyvr11bu",xl:"fyvr11bv"},defaultClass:"fyvr11bs"},lg:{conditions:{sm:"fyvr11bw",md:"fyvr11bx",lg:"fyvr11by",xl:"fyvr11bz"},defaultClass:"fyvr11bw"},circle:{conditions:{sm:"fyvr11c0",md:"fyvr11c1",lg:"fyvr11c2",xl:"fyvr11c3"},defaultClass:"fyvr11c0"}}},borderBottomRightRadius:{values:{none:{conditions:{sm:"fyvr11c4",md:"fyvr11c5",lg:"fyvr11c6",xl:"fyvr11c7"},defaultClass:"fyvr11c4"},xs:{conditions:{sm:"fyvr11c8",md:"fyvr11c9",lg:"fyvr11ca",xl:"fyvr11cb"},defaultClass:"fyvr11c8"},sm:{conditions:{sm:"fyvr11cc",md:"fyvr11cd",lg:"fyvr11ce",xl:"fyvr11cf"},defaultClass:"fyvr11cc"},md:{conditions:{sm:"fyvr11cg",md:"fyvr11ch",lg:"fyvr11ci",xl:"fyvr11cj"},defaultClass:"fyvr11cg"},lg:{conditions:{sm:"fyvr11ck",md:"fyvr11cl",lg:"fyvr11cm",xl:"fyvr11cn"},defaultClass:"fyvr11ck"},circle:{conditions:{sm:"fyvr11co",md:"fyvr11cp",lg:"fyvr11cq",xl:"fyvr11cr"},defaultClass:"fyvr11co"}}},borderTopLeftRadius:{values:{none:{conditions:{sm:"fyvr11cs",md:"fyvr11ct",lg:"fyvr11cu",xl:"fyvr11cv"},defaultClass:"fyvr11cs"},xs:{conditions:{sm:"fyvr11cw",md:"fyvr11cx",lg:"fyvr11cy",xl:"fyvr11cz"},defaultClass:"fyvr11cw"},sm:{conditions:{sm:"fyvr11d0",md:"fyvr11d1",lg:"fyvr11d2",xl:"fyvr11d3"},defaultClass:"fyvr11d0"},md:{conditions:{sm:"fyvr11d4",md:"fyvr11d5",lg:"fyvr11d6",xl:"fyvr11d7"},defaultClass:"fyvr11d4"},lg:{conditions:{sm:"fyvr11d8",md:"fyvr11d9",lg:"fyvr11da",xl:"fyvr11db"},defaultClass:"fyvr11d8"},circle:{conditions:{sm:"fyvr11dc",md:"fyvr11dd",lg:"fyvr11de",xl:"fyvr11df"},defaultClass:"fyvr11dc"}}},borderTopRightRadius:{values:{none:{conditions:{sm:"fyvr11dg",md:"fyvr11dh",lg:"fyvr11di",xl:"fyvr11dj"},defaultClass:"fyvr11dg"},xs:{conditions:{sm:"fyvr11dk",md:"fyvr11dl",lg:"fyvr11dm",xl:"fyvr11dn"},defaultClass:"fyvr11dk"},sm:{conditions:{sm:"fyvr11do",md:"fyvr11dp",lg:"fyvr11dq",xl:"fyvr11dr"},defaultClass:"fyvr11do"},md:{conditions:{sm:"fyvr11ds",md:"fyvr11dt",lg:"fyvr11du",xl:"fyvr11dv"},defaultClass:"fyvr11ds"},lg:{conditions:{sm:"fyvr11dw",md:"fyvr11dx",lg:"fyvr11dy",xl:"fyvr11dz"},defaultClass:"fyvr11dw"},circle:{conditions:{sm:"fyvr11e0",md:"fyvr11e1",lg:"fyvr11e2",xl:"fyvr11e3"},defaultClass:"fyvr11e0"}}},fontSize:{values:{inherit:{conditions:{sm:"fyvr11e4",md:"fyvr11e5",lg:"fyvr11e6",xl:"fyvr11e7"},defaultClass:"fyvr11e4"},xsmall:{conditions:{sm:"fyvr11e8",md:"fyvr11e9",lg:"fyvr11ea",xl:"fyvr11eb"},defaultClass:"fyvr11e8"},small:{conditions:{sm:"fyvr11ec",md:"fyvr11ed",lg:"fyvr11ee",xl:"fyvr11ef"},defaultClass:"fyvr11ec"},normal:{conditions:{sm:"fyvr11eg",md:"fyvr11eh",lg:"fyvr11ei",xl:"fyvr11ej"},defaultClass:"fyvr11eg"},medium:{conditions:{sm:"fyvr11ek",md:"fyvr11el",lg:"fyvr11em",xl:"fyvr11en"},defaultClass:"fyvr11ek"},large:{conditions:{sm:"fyvr11eo",md:"fyvr11ep",lg:"fyvr11eq",xl:"fyvr11er"},defaultClass:"fyvr11eo"},xlarge:{conditions:{sm:"fyvr11es",md:"fyvr11et",lg:"fyvr11eu",xl:"fyvr11ev"},defaultClass:"fyvr11es"}}},fontWeight:{values:{inherit:{conditions:{sm:"fyvr11ew",md:"fyvr11ex",lg:"fyvr11ey",xl:"fyvr11ez"},defaultClass:"fyvr11ew"},normal:{conditions:{sm:"fyvr11f0",md:"fyvr11f1",lg:"fyvr11f2",xl:"fyvr11f3"},defaultClass:"fyvr11f0"},medium:{conditions:{sm:"fyvr11f4",md:"fyvr11f5",lg:"fyvr11f6",xl:"fyvr11f7"},defaultClass:"fyvr11f4"},semibold:{conditions:{sm:"fyvr11f8",md:"fyvr11f9",lg:"fyvr11fa",xl:"fyvr11fb"},defaultClass:"fyvr11f8"},bold:{conditions:{sm:"fyvr11fc",md:"fyvr11fd",lg:"fyvr11fe",xl:"fyvr11ff"},defaultClass:"fyvr11fc"}}},letterSpacing:{values:{inherit:{conditions:{sm:"fyvr11fg",md:"fyvr11fh",lg:"fyvr11fi",xl:"fyvr11fj"},defaultClass:"fyvr11fg"},none:{conditions:{sm:"fyvr11fk",md:"fyvr11fl",lg:"fyvr11fm",xl:"fyvr11fn"},defaultClass:"fyvr11fk"},normal:{conditions:{sm:"fyvr11fo",md:"fyvr11fp",lg:"fyvr11fq",xl:"fyvr11fr"},defaultClass:"fyvr11fo"},wide:{conditions:{sm:"fyvr11fs",md:"fyvr11ft",lg:"fyvr11fu",xl:"fyvr11fv"},defaultClass:"fyvr11fs"}}},lineHeight:{values:{4:{conditions:{sm:"fyvr11fw",md:"fyvr11fx",lg:"fyvr11fy",xl:"fyvr11fz"},defaultClass:"fyvr11fw"},5:{conditions:{sm:"fyvr11g0",md:"fyvr11g1",lg:"fyvr11g2",xl:"fyvr11g3"},defaultClass:"fyvr11g0"},6:{conditions:{sm:"fyvr11g4",md:"fyvr11g5",lg:"fyvr11g6",xl:"fyvr11g7"},defaultClass:"fyvr11g4"},7:{conditions:{sm:"fyvr11g8",md:"fyvr11g9",lg:"fyvr11ga",xl:"fyvr11gb"},defaultClass:"fyvr11g8"},9:{conditions:{sm:"fyvr11gc",md:"fyvr11gd",lg:"fyvr11ge",xl:"fyvr11gf"},defaultClass:"fyvr11gc"},inherit:{conditions:{sm:"fyvr11gg",md:"fyvr11gh",lg:"fyvr11gi",xl:"fyvr11gj"},defaultClass:"fyvr11gg"}}},textAlign:{values:{center:{conditions:{sm:"fyvr11gk",md:"fyvr11gl",lg:"fyvr11gm",xl:"fyvr11gn"},defaultClass:"fyvr11gk"},left:{conditions:{sm:"fyvr11go",md:"fyvr11gp",lg:"fyvr11gq",xl:"fyvr11gr"},defaultClass:"fyvr11go"},right:{conditions:{sm:"fyvr11gs",md:"fyvr11gt",lg:"fyvr11gu",xl:"fyvr11gv"},defaultClass:"fyvr11gs"}}},display:{values:{block:{conditions:{sm:"fyvr11gw",md:"fyvr11gx",lg:"fyvr11gy",xl:"fyvr11gz"},defaultClass:"fyvr11gw"},flex:{conditions:{sm:"fyvr11h0",md:"fyvr11h1",lg:"fyvr11h2",xl:"fyvr11h3"},defaultClass:"fyvr11h0"},grid:{conditions:{sm:"fyvr11h4",md:"fyvr11h5",lg:"fyvr11h6",xl:"fyvr11h7"},defaultClass:"fyvr11h4"},"inline-block":{conditions:{sm:"fyvr11h8",md:"fyvr11h9",lg:"fyvr11ha",xl:"fyvr11hb"},defaultClass:"fyvr11h8"},"inline-flex":{conditions:{sm:"fyvr11hc",md:"fyvr11hd",lg:"fyvr11he",xl:"fyvr11hf"},defaultClass:"fyvr11hc"},none:{conditions:{sm:"fyvr11hg",md:"fyvr11hh",lg:"fyvr11hi",xl:"fyvr11hj"},defaultClass:"fyvr11hg"},contents:{conditions:{sm:"fyvr11hk",md:"fyvr11hl",lg:"fyvr11hm",xl:"fyvr11hn"},defaultClass:"fyvr11hk"}}},position:{values:{absolute:{conditions:{sm:"fyvr11ho",md:"fyvr11hp",lg:"fyvr11hq",xl:"fyvr11hr"},defaultClass:"fyvr11ho"},fixed:{conditions:{sm:"fyvr11hs",md:"fyvr11ht",lg:"fyvr11hu",xl:"fyvr11hv"},defaultClass:"fyvr11hs"},relative:{conditions:{sm:"fyvr11hw",md:"fyvr11hx",lg:"fyvr11hy",xl:"fyvr11hz"},defaultClass:"fyvr11hw"},sticky:{conditions:{sm:"fyvr11i0",md:"fyvr11i1",lg:"fyvr11i2",xl:"fyvr11i3"},defaultClass:"fyvr11i0"}}},flexDirection:{values:{column:{conditions:{sm:"fyvr11i4",md:"fyvr11i5",lg:"fyvr11i6",xl:"fyvr11i7"},defaultClass:"fyvr11i4"},"column-reverse":{conditions:{sm:"fyvr11i8",md:"fyvr11i9",lg:"fyvr11ia",xl:"fyvr11ib"},defaultClass:"fyvr11i8"},row:{conditions:{sm:"fyvr11ic",md:"fyvr11id",lg:"fyvr11ie",xl:"fyvr11if"},defaultClass:"fyvr11ic"},"row-reverse":{conditions:{sm:"fyvr11ig",md:"fyvr11ih",lg:"fyvr11ii",xl:"fyvr11ij"},defaultClass:"fyvr11ig"}}},flexShrink:{values:{0:{conditions:{sm:"fyvr11ik",md:"fyvr11il",lg:"fyvr11im",xl:"fyvr11in"},defaultClass:"fyvr11ik"},1:{conditions:{sm:"fyvr11io",md:"fyvr11ip",lg:"fyvr11iq",xl:"fyvr11ir"},defaultClass:"fyvr11io"}}},flexGrow:{values:{0:{conditions:{sm:"fyvr11is",md:"fyvr11it",lg:"fyvr11iu",xl:"fyvr11iv"},defaultClass:"fyvr11is"},1:{conditions:{sm:"fyvr11iw",md:"fyvr11ix",lg:"fyvr11iy",xl:"fyvr11iz"},defaultClass:"fyvr11iw"}}},flexWrap:{values:{nowrap:{conditions:{sm:"fyvr11j0",md:"fyvr11j1",lg:"fyvr11j2",xl:"fyvr11j3"},defaultClass:"fyvr11j0"},wrap:{conditions:{sm:"fyvr11j4",md:"fyvr11j5",lg:"fyvr11j6",xl:"fyvr11j7"},defaultClass:"fyvr11j4"},"wrap-reverse":{conditions:{sm:"fyvr11j8",md:"fyvr11j9",lg:"fyvr11ja",xl:"fyvr11jb"},defaultClass:"fyvr11j8"}}},justifyContent:{values:{"flex-start":{conditions:{sm:"fyvr11jc",md:"fyvr11jd",lg:"fyvr11je",xl:"fyvr11jf"},defaultClass:"fyvr11jc"},center:{conditions:{sm:"fyvr11jg",md:"fyvr11jh",lg:"fyvr11ji",xl:"fyvr11jj"},defaultClass:"fyvr11jg"},"flex-end":{conditions:{sm:"fyvr11jk",md:"fyvr11jl",lg:"fyvr11jm",xl:"fyvr11jn"},defaultClass:"fyvr11jk"},stretch:{conditions:{sm:"fyvr11jo",md:"fyvr11jp",lg:"fyvr11jq",xl:"fyvr11jr"},defaultClass:"fyvr11jo"},"space-around":{conditions:{sm:"fyvr11js",md:"fyvr11jt",lg:"fyvr11ju",xl:"fyvr11jv"},defaultClass:"fyvr11js"},"space-between":{conditions:{sm:"fyvr11jw",md:"fyvr11jx",lg:"fyvr11jy",xl:"fyvr11jz"},defaultClass:"fyvr11jw"},"space-evenly":{conditions:{sm:"fyvr11k0",md:"fyvr11k1",lg:"fyvr11k2",xl:"fyvr11k3"},defaultClass:"fyvr11k0"}}},justifySelf:{values:{"flex-start":{conditions:{sm:"fyvr11k4",md:"fyvr11k5",lg:"fyvr11k6",xl:"fyvr11k7"},defaultClass:"fyvr11k4"},center:{conditions:{sm:"fyvr11k8",md:"fyvr11k9",lg:"fyvr11ka",xl:"fyvr11kb"},defaultClass:"fyvr11k8"},"flex-end":{conditions:{sm:"fyvr11kc",md:"fyvr11kd",lg:"fyvr11ke",xl:"fyvr11kf"},defaultClass:"fyvr11kc"},stretch:{conditions:{sm:"fyvr11kg",md:"fyvr11kh",lg:"fyvr11ki",xl:"fyvr11kj"},defaultClass:"fyvr11kg"}}},alignItems:{values:{"flex-start":{conditions:{sm:"fyvr11kk",md:"fyvr11kl",lg:"fyvr11km",xl:"fyvr11kn"},defaultClass:"fyvr11kk"},center:{conditions:{sm:"fyvr11ko",md:"fyvr11kp",lg:"fyvr11kq",xl:"fyvr11kr"},defaultClass:"fyvr11ko"},"flex-end":{conditions:{sm:"fyvr11ks",md:"fyvr11kt",lg:"fyvr11ku",xl:"fyvr11kv"},defaultClass:"fyvr11ks"},stretch:{conditions:{sm:"fyvr11kw",md:"fyvr11kx",lg:"fyvr11ky",xl:"fyvr11kz"},defaultClass:"fyvr11kw"},baseline:{conditions:{sm:"fyvr11l0",md:"fyvr11l1",lg:"fyvr11l2",xl:"fyvr11l3"},defaultClass:"fyvr11l0"}}},alignSelf:{values:{"flex-start":{conditions:{sm:"fyvr11l4",md:"fyvr11l5",lg:"fyvr11l6",xl:"fyvr11l7"},defaultClass:"fyvr11l4"},center:{conditions:{sm:"fyvr11l8",md:"fyvr11l9",lg:"fyvr11la",xl:"fyvr11lb"},defaultClass:"fyvr11l8"},"flex-end":{conditions:{sm:"fyvr11lc",md:"fyvr11ld",lg:"fyvr11le",xl:"fyvr11lf"},defaultClass:"fyvr11lc"},stretch:{conditions:{sm:"fyvr11lg",md:"fyvr11lh",lg:"fyvr11li",xl:"fyvr11lj"},defaultClass:"fyvr11lg"},baseline:{conditions:{sm:"fyvr11lk",md:"fyvr11ll",lg:"fyvr11lm",xl:"fyvr11ln"},defaultClass:"fyvr11lk"}}},overflowX:{values:{auto:{conditions:{sm:"fyvr11lo",md:"fyvr11lp",lg:"fyvr11lq",xl:"fyvr11lr"},defaultClass:"fyvr11lo"},hidden:{conditions:{sm:"fyvr11ls",md:"fyvr11lt",lg:"fyvr11lu",xl:"fyvr11lv"},defaultClass:"fyvr11ls"},scroll:{conditions:{sm:"fyvr11lw",md:"fyvr11lx",lg:"fyvr11ly",xl:"fyvr11lz"},defaultClass:"fyvr11lw"},visible:{conditions:{sm:"fyvr11m0",md:"fyvr11m1",lg:"fyvr11m2",xl:"fyvr11m3"},defaultClass:"fyvr11m0"}}},overflowY:{values:{auto:{conditions:{sm:"fyvr11m4",md:"fyvr11m5",lg:"fyvr11m6",xl:"fyvr11m7"},defaultClass:"fyvr11m4"},hidden:{conditions:{sm:"fyvr11m8",md:"fyvr11m9",lg:"fyvr11ma",xl:"fyvr11mb"},defaultClass:"fyvr11m8"},scroll:{conditions:{sm:"fyvr11mc",md:"fyvr11md",lg:"fyvr11me",xl:"fyvr11mf"},defaultClass:"fyvr11mc"},visible:{conditions:{sm:"fyvr11mg",md:"fyvr11mh",lg:"fyvr11mi",xl:"fyvr11mj"},defaultClass:"fyvr11mg"}}},visibility:{values:{hidden:{conditions:{sm:"fyvr11mk",md:"fyvr11ml",lg:"fyvr11mm",xl:"fyvr11mn"},defaultClass:"fyvr11mk"},visible:{conditions:{sm:"fyvr11mo",md:"fyvr11mp",lg:"fyvr11mq",xl:"fyvr11mr"},defaultClass:"fyvr11mo"}}}}},{conditions:void 0,styles:{backdropFilter:{values:{blur:{defaultClass:"fyvr11ms"},none:{defaultClass:"fyvr11mt"}}},fontFamily:{values:{inherit:{defaultClass:"fyvr11mu"},body:{defaultClass:"fyvr11mv"},mono:{defaultClass:"fyvr11mw"}}},textOverflow:{values:{ellipsis:{defaultClass:"fyvr11mx"},clip:{defaultClass:"fyvr11my"}}},textTransform:{values:{capitalize:{defaultClass:"fyvr11mz"},lowercase:{defaultClass:"fyvr11n0"},uppercase:{defaultClass:"fyvr11n1"}}},userSelect:{values:{none:{defaultClass:"fyvr11n2"},text:{defaultClass:"fyvr11n3"},all:{defaultClass:"fyvr11n4"},auto:{defaultClass:"fyvr11n5"}}},whiteSpace:{values:{normal:{defaultClass:"fyvr11n6"},nowrap:{defaultClass:"fyvr11n7"},initial:{defaultClass:"fyvr11n8"},inherit:{defaultClass:"fyvr11n9"}}},wordBreak:{values:{"break-word":{defaultClass:"fyvr11na"}}},wordWrap:{values:{normal:{defaultClass:"fyvr11nb"},"break-word":{defaultClass:"fyvr11nc"},initial:{defaultClass:"fyvr11nd"},inherit:{defaultClass:"fyvr11ne"}}},zIndex:{values:{0:{defaultClass:"fyvr11nf"},1:{defaultClass:"fyvr11ng"},10:{defaultClass:"fyvr11nh"},20:{defaultClass:"fyvr11ni"},30:{defaultClass:"fyvr11nj"},40:{defaultClass:"fyvr11nk"},50:{defaultClass:"fyvr11nl"},"-1":{defaultClass:"fyvr11nm"},auto:{defaultClass:"fyvr11nn"}}},aspectRatio:{values:{"1/1":{defaultClass:"fyvr11no"},"16/9":{defaultClass:"fyvr11np"},"4/3":{defaultClass:"fyvr11nq"},"3/1":{defaultClass:"fyvr11nr"},auto:{defaultClass:"fyvr11ns"}}}}},{conditions:{defaultCondition:"base",conditionNames:["base","active","disabled","focus","hover","checked"],responsiveArray:void 0},styles:{borderColor:{mappings:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]},borderStyle:{mappings:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"]},focusRing:{mappings:["boxShadow","outline"]},background:{values:{black:{conditions:{base:"fyvr11nt",active:"fyvr11nu",disabled:"fyvr11nv",focus:"fyvr11nw",hover:"fyvr11nx",checked:"fyvr11ny"},defaultClass:"fyvr11nt"},white:{conditions:{base:"fyvr11nz",active:"fyvr11o0",disabled:"fyvr11o1",focus:"fyvr11o2",hover:"fyvr11o3",checked:"fyvr11o4"},defaultClass:"fyvr11nz"},inherit:{conditions:{base:"fyvr11o5",active:"fyvr11o6",disabled:"fyvr11o7",focus:"fyvr11o8",hover:"fyvr11o9",checked:"fyvr11oa"},defaultClass:"fyvr11o5"},transparent:{conditions:{base:"fyvr11ob",active:"fyvr11oc",disabled:"fyvr11od",focus:"fyvr11oe",hover:"fyvr11of",checked:"fyvr11og"},defaultClass:"fyvr11ob"},positive:{conditions:{base:"fyvr11oh",active:"fyvr11oi",disabled:"fyvr11oj",focus:"fyvr11ok",hover:"fyvr11ol",checked:"fyvr11om"},defaultClass:"fyvr11oh"},negative:{conditions:{base:"fyvr11on",active:"fyvr11oo",disabled:"fyvr11op",focus:"fyvr11oq",hover:"fyvr11or",checked:"fyvr11os"},defaultClass:"fyvr11on"},info:{conditions:{base:"fyvr11ot",active:"fyvr11ou",disabled:"fyvr11ov",focus:"fyvr11ow",hover:"fyvr11ox",checked:"fyvr11oy"},defaultClass:"fyvr11ot"},warning:{conditions:{base:"fyvr11oz",active:"fyvr11p0",disabled:"fyvr11p1",focus:"fyvr11p2",hover:"fyvr11p3",checked:"fyvr11p4"},defaultClass:"fyvr11oz"},gradientBackdrop:{conditions:{base:"fyvr11p5",active:"fyvr11p6",disabled:"fyvr11p7",focus:"fyvr11p8",hover:"fyvr11p9",checked:"fyvr11pa"},defaultClass:"fyvr11p5"},gradientPrimary:{conditions:{base:"fyvr11pb",active:"fyvr11pc",disabled:"fyvr11pd",focus:"fyvr11pe",hover:"fyvr11pf",checked:"fyvr11pg"},defaultClass:"fyvr11pb"},gradientSecondary:{conditions:{base:"fyvr11ph",active:"fyvr11pi",disabled:"fyvr11pj",focus:"fyvr11pk",hover:"fyvr11pl",checked:"fyvr11pm"},defaultClass:"fyvr11ph"},arbitrumDark:{conditions:{base:"fyvr11pn",active:"fyvr11po",disabled:"fyvr11pp",focus:"fyvr11pq",hover:"fyvr11pr",checked:"fyvr11ps"},defaultClass:"fyvr11pn"},arbitrumLight:{conditions:{base:"fyvr11pt",active:"fyvr11pu",disabled:"fyvr11pv",focus:"fyvr11pw",hover:"fyvr11px",checked:"fyvr11py"},defaultClass:"fyvr11pt"},avalanceDark:{conditions:{base:"fyvr11pz",active:"fyvr11q0",disabled:"fyvr11q1",focus:"fyvr11q2",hover:"fyvr11q3",checked:"fyvr11q4"},defaultClass:"fyvr11pz"},avalanceLight:{conditions:{base:"fyvr11q5",active:"fyvr11q6",disabled:"fyvr11q7",focus:"fyvr11q8",hover:"fyvr11q9",checked:"fyvr11qa"},defaultClass:"fyvr11q5"},bscDark:{conditions:{base:"fyvr11qb",active:"fyvr11qc",disabled:"fyvr11qd",focus:"fyvr11qe",hover:"fyvr11qf",checked:"fyvr11qg"},defaultClass:"fyvr11qb"},bscLight:{conditions:{base:"fyvr11qh",active:"fyvr11qi",disabled:"fyvr11qj",focus:"fyvr11qk",hover:"fyvr11ql",checked:"fyvr11qm"},defaultClass:"fyvr11qh"},ethereumDark:{conditions:{base:"fyvr11qn",active:"fyvr11qo",disabled:"fyvr11qp",focus:"fyvr11qq",hover:"fyvr11qr",checked:"fyvr11qs"},defaultClass:"fyvr11qn"},ethereumLight:{conditions:{base:"fyvr11qt",active:"fyvr11qu",disabled:"fyvr11qv",focus:"fyvr11qw",hover:"fyvr11qx",checked:"fyvr11qy"},defaultClass:"fyvr11qt"},gnosisDark:{conditions:{base:"fyvr11qz",active:"fyvr11r0",disabled:"fyvr11r1",focus:"fyvr11r2",hover:"fyvr11r3",checked:"fyvr11r4"},defaultClass:"fyvr11qz"},gnosisLight:{conditions:{base:"fyvr11r5",active:"fyvr11r6",disabled:"fyvr11r7",focus:"fyvr11r8",hover:"fyvr11r9",checked:"fyvr11ra"},defaultClass:"fyvr11r5"},polygonDark:{conditions:{base:"fyvr11rb",active:"fyvr11rc",disabled:"fyvr11rd",focus:"fyvr11re",hover:"fyvr11rf",checked:"fyvr11rg"},defaultClass:"fyvr11rb"},polygonLight:{conditions:{base:"fyvr11rh",active:"fyvr11ri",disabled:"fyvr11rj",focus:"fyvr11rk",hover:"fyvr11rl",checked:"fyvr11rm"},defaultClass:"fyvr11rh"},text100:{conditions:{base:"fyvr11rn",active:"fyvr11ro",disabled:"fyvr11rp",focus:"fyvr11rq",hover:"fyvr11rr",checked:"fyvr11rs"},defaultClass:"fyvr11rn"},text80:{conditions:{base:"fyvr11rt",active:"fyvr11ru",disabled:"fyvr11rv",focus:"fyvr11rw",hover:"fyvr11rx",checked:"fyvr11ry"},defaultClass:"fyvr11rt"},text50:{conditions:{base:"fyvr11rz",active:"fyvr11s0",disabled:"fyvr11s1",focus:"fyvr11s2",hover:"fyvr11s3",checked:"fyvr11s4"},defaultClass:"fyvr11rz"},textInverse100:{conditions:{base:"fyvr11s5",active:"fyvr11s6",disabled:"fyvr11s7",focus:"fyvr11s8",hover:"fyvr11s9",checked:"fyvr11sa"},defaultClass:"fyvr11s5"},backgroundPrimary:{conditions:{base:"fyvr11sb",active:"fyvr11sc",disabled:"fyvr11sd",focus:"fyvr11se",hover:"fyvr11sf",checked:"fyvr11sg"},defaultClass:"fyvr11sb"},backgroundSecondary:{conditions:{base:"fyvr11sh",active:"fyvr11si",disabled:"fyvr11sj",focus:"fyvr11sk",hover:"fyvr11sl",checked:"fyvr11sm"},defaultClass:"fyvr11sh"},backgroundContrast:{conditions:{base:"fyvr11sn",active:"fyvr11so",disabled:"fyvr11sp",focus:"fyvr11sq",hover:"fyvr11sr",checked:"fyvr11ss"},defaultClass:"fyvr11sn"},backgroundMuted:{conditions:{base:"fyvr11st",active:"fyvr11su",disabled:"fyvr11sv",focus:"fyvr11sw",hover:"fyvr11sx",checked:"fyvr11sy"},defaultClass:"fyvr11st"},backgroundControl:{conditions:{base:"fyvr11sz",active:"fyvr11t0",disabled:"fyvr11t1",focus:"fyvr11t2",hover:"fyvr11t3",checked:"fyvr11t4"},defaultClass:"fyvr11sz"},backgroundInverse:{conditions:{base:"fyvr11t5",active:"fyvr11t6",disabled:"fyvr11t7",focus:"fyvr11t8",hover:"fyvr11t9",checked:"fyvr11ta"},defaultClass:"fyvr11t5"},backgroundBackdrop:{conditions:{base:"fyvr11tb",active:"fyvr11tc",disabled:"fyvr11td",focus:"fyvr11te",hover:"fyvr11tf",checked:"fyvr11tg"},defaultClass:"fyvr11tb"},backgroundOverlay:{conditions:{base:"fyvr11th",active:"fyvr11ti",disabled:"fyvr11tj",focus:"fyvr11tk",hover:"fyvr11tl",checked:"fyvr11tm"},defaultClass:"fyvr11th"},backgroundRaised:{conditions:{base:"fyvr11tn",active:"fyvr11to",disabled:"fyvr11tp",focus:"fyvr11tq",hover:"fyvr11tr",checked:"fyvr11ts"},defaultClass:"fyvr11tn"},buttonGlass:{conditions:{base:"fyvr11tt",active:"fyvr11tu",disabled:"fyvr11tv",focus:"fyvr11tw",hover:"fyvr11tx",checked:"fyvr11ty"},defaultClass:"fyvr11tt"},buttonEmphasis:{conditions:{base:"fyvr11tz",active:"fyvr11u0",disabled:"fyvr11u1",focus:"fyvr11u2",hover:"fyvr11u3",checked:"fyvr11u4"},defaultClass:"fyvr11tz"},buttonInverse:{conditions:{base:"fyvr11u5",active:"fyvr11u6",disabled:"fyvr11u7",focus:"fyvr11u8",hover:"fyvr11u9",checked:"fyvr11ua"},defaultClass:"fyvr11u5"},borderNormal:{conditions:{base:"fyvr11ub",active:"fyvr11uc",disabled:"fyvr11ud",focus:"fyvr11ue",hover:"fyvr11uf",checked:"fyvr11ug"},defaultClass:"fyvr11ub"},borderFocus:{conditions:{base:"fyvr11uh",active:"fyvr11ui",disabled:"fyvr11uj",focus:"fyvr11uk",hover:"fyvr11ul",checked:"fyvr11um"},defaultClass:"fyvr11uh"}}},borderBottomColor:{values:{black:{conditions:{base:"fyvr11un",active:"fyvr11uo",disabled:"fyvr11up",focus:"fyvr11uq",hover:"fyvr11ur",checked:"fyvr11us"},defaultClass:"fyvr11un"},white:{conditions:{base:"fyvr11ut",active:"fyvr11uu",disabled:"fyvr11uv",focus:"fyvr11uw",hover:"fyvr11ux",checked:"fyvr11uy"},defaultClass:"fyvr11ut"},inherit:{conditions:{base:"fyvr11uz",active:"fyvr11v0",disabled:"fyvr11v1",focus:"fyvr11v2",hover:"fyvr11v3",checked:"fyvr11v4"},defaultClass:"fyvr11uz"},transparent:{conditions:{base:"fyvr11v5",active:"fyvr11v6",disabled:"fyvr11v7",focus:"fyvr11v8",hover:"fyvr11v9",checked:"fyvr11va"},defaultClass:"fyvr11v5"},positive:{conditions:{base:"fyvr11vb",active:"fyvr11vc",disabled:"fyvr11vd",focus:"fyvr11ve",hover:"fyvr11vf",checked:"fyvr11vg"},defaultClass:"fyvr11vb"},negative:{conditions:{base:"fyvr11vh",active:"fyvr11vi",disabled:"fyvr11vj",focus:"fyvr11vk",hover:"fyvr11vl",checked:"fyvr11vm"},defaultClass:"fyvr11vh"},info:{conditions:{base:"fyvr11vn",active:"fyvr11vo",disabled:"fyvr11vp",focus:"fyvr11vq",hover:"fyvr11vr",checked:"fyvr11vs"},defaultClass:"fyvr11vn"},warning:{conditions:{base:"fyvr11vt",active:"fyvr11vu",disabled:"fyvr11vv",focus:"fyvr11vw",hover:"fyvr11vx",checked:"fyvr11vy"},defaultClass:"fyvr11vt"},gradientBackdrop:{conditions:{base:"fyvr11vz",active:"fyvr11w0",disabled:"fyvr11w1",focus:"fyvr11w2",hover:"fyvr11w3",checked:"fyvr11w4"},defaultClass:"fyvr11vz"},gradientPrimary:{conditions:{base:"fyvr11w5",active:"fyvr11w6",disabled:"fyvr11w7",focus:"fyvr11w8",hover:"fyvr11w9",checked:"fyvr11wa"},defaultClass:"fyvr11w5"},gradientSecondary:{conditions:{base:"fyvr11wb",active:"fyvr11wc",disabled:"fyvr11wd",focus:"fyvr11we",hover:"fyvr11wf",checked:"fyvr11wg"},defaultClass:"fyvr11wb"},arbitrumDark:{conditions:{base:"fyvr11wh",active:"fyvr11wi",disabled:"fyvr11wj",focus:"fyvr11wk",hover:"fyvr11wl",checked:"fyvr11wm"},defaultClass:"fyvr11wh"},arbitrumLight:{conditions:{base:"fyvr11wn",active:"fyvr11wo",disabled:"fyvr11wp",focus:"fyvr11wq",hover:"fyvr11wr",checked:"fyvr11ws"},defaultClass:"fyvr11wn"},avalanceDark:{conditions:{base:"fyvr11wt",active:"fyvr11wu",disabled:"fyvr11wv",focus:"fyvr11ww",hover:"fyvr11wx",checked:"fyvr11wy"},defaultClass:"fyvr11wt"},avalanceLight:{conditions:{base:"fyvr11wz",active:"fyvr11x0",disabled:"fyvr11x1",focus:"fyvr11x2",hover:"fyvr11x3",checked:"fyvr11x4"},defaultClass:"fyvr11wz"},bscDark:{conditions:{base:"fyvr11x5",active:"fyvr11x6",disabled:"fyvr11x7",focus:"fyvr11x8",hover:"fyvr11x9",checked:"fyvr11xa"},defaultClass:"fyvr11x5"},bscLight:{conditions:{base:"fyvr11xb",active:"fyvr11xc",disabled:"fyvr11xd",focus:"fyvr11xe",hover:"fyvr11xf",checked:"fyvr11xg"},defaultClass:"fyvr11xb"},ethereumDark:{conditions:{base:"fyvr11xh",active:"fyvr11xi",disabled:"fyvr11xj",focus:"fyvr11xk",hover:"fyvr11xl",checked:"fyvr11xm"},defaultClass:"fyvr11xh"},ethereumLight:{conditions:{base:"fyvr11xn",active:"fyvr11xo",disabled:"fyvr11xp",focus:"fyvr11xq",hover:"fyvr11xr",checked:"fyvr11xs"},defaultClass:"fyvr11xn"},gnosisDark:{conditions:{base:"fyvr11xt",active:"fyvr11xu",disabled:"fyvr11xv",focus:"fyvr11xw",hover:"fyvr11xx",checked:"fyvr11xy"},defaultClass:"fyvr11xt"},gnosisLight:{conditions:{base:"fyvr11xz",active:"fyvr11y0",disabled:"fyvr11y1",focus:"fyvr11y2",hover:"fyvr11y3",checked:"fyvr11y4"},defaultClass:"fyvr11xz"},polygonDark:{conditions:{base:"fyvr11y5",active:"fyvr11y6",disabled:"fyvr11y7",focus:"fyvr11y8",hover:"fyvr11y9",checked:"fyvr11ya"},defaultClass:"fyvr11y5"},polygonLight:{conditions:{base:"fyvr11yb",active:"fyvr11yc",disabled:"fyvr11yd",focus:"fyvr11ye",hover:"fyvr11yf",checked:"fyvr11yg"},defaultClass:"fyvr11yb"},text100:{conditions:{base:"fyvr11yh",active:"fyvr11yi",disabled:"fyvr11yj",focus:"fyvr11yk",hover:"fyvr11yl",checked:"fyvr11ym"},defaultClass:"fyvr11yh"},text80:{conditions:{base:"fyvr11yn",active:"fyvr11yo",disabled:"fyvr11yp",focus:"fyvr11yq",hover:"fyvr11yr",checked:"fyvr11ys"},defaultClass:"fyvr11yn"},text50:{conditions:{base:"fyvr11yt",active:"fyvr11yu",disabled:"fyvr11yv",focus:"fyvr11yw",hover:"fyvr11yx",checked:"fyvr11yy"},defaultClass:"fyvr11yt"},textInverse100:{conditions:{base:"fyvr11yz",active:"fyvr11z0",disabled:"fyvr11z1",focus:"fyvr11z2",hover:"fyvr11z3",checked:"fyvr11z4"},defaultClass:"fyvr11yz"},backgroundPrimary:{conditions:{base:"fyvr11z5",active:"fyvr11z6",disabled:"fyvr11z7",focus:"fyvr11z8",hover:"fyvr11z9",checked:"fyvr11za"},defaultClass:"fyvr11z5"},backgroundSecondary:{conditions:{base:"fyvr11zb",active:"fyvr11zc",disabled:"fyvr11zd",focus:"fyvr11ze",hover:"fyvr11zf",checked:"fyvr11zg"},defaultClass:"fyvr11zb"},backgroundContrast:{conditions:{base:"fyvr11zh",active:"fyvr11zi",disabled:"fyvr11zj",focus:"fyvr11zk",hover:"fyvr11zl",checked:"fyvr11zm"},defaultClass:"fyvr11zh"},backgroundMuted:{conditions:{base:"fyvr11zn",active:"fyvr11zo",disabled:"fyvr11zp",focus:"fyvr11zq",hover:"fyvr11zr",checked:"fyvr11zs"},defaultClass:"fyvr11zn"},backgroundControl:{conditions:{base:"fyvr11zt",active:"fyvr11zu",disabled:"fyvr11zv",focus:"fyvr11zw",hover:"fyvr11zx",checked:"fyvr11zy"},defaultClass:"fyvr11zt"},backgroundInverse:{conditions:{base:"fyvr11zz",active:"fyvr1200",disabled:"fyvr1201",focus:"fyvr1202",hover:"fyvr1203",checked:"fyvr1204"},defaultClass:"fyvr11zz"},backgroundBackdrop:{conditions:{base:"fyvr1205",active:"fyvr1206",disabled:"fyvr1207",focus:"fyvr1208",hover:"fyvr1209",checked:"fyvr120a"},defaultClass:"fyvr1205"},backgroundOverlay:{conditions:{base:"fyvr120b",active:"fyvr120c",disabled:"fyvr120d",focus:"fyvr120e",hover:"fyvr120f",checked:"fyvr120g"},defaultClass:"fyvr120b"},backgroundRaised:{conditions:{base:"fyvr120h",active:"fyvr120i",disabled:"fyvr120j",focus:"fyvr120k",hover:"fyvr120l",checked:"fyvr120m"},defaultClass:"fyvr120h"},buttonGlass:{conditions:{base:"fyvr120n",active:"fyvr120o",disabled:"fyvr120p",focus:"fyvr120q",hover:"fyvr120r",checked:"fyvr120s"},defaultClass:"fyvr120n"},buttonEmphasis:{conditions:{base:"fyvr120t",active:"fyvr120u",disabled:"fyvr120v",focus:"fyvr120w",hover:"fyvr120x",checked:"fyvr120y"},defaultClass:"fyvr120t"},buttonInverse:{conditions:{base:"fyvr120z",active:"fyvr1210",disabled:"fyvr1211",focus:"fyvr1212",hover:"fyvr1213",checked:"fyvr1214"},defaultClass:"fyvr120z"},borderNormal:{conditions:{base:"fyvr1215",active:"fyvr1216",disabled:"fyvr1217",focus:"fyvr1218",hover:"fyvr1219",checked:"fyvr121a"},defaultClass:"fyvr1215"},borderFocus:{conditions:{base:"fyvr121b",active:"fyvr121c",disabled:"fyvr121d",focus:"fyvr121e",hover:"fyvr121f",checked:"fyvr121g"},defaultClass:"fyvr121b"}}},borderBottomStyle:{values:{solid:{conditions:{base:"fyvr121h",active:"fyvr121i",disabled:"fyvr121j",focus:"fyvr121k",hover:"fyvr121l",checked:"fyvr121m"},defaultClass:"fyvr121h"},dashed:{conditions:{base:"fyvr121n",active:"fyvr121o",disabled:"fyvr121p",focus:"fyvr121q",hover:"fyvr121r",checked:"fyvr121s"},defaultClass:"fyvr121n"},dotted:{conditions:{base:"fyvr121t",active:"fyvr121u",disabled:"fyvr121v",focus:"fyvr121w",hover:"fyvr121x",checked:"fyvr121y"},defaultClass:"fyvr121t"}}},borderLeftColor:{values:{black:{conditions:{base:"fyvr121z",active:"fyvr1220",disabled:"fyvr1221",focus:"fyvr1222",hover:"fyvr1223",checked:"fyvr1224"},defaultClass:"fyvr121z"},white:{conditions:{base:"fyvr1225",active:"fyvr1226",disabled:"fyvr1227",focus:"fyvr1228",hover:"fyvr1229",checked:"fyvr122a"},defaultClass:"fyvr1225"},inherit:{conditions:{base:"fyvr122b",active:"fyvr122c",disabled:"fyvr122d",focus:"fyvr122e",hover:"fyvr122f",checked:"fyvr122g"},defaultClass:"fyvr122b"},transparent:{conditions:{base:"fyvr122h",active:"fyvr122i",disabled:"fyvr122j",focus:"fyvr122k",hover:"fyvr122l",checked:"fyvr122m"},defaultClass:"fyvr122h"},positive:{conditions:{base:"fyvr122n",active:"fyvr122o",disabled:"fyvr122p",focus:"fyvr122q",hover:"fyvr122r",checked:"fyvr122s"},defaultClass:"fyvr122n"},negative:{conditions:{base:"fyvr122t",active:"fyvr122u",disabled:"fyvr122v",focus:"fyvr122w",hover:"fyvr122x",checked:"fyvr122y"},defaultClass:"fyvr122t"},info:{conditions:{base:"fyvr122z",active:"fyvr1230",disabled:"fyvr1231",focus:"fyvr1232",hover:"fyvr1233",checked:"fyvr1234"},defaultClass:"fyvr122z"},warning:{conditions:{base:"fyvr1235",active:"fyvr1236",disabled:"fyvr1237",focus:"fyvr1238",hover:"fyvr1239",checked:"fyvr123a"},defaultClass:"fyvr1235"},gradientBackdrop:{conditions:{base:"fyvr123b",active:"fyvr123c",disabled:"fyvr123d",focus:"fyvr123e",hover:"fyvr123f",checked:"fyvr123g"},defaultClass:"fyvr123b"},gradientPrimary:{conditions:{base:"fyvr123h",active:"fyvr123i",disabled:"fyvr123j",focus:"fyvr123k",hover:"fyvr123l",checked:"fyvr123m"},defaultClass:"fyvr123h"},gradientSecondary:{conditions:{base:"fyvr123n",active:"fyvr123o",disabled:"fyvr123p",focus:"fyvr123q",hover:"fyvr123r",checked:"fyvr123s"},defaultClass:"fyvr123n"},arbitrumDark:{conditions:{base:"fyvr123t",active:"fyvr123u",disabled:"fyvr123v",focus:"fyvr123w",hover:"fyvr123x",checked:"fyvr123y"},defaultClass:"fyvr123t"},arbitrumLight:{conditions:{base:"fyvr123z",active:"fyvr1240",disabled:"fyvr1241",focus:"fyvr1242",hover:"fyvr1243",checked:"fyvr1244"},defaultClass:"fyvr123z"},avalanceDark:{conditions:{base:"fyvr1245",active:"fyvr1246",disabled:"fyvr1247",focus:"fyvr1248",hover:"fyvr1249",checked:"fyvr124a"},defaultClass:"fyvr1245"},avalanceLight:{conditions:{base:"fyvr124b",active:"fyvr124c",disabled:"fyvr124d",focus:"fyvr124e",hover:"fyvr124f",checked:"fyvr124g"},defaultClass:"fyvr124b"},bscDark:{conditions:{base:"fyvr124h",active:"fyvr124i",disabled:"fyvr124j",focus:"fyvr124k",hover:"fyvr124l",checked:"fyvr124m"},defaultClass:"fyvr124h"},bscLight:{conditions:{base:"fyvr124n",active:"fyvr124o",disabled:"fyvr124p",focus:"fyvr124q",hover:"fyvr124r",checked:"fyvr124s"},defaultClass:"fyvr124n"},ethereumDark:{conditions:{base:"fyvr124t",active:"fyvr124u",disabled:"fyvr124v",focus:"fyvr124w",hover:"fyvr124x",checked:"fyvr124y"},defaultClass:"fyvr124t"},ethereumLight:{conditions:{base:"fyvr124z",active:"fyvr1250",disabled:"fyvr1251",focus:"fyvr1252",hover:"fyvr1253",checked:"fyvr1254"},defaultClass:"fyvr124z"},gnosisDark:{conditions:{base:"fyvr1255",active:"fyvr1256",disabled:"fyvr1257",focus:"fyvr1258",hover:"fyvr1259",checked:"fyvr125a"},defaultClass:"fyvr1255"},gnosisLight:{conditions:{base:"fyvr125b",active:"fyvr125c",disabled:"fyvr125d",focus:"fyvr125e",hover:"fyvr125f",checked:"fyvr125g"},defaultClass:"fyvr125b"},polygonDark:{conditions:{base:"fyvr125h",active:"fyvr125i",disabled:"fyvr125j",focus:"fyvr125k",hover:"fyvr125l",checked:"fyvr125m"},defaultClass:"fyvr125h"},polygonLight:{conditions:{base:"fyvr125n",active:"fyvr125o",disabled:"fyvr125p",focus:"fyvr125q",hover:"fyvr125r",checked:"fyvr125s"},defaultClass:"fyvr125n"},text100:{conditions:{base:"fyvr125t",active:"fyvr125u",disabled:"fyvr125v",focus:"fyvr125w",hover:"fyvr125x",checked:"fyvr125y"},defaultClass:"fyvr125t"},text80:{conditions:{base:"fyvr125z",active:"fyvr1260",disabled:"fyvr1261",focus:"fyvr1262",hover:"fyvr1263",checked:"fyvr1264"},defaultClass:"fyvr125z"},text50:{conditions:{base:"fyvr1265",active:"fyvr1266",disabled:"fyvr1267",focus:"fyvr1268",hover:"fyvr1269",checked:"fyvr126a"},defaultClass:"fyvr1265"},textInverse100:{conditions:{base:"fyvr126b",active:"fyvr126c",disabled:"fyvr126d",focus:"fyvr126e",hover:"fyvr126f",checked:"fyvr126g"},defaultClass:"fyvr126b"},backgroundPrimary:{conditions:{base:"fyvr126h",active:"fyvr126i",disabled:"fyvr126j",focus:"fyvr126k",hover:"fyvr126l",checked:"fyvr126m"},defaultClass:"fyvr126h"},backgroundSecondary:{conditions:{base:"fyvr126n",active:"fyvr126o",disabled:"fyvr126p",focus:"fyvr126q",hover:"fyvr126r",checked:"fyvr126s"},defaultClass:"fyvr126n"},backgroundContrast:{conditions:{base:"fyvr126t",active:"fyvr126u",disabled:"fyvr126v",focus:"fyvr126w",hover:"fyvr126x",checked:"fyvr126y"},defaultClass:"fyvr126t"},backgroundMuted:{conditions:{base:"fyvr126z",active:"fyvr1270",disabled:"fyvr1271",focus:"fyvr1272",hover:"fyvr1273",checked:"fyvr1274"},defaultClass:"fyvr126z"},backgroundControl:{conditions:{base:"fyvr1275",active:"fyvr1276",disabled:"fyvr1277",focus:"fyvr1278",hover:"fyvr1279",checked:"fyvr127a"},defaultClass:"fyvr1275"},backgroundInverse:{conditions:{base:"fyvr127b",active:"fyvr127c",disabled:"fyvr127d",focus:"fyvr127e",hover:"fyvr127f",checked:"fyvr127g"},defaultClass:"fyvr127b"},backgroundBackdrop:{conditions:{base:"fyvr127h",active:"fyvr127i",disabled:"fyvr127j",focus:"fyvr127k",hover:"fyvr127l",checked:"fyvr127m"},defaultClass:"fyvr127h"},backgroundOverlay:{conditions:{base:"fyvr127n",active:"fyvr127o",disabled:"fyvr127p",focus:"fyvr127q",hover:"fyvr127r",checked:"fyvr127s"},defaultClass:"fyvr127n"},backgroundRaised:{conditions:{base:"fyvr127t",active:"fyvr127u",disabled:"fyvr127v",focus:"fyvr127w",hover:"fyvr127x",checked:"fyvr127y"},defaultClass:"fyvr127t"},buttonGlass:{conditions:{base:"fyvr127z",active:"fyvr1280",disabled:"fyvr1281",focus:"fyvr1282",hover:"fyvr1283",checked:"fyvr1284"},defaultClass:"fyvr127z"},buttonEmphasis:{conditions:{base:"fyvr1285",active:"fyvr1286",disabled:"fyvr1287",focus:"fyvr1288",hover:"fyvr1289",checked:"fyvr128a"},defaultClass:"fyvr1285"},buttonInverse:{conditions:{base:"fyvr128b",active:"fyvr128c",disabled:"fyvr128d",focus:"fyvr128e",hover:"fyvr128f",checked:"fyvr128g"},defaultClass:"fyvr128b"},borderNormal:{conditions:{base:"fyvr128h",active:"fyvr128i",disabled:"fyvr128j",focus:"fyvr128k",hover:"fyvr128l",checked:"fyvr128m"},defaultClass:"fyvr128h"},borderFocus:{conditions:{base:"fyvr128n",active:"fyvr128o",disabled:"fyvr128p",focus:"fyvr128q",hover:"fyvr128r",checked:"fyvr128s"},defaultClass:"fyvr128n"}}},borderLeftStyle:{values:{solid:{conditions:{base:"fyvr128t",active:"fyvr128u",disabled:"fyvr128v",focus:"fyvr128w",hover:"fyvr128x",checked:"fyvr128y"},defaultClass:"fyvr128t"},dashed:{conditions:{base:"fyvr128z",active:"fyvr1290",disabled:"fyvr1291",focus:"fyvr1292",hover:"fyvr1293",checked:"fyvr1294"},defaultClass:"fyvr128z"},dotted:{conditions:{base:"fyvr1295",active:"fyvr1296",disabled:"fyvr1297",focus:"fyvr1298",hover:"fyvr1299",checked:"fyvr129a"},defaultClass:"fyvr1295"}}},borderRightColor:{values:{black:{conditions:{base:"fyvr129b",active:"fyvr129c",disabled:"fyvr129d",focus:"fyvr129e",hover:"fyvr129f",checked:"fyvr129g"},defaultClass:"fyvr129b"},white:{conditions:{base:"fyvr129h",active:"fyvr129i",disabled:"fyvr129j",focus:"fyvr129k",hover:"fyvr129l",checked:"fyvr129m"},defaultClass:"fyvr129h"},inherit:{conditions:{base:"fyvr129n",active:"fyvr129o",disabled:"fyvr129p",focus:"fyvr129q",hover:"fyvr129r",checked:"fyvr129s"},defaultClass:"fyvr129n"},transparent:{conditions:{base:"fyvr129t",active:"fyvr129u",disabled:"fyvr129v",focus:"fyvr129w",hover:"fyvr129x",checked:"fyvr129y"},defaultClass:"fyvr129t"},positive:{conditions:{base:"fyvr129z",active:"fyvr12a0",disabled:"fyvr12a1",focus:"fyvr12a2",hover:"fyvr12a3",checked:"fyvr12a4"},defaultClass:"fyvr129z"},negative:{conditions:{base:"fyvr12a5",active:"fyvr12a6",disabled:"fyvr12a7",focus:"fyvr12a8",hover:"fyvr12a9",checked:"fyvr12aa"},defaultClass:"fyvr12a5"},info:{conditions:{base:"fyvr12ab",active:"fyvr12ac",disabled:"fyvr12ad",focus:"fyvr12ae",hover:"fyvr12af",checked:"fyvr12ag"},defaultClass:"fyvr12ab"},warning:{conditions:{base:"fyvr12ah",active:"fyvr12ai",disabled:"fyvr12aj",focus:"fyvr12ak",hover:"fyvr12al",checked:"fyvr12am"},defaultClass:"fyvr12ah"},gradientBackdrop:{conditions:{base:"fyvr12an",active:"fyvr12ao",disabled:"fyvr12ap",focus:"fyvr12aq",hover:"fyvr12ar",checked:"fyvr12as"},defaultClass:"fyvr12an"},gradientPrimary:{conditions:{base:"fyvr12at",active:"fyvr12au",disabled:"fyvr12av",focus:"fyvr12aw",hover:"fyvr12ax",checked:"fyvr12ay"},defaultClass:"fyvr12at"},gradientSecondary:{conditions:{base:"fyvr12az",active:"fyvr12b0",disabled:"fyvr12b1",focus:"fyvr12b2",hover:"fyvr12b3",checked:"fyvr12b4"},defaultClass:"fyvr12az"},arbitrumDark:{conditions:{base:"fyvr12b5",active:"fyvr12b6",disabled:"fyvr12b7",focus:"fyvr12b8",hover:"fyvr12b9",checked:"fyvr12ba"},defaultClass:"fyvr12b5"},arbitrumLight:{conditions:{base:"fyvr12bb",active:"fyvr12bc",disabled:"fyvr12bd",focus:"fyvr12be",hover:"fyvr12bf",checked:"fyvr12bg"},defaultClass:"fyvr12bb"},avalanceDark:{conditions:{base:"fyvr12bh",active:"fyvr12bi",disabled:"fyvr12bj",focus:"fyvr12bk",hover:"fyvr12bl",checked:"fyvr12bm"},defaultClass:"fyvr12bh"},avalanceLight:{conditions:{base:"fyvr12bn",active:"fyvr12bo",disabled:"fyvr12bp",focus:"fyvr12bq",hover:"fyvr12br",checked:"fyvr12bs"},defaultClass:"fyvr12bn"},bscDark:{conditions:{base:"fyvr12bt",active:"fyvr12bu",disabled:"fyvr12bv",focus:"fyvr12bw",hover:"fyvr12bx",checked:"fyvr12by"},defaultClass:"fyvr12bt"},bscLight:{conditions:{base:"fyvr12bz",active:"fyvr12c0",disabled:"fyvr12c1",focus:"fyvr12c2",hover:"fyvr12c3",checked:"fyvr12c4"},defaultClass:"fyvr12bz"},ethereumDark:{conditions:{base:"fyvr12c5",active:"fyvr12c6",disabled:"fyvr12c7",focus:"fyvr12c8",hover:"fyvr12c9",checked:"fyvr12ca"},defaultClass:"fyvr12c5"},ethereumLight:{conditions:{base:"fyvr12cb",active:"fyvr12cc",disabled:"fyvr12cd",focus:"fyvr12ce",hover:"fyvr12cf",checked:"fyvr12cg"},defaultClass:"fyvr12cb"},gnosisDark:{conditions:{base:"fyvr12ch",active:"fyvr12ci",disabled:"fyvr12cj",focus:"fyvr12ck",hover:"fyvr12cl",checked:"fyvr12cm"},defaultClass:"fyvr12ch"},gnosisLight:{conditions:{base:"fyvr12cn",active:"fyvr12co",disabled:"fyvr12cp",focus:"fyvr12cq",hover:"fyvr12cr",checked:"fyvr12cs"},defaultClass:"fyvr12cn"},polygonDark:{conditions:{base:"fyvr12ct",active:"fyvr12cu",disabled:"fyvr12cv",focus:"fyvr12cw",hover:"fyvr12cx",checked:"fyvr12cy"},defaultClass:"fyvr12ct"},polygonLight:{conditions:{base:"fyvr12cz",active:"fyvr12d0",disabled:"fyvr12d1",focus:"fyvr12d2",hover:"fyvr12d3",checked:"fyvr12d4"},defaultClass:"fyvr12cz"},text100:{conditions:{base:"fyvr12d5",active:"fyvr12d6",disabled:"fyvr12d7",focus:"fyvr12d8",hover:"fyvr12d9",checked:"fyvr12da"},defaultClass:"fyvr12d5"},text80:{conditions:{base:"fyvr12db",active:"fyvr12dc",disabled:"fyvr12dd",focus:"fyvr12de",hover:"fyvr12df",checked:"fyvr12dg"},defaultClass:"fyvr12db"},text50:{conditions:{base:"fyvr12dh",active:"fyvr12di",disabled:"fyvr12dj",focus:"fyvr12dk",hover:"fyvr12dl",checked:"fyvr12dm"},defaultClass:"fyvr12dh"},textInverse100:{conditions:{base:"fyvr12dn",active:"fyvr12do",disabled:"fyvr12dp",focus:"fyvr12dq",hover:"fyvr12dr",checked:"fyvr12ds"},defaultClass:"fyvr12dn"},backgroundPrimary:{conditions:{base:"fyvr12dt",active:"fyvr12du",disabled:"fyvr12dv",focus:"fyvr12dw",hover:"fyvr12dx",checked:"fyvr12dy"},defaultClass:"fyvr12dt"},backgroundSecondary:{conditions:{base:"fyvr12dz",active:"fyvr12e0",disabled:"fyvr12e1",focus:"fyvr12e2",hover:"fyvr12e3",checked:"fyvr12e4"},defaultClass:"fyvr12dz"},backgroundContrast:{conditions:{base:"fyvr12e5",active:"fyvr12e6",disabled:"fyvr12e7",focus:"fyvr12e8",hover:"fyvr12e9",checked:"fyvr12ea"},defaultClass:"fyvr12e5"},backgroundMuted:{conditions:{base:"fyvr12eb",active:"fyvr12ec",disabled:"fyvr12ed",focus:"fyvr12ee",hover:"fyvr12ef",checked:"fyvr12eg"},defaultClass:"fyvr12eb"},backgroundControl:{conditions:{base:"fyvr12eh",active:"fyvr12ei",disabled:"fyvr12ej",focus:"fyvr12ek",hover:"fyvr12el",checked:"fyvr12em"},defaultClass:"fyvr12eh"},backgroundInverse:{conditions:{base:"fyvr12en",active:"fyvr12eo",disabled:"fyvr12ep",focus:"fyvr12eq",hover:"fyvr12er",checked:"fyvr12es"},defaultClass:"fyvr12en"},backgroundBackdrop:{conditions:{base:"fyvr12et",active:"fyvr12eu",disabled:"fyvr12ev",focus:"fyvr12ew",hover:"fyvr12ex",checked:"fyvr12ey"},defaultClass:"fyvr12et"},backgroundOverlay:{conditions:{base:"fyvr12ez",active:"fyvr12f0",disabled:"fyvr12f1",focus:"fyvr12f2",hover:"fyvr12f3",checked:"fyvr12f4"},defaultClass:"fyvr12ez"},backgroundRaised:{conditions:{base:"fyvr12f5",active:"fyvr12f6",disabled:"fyvr12f7",focus:"fyvr12f8",hover:"fyvr12f9",checked:"fyvr12fa"},defaultClass:"fyvr12f5"},buttonGlass:{conditions:{base:"fyvr12fb",active:"fyvr12fc",disabled:"fyvr12fd",focus:"fyvr12fe",hover:"fyvr12ff",checked:"fyvr12fg"},defaultClass:"fyvr12fb"},buttonEmphasis:{conditions:{base:"fyvr12fh",active:"fyvr12fi",disabled:"fyvr12fj",focus:"fyvr12fk",hover:"fyvr12fl",checked:"fyvr12fm"},defaultClass:"fyvr12fh"},buttonInverse:{conditions:{base:"fyvr12fn",active:"fyvr12fo",disabled:"fyvr12fp",focus:"fyvr12fq",hover:"fyvr12fr",checked:"fyvr12fs"},defaultClass:"fyvr12fn"},borderNormal:{conditions:{base:"fyvr12ft",active:"fyvr12fu",disabled:"fyvr12fv",focus:"fyvr12fw",hover:"fyvr12fx",checked:"fyvr12fy"},defaultClass:"fyvr12ft"},borderFocus:{conditions:{base:"fyvr12fz",active:"fyvr12g0",disabled:"fyvr12g1",focus:"fyvr12g2",hover:"fyvr12g3",checked:"fyvr12g4"},defaultClass:"fyvr12fz"}}},borderRightStyle:{values:{solid:{conditions:{base:"fyvr12g5",active:"fyvr12g6",disabled:"fyvr12g7",focus:"fyvr12g8",hover:"fyvr12g9",checked:"fyvr12ga"},defaultClass:"fyvr12g5"},dashed:{conditions:{base:"fyvr12gb",active:"fyvr12gc",disabled:"fyvr12gd",focus:"fyvr12ge",hover:"fyvr12gf",checked:"fyvr12gg"},defaultClass:"fyvr12gb"},dotted:{conditions:{base:"fyvr12gh",active:"fyvr12gi",disabled:"fyvr12gj",focus:"fyvr12gk",hover:"fyvr12gl",checked:"fyvr12gm"},defaultClass:"fyvr12gh"}}},borderTopColor:{values:{black:{conditions:{base:"fyvr12gn",active:"fyvr12go",disabled:"fyvr12gp",focus:"fyvr12gq",hover:"fyvr12gr",checked:"fyvr12gs"},defaultClass:"fyvr12gn"},white:{conditions:{base:"fyvr12gt",active:"fyvr12gu",disabled:"fyvr12gv",focus:"fyvr12gw",hover:"fyvr12gx",checked:"fyvr12gy"},defaultClass:"fyvr12gt"},inherit:{conditions:{base:"fyvr12gz",active:"fyvr12h0",disabled:"fyvr12h1",focus:"fyvr12h2",hover:"fyvr12h3",checked:"fyvr12h4"},defaultClass:"fyvr12gz"},transparent:{conditions:{base:"fyvr12h5",active:"fyvr12h6",disabled:"fyvr12h7",focus:"fyvr12h8",hover:"fyvr12h9",checked:"fyvr12ha"},defaultClass:"fyvr12h5"},positive:{conditions:{base:"fyvr12hb",active:"fyvr12hc",disabled:"fyvr12hd",focus:"fyvr12he",hover:"fyvr12hf",checked:"fyvr12hg"},defaultClass:"fyvr12hb"},negative:{conditions:{base:"fyvr12hh",active:"fyvr12hi",disabled:"fyvr12hj",focus:"fyvr12hk",hover:"fyvr12hl",checked:"fyvr12hm"},defaultClass:"fyvr12hh"},info:{conditions:{base:"fyvr12hn",active:"fyvr12ho",disabled:"fyvr12hp",focus:"fyvr12hq",hover:"fyvr12hr",checked:"fyvr12hs"},defaultClass:"fyvr12hn"},warning:{conditions:{base:"fyvr12ht",active:"fyvr12hu",disabled:"fyvr12hv",focus:"fyvr12hw",hover:"fyvr12hx",checked:"fyvr12hy"},defaultClass:"fyvr12ht"},gradientBackdrop:{conditions:{base:"fyvr12hz",active:"fyvr12i0",disabled:"fyvr12i1",focus:"fyvr12i2",hover:"fyvr12i3",checked:"fyvr12i4"},defaultClass:"fyvr12hz"},gradientPrimary:{conditions:{base:"fyvr12i5",active:"fyvr12i6",disabled:"fyvr12i7",focus:"fyvr12i8",hover:"fyvr12i9",checked:"fyvr12ia"},defaultClass:"fyvr12i5"},gradientSecondary:{conditions:{base:"fyvr12ib",active:"fyvr12ic",disabled:"fyvr12id",focus:"fyvr12ie",hover:"fyvr12if",checked:"fyvr12ig"},defaultClass:"fyvr12ib"},arbitrumDark:{conditions:{base:"fyvr12ih",active:"fyvr12ii",disabled:"fyvr12ij",focus:"fyvr12ik",hover:"fyvr12il",checked:"fyvr12im"},defaultClass:"fyvr12ih"},arbitrumLight:{conditions:{base:"fyvr12in",active:"fyvr12io",disabled:"fyvr12ip",focus:"fyvr12iq",hover:"fyvr12ir",checked:"fyvr12is"},defaultClass:"fyvr12in"},avalanceDark:{conditions:{base:"fyvr12it",active:"fyvr12iu",disabled:"fyvr12iv",focus:"fyvr12iw",hover:"fyvr12ix",checked:"fyvr12iy"},defaultClass:"fyvr12it"},avalanceLight:{conditions:{base:"fyvr12iz",active:"fyvr12j0",disabled:"fyvr12j1",focus:"fyvr12j2",hover:"fyvr12j3",checked:"fyvr12j4"},defaultClass:"fyvr12iz"},bscDark:{conditions:{base:"fyvr12j5",active:"fyvr12j6",disabled:"fyvr12j7",focus:"fyvr12j8",hover:"fyvr12j9",checked:"fyvr12ja"},defaultClass:"fyvr12j5"},bscLight:{conditions:{base:"fyvr12jb",active:"fyvr12jc",disabled:"fyvr12jd",focus:"fyvr12je",hover:"fyvr12jf",checked:"fyvr12jg"},defaultClass:"fyvr12jb"},ethereumDark:{conditions:{base:"fyvr12jh",active:"fyvr12ji",disabled:"fyvr12jj",focus:"fyvr12jk",hover:"fyvr12jl",checked:"fyvr12jm"},defaultClass:"fyvr12jh"},ethereumLight:{conditions:{base:"fyvr12jn",active:"fyvr12jo",disabled:"fyvr12jp",focus:"fyvr12jq",hover:"fyvr12jr",checked:"fyvr12js"},defaultClass:"fyvr12jn"},gnosisDark:{conditions:{base:"fyvr12jt",active:"fyvr12ju",disabled:"fyvr12jv",focus:"fyvr12jw",hover:"fyvr12jx",checked:"fyvr12jy"},defaultClass:"fyvr12jt"},gnosisLight:{conditions:{base:"fyvr12jz",active:"fyvr12k0",disabled:"fyvr12k1",focus:"fyvr12k2",hover:"fyvr12k3",checked:"fyvr12k4"},defaultClass:"fyvr12jz"},polygonDark:{conditions:{base:"fyvr12k5",active:"fyvr12k6",disabled:"fyvr12k7",focus:"fyvr12k8",hover:"fyvr12k9",checked:"fyvr12ka"},defaultClass:"fyvr12k5"},polygonLight:{conditions:{base:"fyvr12kb",active:"fyvr12kc",disabled:"fyvr12kd",focus:"fyvr12ke",hover:"fyvr12kf",checked:"fyvr12kg"},defaultClass:"fyvr12kb"},text100:{conditions:{base:"fyvr12kh",active:"fyvr12ki",disabled:"fyvr12kj",focus:"fyvr12kk",hover:"fyvr12kl",checked:"fyvr12km"},defaultClass:"fyvr12kh"},text80:{conditions:{base:"fyvr12kn",active:"fyvr12ko",disabled:"fyvr12kp",focus:"fyvr12kq",hover:"fyvr12kr",checked:"fyvr12ks"},defaultClass:"fyvr12kn"},text50:{conditions:{base:"fyvr12kt",active:"fyvr12ku",disabled:"fyvr12kv",focus:"fyvr12kw",hover:"fyvr12kx",checked:"fyvr12ky"},defaultClass:"fyvr12kt"},textInverse100:{conditions:{base:"fyvr12kz",active:"fyvr12l0",disabled:"fyvr12l1",focus:"fyvr12l2",hover:"fyvr12l3",checked:"fyvr12l4"},defaultClass:"fyvr12kz"},backgroundPrimary:{conditions:{base:"fyvr12l5",active:"fyvr12l6",disabled:"fyvr12l7",focus:"fyvr12l8",hover:"fyvr12l9",checked:"fyvr12la"},defaultClass:"fyvr12l5"},backgroundSecondary:{conditions:{base:"fyvr12lb",active:"fyvr12lc",disabled:"fyvr12ld",focus:"fyvr12le",hover:"fyvr12lf",checked:"fyvr12lg"},defaultClass:"fyvr12lb"},backgroundContrast:{conditions:{base:"fyvr12lh",active:"fyvr12li",disabled:"fyvr12lj",focus:"fyvr12lk",hover:"fyvr12ll",checked:"fyvr12lm"},defaultClass:"fyvr12lh"},backgroundMuted:{conditions:{base:"fyvr12ln",active:"fyvr12lo",disabled:"fyvr12lp",focus:"fyvr12lq",hover:"fyvr12lr",checked:"fyvr12ls"},defaultClass:"fyvr12ln"},backgroundControl:{conditions:{base:"fyvr12lt",active:"fyvr12lu",disabled:"fyvr12lv",focus:"fyvr12lw",hover:"fyvr12lx",checked:"fyvr12ly"},defaultClass:"fyvr12lt"},backgroundInverse:{conditions:{base:"fyvr12lz",active:"fyvr12m0",disabled:"fyvr12m1",focus:"fyvr12m2",hover:"fyvr12m3",checked:"fyvr12m4"},defaultClass:"fyvr12lz"},backgroundBackdrop:{conditions:{base:"fyvr12m5",active:"fyvr12m6",disabled:"fyvr12m7",focus:"fyvr12m8",hover:"fyvr12m9",checked:"fyvr12ma"},defaultClass:"fyvr12m5"},backgroundOverlay:{conditions:{base:"fyvr12mb",active:"fyvr12mc",disabled:"fyvr12md",focus:"fyvr12me",hover:"fyvr12mf",checked:"fyvr12mg"},defaultClass:"fyvr12mb"},backgroundRaised:{conditions:{base:"fyvr12mh",active:"fyvr12mi",disabled:"fyvr12mj",focus:"fyvr12mk",hover:"fyvr12ml",checked:"fyvr12mm"},defaultClass:"fyvr12mh"},buttonGlass:{conditions:{base:"fyvr12mn",active:"fyvr12mo",disabled:"fyvr12mp",focus:"fyvr12mq",hover:"fyvr12mr",checked:"fyvr12ms"},defaultClass:"fyvr12mn"},buttonEmphasis:{conditions:{base:"fyvr12mt",active:"fyvr12mu",disabled:"fyvr12mv",focus:"fyvr12mw",hover:"fyvr12mx",checked:"fyvr12my"},defaultClass:"fyvr12mt"},buttonInverse:{conditions:{base:"fyvr12mz",active:"fyvr12n0",disabled:"fyvr12n1",focus:"fyvr12n2",hover:"fyvr12n3",checked:"fyvr12n4"},defaultClass:"fyvr12mz"},borderNormal:{conditions:{base:"fyvr12n5",active:"fyvr12n6",disabled:"fyvr12n7",focus:"fyvr12n8",hover:"fyvr12n9",checked:"fyvr12na"},defaultClass:"fyvr12n5"},borderFocus:{conditions:{base:"fyvr12nb",active:"fyvr12nc",disabled:"fyvr12nd",focus:"fyvr12ne",hover:"fyvr12nf",checked:"fyvr12ng"},defaultClass:"fyvr12nb"}}},borderTopStyle:{values:{solid:{conditions:{base:"fyvr12nh",active:"fyvr12ni",disabled:"fyvr12nj",focus:"fyvr12nk",hover:"fyvr12nl",checked:"fyvr12nm"},defaultClass:"fyvr12nh"},dashed:{conditions:{base:"fyvr12nn",active:"fyvr12no",disabled:"fyvr12np",focus:"fyvr12nq",hover:"fyvr12nr",checked:"fyvr12ns"},defaultClass:"fyvr12nn"},dotted:{conditions:{base:"fyvr12nt",active:"fyvr12nu",disabled:"fyvr12nv",focus:"fyvr12nw",hover:"fyvr12nx",checked:"fyvr12ny"},defaultClass:"fyvr12nt"}}},color:{values:{black:{conditions:{base:"fyvr12nz",active:"fyvr12o0",disabled:"fyvr12o1",focus:"fyvr12o2",hover:"fyvr12o3",checked:"fyvr12o4"},defaultClass:"fyvr12nz"},white:{conditions:{base:"fyvr12o5",active:"fyvr12o6",disabled:"fyvr12o7",focus:"fyvr12o8",hover:"fyvr12o9",checked:"fyvr12oa"},defaultClass:"fyvr12o5"},inherit:{conditions:{base:"fyvr12ob",active:"fyvr12oc",disabled:"fyvr12od",focus:"fyvr12oe",hover:"fyvr12of",checked:"fyvr12og"},defaultClass:"fyvr12ob"},transparent:{conditions:{base:"fyvr12oh",active:"fyvr12oi",disabled:"fyvr12oj",focus:"fyvr12ok",hover:"fyvr12ol",checked:"fyvr12om"},defaultClass:"fyvr12oh"},positive:{conditions:{base:"fyvr12on",active:"fyvr12oo",disabled:"fyvr12op",focus:"fyvr12oq",hover:"fyvr12or",checked:"fyvr12os"},defaultClass:"fyvr12on"},negative:{conditions:{base:"fyvr12ot",active:"fyvr12ou",disabled:"fyvr12ov",focus:"fyvr12ow",hover:"fyvr12ox",checked:"fyvr12oy"},defaultClass:"fyvr12ot"},info:{conditions:{base:"fyvr12oz",active:"fyvr12p0",disabled:"fyvr12p1",focus:"fyvr12p2",hover:"fyvr12p3",checked:"fyvr12p4"},defaultClass:"fyvr12oz"},warning:{conditions:{base:"fyvr12p5",active:"fyvr12p6",disabled:"fyvr12p7",focus:"fyvr12p8",hover:"fyvr12p9",checked:"fyvr12pa"},defaultClass:"fyvr12p5"},gradientBackdrop:{conditions:{base:"fyvr12pb",active:"fyvr12pc",disabled:"fyvr12pd",focus:"fyvr12pe",hover:"fyvr12pf",checked:"fyvr12pg"},defaultClass:"fyvr12pb"},gradientPrimary:{conditions:{base:"fyvr12ph",active:"fyvr12pi",disabled:"fyvr12pj",focus:"fyvr12pk",hover:"fyvr12pl",checked:"fyvr12pm"},defaultClass:"fyvr12ph"},gradientSecondary:{conditions:{base:"fyvr12pn",active:"fyvr12po",disabled:"fyvr12pp",focus:"fyvr12pq",hover:"fyvr12pr",checked:"fyvr12ps"},defaultClass:"fyvr12pn"},arbitrumDark:{conditions:{base:"fyvr12pt",active:"fyvr12pu",disabled:"fyvr12pv",focus:"fyvr12pw",hover:"fyvr12px",checked:"fyvr12py"},defaultClass:"fyvr12pt"},arbitrumLight:{conditions:{base:"fyvr12pz",active:"fyvr12q0",disabled:"fyvr12q1",focus:"fyvr12q2",hover:"fyvr12q3",checked:"fyvr12q4"},defaultClass:"fyvr12pz"},avalanceDark:{conditions:{base:"fyvr12q5",active:"fyvr12q6",disabled:"fyvr12q7",focus:"fyvr12q8",hover:"fyvr12q9",checked:"fyvr12qa"},defaultClass:"fyvr12q5"},avalanceLight:{conditions:{base:"fyvr12qb",active:"fyvr12qc",disabled:"fyvr12qd",focus:"fyvr12qe",hover:"fyvr12qf",checked:"fyvr12qg"},defaultClass:"fyvr12qb"},bscDark:{conditions:{base:"fyvr12qh",active:"fyvr12qi",disabled:"fyvr12qj",focus:"fyvr12qk",hover:"fyvr12ql",checked:"fyvr12qm"},defaultClass:"fyvr12qh"},bscLight:{conditions:{base:"fyvr12qn",active:"fyvr12qo",disabled:"fyvr12qp",focus:"fyvr12qq",hover:"fyvr12qr",checked:"fyvr12qs"},defaultClass:"fyvr12qn"},ethereumDark:{conditions:{base:"fyvr12qt",active:"fyvr12qu",disabled:"fyvr12qv",focus:"fyvr12qw",hover:"fyvr12qx",checked:"fyvr12qy"},defaultClass:"fyvr12qt"},ethereumLight:{conditions:{base:"fyvr12qz",active:"fyvr12r0",disabled:"fyvr12r1",focus:"fyvr12r2",hover:"fyvr12r3",checked:"fyvr12r4"},defaultClass:"fyvr12qz"},gnosisDark:{conditions:{base:"fyvr12r5",active:"fyvr12r6",disabled:"fyvr12r7",focus:"fyvr12r8",hover:"fyvr12r9",checked:"fyvr12ra"},defaultClass:"fyvr12r5"},gnosisLight:{conditions:{base:"fyvr12rb",active:"fyvr12rc",disabled:"fyvr12rd",focus:"fyvr12re",hover:"fyvr12rf",checked:"fyvr12rg"},defaultClass:"fyvr12rb"},polygonDark:{conditions:{base:"fyvr12rh",active:"fyvr12ri",disabled:"fyvr12rj",focus:"fyvr12rk",hover:"fyvr12rl",checked:"fyvr12rm"},defaultClass:"fyvr12rh"},polygonLight:{conditions:{base:"fyvr12rn",active:"fyvr12ro",disabled:"fyvr12rp",focus:"fyvr12rq",hover:"fyvr12rr",checked:"fyvr12rs"},defaultClass:"fyvr12rn"},text100:{conditions:{base:"fyvr12rt",active:"fyvr12ru",disabled:"fyvr12rv",focus:"fyvr12rw",hover:"fyvr12rx",checked:"fyvr12ry"},defaultClass:"fyvr12rt"},text80:{conditions:{base:"fyvr12rz",active:"fyvr12s0",disabled:"fyvr12s1",focus:"fyvr12s2",hover:"fyvr12s3",checked:"fyvr12s4"},defaultClass:"fyvr12rz"},text50:{conditions:{base:"fyvr12s5",active:"fyvr12s6",disabled:"fyvr12s7",focus:"fyvr12s8",hover:"fyvr12s9",checked:"fyvr12sa"},defaultClass:"fyvr12s5"},textInverse100:{conditions:{base:"fyvr12sb",active:"fyvr12sc",disabled:"fyvr12sd",focus:"fyvr12se",hover:"fyvr12sf",checked:"fyvr12sg"},defaultClass:"fyvr12sb"},backgroundPrimary:{conditions:{base:"fyvr12sh",active:"fyvr12si",disabled:"fyvr12sj",focus:"fyvr12sk",hover:"fyvr12sl",checked:"fyvr12sm"},defaultClass:"fyvr12sh"},backgroundSecondary:{conditions:{base:"fyvr12sn",active:"fyvr12so",disabled:"fyvr12sp",focus:"fyvr12sq",hover:"fyvr12sr",checked:"fyvr12ss"},defaultClass:"fyvr12sn"},backgroundContrast:{conditions:{base:"fyvr12st",active:"fyvr12su",disabled:"fyvr12sv",focus:"fyvr12sw",hover:"fyvr12sx",checked:"fyvr12sy"},defaultClass:"fyvr12st"},backgroundMuted:{conditions:{base:"fyvr12sz",active:"fyvr12t0",disabled:"fyvr12t1",focus:"fyvr12t2",hover:"fyvr12t3",checked:"fyvr12t4"},defaultClass:"fyvr12sz"},backgroundControl:{conditions:{base:"fyvr12t5",active:"fyvr12t6",disabled:"fyvr12t7",focus:"fyvr12t8",hover:"fyvr12t9",checked:"fyvr12ta"},defaultClass:"fyvr12t5"},backgroundInverse:{conditions:{base:"fyvr12tb",active:"fyvr12tc",disabled:"fyvr12td",focus:"fyvr12te",hover:"fyvr12tf",checked:"fyvr12tg"},defaultClass:"fyvr12tb"},backgroundBackdrop:{conditions:{base:"fyvr12th",active:"fyvr12ti",disabled:"fyvr12tj",focus:"fyvr12tk",hover:"fyvr12tl",checked:"fyvr12tm"},defaultClass:"fyvr12th"},backgroundOverlay:{conditions:{base:"fyvr12tn",active:"fyvr12to",disabled:"fyvr12tp",focus:"fyvr12tq",hover:"fyvr12tr",checked:"fyvr12ts"},defaultClass:"fyvr12tn"},backgroundRaised:{conditions:{base:"fyvr12tt",active:"fyvr12tu",disabled:"fyvr12tv",focus:"fyvr12tw",hover:"fyvr12tx",checked:"fyvr12ty"},defaultClass:"fyvr12tt"},buttonGlass:{conditions:{base:"fyvr12tz",active:"fyvr12u0",disabled:"fyvr12u1",focus:"fyvr12u2",hover:"fyvr12u3",checked:"fyvr12u4"},defaultClass:"fyvr12tz"},buttonEmphasis:{conditions:{base:"fyvr12u5",active:"fyvr12u6",disabled:"fyvr12u7",focus:"fyvr12u8",hover:"fyvr12u9",checked:"fyvr12ua"},defaultClass:"fyvr12u5"},buttonInverse:{conditions:{base:"fyvr12ub",active:"fyvr12uc",disabled:"fyvr12ud",focus:"fyvr12ue",hover:"fyvr12uf",checked:"fyvr12ug"},defaultClass:"fyvr12ub"},borderNormal:{conditions:{base:"fyvr12uh",active:"fyvr12ui",disabled:"fyvr12uj",focus:"fyvr12uk",hover:"fyvr12ul",checked:"fyvr12um"},defaultClass:"fyvr12uh"},borderFocus:{conditions:{base:"fyvr12un",active:"fyvr12uo",disabled:"fyvr12up",focus:"fyvr12uq",hover:"fyvr12ur",checked:"fyvr12us"},defaultClass:"fyvr12un"}}},cursor:{values:{default:{conditions:{base:"fyvr12ut",active:"fyvr12uu",disabled:"fyvr12uv",focus:"fyvr12uw",hover:"fyvr12ux",checked:"fyvr12uy"},defaultClass:"fyvr12ut"},pointer:{conditions:{base:"fyvr12uz",active:"fyvr12v0",disabled:"fyvr12v1",focus:"fyvr12v2",hover:"fyvr12v3",checked:"fyvr12v4"},defaultClass:"fyvr12uz"},text:{conditions:{base:"fyvr12v5",active:"fyvr12v6",disabled:"fyvr12v7",focus:"fyvr12v8",hover:"fyvr12v9",checked:"fyvr12va"},defaultClass:"fyvr12v5"}}},opacity:{values:{0:{conditions:{base:"fyvr12vb",active:"fyvr12vc",disabled:"fyvr12vd",focus:"fyvr12ve",hover:"fyvr12vf",checked:"fyvr12vg"},defaultClass:"fyvr12vb"},50:{conditions:{base:"fyvr12vh",active:"fyvr12vi",disabled:"fyvr12vj",focus:"fyvr12vk",hover:"fyvr12vl",checked:"fyvr12vm"},defaultClass:"fyvr12vh"},80:{conditions:{base:"fyvr12vn",active:"fyvr12vo",disabled:"fyvr12vp",focus:"fyvr12vq",hover:"fyvr12vr",checked:"fyvr12vs"},defaultClass:"fyvr12vn"},100:{conditions:{base:"fyvr12vt",active:"fyvr12vu",disabled:"fyvr12vv",focus:"fyvr12vw",hover:"fyvr12vx",checked:"fyvr12vy"},defaultClass:"fyvr12vt"}}},pointerEvents:{values:{none:{conditions:{base:"fyvr12vz",active:"fyvr12w0",disabled:"fyvr12w1",focus:"fyvr12w2",hover:"fyvr12w3",checked:"fyvr12w4"},defaultClass:"fyvr12vz"},auto:{conditions:{base:"fyvr12w5",active:"fyvr12w6",disabled:"fyvr12w7",focus:"fyvr12w8",hover:"fyvr12w9",checked:"fyvr12wa"},defaultClass:"fyvr12w5"}}},outline:{values:{none:{conditions:{base:"fyvr12wb",active:"fyvr12wc",disabled:"fyvr12wd",focus:"fyvr12we",hover:"fyvr12wf",checked:"fyvr12wg"},defaultClass:"fyvr12wb"}}},boxShadow:{values:{none:{conditions:{base:"fyvr12wh",active:"fyvr12wi",disabled:"fyvr12wj",focus:"fyvr12wk",hover:"fyvr12wl",checked:"fyvr12wm"},defaultClass:"fyvr12wh"}}}}});const Jre=["alignItems","alignSelf","flexDirection","gap","justifyContent","justifySelf","placeItems"],nC=t=>(t.display||(t.display=Object.keys(t).some(e=>Jre.includes(e))?"flex":void 0),QN(t));nC.properties=QN.properties;function YN(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e{const{as:r="div",sx:n={},className:i,...s}=t,o={},a={};for(const l in s)nC.properties.has(l)?o[l]=s[l]:a[l]=s[l];const c=nC({...o,...n});return C.createElement(r,{className:ki(c,i),...a,ref:e})});var JN={exports:{}},eh={};/** * @license React * react-jsx-runtime.production.min.js * @@ -68,8 +68,8 @@ Error generating stack: `+s.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var X_;function mre(){if(X_)return Jd;X_=1;var t=x,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,c,l){var u,f={},d=null,h=null;l!==void 0&&(d=""+l),c.key!==void 0&&(d=""+c.key),c.ref!==void 0&&(h=c.ref);for(u in c)n.call(c,u)&&!s.hasOwnProperty(u)&&(f[u]=c[u]);if(a&&a.defaultProps)for(u in c=a.defaultProps,c)f[u]===void 0&&(f[u]=c[u]);return{$$typeof:e,type:a,key:d,ref:h,props:f,_owner:i.current}}return Jd.Fragment=r,Jd.jsx=o,Jd.jsxs=o,Jd}EN.exports=mre();var G=EN.exports;function yre(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gre(t){var e=yre(t,"string");return typeof e=="symbol"?e:String(e)}function bre(t,e,r){return e=gre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Z_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function eP(t){for(var e=1;e{for(var n of Object.keys(t)){var i;if(t[n]!==((i=e[n])!==null&&i!==void 0?i:r[n]))return!1}return!0},fr=t=>{var e=r=>{var n=t.defaultClassName,i=eP(eP({},t.defaultVariants),r);for(var s in i){var o,a=(o=i[s])!==null&&o!==void 0?o:t.defaultVariants[s];if(a!=null){var c=a;typeof c=="boolean"&&(c=c===!0?"true":"false");var l=t.variantClassNames[s][c];l&&(n+=" "+l)}}for(var[u,f]of t.compoundVariants)wre(u,i,t.defaultVariants)&&(n+=" "+f);return n};return e.variants=()=>Object.keys(t.variantClassNames),e.classNames={get base(){return t.defaultClassName.split(" ")[0]},get variants(){return tP(t.variantClassNames,r=>tP(r,n=>n.split(" ")[0]))}},e};fr({defaultClassName:"_2q9vfj7",variantClassNames:{variant:{info:"fyvr11ot",warning:"fyvr11oz",success:"fyvr11oh",error:"fyvr11on"},size:{sm:"_1qxj1ib9 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 fyvr1wo fyvr1yk fyvr13w fyvr1e8",md:"_1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1ws fyvr1yo fyvr140 fyvr1ec",lg:"_1qxj1ib9 fyvr11mv fyvr11ek fyvr11g4 fyvr11fo fyvr11fc fyvr1ww fyvr1ys fyvr144 fyvr1eg"}},defaultVariants:{},compoundVariants:[]});const R0=t=>{const{color:e="backgroundMuted",marginY:r="4",...n}=t;return G.jsx(z,{as:"hr",marginY:r,background:e,height:"px",borderWidth:"none",...n})};var Ere=fr({defaultClassName:"_1qxj1ib9",variantClassNames:{variant:{inherit:"fyvr11mu fyvr11e4 fyvr11gg fyvr11fg fyvr11ew",xlarge:"fyvr11mv fyvr11es fyvr11gc fyvr11fk fyvr11fc",large:"fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8",medium:"fyvr11mv fyvr11ek fyvr11g4 fyvr11fo fyvr11fc",normal:"fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0",small:"fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4",xsmall:"fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc",code:"fyvr11mw fyvr11eg fyvr11g0 fyvr11fk fyvr11f0"},ellipsis:{true:"fyvr11ls fyvr11m8 fyvr11n7 fyvr11mx"},italic:{true:"_1qxj1ibj"},underline:{true:"_1qxj1ibk"},uppercase:{true:"_1qxj1ibl"},capitalize:{true:"_1qxj1ibm"},hidden:{true:"_1qxj1ibn"}},defaultVariants:{},compoundVariants:[]});const ne=C.forwardRef((t,e)=>{const{as:r="span",variant:n="inherit",className:i,hidden:s,italic:o,underline:a,children:c,ellipsis:l,uppercase:u,capitalize:f,...d}=t,h=cre[n];return G.jsx(z,{as:r,className:Si(i,Ere({hidden:s,ellipsis:l,italic:o,underline:a,uppercase:u,capitalize:f})),ref:e,...h,...d,children:c})});var xre=fr({defaultClassName:"_140wn8ng fyvr11ls fyvr11m8 fyvr11n7 fyvr11ko fyvr11h0",variantClassNames:{variant:{base:"_140wn8nh",feature:"_140wn8ni fyvr11ph fyvr12o5",primary:"fyvr11pb fyvr12o5",glass:"fyvr11tt fyvr12rt",emphasis:"fyvr11tz fyvr12rt",raised:"fyvr11tn fyvr12rt",danger:"fyvr11on fyvr12o5",text:"_140wn8no _1qxj1ib9 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr11ob fyvr12s5"},shape:{circle:"fyvr11dc fyvr11e0 fyvr11c0 fyvr11co",square:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc"},disabled:{true:"fyvr12ut fyvr12vh",false:"fyvr12uz fyvr12vt fyvr12vr"},size:{xs:"_140wn8nt _1qxj1ib9 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc fyvr1ws fyvr1yo",sm:"_140wn8nu _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1ww fyvr1ys",md:"_140wn8nv _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1x0 fyvr1yw",lg:"_140wn8nw _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1x0 fyvr1yw"},iconOnly:{true:"_140wn8nx"},hasLeftIcon:{true:"_140wn8ny"},hasRightIcon:{true:"_140wn8nz"},activeOutline:{light:"_140wn8n10",bold:"_140wn8n11"}},defaultVariants:{},compoundVariants:[[{iconOnly:!0,size:"xs"},"_140wn8n12"],[{iconOnly:!0,size:"sm"},"_140wn8n13"],[{iconOnly:!0,size:"md"},"_140wn8n14"],[{iconOnly:!0,size:"lg"},"_140wn8n15"],[{iconOnly:!1,hasLeftIcon:!0,size:"xs"},"_140wn8n16"],[{iconOnly:!1,hasLeftIcon:!0,size:"sm"},"_140wn8n17"],[{iconOnly:!1,hasLeftIcon:!0,size:"md"},"_140wn8n18"],[{iconOnly:!1,hasRightIcon:!0,size:"xs"},"_140wn8n19"],[{iconOnly:!1,hasRightIcon:!0,size:"sm"},"_140wn8n1a"],[{iconOnly:!1,hasRightIcon:!0,size:"md"},"_140wn8n1b"]]});const tt=C.forwardRef((t,e)=>{const{as:r="button",activeOutline:n,className:i,disabled:s=!1,display:o="inline-flex",fontWeight:a="bold",pending:c=!1,label:l,leftIcon:u,rightIcon:f,size:d="md",variant:h="glass",width:p="fit",shape:v="circle",type:b="button",...y}=t,m=u!==void 0&&l!==void 0,g=f!==void 0&&l!==void 0,S=u!==void 0&&l===void 0,P=d==="xs"?"xs":"sm";return G.jsx(z,{as:r,className:Si(i,xre({activeOutline:n,disabled:s||c,hasLeftIcon:m,hasRightIcon:g,iconOnly:S,size:h==="text"?void 0:d,shape:h==="text"?void 0:v,variant:h})),disabled:s||c,display:o,fontWeight:a,ref:e,type:b,width:p,...y,children:S?G.jsx(u,{size:P}):G.jsxs(z,{width:"full",height:"full",justifyContent:"space-between",alignItems:"center",gap:d==="xs"?"1":"2",children:[G.jsxs(z,{justifyContent:"flex-start",alignItems:"center",gap:d==="xs"?"1":"2",children:[u&&G.jsx(u,{size:P}),G.jsx(ne,{children:l})]}),f&&G.jsx(f,{size:P})]})})});var Cre=fr({defaultClassName:"rhmai63",variantClassNames:{clickable:{true:"fyvr12vr fyvr12uz"},disabled:{true:"rhmai65"},outlined:{true:"fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr12n5 fyvr12ft fyvr1215 fyvr128h fyvr12nh fyvr12g5 fyvr121h fyvr128t"},blur:{true:"fyvr11ms"}},defaultVariants:{},compoundVariants:[]});const ho=C.forwardRef((t,e)=>{const{className:r,children:n,clickable:i,outlined:s,disabled:o,blur:a,width:c="full",...l}=t;return G.jsx(z,{className:Si(r,Cre({clickable:i,outlined:s,disabled:o,blur:a})),background:s?"transparent":"backgroundSecondary",overflow:"hidden",borderRadius:"md",padding:"4",width:c,ref:e,...l,children:n})});function ht(){return ht=Object.assign?Object.assign.bind():function(t){for(var e=1;et.forEach(r=>Sre(r,e))}function Gt(...t){return C.useCallback(xN(...t),t)}function Sn(t,e=[]){let r=[];function n(s,o){const a=C.createContext(o),c=r.length;r=[...r,o];function l(f){const{scope:d,children:h,...p}=f,v=(d==null?void 0:d[t][c])||a,b=C.useMemo(()=>p,Object.values(p));return C.createElement(v.Provider,{value:b},h)}function u(f,d){const h=(d==null?void 0:d[t][c])||a,p=C.useContext(h);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,u]}const i=()=>{const s=r.map(o=>C.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return C.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[n,kre(i,...e)]}function kre(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const f=c(s)[`__scope${l}`];return{...a,...f}},{});return C.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function Ee(t,e,{checkForDefaultPrevented:r=!0}={}){return function(i){if(t==null||t(i),r===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function zi(t){const e=C.useRef(t);return C.useEffect(()=>{e.current=t}),C.useMemo(()=>(...r)=>{var n;return(n=e.current)===null||n===void 0?void 0:n.call(e,...r)},[])}function fc({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=Are({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=zi(r),c=C.useCallback(l=>{if(s){const f=typeof l=="function"?l(t):l;f!==t&&a(f)}else i(l)},[s,t,i,a]);return[o,c]}function Are({defaultProp:t,onChange:e}){const r=C.useState(t),[n]=r,i=C.useRef(n),s=zi(e);return C.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}function Dg(t){const e=C.useRef({value:t,previous:t});return C.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}const Wi=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{};function Lg(t){const[e,r]=C.useState(void 0);return Wi(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}function _re(t,e){return C.useReducer((r,n)=>{const i=e[r][n];return i??r},t)}const Oc=t=>{const{present:e,children:r}=t,n=Pre(e),i=typeof r=="function"?r({present:n.isPresent}):C.Children.only(r),s=Gt(n.ref,i.ref);return typeof r=="function"||n.isPresent?C.cloneElement(i,{ref:s}):null};Oc.displayName="Presence";function Pre(t){const[e,r]=C.useState(),n=C.useRef({}),i=C.useRef(t),s=C.useRef("none"),o=t?"mounted":"unmounted",[a,c]=_re(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const l=Fp(n.current);s.current=a==="mounted"?l:"none"},[a]),Wi(()=>{const l=n.current,u=i.current;if(u!==t){const d=s.current,h=Fp(l);t?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),Wi(()=>{if(e){const l=f=>{const h=Fp(n.current).includes(f.animationName);f.target===e&&h&&As.flushSync(()=>c("ANIMATION_END"))},u=f=>{f.target===e&&(s.current=Fp(n.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function Fp(t){return(t==null?void 0:t.animationName)||"none"}function ke(){return ke=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{children:r,...n}=t,i=C.Children.toArray(r),s=i.find(Ire);if(s){const o=s.props.children,a=i.map(c=>c===s?C.Children.count(o)>1?C.Children.only(null):C.isValidElement(o)?o.props.children:null:c);return C.createElement(Yx,ke({},n,{ref:e}),C.isValidElement(o)?C.cloneElement(o,void 0,a):null)}return C.createElement(Yx,ke({},n,{ref:e}),r)});Lf.displayName="Slot";const Yx=C.forwardRef((t,e)=>{const{children:r,...n}=t;return C.isValidElement(r)?C.cloneElement(r,{...Ore(n,r.props),ref:e?xN(e,r.ref):r.ref}):C.Children.count(r)>1?C.Children.only(null):null});Yx.displayName="SlotClone";const Tre=({children:t})=>C.createElement(C.Fragment,null,t);function Ire(t){return C.isValidElement(t)&&t.type===Tre}function Ore(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}const Rre=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ze=Rre.reduce((t,e)=>{const r=C.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?Lf:e;return C.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),C.createElement(a,ht({},o,{ref:i}))});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function W3(t,e){t&&As.flushSync(()=>t.dispatchEvent(e))}const CN="Checkbox",[Mre,vPe]=Sn(CN),[$re,Nre]=Mre(CN),Dre=C.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...u}=t,[f,d]=C.useState(null),h=Gt(e,g=>d(g)),p=C.useRef(!1),v=f?!!f.closest("form"):!0,[b=!1,y]=fc({prop:i,defaultProp:s,onChange:l}),m=C.useRef(b);return C.useEffect(()=>{const g=f==null?void 0:f.form;if(g){const S=()=>y(m.current);return g.addEventListener("reset",S),()=>g.removeEventListener("reset",S)}},[f,y]),C.createElement($re,{scope:r,state:b,disabled:a},C.createElement(Ze.button,ht({type:"button",role:"checkbox","aria-checked":wl(b)?"mixed":b,"aria-required":o,"data-state":SN(b),"data-disabled":a?"":void 0,disabled:a,value:c},u,{ref:h,onKeyDown:Ee(t.onKeyDown,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:Ee(t.onClick,g=>{y(S=>wl(S)?!0:!S),v&&(p.current=g.isPropagationStopped(),p.current||g.stopPropagation())})})),v&&C.createElement(Fre,{control:f,bubbles:!p.current,name:n,value:c,checked:b,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),Lre="CheckboxIndicator",Bre=C.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...i}=t,s=Nre(Lre,r);return C.createElement(Oc,{present:n||wl(s.state)||s.state===!0},C.createElement(Ze.span,ht({"data-state":SN(s.state),"data-disabled":s.disabled?"":void 0},i,{ref:e,style:{pointerEvents:"none",...t.style}})))}),Fre=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=C.useRef(null),o=Dg(r),a=Lg(e);return C.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});c.indeterminate=wl(r),f.call(c,wl(r)?!1:r),c.dispatchEvent(d)}},[o,r,n]),C.createElement("input",ht({type:"checkbox","aria-hidden":!0,defaultChecked:wl(r)?!1:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function wl(t){return t==="indeterminate"}function SN(t){return wl(t)?"indeterminate":t?"checked":"unchecked"}const jre=Dre,Ure=Bre;var zre=fr({defaultClassName:"_43lu9r4",variantClassNames:{labelLocation:{top:"fyvr11kw fyvr11i4 fyvr118k fyvr11h0",left:"_43lu9r6 fyvr11ko fyvr11ic fyvr118k fyvr11h0",right:"_43lu9r7 fyvr11ko fyvr11ic fyvr118k fyvr11h0",hidden:"fyvr1188 fyvr11h0"}},defaultVariants:{},compoundVariants:[]});const tu=t=>{const{id:e,label:r,description:n,labelLocation:i="top",children:s,...o}=t,a=()=>r||n?G.jsxs(z,{flexDirection:"column",gap:"0.5",children:[r&&G.jsx(ne,{variant:"small",color:"text100",hidden:i==="hidden",children:r}),n&&G.jsx(ne,{variant:"small",color:"text50",hidden:i==="hidden",children:n})]}):null;return G.jsxs(z,{as:"label",className:zre({labelLocation:i}),htmlFor:e,...o,children:[["left","top","hidden"].includes(i)&&a(),s,i==="right"&&a()]})};var yr=fr({defaultClassName:"_1dizidw0",variantClassNames:{size:{xs:"_1dizidw1",sm:"_1dizidw2",md:"_1dizidw3",lg:"_1dizidw4",xl:"_1dizidw5"}},defaultVariants:{},compoundVariants:[]});const Wre=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.168 9.25V2.929h-1.5V9.25h-6.32v1.5h6.32v6.321h1.5V10.75h6.321v-1.5h-6.32Z",clipRule:"evenodd"})}),Hre=({size:t="sm",...e})=>G.jsx(z,{as:Wre,className:yr({size:t}),...e}),qre=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.888 14.47 1.06 1.06L17.48 10l-5.53-5.53-1.06 1.06 3.719 3.72H4.418v1.5h10.19l-3.72 3.72Z",clipRule:"evenodd"})}),Jx=({size:t="sm",...e})=>G.jsx(z,{as:qre,className:yr({size:t}),...e}),Vre=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m4.304 10.232 4.263 4.79 7.13-11.238"})}),cd=({size:t="sm",...e})=>G.jsx(z,{as:Vre,className:yr({size:t}),...e}),Gre=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m3.888 7.53 1.06-1.06 5.47 5.47 5.47-5.47 1.06 1.06-6.53 6.53-6.53-6.53Z",clipRule:"evenodd"})}),kN=({size:t="sm",...e})=>G.jsx(z,{as:Gre,className:yr({size:t}),...e}),Kre=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m12.888 3.47 1.06 1.06L8.48 10l5.47 5.47-1.061 1.06L6.358 10l6.53-6.53Z",clipRule:"evenodd"})}),Bg=({size:t="sm",...e})=>G.jsx(z,{as:Kre,className:yr({size:t}),...e}),Qre=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m7.949 16.53-1.061-1.06 5.47-5.47-5.47-5.47 1.06-1.06L14.48 10l-6.53 6.53Z",clipRule:"evenodd"})}),Lo=({size:t="sm",...e})=>G.jsx(z,{as:Qre,className:yr({size:t}),...e}),Yre=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.418 11.06 4.47 4.47 1.06-1.06L11.48 10l4.47-4.47-1.06-1.06-4.47 4.47-4.47-4.47-1.06 1.06L9.357 10l-4.47 4.47 1.06 1.06 4.47-4.47Z",clipRule:"evenodd"})}),ru=({size:t="sm",...e})=>G.jsx(z,{as:Yre,className:yr({size:t}),...e}),Jre=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.918 4.5h-6V6h4.5v6.5h1.5v-8Zm-1.5 9.5v3h-9V6h3V3h9v11h-3Zm-7.5 1.5v-8h6v8h-6Z",clipRule:"evenodd"})}),Fg=({size:t="sm",...e})=>G.jsx(z,{as:Jre,className:yr({size:t}),...e}),Xre=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5 6.714 3.618 3.547H2.5L4.158 7.02H2.98v.69h1.494v.663H2.981v.69h1.494v1.484h1.036V9.063h1.46v-.69h-1.46v-.66l.001-.003h1.46v-.69h-1.13L7.5 3.547H6.383L5 6.714Zm4.747 8.232v-.788a2.887 2.887 0 0 1-1.04-.249 2.04 2.04 0 0 1-.863-.727 2.213 2.213 0 0 1-.344-1.125h1.017c.02.26.098.476.236.65.14.171.319.299.535.383.144.054.297.09.46.109V10.81l-.319-.093c-.538-.157-.964-.388-1.28-.693-.312-.304-.469-.707-.469-1.209 0-.415.105-.777.315-1.086.21-.31.495-.55.853-.72.273-.133.573-.215.9-.246v-.817h.537v.81c.365.023.692.106.981.249.35.17.626.406.827.706.201.298.306.64.315 1.027h-.978a1.04 1.04 0 0 0-.433-.774 1.47 1.47 0 0 0-.712-.264v2.253l.283.079c.214.056.434.132.659.228a2.6 2.6 0 0 1 .627.38c.192.157.347.351.466.583.12.232.18.51.18.834 0 .407-.098.77-.295 1.086a2.006 2.006 0 0 1-.85.749c-.304.15-.66.239-1.07.265v.79h-.538Zm1.024-1.877c-.148.064-.31.106-.486.128v-2.23c.216.064.41.136.584.218.193.089.345.201.457.337.113.136.17.31.17.524 0 .234-.065.44-.194.615-.129.174-.306.31-.531.408ZM9.747 7.706v2.095a4.605 4.605 0 0 1-.246-.086 2.195 2.195 0 0 1-.4-.207 1.038 1.038 0 0 1-.299-.313.847.847 0 0 1-.111-.443.94.94 0 0 1 .164-.545c.112-.162.268-.288.47-.38.126-.059.267-.099.422-.12Zm7.677 10.086h-4.9v-.897h.34a.342.342 0 0 0 .29-.186c.068-.117.114-.254.137-.411.023-.16.032-.304.028-.432l-.027-.779H12.5v-.896h.76l-.043-1.262c-.018-.472.073-.866.273-1.183.203-.317.473-.555.809-.715.335-.16.697-.24 1.084-.24.346 0 .656.056.931.166.278.11.511.26.7.452.191.188.328.404.41.647.081.243.097.498.048.766l-1.01-.156c.023-.22-.014-.403-.11-.55a.891.891 0 0 0-.395-.33 1.31 1.31 0 0 0-1.102.024c-.177.09-.322.227-.434.411-.11.185-.164.42-.164.708l.048 1.261h1.649v.897H14.34l.029.752c.014.29-.025.55-.116.78-.04.1-.096.193-.166.276h3.337v.897Z",clipRule:"evenodd"})}),Zre=({size:t="sm",...e})=>G.jsx(z,{as:Xre,className:yr({size:t}),...e}),ene=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",d:"m5.285 12.883 6.53-6.53 2.254 2.253-6.531 6.531-2.878.618.625-2.872ZM14.674 8.001l-2.253-2.253 1.502-1.503L16.176 6.5 14.674 8Z"})}),tne=({size:t="sm",...e})=>G.jsx(z,{as:ene,className:yr({size:t}),...e}),rne=t=>G.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[G.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M10.906 8.966c1.459 1.316 1.459 3.45 0 4.765l-2.53 2.282c-1.459 1.316-3.824 1.316-5.282 0-1.459-1.315-1.459-3.449 0-4.764l1.265-1.142"}),G.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M8.094 11c-1.459-1.316-1.459-3.449 0-4.765l2.53-2.282c1.459-1.316 3.823-1.316 5.282 0s1.459 3.449 0 4.765l-1.265 1.14"})]}),nne=({size:t="sm",...e})=>G.jsx(z,{as:rne,className:yr({size:t}),...e}),ine=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M15.918 14.994v.752A7.003 7.003 0 0 1 6.968 5.05a7.003 7.003 0 0 1 8.95-.796v.752a4.979 4.979 0 0 0-3.293 1.459 5 5 0 0 0 3.293 8.53Zm-4.353-.398c.329.329.684.615 1.059.859a5.5 5.5 0 1 1 0-10.91 6.5 6.5 0 0 0-1.06 10.051Z",clipRule:"evenodd"})}),sne=({size:t="sm",...e})=>G.jsx(z,{as:ine,className:yr({size:t}),...e}),one=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.283 6.175a4.643 4.643 0 1 0-6.566 6.567l-.708.707a5.644 5.644 0 1 1 7.982 0l-.708-.707a4.644 4.644 0 0 0 0-6.567Zm-5.097 1.47a2.565 2.565 0 0 1 3.628 3.627l.707.707a3.565 3.565 0 1 0-5.042 0l.707-.707a2.565 2.565 0 0 1 0-3.627ZM10 10.959a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm0 .667-1.5 6h3l-1.5-6Z",clipRule:"evenodd"})}),ane=({size:t="sm",...e})=>G.jsx(z,{as:one,className:yr({size:t}),...e}),cne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.418 3.6h-2.5v2.5h2.5V3.6Zm0-1.5h1.5v5.5h-5.5V2.1h4Zm0 12h-2.5v2.5h2.5v-2.5Zm0-1.5h1.5v5.5h-5.5v-5.5h4Zm8-9h2.5v2.5h-2.5V3.6Zm4-1.5h-5.5v5.5h5.5V2.1Zm-1.5 12h-2.5v2.5h2.5v-2.5Zm0-1.5h1.5v5.5h-5.5v-5.5h4ZM9.668 2.1v7.25h-7.25v1.5h8.75V2.1h-1.5Zm1.5 10.5v5.5h-1.5v-5.5h1.5Zm1.75-1.75h5.5v-1.5h-5.5v1.5Z",clipRule:"evenodd"})}),lne=({size:t="sm",...e})=>G.jsx(z,{as:cne,className:yr({size:t}),...e}),une=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.918 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-.677 4.383a5.5 5.5 0 1 1 1.06-1.06l2.648 2.647-1.061 1.06-2.647-2.647Z",clipRule:"evenodd"})}),jg=({size:t="sm",...e})=>G.jsx(z,{as:une,className:yr({size:t}),...e}),fne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.529 15.925 9.419 11 4.493 8.89 2.418 8l2.142-.714 11.08-3.693L17.418 3l-.593 1.779-3.693 11.08L12.418 18l-.89-2.075Zm-1.71-6.386L6.635 8.175l6.82-2.273-3.638 3.637Zm1.06 1.061 1.364 3.183 2.273-6.82L10.88 10.6Z",clipRule:"evenodd"})}),Ug=({size:t="sm",...e})=>G.jsx(z,{as:fne,className:yr({size:t}),...e}),dne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.775 5.204a5.465 5.465 0 0 0-1.341-.537L11 2.5H9l-.443 2.214c-.444.128-.866.31-1.257.54L5.404 3.99 3.99 5.404l1.283 1.925c-.212.38-.38.787-.497 1.216L2.5 9v2l2.276.455c.118.429.285.836.497 1.216L3.99 14.596l1.414 1.414L7.3 14.746c.391.23.813.412 1.257.54L9 17.5h2l.434-2.167c.474-.12.925-.302 1.341-.537l1.821 1.214 1.414-1.414-1.195-1.793c.253-.427.45-.891.581-1.382L17.5 11V9l-2.104-.42a5.467 5.467 0 0 0-.581-1.383l1.195-1.793-1.414-1.414-1.82 1.214Zm-.59 2.692a2.976 2.976 0 1 0-4.208 4.208 2.976 2.976 0 0 0 4.209-4.208Z",clipRule:"evenodd"})}),AN=({size:t="sm",...e})=>G.jsx(z,{as:dne,className:yr({size:t}),...e}),hne=t=>G.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[G.jsx("path",{fill:"currentColor",d:"M4 6.234a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5V10.5L14 9v5.734a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h5.769l-1.516 1.5H4Z"}),G.jsx("path",{stroke:"currentColor",strokeWidth:1.25,d:"M11 3h5v5"}),G.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m16 3-8 8"})]}),pne=({size:t="sm",...e})=>G.jsx(z,{as:hne,className:yr({size:t}),...e}),vne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.418 3.25h-5.75v13.5h5.75v-1.5h-4.25V4.75h4.25v-1.5Zm4.53 11.28-1.06-1.06 2.72-2.72h-8.19v-1.5h8.19l-2.72-2.72 1.06-1.06L18.48 10l-4.53 4.53Z",clipRule:"evenodd"})}),_N=({size:t="sm",...e})=>G.jsx(z,{as:vne,className:yr({size:t}),...e}),mne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.539 10.75H4.298v-1.5h12.24v1.5Z",clipRule:"evenodd"})}),yne=({size:t="sm",...e})=>G.jsx(z,{as:mne,className:yr({size:t}),...e}),gne=t=>G.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[G.jsx("path",{fill:"currentColor",d:"M4.633 10.75a5.878 5.878 0 0 1 .008-1.5H2.202v1.5h2.431ZM5.814 6.456A5.854 5.854 0 0 1 6.88 5.401L5.139 3.66l-1.06 1.06 1.735 1.736ZM4.078 15.28l1.711-1.711c.306.398.662.755 1.058 1.063L5.14 16.34l-1.06-1.06ZM9.668 15.802v2.414h1.5V15.8a5.876 5.876 0 0 1-1.5.003ZM13.98 14.623l1.718 1.717 1.06-1.06-1.721-1.723c-.305.4-.66.758-1.056 1.066ZM16.184 10.75h2.45v-1.5h-2.457a5.882 5.882 0 0 1 .007 1.5ZM15.012 6.467l1.747-1.747-1.061-1.06-1.75 1.75c.399.305.756.66 1.064 1.057ZM11.168 4.258V1.784h-1.5v2.472a5.875 5.875 0 0 1 1.5.002Z"}),G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M10.418 12.504a2.504 2.504 0 1 0 0-5.008 2.504 2.504 0 0 0 0 5.008Zm0 1.5a4.004 4.004 0 1 0 0-8.008 4.004 4.004 0 0 0 0 8.008Z",clipRule:"evenodd"})]}),bne=({size:t="sm",...e})=>G.jsx(z,{as:gne,className:yr({size:t}),...e}),wne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m12.28 2.856-6.71 8.887h4.134l-1.424 6.2 6.887-8.71h-4.322l1.435-6.377Z",clipRule:"evenodd"})}),PN=({size:t="sm",...e})=>G.jsx(z,{as:wne,className:yr({size:t}),...e});var Ene=fr({defaultClassName:"_1c9x66f1 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr12nb fyvr12fz fyvr121b fyvr128n fyvr12nh fyvr12g5 fyvr121h fyvr128t fyvr11h0 fyvr11ko fyvr11jg fyvr12vt fyvr12vr fyvr12vj fyvr12uz fyvr12uv",variantClassNames:{size:{sm:"_1c9x66f2",lg:"_1c9x66f3"}},defaultVariants:{},compoundVariants:[]}),xne=fr({defaultClassName:"_1c9x66f5 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr12rt fyvr11rz",variantClassNames:{size:{sm:"_1c9x66f6",lg:"_1c9x66f7"}},defaultVariants:{},compoundVariants:[]});const Cne=({size:t="sm"})=>G.jsx(Ure,{className:xne({size:t}),children:G.jsx(cd,{size:t})});C.forwardRef((t,e)=>{const{disabled:r=!1,id:n,name:i,label:s="",labelLocation:o="left",size:a="sm",...c}=t;return G.jsx(tu,{disabled:r,display:"flex",id:n??i,label:s,labelLocation:o,whiteSpace:"nowrap",children:G.jsx(jre,{className:Ene({size:a}),disabled:r,id:n??i,name:i,ref:e,...c,children:G.jsx(Cne,{})})})});x.createContext(null);const Sne=l7["useId".toString()]||(()=>{});let kne=0;function tc(t){const[e,r]=C.useState(Sne());return Wi(()=>{t||r(n=>n??String(kne++))},[t]),t||(e?`radix-${e}`:"")}const TN="Collapsible",[Ane,mPe]=Sn(TN);Ane(TN);function zg(t){const e=t+"CollectionProvider",[r,n]=Sn(e),[i,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=h=>{const{scope:p,children:v}=h,b=x.useRef(null),y=x.useRef(new Map).current;return x.createElement(i,{scope:p,itemMap:y,collectionRef:b},v)},a=t+"CollectionSlot",c=x.forwardRef((h,p)=>{const{scope:v,children:b}=h,y=s(a,v),m=Gt(p,y.collectionRef);return x.createElement(Lf,{ref:m},b)}),l=t+"CollectionItemSlot",u="data-radix-collection-item",f=x.forwardRef((h,p)=>{const{scope:v,children:b,...y}=h,m=x.useRef(null),g=Gt(p,m),S=s(l,v);return x.useEffect(()=>(S.itemMap.set(m,{ref:m,...y}),()=>void S.itemMap.delete(m))),x.createElement(Lf,{[u]:"",ref:g},b)});function d(h){const p=s(t+"CollectionConsumer",h);return x.useCallback(()=>{const b=p.collectionRef.current;if(!b)return[];const y=Array.from(b.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((S,P)=>y.indexOf(S.ref.current)-y.indexOf(P.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:o,Slot:c,ItemSlot:f},d,n]}const _ne=C.createContext(void 0);function Wg(t){const e=C.useContext(_ne);return t||e||"ltr"}function Pne(t,e=globalThis==null?void 0:globalThis.document){const r=zi(t);C.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[r,e])}const Xx="dismissableLayer.update",Tne="dismissableLayer.pointerDownOutside",Ine="dismissableLayer.focusOutside";let rP;const One=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),H3=C.forwardRef((t,e)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...l}=t,u=C.useContext(One),[f,d]=C.useState(null),h=(r=f==null?void 0:f.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,p]=C.useState({}),v=Gt(e,I=>d(I)),b=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=b.indexOf(y),g=f?b.indexOf(f):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,P=g>=m,T=Rne(I=>{const B=I.target,j=[...u.branches].some(H=>H.contains(B));!P||j||(s==null||s(I),a==null||a(I),I.defaultPrevented||c==null||c())},h),w=Mne(I=>{const B=I.target;[...u.branches].some(H=>H.contains(B))||(o==null||o(I),a==null||a(I),I.defaultPrevented||c==null||c())},h);return Pne(I=>{g===u.layers.size-1&&(i==null||i(I),!I.defaultPrevented&&c&&(I.preventDefault(),c()))},h),C.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(rP=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),nP(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=rP)}},[f,h,n,u]),C.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),nP())},[f,u]),C.useEffect(()=>{const I=()=>p({});return document.addEventListener(Xx,I),()=>document.removeEventListener(Xx,I)},[]),C.createElement(Ze.div,ke({},l,{ref:v,style:{pointerEvents:S?P?"auto":"none":void 0,...t.style},onFocusCapture:Ee(t.onFocusCapture,w.onFocusCapture),onBlurCapture:Ee(t.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Ee(t.onPointerDownCapture,T.onPointerDownCapture)}))});function Rne(t,e=globalThis==null?void 0:globalThis.document){const r=zi(t),n=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let c=function(){IN(Tne,r,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function Mne(t,e=globalThis==null?void 0:globalThis.document){const r=zi(t),n=C.useRef(!1);return C.useEffect(()=>{const i=s=>{s.target&&!n.current&&IN(Ine,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function nP(){const t=new CustomEvent(Xx);document.dispatchEvent(t)}function IN(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?W3(i,s):i.dispatchEvent(s)}const $ne=H3;let C2=0;function ON(){C.useEffect(()=>{var t,e;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=r[0])!==null&&t!==void 0?t:iP()),document.body.insertAdjacentElement("beforeend",(e=r[1])!==null&&e!==void 0?e:iP()),C2++,()=>{C2===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),C2--}},[])}function iP(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const S2="focusScope.autoFocusOnMount",k2="focusScope.autoFocusOnUnmount",sP={bubbles:!1,cancelable:!0},RN=C.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=C.useState(null),l=zi(i),u=zi(s),f=C.useRef(null),d=Gt(e,v=>c(v)),h=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(n){let v=function(g){if(h.paused||!a)return;const S=g.target;a.contains(S)?f.current=S:ka(f.current,{select:!0})},b=function(g){if(h.paused||!a)return;const S=g.relatedTarget;S!==null&&(a.contains(S)||ka(f.current,{select:!0}))},y=function(g){if(document.activeElement===document.body)for(const P of g)P.removedNodes.length>0&&ka(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const m=new MutationObserver(y);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),m.disconnect()}}},[n,a,h.paused]),C.useEffect(()=>{if(a){aP.add(h);const v=document.activeElement;if(!a.contains(v)){const y=new CustomEvent(S2,sP);a.addEventListener(S2,l),a.dispatchEvent(y),y.defaultPrevented||(Nne(jne(MN(a)),{select:!0}),document.activeElement===v&&ka(a))}return()=>{a.removeEventListener(S2,l),setTimeout(()=>{const y=new CustomEvent(k2,sP);a.addEventListener(k2,u),a.dispatchEvent(y),y.defaultPrevented||ka(v??document.body,{select:!0}),a.removeEventListener(k2,u),aP.remove(h)},0)}}},[a,l,u,h]);const p=C.useCallback(v=>{if(!r&&!n||h.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(b&&y){const m=v.currentTarget,[g,S]=Dne(m);g&&S?!v.shiftKey&&y===S?(v.preventDefault(),r&&ka(g,{select:!0})):v.shiftKey&&y===g&&(v.preventDefault(),r&&ka(S,{select:!0})):y===m&&v.preventDefault()}},[r,n,h.paused]);return C.createElement(Ze.div,ke({tabIndex:-1},o,{ref:d,onKeyDown:p}))});function Nne(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(ka(n,{select:e}),document.activeElement!==r)return}function Dne(t){const e=MN(t),r=oP(e,t),n=oP(e.reverse(),t);return[r,n]}function MN(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function oP(t,e){for(const r of t)if(!Lne(r,{upTo:e}))return r}function Lne(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Bne(t){return t instanceof HTMLInputElement&&"select"in t}function ka(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&Bne(t)&&e&&t.select()}}const aP=Fne();function Fne(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=cP(t,e),t.unshift(e)},remove(e){var r;t=cP(t,e),(r=t[0])===null||r===void 0||r.resume()}}}function cP(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function jne(t){return t.filter(e=>e.tagName!=="A")}const Une=["top","right","bottom","left"],dc=Math.min,li=Math.max,Zm=Math.round,jp=Math.floor,hc=t=>({x:t,y:t}),zne={left:"right",right:"left",bottom:"top",top:"bottom"},Wne={start:"end",end:"start"};function Zx(t,e,r){return li(t,dc(e,r))}function Qo(t,e){return typeof t=="function"?t(e):t}function Yo(t){return t.split("-")[0]}function ld(t){return t.split("-")[1]}function q3(t){return t==="x"?"y":"x"}function V3(t){return t==="y"?"height":"width"}function ud(t){return["top","bottom"].includes(Yo(t))?"y":"x"}function G3(t){return q3(ud(t))}function Hne(t,e,r){r===void 0&&(r=!1);const n=ld(t),i=G3(t),s=V3(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=ey(o)),[o,ey(o)]}function qne(t){const e=ey(t);return[eC(t),e,eC(e)]}function eC(t){return t.replace(/start|end/g,e=>Wne[e])}function Vne(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function Gne(t,e,r,n){const i=ld(t);let s=Vne(Yo(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(eC)))),s}function ey(t){return t.replace(/left|right|bottom|top/g,e=>zne[e])}function Kne(t){return{top:0,right:0,bottom:0,left:0,...t}}function $N(t){return typeof t!="number"?Kne(t):{top:t,right:t,bottom:t,left:t}}function ty(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function lP(t,e,r){let{reference:n,floating:i}=t;const s=ud(e),o=G3(e),a=V3(o),c=Yo(e),l=s==="y",u=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let h;switch(c){case"top":h={x:u,y:n.y-i.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-i.width,y:f};break;default:h={x:n.x,y:n.y}}switch(ld(e)){case"start":h[o]-=d*(r&&l?-1:1);break;case"end":h[o]+=d*(r&&l?-1:1);break}return h}const Qne=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=lP(l,n,c),d=n,h={},p=0;for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:u=0}=Qo(t,e)||{};if(l==null)return{};const f=$N(u),d={x:r,y:n},h=G3(i),p=V3(h),v=await o.getDimensions(l),b=h==="y",y=b?"top":"left",m=b?"bottom":"right",g=b?"clientHeight":"clientWidth",S=s.reference[p]+s.reference[h]-d[h]-s.floating[p],P=d[h]-s.reference[h],T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let w=T?T[g]:0;(!w||!await(o.isElement==null?void 0:o.isElement(T)))&&(w=a.floating[g]||s.floating[p]);const I=S/2-P/2,B=w/2-v[p]/2-1,j=dc(f[y],B),H=dc(f[m],B),K=j,F=w-v[p]-H,E=w/2-v[p]/2+I,_=Zx(K,E,F),O=!c.arrow&&ld(i)!=null&&E!=_&&s.reference[p]/2-(EK<=0)){var B,j;const K=(((B=s.flip)==null?void 0:B.index)||0)+1,F=P[K];if(F)return{data:{index:K,overflows:I},reset:{placement:F}};let E=(j=I.filter(_=>_.overflows[0]<=0).sort((_,O)=>_.overflows[1]-O.overflows[1])[0])==null?void 0:j.placement;if(!E)switch(h){case"bestFit":{var H;const _=(H=I.map(O=>[O.placement,O.overflows.filter(N=>N>0).reduce((N,k)=>N+k,0)]).sort((O,N)=>O[1]-N[1])[0])==null?void 0:H[0];_&&(E=_);break}case"initialPlacement":E=a;break}if(i!==E)return{reset:{placement:E}}}return{}}}};function fP(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function dP(t){return Une.some(e=>t[e]>=0)}const Jne=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=Qo(t,e);switch(n){case"referenceHidden":{const s=await M0(e,{...i,elementContext:"reference"}),o=fP(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:dP(o)}}}case"escaped":{const s=await M0(e,{...i,altBoundary:!0}),o=fP(s,r.floating);return{data:{escapedOffsets:o,escaped:dP(o)}}}default:return{}}}}};async function Xne(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Yo(r),a=ld(r),c=ud(r)==="y",l=["left","top"].includes(o)?-1:1,u=s&&c?-1:1,f=Qo(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),c?{x:h*u,y:d*l}:{x:d*l,y:h*u}}const Zne=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:r,y:n}=e,i=await Xne(e,t);return{x:r+i.x,y:n+i.y,data:i}}}},eie=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:b=>{let{x:y,y:m}=b;return{x:y,y:m}}},...c}=Qo(t,e),l={x:r,y:n},u=await M0(e,c),f=ud(Yo(i)),d=q3(f);let h=l[d],p=l[f];if(s){const b=d==="y"?"top":"left",y=d==="y"?"bottom":"right",m=h+u[b],g=h-u[y];h=Zx(m,h,g)}if(o){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",m=p+u[b],g=p-u[y];p=Zx(m,p,g)}const v=a.fn({...e,[d]:h,[f]:p});return{...v,data:{x:v.x-r,y:v.y-n}}}}},tie=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Qo(t,e),u={x:r,y:n},f=ud(i),d=q3(f);let h=u[d],p=u[f];const v=Qo(a,e),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const g=d==="y"?"height":"width",S=s.reference[d]-s.floating[g]+b.mainAxis,P=s.reference[d]+s.reference[g]-b.mainAxis;hP&&(h=P)}if(l){var y,m;const g=d==="y"?"width":"height",S=["top","left"].includes(Yo(i)),P=s.reference[f]-s.floating[g]+(S&&((y=o.offset)==null?void 0:y[f])||0)+(S?0:b.crossAxis),T=s.reference[f]+s.reference[g]+(S?0:((m=o.offset)==null?void 0:m[f])||0)-(S?b.crossAxis:0);pT&&(p=T)}return{[d]:h,[f]:p}}}},rie=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=Qo(t,e),c=await M0(e,a),l=Yo(r),u=ld(r),f=ud(r)==="y",{width:d,height:h}=n.floating;let p,v;l==="top"||l==="bottom"?(p=l,v=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=l,p=u==="end"?"top":"bottom");const b=h-c[p],y=d-c[v],m=!e.middlewareData.shift;let g=b,S=y;if(f){const T=d-c.left-c.right;S=u||m?dc(y,T):T}else{const T=h-c.top-c.bottom;g=u||m?dc(b,T):T}if(m&&!u){const T=li(c.left,0),w=li(c.right,0),I=li(c.top,0),B=li(c.bottom,0);f?S=d-2*(T!==0||w!==0?T+w:li(c.left,c.right)):g=h-2*(I!==0||B!==0?I+B:li(c.top,c.bottom))}await o({...e,availableWidth:S,availableHeight:g});const P=await i.getDimensions(s.floating);return d!==P.width||h!==P.height?{reset:{rects:!0}}:{}}}};function pc(t){return NN(t)?(t.nodeName||"").toLowerCase():"#document"}function mi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ua(t){var e;return(e=(NN(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function NN(t){return t instanceof Node||t instanceof mi(t).Node}function Jo(t){return t instanceof Element||t instanceof mi(t).Element}function po(t){return t instanceof HTMLElement||t instanceof mi(t).HTMLElement}function hP(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof mi(t).ShadowRoot}function R1(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=Hi(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function nie(t){return["table","td","th"].includes(pc(t))}function K3(t){const e=Q3(),r=Hi(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function iie(t){let e=Bf(t);for(;po(e)&&!Hg(e);){if(K3(e))return e;e=Bf(e)}return null}function Q3(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Hg(t){return["html","body","#document"].includes(pc(t))}function Hi(t){return mi(t).getComputedStyle(t)}function qg(t){return Jo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Bf(t){if(pc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||hP(t)&&t.host||ua(t);return hP(e)?e.host:e}function DN(t){const e=Bf(t);return Hg(e)?t.ownerDocument?t.ownerDocument.body:t.body:po(e)&&R1(e)?e:DN(e)}function $0(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=DN(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=mi(i);return s?e.concat(o,o.visualViewport||[],R1(i)?i:[],o.frameElement&&r?$0(o.frameElement):[]):e.concat(i,$0(i,[],r))}function LN(t){const e=Hi(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=po(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=Zm(r)!==s||Zm(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function Y3(t){return Jo(t)?t:t.contextElement}function df(t){const e=Y3(t);if(!po(e))return hc(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=LN(e);let o=(s?Zm(r.width):r.width)/n,a=(s?Zm(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const sie=hc(0);function BN(t){const e=mi(t);return!Q3()||!e.visualViewport?sie:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function oie(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==mi(t)?!1:e}function Fl(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=Y3(t);let o=hc(1);e&&(n?Jo(n)&&(o=df(n)):o=df(t));const a=oie(s,r,n)?BN(s):hc(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(s){const d=mi(s),h=n&&Jo(n)?mi(n):n;let p=d.frameElement;for(;p&&n&&h!==d;){const v=df(p),b=p.getBoundingClientRect(),y=Hi(p),m=b.left+(p.clientLeft+parseFloat(y.paddingLeft))*v.x,g=b.top+(p.clientTop+parseFloat(y.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=m,l+=g,p=mi(p).frameElement}}return ty({width:u,height:f,x:c,y:l})}function aie(t){let{rect:e,offsetParent:r,strategy:n}=t;const i=po(r),s=ua(r);if(r===s)return e;let o={scrollLeft:0,scrollTop:0},a=hc(1);const c=hc(0);if((i||!i&&n!=="fixed")&&((pc(r)!=="body"||R1(s))&&(o=qg(r)),po(r))){const l=Fl(r);a=df(r),c.x=l.x+r.clientLeft,c.y=l.y+r.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-o.scrollLeft*a.x+c.x,y:e.y*a.y-o.scrollTop*a.y+c.y}}function cie(t){return Array.from(t.getClientRects())}function FN(t){return Fl(ua(t)).left+qg(t).scrollLeft}function lie(t){const e=ua(t),r=qg(t),n=t.ownerDocument.body,i=li(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=li(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+FN(t);const a=-r.scrollTop;return Hi(n).direction==="rtl"&&(o+=li(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function uie(t,e){const r=mi(t),n=ua(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=Q3();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function fie(t,e){const r=Fl(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=po(t)?df(t):hc(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function pP(t,e,r){let n;if(e==="viewport")n=uie(t,r);else if(e==="document")n=lie(ua(t));else if(Jo(e))n=fie(e,r);else{const i=BN(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return ty(n)}function jN(t,e){const r=Bf(t);return r===e||!Jo(r)||Hg(r)?!1:Hi(r).position==="fixed"||jN(r,e)}function die(t,e){const r=e.get(t);if(r)return r;let n=$0(t,[],!1).filter(a=>Jo(a)&&pc(a)!=="body"),i=null;const s=Hi(t).position==="fixed";let o=s?Bf(t):t;for(;Jo(o)&&!Hg(o);){const a=Hi(o),c=K3(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||R1(o)&&!c&&jN(t,o))?n=n.filter(u=>u!==o):i=a,o=Bf(o)}return e.set(t,n),n}function hie(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?die(e,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,u)=>{const f=pP(e,u,i);return l.top=li(f.top,l.top),l.right=dc(f.right,l.right),l.bottom=dc(f.bottom,l.bottom),l.left=li(f.left,l.left),l},pP(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function pie(t){return LN(t)}function vie(t,e,r){const n=po(e),i=ua(e),s=r==="fixed",o=Fl(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=hc(0);if(n||!n&&!s)if((pc(e)!=="body"||R1(i))&&(a=qg(e)),n){const l=Fl(e,!0,s,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else i&&(c.x=FN(i));return{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function vP(t,e){return!po(t)||Hi(t).position==="fixed"?null:e?e(t):t.offsetParent}function UN(t,e){const r=mi(t);if(!po(t))return r;let n=vP(t,e);for(;n&&nie(n)&&Hi(n).position==="static";)n=vP(n,e);return n&&(pc(n)==="html"||pc(n)==="body"&&Hi(n).position==="static"&&!K3(n))?r:n||iie(t)||r}const mie=async function(t){let{reference:e,floating:r,strategy:n}=t;const i=this.getOffsetParent||UN,s=this.getDimensions;return{reference:vie(e,await i(r),n),floating:{x:0,y:0,...await s(r)}}};function yie(t){return Hi(t).direction==="rtl"}const gie={convertOffsetParentRelativeRectToViewportRelativeRect:aie,getDocumentElement:ua,getClippingRect:hie,getOffsetParent:UN,getElementRects:mie,getClientRects:cie,getDimensions:pie,getScale:df,isElement:Jo,isRTL:yie};function bie(t,e){let r=null,n;const i=ua(t);function s(){clearTimeout(n),r&&r.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:u,width:f,height:d}=t.getBoundingClientRect();if(a||e(),!f||!d)return;const h=jp(u),p=jp(i.clientWidth-(l+f)),v=jp(i.clientHeight-(u+d)),b=jp(l),m={rootMargin:-h+"px "+-p+"px "+-v+"px "+-b+"px",threshold:li(0,dc(1,c))||1};let g=!0;function S(P){const T=P[0].intersectionRatio;if(T!==c){if(!g)return o();T?o(!1,T):n=setTimeout(()=>{o(!1,1e-7)},100)}g=!1}try{r=new IntersectionObserver(S,{...m,root:i.ownerDocument})}catch{r=new IntersectionObserver(S,m)}r.observe(t)}return o(!0),s}function wie(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=Y3(t),u=i||s?[...l?$0(l):[],...$0(e)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",r,{passive:!0}),s&&y.addEventListener("resize",r)});const f=l&&a?bie(l,r):null;let d=-1,h=null;o&&(h=new ResizeObserver(y=>{let[m]=y;m&&m.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{h&&h.observe(e)})),r()}),l&&!c&&h.observe(l),h.observe(e));let p,v=c?Fl(t):null;c&&b();function b(){const y=Fl(t);v&&(y.x!==v.x||y.y!==v.y||y.width!==v.width||y.height!==v.height)&&r(),v=y,p=requestAnimationFrame(b)}return r(),()=>{u.forEach(y=>{i&&y.removeEventListener("scroll",r),s&&y.removeEventListener("resize",r)}),f&&f(),h&&h.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const Eie=(t,e,r)=>{const n=new Map,i={platform:gie,...r},s={...i.platform,_c:n};return Qne(t,e,{...i,platform:s})},xie=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?uP({element:n.current,padding:i}).fn(r):{}:n?uP({element:n,padding:i}).fn(r):{}}}};var Mv=typeof document<"u"?C.useLayoutEffect:C.useEffect;function ry(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!ry(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!ry(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function zN(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function mP(t,e){const r=zN(t);return Math.round(e*r)/r}function yP(t){const e=C.useRef(t);return Mv(()=>{e.current=t}),e}function Cie(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,f]=C.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,h]=C.useState(n);ry(d,n)||h(n);const[p,v]=C.useState(null),[b,y]=C.useState(null),m=C.useCallback(O=>{O!=T.current&&(T.current=O,v(O))},[v]),g=C.useCallback(O=>{O!==w.current&&(w.current=O,y(O))},[y]),S=s||p,P=o||b,T=C.useRef(null),w=C.useRef(null),I=C.useRef(u),B=yP(c),j=yP(i),H=C.useCallback(()=>{if(!T.current||!w.current)return;const O={placement:e,strategy:r,middleware:d};j.current&&(O.platform=j.current),Eie(T.current,w.current,O).then(N=>{const k={...N,isPositioned:!0};K.current&&!ry(I.current,k)&&(I.current=k,As.flushSync(()=>{f(k)}))})},[d,e,r,j]);Mv(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(O=>({...O,isPositioned:!1})))},[l]);const K=C.useRef(!1);Mv(()=>(K.current=!0,()=>{K.current=!1}),[]),Mv(()=>{if(S&&(T.current=S),P&&(w.current=P),S&&P){if(B.current)return B.current(S,P,H);H()}},[S,P,H,B]);const F=C.useMemo(()=>({reference:T,floating:w,setReference:m,setFloating:g}),[m,g]),E=C.useMemo(()=>({reference:S,floating:P}),[S,P]),_=C.useMemo(()=>{const O={position:r,left:0,top:0};if(!E.floating)return O;const N=mP(E.floating,u.x),k=mP(E.floating,u.y);return a?{...O,transform:"translate("+N+"px, "+k+"px)",...zN(E.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:N,top:k}},[r,a,E.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:H,refs:F,elements:E,floatingStyles:_}),[u,H,F,E,_])}const WN="Popper",[HN,fd]=Sn(WN),[Sie,qN]=HN(WN),kie=t=>{const{__scopePopper:e,children:r}=t,[n,i]=C.useState(null);return C.createElement(Sie,{scope:e,anchor:n,onAnchorChange:i},r)},Aie="PopperAnchor",_ie=C.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=qN(Aie,r),o=C.useRef(null),a=Gt(e,o);return C.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:C.createElement(Ze.div,ke({},i,{ref:a}))}),VN="PopperContent",[Pie,yPe]=HN(VN),Tie=C.forwardRef((t,e)=>{var r,n,i,s,o,a,c,l;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:h="center",alignOffset:p=0,arrowPadding:v=0,avoidCollisions:b=!0,collisionBoundary:y=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:S=!1,updatePositionStrategy:P="optimized",onPlaced:T,...w}=t,I=qN(VN,u),[B,j]=C.useState(null),H=Gt(e,ue=>j(ue)),[K,F]=C.useState(null),E=Lg(K),_=(r=E==null?void 0:E.width)!==null&&r!==void 0?r:0,O=(n=E==null?void 0:E.height)!==null&&n!==void 0?n:0,N=f+(h!=="center"?"-"+h:""),k=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},M=Array.isArray(y)?y:[y],L=M.length>0,$={padding:k,boundary:M.filter(Iie),altBoundary:L},{refs:A,floatingStyles:D,placement:V,isPositioned:R,middlewareData:U}=Cie({strategy:"fixed",placement:N,whileElementsMounted:(...ue)=>wie(...ue,{animationFrame:P==="always"}),elements:{reference:I.anchor},middleware:[Zne({mainAxis:d+O,alignmentAxis:p}),b&&eie({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?tie():void 0,...$}),b&&Yne({...$}),rie({...$,apply:({elements:ue,rects:ot,availableWidth:Pe,availableHeight:Ae})=>{const{width:at,height:xe}=ot.reference,be=ue.floating.style;be.setProperty("--radix-popper-available-width",`${Pe}px`),be.setProperty("--radix-popper-available-height",`${Ae}px`),be.setProperty("--radix-popper-anchor-width",`${at}px`),be.setProperty("--radix-popper-anchor-height",`${xe}px`)}}),K&&xie({element:K,padding:v}),Oie({arrowWidth:_,arrowHeight:O}),S&&Jne({strategy:"referenceHidden",...$})]}),[W,q]=GN(V),Y=zi(T);Wi(()=>{R&&(Y==null||Y())},[R,Y]);const X=(i=U.arrow)===null||i===void 0?void 0:i.x,Q=(s=U.arrow)===null||s===void 0?void 0:s.y,Z=((o=U.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[ae,se]=C.useState();return Wi(()=>{B&&se(window.getComputedStyle(B).zIndex)},[B]),C.createElement("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:R?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[(a=U.transformOrigin)===null||a===void 0?void 0:a.x,(c=U.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:t.dir},C.createElement(Pie,{scope:u,placedSide:W,onArrowChange:F,arrowX:X,arrowY:Q,shouldHideArrow:Z},C.createElement(Ze.div,ke({"data-side":W,"data-align":q},w,{ref:H,style:{...w.style,animation:R?void 0:"none",opacity:(l=U.hide)!==null&&l!==void 0&&l.referenceHidden?0:void 0}}))))});function Iie(t){return t!==null}const Oie=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i,s,o;const{placement:a,rects:c,middlewareData:l}=e,f=((r=l.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:t.arrowWidth,h=f?0:t.arrowHeight,[p,v]=GN(a),b={start:"0%",center:"50%",end:"100%"}[v],y=((n=(i=l.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,m=((s=(o=l.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+h/2;let g="",S="";return p==="bottom"?(g=f?b:`${y}px`,S=`${-h}px`):p==="top"?(g=f?b:`${y}px`,S=`${c.floating.height+h}px`):p==="right"?(g=`${-h}px`,S=f?b:`${m}px`):p==="left"&&(g=`${c.floating.width+h}px`,S=f?b:`${m}px`),{data:{x:g,y:S}}}});function GN(t){const[e,r="center"]=t.split("-");return[e,r]}const Rie=kie,Mie=_ie,$ie=Tie,KN=C.forwardRef((t,e)=>{var r;const{container:n=globalThis==null||(r=globalThis.document)===null||r===void 0?void 0:r.body,...i}=t;return n?AV.createPortal(C.createElement(Ze.div,ke({},i,{ref:e})),n):null}),A2="rovingFocusGroup.onEntryFocus",Nie={bubbles:!1,cancelable:!0},J3="RovingFocusGroup",[tC,QN,Die]=zg(J3),[Lie,dd]=Sn(J3,[Die]),[Bie,Fie]=Lie(J3),jie=C.forwardRef((t,e)=>C.createElement(tC.Provider,{scope:t.__scopeRovingFocusGroup},C.createElement(tC.Slot,{scope:t.__scopeRovingFocusGroup},C.createElement(Uie,ht({},t,{ref:e}))))),Uie=C.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,...u}=t,f=C.useRef(null),d=Gt(e,f),h=Wg(s),[p=null,v]=fc({prop:o,defaultProp:a,onChange:c}),[b,y]=C.useState(!1),m=zi(l),g=QN(r),S=C.useRef(!1),[P,T]=C.useState(0);return C.useEffect(()=>{const w=f.current;if(w)return w.addEventListener(A2,m),()=>w.removeEventListener(A2,m)},[m]),C.createElement(Bie,{scope:r,orientation:n,dir:h,loop:i,currentTabStopId:p,onItemFocus:C.useCallback(w=>v(w),[v]),onItemShiftTab:C.useCallback(()=>y(!0),[]),onFocusableItemAdd:C.useCallback(()=>T(w=>w+1),[]),onFocusableItemRemove:C.useCallback(()=>T(w=>w-1),[])},C.createElement(Ze.div,ht({tabIndex:b||P===0?-1:0,"data-orientation":n},u,{ref:d,style:{outline:"none",...t.style},onMouseDown:Ee(t.onMouseDown,()=>{S.current=!0}),onFocus:Ee(t.onFocus,w=>{const I=!S.current;if(w.target===w.currentTarget&&I&&!b){const B=new CustomEvent(A2,Nie);if(w.currentTarget.dispatchEvent(B),!B.defaultPrevented){const j=g().filter(_=>_.focusable),H=j.find(_=>_.active),K=j.find(_=>_.id===p),E=[H,K,...j].filter(Boolean).map(_=>_.ref.current);YN(E)}}S.current=!1}),onBlur:Ee(t.onBlur,()=>y(!1))})))}),zie="RovingFocusGroupItem",Wie=C.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...o}=t,a=tc(),c=s||a,l=Fie(zie,r),u=l.currentTabStopId===c,f=QN(r),{onFocusableItemAdd:d,onFocusableItemRemove:h}=l;return C.useEffect(()=>{if(n)return d(),()=>h()},[n,d,h]),C.createElement(tC.ItemSlot,{scope:r,id:c,focusable:n,active:i},C.createElement(Ze.span,ht({tabIndex:u?0:-1,"data-orientation":l.orientation},o,{ref:e,onMouseDown:Ee(t.onMouseDown,p=>{n?l.onItemFocus(c):p.preventDefault()}),onFocus:Ee(t.onFocus,()=>l.onItemFocus(c)),onKeyDown:Ee(t.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){l.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const v=Vie(p,l.orientation,l.dir);if(v!==void 0){p.preventDefault();let y=f().filter(m=>m.focusable).map(m=>m.ref.current);if(v==="last")y.reverse();else if(v==="prev"||v==="next"){v==="prev"&&y.reverse();const m=y.indexOf(p.currentTarget);y=l.loop?Gie(y,m+1):y.slice(m+1)}setTimeout(()=>YN(y))}})})))}),Hie={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qie(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Vie(t,e,r){const n=qie(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Hie[n]}function YN(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function Gie(t,e){return t.map((r,n)=>t[(e+n)%t.length])}const JN=jie,X3=Wie;var Kie=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},vu=new WeakMap,Up=new WeakMap,zp={},_2=0,XN=function(t){return t&&(t.host||XN(t.parentNode))},Qie=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=XN(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},Yie=function(t,e,r,n){var i=Qie(e,Array.isArray(t)?t:[t]);zp[r]||(zp[r]=new WeakMap);var s=zp[r],o=[],a=new Set,c=new Set(i),l=function(f){!f||a.has(f)||(a.add(f),l(f.parentNode))};i.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))u(d);else{var h=d.getAttribute(n),p=h!==null&&h!=="false",v=(vu.get(d)||0)+1,b=(s.get(d)||0)+1;vu.set(d,v),s.set(d,b),o.push(d),v===1&&p&&Up.set(d,!0),b===1&&d.setAttribute(r,"true"),p||d.setAttribute(n,"true")}})};return u(e),a.clear(),_2++,function(){o.forEach(function(f){var d=vu.get(f)-1,h=s.get(f)-1;vu.set(f,d),s.set(f,h),d||(Up.has(f)||f.removeAttribute(n),Up.delete(f)),h||f.removeAttribute(r)}),_2--,_2||(vu=new WeakMap,vu=new WeakMap,Up=new WeakMap,zp={})}},ZN=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=e||Kie(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),Yie(n,i,r,"aria-hidden")):function(){return null}},Ks=function(){return Ks=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u")return hse;var e=pse(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},mse=nD(),yse=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` - .`.concat(Xie,` { + */var cP;function Xre(){if(cP)return eh;cP=1;var t=x,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,c,l){var u,f={},d=null,h=null;l!==void 0&&(d=""+l),c.key!==void 0&&(d=""+c.key),c.ref!==void 0&&(h=c.ref);for(u in c)n.call(c,u)&&!s.hasOwnProperty(u)&&(f[u]=c[u]);if(a&&a.defaultProps)for(u in c=a.defaultProps,c)f[u]===void 0&&(f[u]=c[u]);return{$$typeof:e,type:a,key:d,ref:h,props:f,_owner:i.current}}return eh.Fragment=r,eh.jsx=o,eh.jsxs=o,eh}JN.exports=Xre();var G=JN.exports;function Zre(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ene(t){var e=Zre(t,"string");return typeof e=="symbol"?e:String(e)}function tne(t,e,r){return e=ene(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function uP(t){for(var e=1;e{for(var n of Object.keys(t)){var i;if(t[n]!==((i=e[n])!==null&&i!==void 0?i:r[n]))return!1}return!0},fr=t=>{var e=r=>{var n=t.defaultClassName,i=uP(uP({},t.defaultVariants),r);for(var s in i){var o,a=(o=i[s])!==null&&o!==void 0?o:t.defaultVariants[s];if(a!=null){var c=a;typeof c=="boolean"&&(c=c===!0?"true":"false");var l=t.variantClassNames[s][c];l&&(n+=" "+l)}}for(var[u,f]of t.compoundVariants)rne(u,i,t.defaultVariants)&&(n+=" "+f);return n};return e.variants=()=>Object.keys(t.variantClassNames),e.classNames={get base(){return t.defaultClassName.split(" ")[0]},get variants(){return fP(t.variantClassNames,r=>fP(r,n=>n.split(" ")[0]))}},e};fr({defaultClassName:"_2q9vfj7",variantClassNames:{variant:{info:"fyvr11ot",warning:"fyvr11oz",success:"fyvr11oh",error:"fyvr11on"},size:{sm:"_1qxj1ib9 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 fyvr1wo fyvr1yk fyvr13w fyvr1e8",md:"_1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1ws fyvr1yo fyvr140 fyvr1ec",lg:"_1qxj1ib9 fyvr11mv fyvr11ek fyvr11g4 fyvr11fo fyvr11fc fyvr1ww fyvr1ys fyvr144 fyvr1eg"}},defaultVariants:{},compoundVariants:[]});const N0=t=>{const{color:e="backgroundMuted",marginY:r="4",...n}=t;return G.jsx(z,{as:"hr",marginY:r,background:e,height:"px",borderWidth:"none",...n})};var nne=fr({defaultClassName:"_1qxj1ib9",variantClassNames:{variant:{inherit:"fyvr11mu fyvr11e4 fyvr11gg fyvr11fg fyvr11ew",xlarge:"fyvr11mv fyvr11es fyvr11gc fyvr11fk fyvr11fc",large:"fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8",medium:"fyvr11mv fyvr11ek fyvr11g4 fyvr11fo fyvr11fc",normal:"fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0",small:"fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4",xsmall:"fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc",code:"fyvr11mw fyvr11eg fyvr11g0 fyvr11fk fyvr11f0"},ellipsis:{true:"fyvr11ls fyvr11m8 fyvr11n7 fyvr11mx"},italic:{true:"_1qxj1ibj"},underline:{true:"_1qxj1ibk"},uppercase:{true:"_1qxj1ibl"},capitalize:{true:"_1qxj1ibm"},hidden:{true:"_1qxj1ibn"}},defaultVariants:{},compoundVariants:[]});const ne=C.forwardRef((t,e)=>{const{as:r="span",variant:n="inherit",className:i,hidden:s,italic:o,underline:a,children:c,ellipsis:l,uppercase:u,capitalize:f,...d}=t,h=Hre[n];return G.jsx(z,{as:r,className:ki(i,nne({hidden:s,ellipsis:l,italic:o,underline:a,uppercase:u,capitalize:f})),ref:e,...h,...d,children:c})});var ine=fr({defaultClassName:"_140wn8ng fyvr11ls fyvr11m8 fyvr11n7 fyvr11ko fyvr11h0",variantClassNames:{variant:{base:"_140wn8nh",feature:"_140wn8ni fyvr11ph fyvr12o5",primary:"fyvr11pb fyvr12o5",glass:"fyvr11tt fyvr12rt",emphasis:"fyvr11tz fyvr12rt",raised:"fyvr11tn fyvr12rt",danger:"fyvr11on fyvr12o5",text:"_140wn8no _1qxj1ib9 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr11ob fyvr12s5"},shape:{circle:"fyvr11dc fyvr11e0 fyvr11c0 fyvr11co",square:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc"},disabled:{true:"fyvr12ut fyvr12vh",false:"fyvr12uz fyvr12vt fyvr12vr"},size:{xs:"_140wn8nt _1qxj1ib9 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc fyvr1ws fyvr1yo",sm:"_140wn8nu _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1ww fyvr1ys",md:"_140wn8nv _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1x0 fyvr1yw",lg:"_140wn8nw _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1x0 fyvr1yw"},iconOnly:{true:"_140wn8nx"},hasLeftIcon:{true:"_140wn8ny"},hasRightIcon:{true:"_140wn8nz"},activeOutline:{light:"_140wn8n10",bold:"_140wn8n11"}},defaultVariants:{},compoundVariants:[[{iconOnly:!0,size:"xs"},"_140wn8n12"],[{iconOnly:!0,size:"sm"},"_140wn8n13"],[{iconOnly:!0,size:"md"},"_140wn8n14"],[{iconOnly:!0,size:"lg"},"_140wn8n15"],[{iconOnly:!1,hasLeftIcon:!0,size:"xs"},"_140wn8n16"],[{iconOnly:!1,hasLeftIcon:!0,size:"sm"},"_140wn8n17"],[{iconOnly:!1,hasLeftIcon:!0,size:"md"},"_140wn8n18"],[{iconOnly:!1,hasRightIcon:!0,size:"xs"},"_140wn8n19"],[{iconOnly:!1,hasRightIcon:!0,size:"sm"},"_140wn8n1a"],[{iconOnly:!1,hasRightIcon:!0,size:"md"},"_140wn8n1b"]]});const rt=C.forwardRef((t,e)=>{const{as:r="button",activeOutline:n,className:i,disabled:s=!1,display:o="inline-flex",fontWeight:a="bold",pending:c=!1,label:l,leftIcon:u,rightIcon:f,size:d="md",variant:h="glass",width:p="fit",shape:v="circle",type:b="button",...y}=t,m=u!==void 0&&l!==void 0,g=f!==void 0&&l!==void 0,S=u!==void 0&&l===void 0,P=d==="xs"?"xs":"sm";return G.jsx(z,{as:r,className:ki(i,ine({activeOutline:n,disabled:s||c,hasLeftIcon:m,hasRightIcon:g,iconOnly:S,size:h==="text"?void 0:d,shape:h==="text"?void 0:v,variant:h})),disabled:s||c,display:o,fontWeight:a,ref:e,type:b,width:p,...y,children:S?G.jsx(u,{size:P}):G.jsxs(z,{width:"full",height:"full",justifyContent:"space-between",alignItems:"center",gap:d==="xs"?"1":"2",children:[G.jsxs(z,{justifyContent:"flex-start",alignItems:"center",gap:d==="xs"?"1":"2",children:[u&&G.jsx(u,{size:P}),G.jsx(ne,{children:l})]}),f&&G.jsx(f,{size:P})]})})});var sne=fr({defaultClassName:"rhmai63",variantClassNames:{clickable:{true:"fyvr12vr fyvr12uz"},disabled:{true:"rhmai65"},outlined:{true:"fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr12n5 fyvr12ft fyvr1215 fyvr128h fyvr12nh fyvr12g5 fyvr121h fyvr128t"},blur:{true:"fyvr11ms"}},defaultVariants:{},compoundVariants:[]});const po=C.forwardRef((t,e)=>{const{className:r,children:n,clickable:i,outlined:s,disabled:o,blur:a,width:c="full",...l}=t;return G.jsx(z,{className:ki(r,sne({clickable:i,outlined:s,disabled:o,blur:a})),background:s?"transparent":"backgroundSecondary",overflow:"hidden",borderRadius:"md",padding:"4",width:c,ref:e,...l,children:n})});function ht(){return ht=Object.assign?Object.assign.bind():function(t){for(var e=1;et.forEach(r=>one(r,e))}function Gt(...t){return C.useCallback(XN(...t),t)}function Sn(t,e=[]){let r=[];function n(s,o){const a=C.createContext(o),c=r.length;r=[...r,o];function l(f){const{scope:d,children:h,...p}=f,v=(d==null?void 0:d[t][c])||a,b=C.useMemo(()=>p,Object.values(p));return C.createElement(v.Provider,{value:b},h)}function u(f,d){const h=(d==null?void 0:d[t][c])||a,p=C.useContext(h);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,u]}const i=()=>{const s=r.map(o=>C.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return C.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[n,ane(i,...e)]}function ane(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const f=c(s)[`__scope${l}`];return{...a,...f}},{});return C.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function Ee(t,e,{checkForDefaultPrevented:r=!0}={}){return function(i){if(t==null||t(i),r===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function Wi(t){const e=C.useRef(t);return C.useEffect(()=>{e.current=t}),C.useMemo(()=>(...r)=>{var n;return(n=e.current)===null||n===void 0?void 0:n.call(e,...r)},[])}function dc({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=cne({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=Wi(r),c=C.useCallback(l=>{if(s){const f=typeof l=="function"?l(t):l;f!==t&&a(f)}else i(l)},[s,t,i,a]);return[o,c]}function cne({defaultProp:t,onChange:e}){const r=C.useState(t),[n]=r,i=C.useRef(n),s=Wi(e);return C.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}function Hg(t){const e=C.useRef({value:t,previous:t});return C.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}const Hi=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{};function qg(t){const[e,r]=C.useState(void 0);return Hi(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}function lne(t,e){return C.useReducer((r,n)=>{const i=e[r][n];return i??r},t)}const Oc=t=>{const{present:e,children:r}=t,n=une(e),i=typeof r=="function"?r({present:n.isPresent}):C.Children.only(r),s=Gt(n.ref,i.ref);return typeof r=="function"||n.isPresent?C.cloneElement(i,{ref:s}):null};Oc.displayName="Presence";function une(t){const[e,r]=C.useState(),n=C.useRef({}),i=C.useRef(t),s=C.useRef("none"),o=t?"mounted":"unmounted",[a,c]=lne(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const l=Hp(n.current);s.current=a==="mounted"?l:"none"},[a]),Hi(()=>{const l=n.current,u=i.current;if(u!==t){const d=s.current,h=Hp(l);t?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),Hi(()=>{if(e){const l=f=>{const h=Hp(n.current).includes(f.animationName);f.target===e&&h&&Ts.flushSync(()=>c("ANIMATION_END"))},u=f=>{f.target===e&&(s.current=Hp(n.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function Hp(t){return(t==null?void 0:t.animationName)||"none"}function Ae(){return Ae=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{children:r,...n}=t,i=C.Children.toArray(r),s=i.find(dne);if(s){const o=s.props.children,a=i.map(c=>c===s?C.Children.count(o)>1?C.Children.only(null):C.isValidElement(o)?o.props.children:null:c);return C.createElement(iC,Ae({},n,{ref:e}),C.isValidElement(o)?C.cloneElement(o,void 0,a):null)}return C.createElement(iC,Ae({},n,{ref:e}),r)});jf.displayName="Slot";const iC=C.forwardRef((t,e)=>{const{children:r,...n}=t;return C.isValidElement(r)?C.cloneElement(r,{...hne(n,r.props),ref:e?XN(e,r.ref):r.ref}):C.Children.count(r)>1?C.Children.only(null):null});iC.displayName="SlotClone";const fne=({children:t})=>C.createElement(C.Fragment,null,t);function dne(t){return C.isValidElement(t)&&t.type===fne}function hne(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}const pne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],et=pne.reduce((t,e)=>{const r=C.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?jf:e;return C.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),C.createElement(a,ht({},o,{ref:i}))});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Z3(t,e){t&&Ts.flushSync(()=>t.dispatchEvent(e))}const ZN="Checkbox",[vne,ZPe]=Sn(ZN),[mne,yne]=vne(ZN),gne=C.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...u}=t,[f,d]=C.useState(null),h=Gt(e,g=>d(g)),p=C.useRef(!1),v=f?!!f.closest("form"):!0,[b=!1,y]=dc({prop:i,defaultProp:s,onChange:l}),m=C.useRef(b);return C.useEffect(()=>{const g=f==null?void 0:f.form;if(g){const S=()=>y(m.current);return g.addEventListener("reset",S),()=>g.removeEventListener("reset",S)}},[f,y]),C.createElement(mne,{scope:r,state:b,disabled:a},C.createElement(et.button,ht({type:"button",role:"checkbox","aria-checked":wl(b)?"mixed":b,"aria-required":o,"data-state":eD(b),"data-disabled":a?"":void 0,disabled:a,value:c},u,{ref:h,onKeyDown:Ee(t.onKeyDown,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:Ee(t.onClick,g=>{y(S=>wl(S)?!0:!S),v&&(p.current=g.isPropagationStopped(),p.current||g.stopPropagation())})})),v&&C.createElement(Ene,{control:f,bubbles:!p.current,name:n,value:c,checked:b,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),bne="CheckboxIndicator",wne=C.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...i}=t,s=yne(bne,r);return C.createElement(Oc,{present:n||wl(s.state)||s.state===!0},C.createElement(et.span,ht({"data-state":eD(s.state),"data-disabled":s.disabled?"":void 0},i,{ref:e,style:{pointerEvents:"none",...t.style}})))}),Ene=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=C.useRef(null),o=Hg(r),a=qg(e);return C.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});c.indeterminate=wl(r),f.call(c,wl(r)?!1:r),c.dispatchEvent(d)}},[o,r,n]),C.createElement("input",ht({type:"checkbox","aria-hidden":!0,defaultChecked:wl(r)?!1:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function wl(t){return t==="indeterminate"}function eD(t){return wl(t)?"indeterminate":t?"checked":"unchecked"}const xne=gne,Cne=wne;var Sne=fr({defaultClassName:"_43lu9r4",variantClassNames:{labelLocation:{top:"fyvr11kw fyvr11i4 fyvr118k fyvr11h0",left:"_43lu9r6 fyvr11ko fyvr11ic fyvr118k fyvr11h0",right:"_43lu9r7 fyvr11ko fyvr11ic fyvr118k fyvr11h0",hidden:"fyvr1188 fyvr11h0"}},defaultVariants:{},compoundVariants:[]});const ru=t=>{const{id:e,label:r,description:n,labelLocation:i="top",children:s,...o}=t,a=()=>r||n?G.jsxs(z,{flexDirection:"column",gap:"0.5",children:[r&&G.jsx(ne,{variant:"small",color:"text100",hidden:i==="hidden",children:r}),n&&G.jsx(ne,{variant:"small",color:"text50",hidden:i==="hidden",children:n})]}):null;return G.jsxs(z,{as:"label",className:Sne({labelLocation:i}),htmlFor:e,...o,children:[["left","top","hidden"].includes(i)&&a(),s,i==="right"&&a()]})};var yr=fr({defaultClassName:"_1dizidw0",variantClassNames:{size:{xs:"_1dizidw1",sm:"_1dizidw2",md:"_1dizidw3",lg:"_1dizidw4",xl:"_1dizidw5"}},defaultVariants:{},compoundVariants:[]});const kne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.168 9.25V2.929h-1.5V9.25h-6.32v1.5h6.32v6.321h1.5V10.75h6.321v-1.5h-6.32Z",clipRule:"evenodd"})}),Ane=({size:t="sm",...e})=>G.jsx(z,{as:kne,className:yr({size:t}),...e}),_ne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.888 14.47 1.06 1.06L17.48 10l-5.53-5.53-1.06 1.06 3.719 3.72H4.418v1.5h10.19l-3.72 3.72Z",clipRule:"evenodd"})}),sC=({size:t="sm",...e})=>G.jsx(z,{as:_ne,className:yr({size:t}),...e}),Pne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m4.304 10.232 4.263 4.79 7.13-11.238"})}),fd=({size:t="sm",...e})=>G.jsx(z,{as:Pne,className:yr({size:t}),...e}),Tne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m3.888 7.53 1.06-1.06 5.47 5.47 5.47-5.47 1.06 1.06-6.53 6.53-6.53-6.53Z",clipRule:"evenodd"})}),tD=({size:t="sm",...e})=>G.jsx(z,{as:Tne,className:yr({size:t}),...e}),Ine=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m12.888 3.47 1.06 1.06L8.48 10l5.47 5.47-1.061 1.06L6.358 10l6.53-6.53Z",clipRule:"evenodd"})}),Vg=({size:t="sm",...e})=>G.jsx(z,{as:Ine,className:yr({size:t}),...e}),One=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m7.949 16.53-1.061-1.06 5.47-5.47-5.47-5.47 1.06-1.06L14.48 10l-6.53 6.53Z",clipRule:"evenodd"})}),Lo=({size:t="sm",...e})=>G.jsx(z,{as:One,className:yr({size:t}),...e}),Rne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.418 11.06 4.47 4.47 1.06-1.06L11.48 10l4.47-4.47-1.06-1.06-4.47 4.47-4.47-4.47-1.06 1.06L9.357 10l-4.47 4.47 1.06 1.06 4.47-4.47Z",clipRule:"evenodd"})}),nu=({size:t="sm",...e})=>G.jsx(z,{as:Rne,className:yr({size:t}),...e}),$ne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.918 4.5h-6V6h4.5v6.5h1.5v-8Zm-1.5 9.5v3h-9V6h3V3h9v11h-3Zm-7.5 1.5v-8h6v8h-6Z",clipRule:"evenodd"})}),Gg=({size:t="sm",...e})=>G.jsx(z,{as:$ne,className:yr({size:t}),...e}),Mne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5 6.714 3.618 3.547H2.5L4.158 7.02H2.98v.69h1.494v.663H2.981v.69h1.494v1.484h1.036V9.063h1.46v-.69h-1.46v-.66l.001-.003h1.46v-.69h-1.13L7.5 3.547H6.383L5 6.714Zm4.747 8.232v-.788a2.887 2.887 0 0 1-1.04-.249 2.04 2.04 0 0 1-.863-.727 2.213 2.213 0 0 1-.344-1.125h1.017c.02.26.098.476.236.65.14.171.319.299.535.383.144.054.297.09.46.109V10.81l-.319-.093c-.538-.157-.964-.388-1.28-.693-.312-.304-.469-.707-.469-1.209 0-.415.105-.777.315-1.086.21-.31.495-.55.853-.72.273-.133.573-.215.9-.246v-.817h.537v.81c.365.023.692.106.981.249.35.17.626.406.827.706.201.298.306.64.315 1.027h-.978a1.04 1.04 0 0 0-.433-.774 1.47 1.47 0 0 0-.712-.264v2.253l.283.079c.214.056.434.132.659.228a2.6 2.6 0 0 1 .627.38c.192.157.347.351.466.583.12.232.18.51.18.834 0 .407-.098.77-.295 1.086a2.006 2.006 0 0 1-.85.749c-.304.15-.66.239-1.07.265v.79h-.538Zm1.024-1.877c-.148.064-.31.106-.486.128v-2.23c.216.064.41.136.584.218.193.089.345.201.457.337.113.136.17.31.17.524 0 .234-.065.44-.194.615-.129.174-.306.31-.531.408ZM9.747 7.706v2.095a4.605 4.605 0 0 1-.246-.086 2.195 2.195 0 0 1-.4-.207 1.038 1.038 0 0 1-.299-.313.847.847 0 0 1-.111-.443.94.94 0 0 1 .164-.545c.112-.162.268-.288.47-.38.126-.059.267-.099.422-.12Zm7.677 10.086h-4.9v-.897h.34a.342.342 0 0 0 .29-.186c.068-.117.114-.254.137-.411.023-.16.032-.304.028-.432l-.027-.779H12.5v-.896h.76l-.043-1.262c-.018-.472.073-.866.273-1.183.203-.317.473-.555.809-.715.335-.16.697-.24 1.084-.24.346 0 .656.056.931.166.278.11.511.26.7.452.191.188.328.404.41.647.081.243.097.498.048.766l-1.01-.156c.023-.22-.014-.403-.11-.55a.891.891 0 0 0-.395-.33 1.31 1.31 0 0 0-1.102.024c-.177.09-.322.227-.434.411-.11.185-.164.42-.164.708l.048 1.261h1.649v.897H14.34l.029.752c.014.29-.025.55-.116.78-.04.1-.096.193-.166.276h3.337v.897Z",clipRule:"evenodd"})}),Nne=({size:t="sm",...e})=>G.jsx(z,{as:Mne,className:yr({size:t}),...e}),Dne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",d:"m5.285 12.883 6.53-6.53 2.254 2.253-6.531 6.531-2.878.618.625-2.872ZM14.674 8.001l-2.253-2.253 1.502-1.503L16.176 6.5 14.674 8Z"})}),Lne=({size:t="sm",...e})=>G.jsx(z,{as:Dne,className:yr({size:t}),...e}),Fne=t=>G.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[G.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M10.906 8.966c1.459 1.316 1.459 3.45 0 4.765l-2.53 2.282c-1.459 1.316-3.824 1.316-5.282 0-1.459-1.315-1.459-3.449 0-4.764l1.265-1.142"}),G.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M8.094 11c-1.459-1.316-1.459-3.449 0-4.765l2.53-2.282c1.459-1.316 3.823-1.316 5.282 0s1.459 3.449 0 4.765l-1.265 1.14"})]}),Bne=({size:t="sm",...e})=>G.jsx(z,{as:Fne,className:yr({size:t}),...e}),jne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M15.918 14.994v.752A7.003 7.003 0 0 1 6.968 5.05a7.003 7.003 0 0 1 8.95-.796v.752a4.979 4.979 0 0 0-3.293 1.459 5 5 0 0 0 3.293 8.53Zm-4.353-.398c.329.329.684.615 1.059.859a5.5 5.5 0 1 1 0-10.91 6.5 6.5 0 0 0-1.06 10.051Z",clipRule:"evenodd"})}),Une=({size:t="sm",...e})=>G.jsx(z,{as:jne,className:yr({size:t}),...e}),zne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.283 6.175a4.643 4.643 0 1 0-6.566 6.567l-.708.707a5.644 5.644 0 1 1 7.982 0l-.708-.707a4.644 4.644 0 0 0 0-6.567Zm-5.097 1.47a2.565 2.565 0 0 1 3.628 3.627l.707.707a3.565 3.565 0 1 0-5.042 0l.707-.707a2.565 2.565 0 0 1 0-3.627ZM10 10.959a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm0 .667-1.5 6h3l-1.5-6Z",clipRule:"evenodd"})}),Wne=({size:t="sm",...e})=>G.jsx(z,{as:zne,className:yr({size:t}),...e}),Hne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.418 3.6h-2.5v2.5h2.5V3.6Zm0-1.5h1.5v5.5h-5.5V2.1h4Zm0 12h-2.5v2.5h2.5v-2.5Zm0-1.5h1.5v5.5h-5.5v-5.5h4Zm8-9h2.5v2.5h-2.5V3.6Zm4-1.5h-5.5v5.5h5.5V2.1Zm-1.5 12h-2.5v2.5h2.5v-2.5Zm0-1.5h1.5v5.5h-5.5v-5.5h4ZM9.668 2.1v7.25h-7.25v1.5h8.75V2.1h-1.5Zm1.5 10.5v5.5h-1.5v-5.5h1.5Zm1.75-1.75h5.5v-1.5h-5.5v1.5Z",clipRule:"evenodd"})}),qne=({size:t="sm",...e})=>G.jsx(z,{as:Hne,className:yr({size:t}),...e}),Vne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.918 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-.677 4.383a5.5 5.5 0 1 1 1.06-1.06l2.648 2.647-1.061 1.06-2.647-2.647Z",clipRule:"evenodd"})}),Kg=({size:t="sm",...e})=>G.jsx(z,{as:Vne,className:yr({size:t}),...e}),Gne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.529 15.925 9.419 11 4.493 8.89 2.418 8l2.142-.714 11.08-3.693L17.418 3l-.593 1.779-3.693 11.08L12.418 18l-.89-2.075Zm-1.71-6.386L6.635 8.175l6.82-2.273-3.638 3.637Zm1.06 1.061 1.364 3.183 2.273-6.82L10.88 10.6Z",clipRule:"evenodd"})}),Qg=({size:t="sm",...e})=>G.jsx(z,{as:Gne,className:yr({size:t}),...e}),Kne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.775 5.204a5.465 5.465 0 0 0-1.341-.537L11 2.5H9l-.443 2.214c-.444.128-.866.31-1.257.54L5.404 3.99 3.99 5.404l1.283 1.925c-.212.38-.38.787-.497 1.216L2.5 9v2l2.276.455c.118.429.285.836.497 1.216L3.99 14.596l1.414 1.414L7.3 14.746c.391.23.813.412 1.257.54L9 17.5h2l.434-2.167c.474-.12.925-.302 1.341-.537l1.821 1.214 1.414-1.414-1.195-1.793c.253-.427.45-.891.581-1.382L17.5 11V9l-2.104-.42a5.467 5.467 0 0 0-.581-1.383l1.195-1.793-1.414-1.414-1.82 1.214Zm-.59 2.692a2.976 2.976 0 1 0-4.208 4.208 2.976 2.976 0 0 0 4.209-4.208Z",clipRule:"evenodd"})}),rD=({size:t="sm",...e})=>G.jsx(z,{as:Kne,className:yr({size:t}),...e}),Qne=t=>G.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[G.jsx("path",{fill:"currentColor",d:"M4 6.234a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5V10.5L14 9v5.734a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h5.769l-1.516 1.5H4Z"}),G.jsx("path",{stroke:"currentColor",strokeWidth:1.25,d:"M11 3h5v5"}),G.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m16 3-8 8"})]}),Yne=({size:t="sm",...e})=>G.jsx(z,{as:Qne,className:yr({size:t}),...e}),Jne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.418 3.25h-5.75v13.5h5.75v-1.5h-4.25V4.75h4.25v-1.5Zm4.53 11.28-1.06-1.06 2.72-2.72h-8.19v-1.5h8.19l-2.72-2.72 1.06-1.06L18.48 10l-4.53 4.53Z",clipRule:"evenodd"})}),nD=({size:t="sm",...e})=>G.jsx(z,{as:Jne,className:yr({size:t}),...e}),Xne=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.539 10.75H4.298v-1.5h12.24v1.5Z",clipRule:"evenodd"})}),Zne=({size:t="sm",...e})=>G.jsx(z,{as:Xne,className:yr({size:t}),...e}),eie=t=>G.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[G.jsx("path",{fill:"currentColor",d:"M4.633 10.75a5.878 5.878 0 0 1 .008-1.5H2.202v1.5h2.431ZM5.814 6.456A5.854 5.854 0 0 1 6.88 5.401L5.139 3.66l-1.06 1.06 1.735 1.736ZM4.078 15.28l1.711-1.711c.306.398.662.755 1.058 1.063L5.14 16.34l-1.06-1.06ZM9.668 15.802v2.414h1.5V15.8a5.876 5.876 0 0 1-1.5.003ZM13.98 14.623l1.718 1.717 1.06-1.06-1.721-1.723c-.305.4-.66.758-1.056 1.066ZM16.184 10.75h2.45v-1.5h-2.457a5.882 5.882 0 0 1 .007 1.5ZM15.012 6.467l1.747-1.747-1.061-1.06-1.75 1.75c.399.305.756.66 1.064 1.057ZM11.168 4.258V1.784h-1.5v2.472a5.875 5.875 0 0 1 1.5.002Z"}),G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M10.418 12.504a2.504 2.504 0 1 0 0-5.008 2.504 2.504 0 0 0 0 5.008Zm0 1.5a4.004 4.004 0 1 0 0-8.008 4.004 4.004 0 0 0 0 8.008Z",clipRule:"evenodd"})]}),tie=({size:t="sm",...e})=>G.jsx(z,{as:eie,className:yr({size:t}),...e}),rie=t=>G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:G.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m12.28 2.856-6.71 8.887h4.134l-1.424 6.2 6.887-8.71h-4.322l1.435-6.377Z",clipRule:"evenodd"})}),iD=({size:t="sm",...e})=>G.jsx(z,{as:rie,className:yr({size:t}),...e});var nie=fr({defaultClassName:"_1c9x66f1 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr12nb fyvr12fz fyvr121b fyvr128n fyvr12nh fyvr12g5 fyvr121h fyvr128t fyvr11h0 fyvr11ko fyvr11jg fyvr12vt fyvr12vr fyvr12vj fyvr12uz fyvr12uv",variantClassNames:{size:{sm:"_1c9x66f2",lg:"_1c9x66f3"}},defaultVariants:{},compoundVariants:[]}),iie=fr({defaultClassName:"_1c9x66f5 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr12rt fyvr11rz",variantClassNames:{size:{sm:"_1c9x66f6",lg:"_1c9x66f7"}},defaultVariants:{},compoundVariants:[]});const sie=({size:t="sm"})=>G.jsx(Cne,{className:iie({size:t}),children:G.jsx(fd,{size:t})});C.forwardRef((t,e)=>{const{disabled:r=!1,id:n,name:i,label:s="",labelLocation:o="left",size:a="sm",...c}=t;return G.jsx(ru,{disabled:r,display:"flex",id:n??i,label:s,labelLocation:o,whiteSpace:"nowrap",children:G.jsx(xne,{className:nie({size:a}),disabled:r,id:n??i,name:i,ref:e,...c,children:G.jsx(sie,{})})})});x.createContext(null);const oie=w7["useId".toString()]||(()=>{});let aie=0;function rc(t){const[e,r]=C.useState(oie());return Hi(()=>{t||r(n=>n??String(aie++))},[t]),t||(e?`radix-${e}`:"")}const sD="Collapsible",[cie,eTe]=Sn(sD);cie(sD);function Yg(t){const e=t+"CollectionProvider",[r,n]=Sn(e),[i,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=h=>{const{scope:p,children:v}=h,b=x.useRef(null),y=x.useRef(new Map).current;return x.createElement(i,{scope:p,itemMap:y,collectionRef:b},v)},a=t+"CollectionSlot",c=x.forwardRef((h,p)=>{const{scope:v,children:b}=h,y=s(a,v),m=Gt(p,y.collectionRef);return x.createElement(jf,{ref:m},b)}),l=t+"CollectionItemSlot",u="data-radix-collection-item",f=x.forwardRef((h,p)=>{const{scope:v,children:b,...y}=h,m=x.useRef(null),g=Gt(p,m),S=s(l,v);return x.useEffect(()=>(S.itemMap.set(m,{ref:m,...y}),()=>void S.itemMap.delete(m))),x.createElement(jf,{[u]:"",ref:g},b)});function d(h){const p=s(t+"CollectionConsumer",h);return x.useCallback(()=>{const b=p.collectionRef.current;if(!b)return[];const y=Array.from(b.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((S,P)=>y.indexOf(S.ref.current)-y.indexOf(P.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:o,Slot:c,ItemSlot:f},d,n]}const lie=C.createContext(void 0);function Jg(t){const e=C.useContext(lie);return t||e||"ltr"}function uie(t,e=globalThis==null?void 0:globalThis.document){const r=Wi(t);C.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[r,e])}const oC="dismissableLayer.update",fie="dismissableLayer.pointerDownOutside",die="dismissableLayer.focusOutside";let dP;const hie=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),eS=C.forwardRef((t,e)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...l}=t,u=C.useContext(hie),[f,d]=C.useState(null),h=(r=f==null?void 0:f.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,p]=C.useState({}),v=Gt(e,I=>d(I)),b=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=b.indexOf(y),g=f?b.indexOf(f):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,P=g>=m,T=pie(I=>{const F=I.target,j=[...u.branches].some(H=>H.contains(F));!P||j||(s==null||s(I),a==null||a(I),I.defaultPrevented||c==null||c())},h),w=vie(I=>{const F=I.target;[...u.branches].some(H=>H.contains(F))||(o==null||o(I),a==null||a(I),I.defaultPrevented||c==null||c())},h);return uie(I=>{g===u.layers.size-1&&(i==null||i(I),!I.defaultPrevented&&c&&(I.preventDefault(),c()))},h),C.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(dP=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),hP(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=dP)}},[f,h,n,u]),C.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),hP())},[f,u]),C.useEffect(()=>{const I=()=>p({});return document.addEventListener(oC,I),()=>document.removeEventListener(oC,I)},[]),C.createElement(et.div,Ae({},l,{ref:v,style:{pointerEvents:S?P?"auto":"none":void 0,...t.style},onFocusCapture:Ee(t.onFocusCapture,w.onFocusCapture),onBlurCapture:Ee(t.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Ee(t.onPointerDownCapture,T.onPointerDownCapture)}))});function pie(t,e=globalThis==null?void 0:globalThis.document){const r=Wi(t),n=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let c=function(){oD(fie,r,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function vie(t,e=globalThis==null?void 0:globalThis.document){const r=Wi(t),n=C.useRef(!1);return C.useEffect(()=>{const i=s=>{s.target&&!n.current&&oD(die,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function hP(){const t=new CustomEvent(oC);document.dispatchEvent(t)}function oD(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?Z3(i,s):i.dispatchEvent(s)}const mie=eS;let I2=0;function aD(){C.useEffect(()=>{var t,e;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=r[0])!==null&&t!==void 0?t:pP()),document.body.insertAdjacentElement("beforeend",(e=r[1])!==null&&e!==void 0?e:pP()),I2++,()=>{I2===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),I2--}},[])}function pP(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const O2="focusScope.autoFocusOnMount",R2="focusScope.autoFocusOnUnmount",vP={bubbles:!1,cancelable:!0},cD=C.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=C.useState(null),l=Wi(i),u=Wi(s),f=C.useRef(null),d=Gt(e,v=>c(v)),h=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(n){let v=function(g){if(h.paused||!a)return;const S=g.target;a.contains(S)?f.current=S:Aa(f.current,{select:!0})},b=function(g){if(h.paused||!a)return;const S=g.relatedTarget;S!==null&&(a.contains(S)||Aa(f.current,{select:!0}))},y=function(g){if(document.activeElement===document.body)for(const P of g)P.removedNodes.length>0&&Aa(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const m=new MutationObserver(y);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),m.disconnect()}}},[n,a,h.paused]),C.useEffect(()=>{if(a){yP.add(h);const v=document.activeElement;if(!a.contains(v)){const y=new CustomEvent(O2,vP);a.addEventListener(O2,l),a.dispatchEvent(y),y.defaultPrevented||(yie(xie(lD(a)),{select:!0}),document.activeElement===v&&Aa(a))}return()=>{a.removeEventListener(O2,l),setTimeout(()=>{const y=new CustomEvent(R2,vP);a.addEventListener(R2,u),a.dispatchEvent(y),y.defaultPrevented||Aa(v??document.body,{select:!0}),a.removeEventListener(R2,u),yP.remove(h)},0)}}},[a,l,u,h]);const p=C.useCallback(v=>{if(!r&&!n||h.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(b&&y){const m=v.currentTarget,[g,S]=gie(m);g&&S?!v.shiftKey&&y===S?(v.preventDefault(),r&&Aa(g,{select:!0})):v.shiftKey&&y===g&&(v.preventDefault(),r&&Aa(S,{select:!0})):y===m&&v.preventDefault()}},[r,n,h.paused]);return C.createElement(et.div,Ae({tabIndex:-1},o,{ref:d,onKeyDown:p}))});function yie(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(Aa(n,{select:e}),document.activeElement!==r)return}function gie(t){const e=lD(t),r=mP(e,t),n=mP(e.reverse(),t);return[r,n]}function lD(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function mP(t,e){for(const r of t)if(!bie(r,{upTo:e}))return r}function bie(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function wie(t){return t instanceof HTMLInputElement&&"select"in t}function Aa(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&wie(t)&&e&&t.select()}}const yP=Eie();function Eie(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=gP(t,e),t.unshift(e)},remove(e){var r;t=gP(t,e),(r=t[0])===null||r===void 0||r.resume()}}}function gP(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function xie(t){return t.filter(e=>e.tagName!=="A")}const Cie=["top","right","bottom","left"],hc=Math.min,ui=Math.max,sy=Math.round,qp=Math.floor,pc=t=>({x:t,y:t}),Sie={left:"right",right:"left",bottom:"top",top:"bottom"},kie={start:"end",end:"start"};function aC(t,e,r){return ui(t,hc(e,r))}function Qo(t,e){return typeof t=="function"?t(e):t}function Yo(t){return t.split("-")[0]}function dd(t){return t.split("-")[1]}function tS(t){return t==="x"?"y":"x"}function rS(t){return t==="y"?"height":"width"}function hd(t){return["top","bottom"].includes(Yo(t))?"y":"x"}function nS(t){return tS(hd(t))}function Aie(t,e,r){r===void 0&&(r=!1);const n=dd(t),i=nS(t),s=rS(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=oy(o)),[o,oy(o)]}function _ie(t){const e=oy(t);return[cC(t),e,cC(e)]}function cC(t){return t.replace(/start|end/g,e=>kie[e])}function Pie(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function Tie(t,e,r,n){const i=dd(t);let s=Pie(Yo(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(cC)))),s}function oy(t){return t.replace(/left|right|bottom|top/g,e=>Sie[e])}function Iie(t){return{top:0,right:0,bottom:0,left:0,...t}}function uD(t){return typeof t!="number"?Iie(t):{top:t,right:t,bottom:t,left:t}}function ay(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function bP(t,e,r){let{reference:n,floating:i}=t;const s=hd(e),o=nS(e),a=rS(o),c=Yo(e),l=s==="y",u=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let h;switch(c){case"top":h={x:u,y:n.y-i.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-i.width,y:f};break;default:h={x:n.x,y:n.y}}switch(dd(e)){case"start":h[o]-=d*(r&&l?-1:1);break;case"end":h[o]+=d*(r&&l?-1:1);break}return h}const Oie=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=bP(l,n,c),d=n,h={},p=0;for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:u=0}=Qo(t,e)||{};if(l==null)return{};const f=uD(u),d={x:r,y:n},h=nS(i),p=rS(h),v=await o.getDimensions(l),b=h==="y",y=b?"top":"left",m=b?"bottom":"right",g=b?"clientHeight":"clientWidth",S=s.reference[p]+s.reference[h]-d[h]-s.floating[p],P=d[h]-s.reference[h],T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let w=T?T[g]:0;(!w||!await(o.isElement==null?void 0:o.isElement(T)))&&(w=a.floating[g]||s.floating[p]);const I=S/2-P/2,F=w/2-v[p]/2-1,j=hc(f[y],F),H=hc(f[m],F),K=j,B=w-v[p]-H,E=w/2-v[p]/2+I,_=aC(K,E,B),O=!c.arrow&&dd(i)!=null&&E!=_&&s.reference[p]/2-(EK<=0)){var F,j;const K=(((F=s.flip)==null?void 0:F.index)||0)+1,B=P[K];if(B)return{data:{index:K,overflows:I},reset:{placement:B}};let E=(j=I.filter(_=>_.overflows[0]<=0).sort((_,O)=>_.overflows[1]-O.overflows[1])[0])==null?void 0:j.placement;if(!E)switch(h){case"bestFit":{var H;const _=(H=I.map(O=>[O.placement,O.overflows.filter(N=>N>0).reduce((N,k)=>N+k,0)]).sort((O,N)=>O[1]-N[1])[0])==null?void 0:H[0];_&&(E=_);break}case"initialPlacement":E=a;break}if(i!==E)return{reset:{placement:E}}}return{}}}};function EP(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function xP(t){return Cie.some(e=>t[e]>=0)}const $ie=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=Qo(t,e);switch(n){case"referenceHidden":{const s=await D0(e,{...i,elementContext:"reference"}),o=EP(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:xP(o)}}}case"escaped":{const s=await D0(e,{...i,altBoundary:!0}),o=EP(s,r.floating);return{data:{escapedOffsets:o,escaped:xP(o)}}}default:return{}}}}};async function Mie(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Yo(r),a=dd(r),c=hd(r)==="y",l=["left","top"].includes(o)?-1:1,u=s&&c?-1:1,f=Qo(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),c?{x:h*u,y:d*l}:{x:d*l,y:h*u}}const Nie=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:r,y:n}=e,i=await Mie(e,t);return{x:r+i.x,y:n+i.y,data:i}}}},Die=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:b=>{let{x:y,y:m}=b;return{x:y,y:m}}},...c}=Qo(t,e),l={x:r,y:n},u=await D0(e,c),f=hd(Yo(i)),d=tS(f);let h=l[d],p=l[f];if(s){const b=d==="y"?"top":"left",y=d==="y"?"bottom":"right",m=h+u[b],g=h-u[y];h=aC(m,h,g)}if(o){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",m=p+u[b],g=p-u[y];p=aC(m,p,g)}const v=a.fn({...e,[d]:h,[f]:p});return{...v,data:{x:v.x-r,y:v.y-n}}}}},Lie=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Qo(t,e),u={x:r,y:n},f=hd(i),d=tS(f);let h=u[d],p=u[f];const v=Qo(a,e),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const g=d==="y"?"height":"width",S=s.reference[d]-s.floating[g]+b.mainAxis,P=s.reference[d]+s.reference[g]-b.mainAxis;hP&&(h=P)}if(l){var y,m;const g=d==="y"?"width":"height",S=["top","left"].includes(Yo(i)),P=s.reference[f]-s.floating[g]+(S&&((y=o.offset)==null?void 0:y[f])||0)+(S?0:b.crossAxis),T=s.reference[f]+s.reference[g]+(S?0:((m=o.offset)==null?void 0:m[f])||0)-(S?b.crossAxis:0);pT&&(p=T)}return{[d]:h,[f]:p}}}},Fie=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=Qo(t,e),c=await D0(e,a),l=Yo(r),u=dd(r),f=hd(r)==="y",{width:d,height:h}=n.floating;let p,v;l==="top"||l==="bottom"?(p=l,v=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=l,p=u==="end"?"top":"bottom");const b=h-c[p],y=d-c[v],m=!e.middlewareData.shift;let g=b,S=y;if(f){const T=d-c.left-c.right;S=u||m?hc(y,T):T}else{const T=h-c.top-c.bottom;g=u||m?hc(b,T):T}if(m&&!u){const T=ui(c.left,0),w=ui(c.right,0),I=ui(c.top,0),F=ui(c.bottom,0);f?S=d-2*(T!==0||w!==0?T+w:ui(c.left,c.right)):g=h-2*(I!==0||F!==0?I+F:ui(c.top,c.bottom))}await o({...e,availableWidth:S,availableHeight:g});const P=await i.getDimensions(s.floating);return d!==P.width||h!==P.height?{reset:{rects:!0}}:{}}}};function vc(t){return fD(t)?(t.nodeName||"").toLowerCase():"#document"}function yi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function fa(t){var e;return(e=(fD(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function fD(t){return t instanceof Node||t instanceof yi(t).Node}function Jo(t){return t instanceof Element||t instanceof yi(t).Element}function vo(t){return t instanceof HTMLElement||t instanceof yi(t).HTMLElement}function CP(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof yi(t).ShadowRoot}function N1(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=qi(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function Bie(t){return["table","td","th"].includes(vc(t))}function iS(t){const e=sS(),r=qi(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function jie(t){let e=Uf(t);for(;vo(e)&&!Xg(e);){if(iS(e))return e;e=Uf(e)}return null}function sS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Xg(t){return["html","body","#document"].includes(vc(t))}function qi(t){return yi(t).getComputedStyle(t)}function Zg(t){return Jo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Uf(t){if(vc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||CP(t)&&t.host||fa(t);return CP(e)?e.host:e}function dD(t){const e=Uf(t);return Xg(e)?t.ownerDocument?t.ownerDocument.body:t.body:vo(e)&&N1(e)?e:dD(e)}function L0(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=dD(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=yi(i);return s?e.concat(o,o.visualViewport||[],N1(i)?i:[],o.frameElement&&r?L0(o.frameElement):[]):e.concat(i,L0(i,[],r))}function hD(t){const e=qi(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=vo(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=sy(r)!==s||sy(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function oS(t){return Jo(t)?t:t.contextElement}function pf(t){const e=oS(t);if(!vo(e))return pc(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=hD(e);let o=(s?sy(r.width):r.width)/n,a=(s?sy(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Uie=pc(0);function pD(t){const e=yi(t);return!sS()||!e.visualViewport?Uie:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function zie(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==yi(t)?!1:e}function jl(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=oS(t);let o=pc(1);e&&(n?Jo(n)&&(o=pf(n)):o=pf(t));const a=zie(s,r,n)?pD(s):pc(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(s){const d=yi(s),h=n&&Jo(n)?yi(n):n;let p=d.frameElement;for(;p&&n&&h!==d;){const v=pf(p),b=p.getBoundingClientRect(),y=qi(p),m=b.left+(p.clientLeft+parseFloat(y.paddingLeft))*v.x,g=b.top+(p.clientTop+parseFloat(y.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=m,l+=g,p=yi(p).frameElement}}return ay({width:u,height:f,x:c,y:l})}function Wie(t){let{rect:e,offsetParent:r,strategy:n}=t;const i=vo(r),s=fa(r);if(r===s)return e;let o={scrollLeft:0,scrollTop:0},a=pc(1);const c=pc(0);if((i||!i&&n!=="fixed")&&((vc(r)!=="body"||N1(s))&&(o=Zg(r)),vo(r))){const l=jl(r);a=pf(r),c.x=l.x+r.clientLeft,c.y=l.y+r.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-o.scrollLeft*a.x+c.x,y:e.y*a.y-o.scrollTop*a.y+c.y}}function Hie(t){return Array.from(t.getClientRects())}function vD(t){return jl(fa(t)).left+Zg(t).scrollLeft}function qie(t){const e=fa(t),r=Zg(t),n=t.ownerDocument.body,i=ui(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=ui(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+vD(t);const a=-r.scrollTop;return qi(n).direction==="rtl"&&(o+=ui(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function Vie(t,e){const r=yi(t),n=fa(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=sS();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function Gie(t,e){const r=jl(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=vo(t)?pf(t):pc(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function SP(t,e,r){let n;if(e==="viewport")n=Vie(t,r);else if(e==="document")n=qie(fa(t));else if(Jo(e))n=Gie(e,r);else{const i=pD(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return ay(n)}function mD(t,e){const r=Uf(t);return r===e||!Jo(r)||Xg(r)?!1:qi(r).position==="fixed"||mD(r,e)}function Kie(t,e){const r=e.get(t);if(r)return r;let n=L0(t,[],!1).filter(a=>Jo(a)&&vc(a)!=="body"),i=null;const s=qi(t).position==="fixed";let o=s?Uf(t):t;for(;Jo(o)&&!Xg(o);){const a=qi(o),c=iS(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||N1(o)&&!c&&mD(t,o))?n=n.filter(u=>u!==o):i=a,o=Uf(o)}return e.set(t,n),n}function Qie(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?Kie(e,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,u)=>{const f=SP(e,u,i);return l.top=ui(f.top,l.top),l.right=hc(f.right,l.right),l.bottom=hc(f.bottom,l.bottom),l.left=ui(f.left,l.left),l},SP(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Yie(t){return hD(t)}function Jie(t,e,r){const n=vo(e),i=fa(e),s=r==="fixed",o=jl(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=pc(0);if(n||!n&&!s)if((vc(e)!=="body"||N1(i))&&(a=Zg(e)),n){const l=jl(e,!0,s,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else i&&(c.x=vD(i));return{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function kP(t,e){return!vo(t)||qi(t).position==="fixed"?null:e?e(t):t.offsetParent}function yD(t,e){const r=yi(t);if(!vo(t))return r;let n=kP(t,e);for(;n&&Bie(n)&&qi(n).position==="static";)n=kP(n,e);return n&&(vc(n)==="html"||vc(n)==="body"&&qi(n).position==="static"&&!iS(n))?r:n||jie(t)||r}const Xie=async function(t){let{reference:e,floating:r,strategy:n}=t;const i=this.getOffsetParent||yD,s=this.getDimensions;return{reference:Jie(e,await i(r),n),floating:{x:0,y:0,...await s(r)}}};function Zie(t){return qi(t).direction==="rtl"}const ese={convertOffsetParentRelativeRectToViewportRelativeRect:Wie,getDocumentElement:fa,getClippingRect:Qie,getOffsetParent:yD,getElementRects:Xie,getClientRects:Hie,getDimensions:Yie,getScale:pf,isElement:Jo,isRTL:Zie};function tse(t,e){let r=null,n;const i=fa(t);function s(){clearTimeout(n),r&&r.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:u,width:f,height:d}=t.getBoundingClientRect();if(a||e(),!f||!d)return;const h=qp(u),p=qp(i.clientWidth-(l+f)),v=qp(i.clientHeight-(u+d)),b=qp(l),m={rootMargin:-h+"px "+-p+"px "+-v+"px "+-b+"px",threshold:ui(0,hc(1,c))||1};let g=!0;function S(P){const T=P[0].intersectionRatio;if(T!==c){if(!g)return o();T?o(!1,T):n=setTimeout(()=>{o(!1,1e-7)},100)}g=!1}try{r=new IntersectionObserver(S,{...m,root:i.ownerDocument})}catch{r=new IntersectionObserver(S,m)}r.observe(t)}return o(!0),s}function rse(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=oS(t),u=i||s?[...l?L0(l):[],...L0(e)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",r,{passive:!0}),s&&y.addEventListener("resize",r)});const f=l&&a?tse(l,r):null;let d=-1,h=null;o&&(h=new ResizeObserver(y=>{let[m]=y;m&&m.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{h&&h.observe(e)})),r()}),l&&!c&&h.observe(l),h.observe(e));let p,v=c?jl(t):null;c&&b();function b(){const y=jl(t);v&&(y.x!==v.x||y.y!==v.y||y.width!==v.width||y.height!==v.height)&&r(),v=y,p=requestAnimationFrame(b)}return r(),()=>{u.forEach(y=>{i&&y.removeEventListener("scroll",r),s&&y.removeEventListener("resize",r)}),f&&f(),h&&h.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const nse=(t,e,r)=>{const n=new Map,i={platform:ese,...r},s={...i.platform,_c:n};return Oie(t,e,{...i,platform:s})},ise=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?wP({element:n.current,padding:i}).fn(r):{}:n?wP({element:n,padding:i}).fn(r):{}}}};var Fv=typeof document<"u"?C.useLayoutEffect:C.useEffect;function cy(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!cy(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!cy(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function gD(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function AP(t,e){const r=gD(t);return Math.round(e*r)/r}function _P(t){const e=C.useRef(t);return Fv(()=>{e.current=t}),e}function sse(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,f]=C.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,h]=C.useState(n);cy(d,n)||h(n);const[p,v]=C.useState(null),[b,y]=C.useState(null),m=C.useCallback(O=>{O!=T.current&&(T.current=O,v(O))},[v]),g=C.useCallback(O=>{O!==w.current&&(w.current=O,y(O))},[y]),S=s||p,P=o||b,T=C.useRef(null),w=C.useRef(null),I=C.useRef(u),F=_P(c),j=_P(i),H=C.useCallback(()=>{if(!T.current||!w.current)return;const O={placement:e,strategy:r,middleware:d};j.current&&(O.platform=j.current),nse(T.current,w.current,O).then(N=>{const k={...N,isPositioned:!0};K.current&&!cy(I.current,k)&&(I.current=k,Ts.flushSync(()=>{f(k)}))})},[d,e,r,j]);Fv(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(O=>({...O,isPositioned:!1})))},[l]);const K=C.useRef(!1);Fv(()=>(K.current=!0,()=>{K.current=!1}),[]),Fv(()=>{if(S&&(T.current=S),P&&(w.current=P),S&&P){if(F.current)return F.current(S,P,H);H()}},[S,P,H,F]);const B=C.useMemo(()=>({reference:T,floating:w,setReference:m,setFloating:g}),[m,g]),E=C.useMemo(()=>({reference:S,floating:P}),[S,P]),_=C.useMemo(()=>{const O={position:r,left:0,top:0};if(!E.floating)return O;const N=AP(E.floating,u.x),k=AP(E.floating,u.y);return a?{...O,transform:"translate("+N+"px, "+k+"px)",...gD(E.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:N,top:k}},[r,a,E.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:H,refs:B,elements:E,floatingStyles:_}),[u,H,B,E,_])}const bD="Popper",[wD,pd]=Sn(bD),[ose,ED]=wD(bD),ase=t=>{const{__scopePopper:e,children:r}=t,[n,i]=C.useState(null);return C.createElement(ose,{scope:e,anchor:n,onAnchorChange:i},r)},cse="PopperAnchor",lse=C.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=ED(cse,r),o=C.useRef(null),a=Gt(e,o);return C.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:C.createElement(et.div,Ae({},i,{ref:a}))}),xD="PopperContent",[use,tTe]=wD(xD),fse=C.forwardRef((t,e)=>{var r,n,i,s,o,a,c,l;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:h="center",alignOffset:p=0,arrowPadding:v=0,avoidCollisions:b=!0,collisionBoundary:y=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:S=!1,updatePositionStrategy:P="optimized",onPlaced:T,...w}=t,I=ED(xD,u),[F,j]=C.useState(null),H=Gt(e,ue=>j(ue)),[K,B]=C.useState(null),E=qg(K),_=(r=E==null?void 0:E.width)!==null&&r!==void 0?r:0,O=(n=E==null?void 0:E.height)!==null&&n!==void 0?n:0,N=f+(h!=="center"?"-"+h:""),k=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},$=Array.isArray(y)?y:[y],L=$.length>0,M={padding:k,boundary:$.filter(dse),altBoundary:L},{refs:A,floatingStyles:D,placement:V,isPositioned:R,middlewareData:U}=sse({strategy:"fixed",placement:N,whileElementsMounted:(...ue)=>rse(...ue,{animationFrame:P==="always"}),elements:{reference:I.anchor},middleware:[Nie({mainAxis:d+O,alignmentAxis:p}),b&&Die({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?Lie():void 0,...M}),b&&Rie({...M}),Fie({...M,apply:({elements:ue,rects:ot,availableWidth:Te,availableHeight:_e})=>{const{width:at,height:xe}=ot.reference,be=ue.floating.style;be.setProperty("--radix-popper-available-width",`${Te}px`),be.setProperty("--radix-popper-available-height",`${_e}px`),be.setProperty("--radix-popper-anchor-width",`${at}px`),be.setProperty("--radix-popper-anchor-height",`${xe}px`)}}),K&&ise({element:K,padding:v}),hse({arrowWidth:_,arrowHeight:O}),S&&$ie({strategy:"referenceHidden",...M})]}),[W,q]=CD(V),Y=Wi(T);Hi(()=>{R&&(Y==null||Y())},[R,Y]);const X=(i=U.arrow)===null||i===void 0?void 0:i.x,Q=(s=U.arrow)===null||s===void 0?void 0:s.y,Z=((o=U.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[ae,se]=C.useState();return Hi(()=>{F&&se(window.getComputedStyle(F).zIndex)},[F]),C.createElement("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:R?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[(a=U.transformOrigin)===null||a===void 0?void 0:a.x,(c=U.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:t.dir},C.createElement(use,{scope:u,placedSide:W,onArrowChange:B,arrowX:X,arrowY:Q,shouldHideArrow:Z},C.createElement(et.div,Ae({"data-side":W,"data-align":q},w,{ref:H,style:{...w.style,animation:R?void 0:"none",opacity:(l=U.hide)!==null&&l!==void 0&&l.referenceHidden?0:void 0}}))))});function dse(t){return t!==null}const hse=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i,s,o;const{placement:a,rects:c,middlewareData:l}=e,f=((r=l.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:t.arrowWidth,h=f?0:t.arrowHeight,[p,v]=CD(a),b={start:"0%",center:"50%",end:"100%"}[v],y=((n=(i=l.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,m=((s=(o=l.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+h/2;let g="",S="";return p==="bottom"?(g=f?b:`${y}px`,S=`${-h}px`):p==="top"?(g=f?b:`${y}px`,S=`${c.floating.height+h}px`):p==="right"?(g=`${-h}px`,S=f?b:`${m}px`):p==="left"&&(g=`${c.floating.width+h}px`,S=f?b:`${m}px`),{data:{x:g,y:S}}}});function CD(t){const[e,r="center"]=t.split("-");return[e,r]}const pse=ase,vse=lse,mse=fse,SD=C.forwardRef((t,e)=>{var r;const{container:n=globalThis==null||(r=globalThis.document)===null||r===void 0?void 0:r.body,...i}=t;return n?rG.createPortal(C.createElement(et.div,Ae({},i,{ref:e})),n):null}),$2="rovingFocusGroup.onEntryFocus",yse={bubbles:!1,cancelable:!0},aS="RovingFocusGroup",[lC,kD,gse]=Yg(aS),[bse,vd]=Sn(aS,[gse]),[wse,Ese]=bse(aS),xse=C.forwardRef((t,e)=>C.createElement(lC.Provider,{scope:t.__scopeRovingFocusGroup},C.createElement(lC.Slot,{scope:t.__scopeRovingFocusGroup},C.createElement(Cse,ht({},t,{ref:e}))))),Cse=C.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,...u}=t,f=C.useRef(null),d=Gt(e,f),h=Jg(s),[p=null,v]=dc({prop:o,defaultProp:a,onChange:c}),[b,y]=C.useState(!1),m=Wi(l),g=kD(r),S=C.useRef(!1),[P,T]=C.useState(0);return C.useEffect(()=>{const w=f.current;if(w)return w.addEventListener($2,m),()=>w.removeEventListener($2,m)},[m]),C.createElement(wse,{scope:r,orientation:n,dir:h,loop:i,currentTabStopId:p,onItemFocus:C.useCallback(w=>v(w),[v]),onItemShiftTab:C.useCallback(()=>y(!0),[]),onFocusableItemAdd:C.useCallback(()=>T(w=>w+1),[]),onFocusableItemRemove:C.useCallback(()=>T(w=>w-1),[])},C.createElement(et.div,ht({tabIndex:b||P===0?-1:0,"data-orientation":n},u,{ref:d,style:{outline:"none",...t.style},onMouseDown:Ee(t.onMouseDown,()=>{S.current=!0}),onFocus:Ee(t.onFocus,w=>{const I=!S.current;if(w.target===w.currentTarget&&I&&!b){const F=new CustomEvent($2,yse);if(w.currentTarget.dispatchEvent(F),!F.defaultPrevented){const j=g().filter(_=>_.focusable),H=j.find(_=>_.active),K=j.find(_=>_.id===p),E=[H,K,...j].filter(Boolean).map(_=>_.ref.current);AD(E)}}S.current=!1}),onBlur:Ee(t.onBlur,()=>y(!1))})))}),Sse="RovingFocusGroupItem",kse=C.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...o}=t,a=rc(),c=s||a,l=Ese(Sse,r),u=l.currentTabStopId===c,f=kD(r),{onFocusableItemAdd:d,onFocusableItemRemove:h}=l;return C.useEffect(()=>{if(n)return d(),()=>h()},[n,d,h]),C.createElement(lC.ItemSlot,{scope:r,id:c,focusable:n,active:i},C.createElement(et.span,ht({tabIndex:u?0:-1,"data-orientation":l.orientation},o,{ref:e,onMouseDown:Ee(t.onMouseDown,p=>{n?l.onItemFocus(c):p.preventDefault()}),onFocus:Ee(t.onFocus,()=>l.onItemFocus(c)),onKeyDown:Ee(t.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){l.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const v=Pse(p,l.orientation,l.dir);if(v!==void 0){p.preventDefault();let y=f().filter(m=>m.focusable).map(m=>m.ref.current);if(v==="last")y.reverse();else if(v==="prev"||v==="next"){v==="prev"&&y.reverse();const m=y.indexOf(p.currentTarget);y=l.loop?Tse(y,m+1):y.slice(m+1)}setTimeout(()=>AD(y))}})})))}),Ase={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function _se(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Pse(t,e,r){const n=_se(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Ase[n]}function AD(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function Tse(t,e){return t.map((r,n)=>t[(e+n)%t.length])}const _D=xse,cS=kse;var Ise=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},mu=new WeakMap,Vp=new WeakMap,Gp={},M2=0,PD=function(t){return t&&(t.host||PD(t.parentNode))},Ose=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=PD(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},Rse=function(t,e,r,n){var i=Ose(e,Array.isArray(t)?t:[t]);Gp[r]||(Gp[r]=new WeakMap);var s=Gp[r],o=[],a=new Set,c=new Set(i),l=function(f){!f||a.has(f)||(a.add(f),l(f.parentNode))};i.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))u(d);else{var h=d.getAttribute(n),p=h!==null&&h!=="false",v=(mu.get(d)||0)+1,b=(s.get(d)||0)+1;mu.set(d,v),s.set(d,b),o.push(d),v===1&&p&&Vp.set(d,!0),b===1&&d.setAttribute(r,"true"),p||d.setAttribute(n,"true")}})};return u(e),a.clear(),M2++,function(){o.forEach(function(f){var d=mu.get(f)-1,h=s.get(f)-1;mu.set(f,d),s.set(f,h),d||(Vp.has(f)||f.removeAttribute(n),Vp.delete(f)),h||f.removeAttribute(r)}),M2--,M2||(mu=new WeakMap,mu=new WeakMap,Vp=new WeakMap,Gp={})}},TD=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=e||Ise(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),Rse(n,i,r,"aria-hidden")):function(){return null}},Qs=function(){return Qs=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u")return Qse;var e=Yse(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},Xse=$D(),Zse=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` + .`.concat(Mse,` { overflow: hidden `).concat(n,`; padding-right: `).concat(a,"px ").concat(n,`; } @@ -86,34 +86,34 @@ Error generating stack: `+s.message+` `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),` } - .`).concat($v,` { + .`).concat(Bv,` { right: `).concat(a,"px ").concat(n,`; } - .`).concat(Nv,` { + .`).concat(jv,` { margin-right: `).concat(a,"px ").concat(n,`; } - .`).concat($v," .").concat($v,` { + .`).concat(Bv," .").concat(Bv,` { right: 0 `).concat(n,`; } - .`).concat(Nv," .").concat(Nv,` { + .`).concat(jv," .").concat(jv,` { margin-right: 0 `).concat(n,`; } body { - `).concat(Zie,": ").concat(a,`px; + `).concat(Nse,": ").concat(a,`px; } -`)},gse=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n,s=C.useMemo(function(){return vse(i)},[i]);return C.createElement(mse,{styles:yse(s,!e,i,r?"":"!important")})},rC=!1;if(typeof window<"u")try{var Wp=Object.defineProperty({},"passive",{get:function(){return rC=!0,!0}});window.addEventListener("test",Wp,Wp),window.removeEventListener("test",Wp,Wp)}catch{rC=!1}var mu=rC?{passive:!1}:!1,bse=function(t){return t.tagName==="TEXTAREA"},iD=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!bse(t)&&r[e]==="visible")},wse=function(t){return iD(t,"overflowY")},Ese=function(t){return iD(t,"overflowX")},gP=function(t,e){var r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=sD(t,r);if(n){var i=oD(t,r),s=i[1],o=i[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},xse=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},Cse=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},sD=function(t,e){return t==="v"?wse(e):Ese(e)},oD=function(t,e){return t==="v"?xse(e):Cse(e)},Sse=function(t,e){return t==="h"&&e==="rtl"?-1:1},kse=function(t,e,r,n,i){var s=Sse(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,c=e.contains(a),l=!1,u=o>0,f=0,d=0;do{var h=oD(t,a),p=h[0],v=h[1],b=h[2],y=v-b-s*p;(p||y)&&sD(t,a)&&(f+=y,d+=p),a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(u&&(i&&f===0||!i&&o>f)||!u&&(i&&d===0||!i&&-o>d))&&(l=!0),l},Hp=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},bP=function(t){return[t.deltaX,t.deltaY]},wP=function(t){return t&&"current"in t?t.current:t},Ase=function(t,e){return t[0]===e[0]&&t[1]===e[1]},_se=function(t){return` +`)},eoe=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n,s=C.useMemo(function(){return Jse(i)},[i]);return C.createElement(Xse,{styles:Zse(s,!e,i,r?"":"!important")})},uC=!1;if(typeof window<"u")try{var Kp=Object.defineProperty({},"passive",{get:function(){return uC=!0,!0}});window.addEventListener("test",Kp,Kp),window.removeEventListener("test",Kp,Kp)}catch{uC=!1}var yu=uC?{passive:!1}:!1,toe=function(t){return t.tagName==="TEXTAREA"},MD=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!toe(t)&&r[e]==="visible")},roe=function(t){return MD(t,"overflowY")},noe=function(t){return MD(t,"overflowX")},PP=function(t,e){var r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=ND(t,r);if(n){var i=DD(t,r),s=i[1],o=i[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},ioe=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},soe=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},ND=function(t,e){return t==="v"?roe(e):noe(e)},DD=function(t,e){return t==="v"?ioe(e):soe(e)},ooe=function(t,e){return t==="h"&&e==="rtl"?-1:1},aoe=function(t,e,r,n,i){var s=ooe(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,c=e.contains(a),l=!1,u=o>0,f=0,d=0;do{var h=DD(t,a),p=h[0],v=h[1],b=h[2],y=v-b-s*p;(p||y)&&ND(t,a)&&(f+=y,d+=p),a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(u&&(i&&f===0||!i&&o>f)||!u&&(i&&d===0||!i&&-o>d))&&(l=!0),l},Qp=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},TP=function(t){return[t.deltaX,t.deltaY]},IP=function(t){return t&&"current"in t?t.current:t},coe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},loe=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},Pse=0,yu=[];function Tse(t){var e=C.useRef([]),r=C.useRef([0,0]),n=C.useRef(),i=C.useState(Pse++)[0],s=C.useState(function(){return nD()})[0],o=C.useRef(t);C.useEffect(function(){o.current=t},[t]),C.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var v=Jie([t.lockRef.current],(t.shards||[]).map(wP),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=C.useCallback(function(v,b){if("touches"in v&&v.touches.length===2)return!o.current.allowPinchZoom;var y=Hp(v),m=r.current,g="deltaX"in v?v.deltaX:m[0]-y[0],S="deltaY"in v?v.deltaY:m[1]-y[1],P,T=v.target,w=Math.abs(g)>Math.abs(S)?"h":"v";if("touches"in v&&w==="h"&&T.type==="range")return!1;var I=gP(w,T);if(!I)return!0;if(I?P=w:(P=w==="v"?"h":"v",I=gP(w,T)),!I)return!1;if(!n.current&&"changedTouches"in v&&(g||S)&&(n.current=P),!P)return!0;var B=n.current||P;return kse(B,b,v,B==="h"?g:S,!0)},[]),c=C.useCallback(function(v){var b=v;if(!(!yu.length||yu[yu.length-1]!==s)){var y="deltaY"in b?bP(b):Hp(b),m=e.current.filter(function(P){return P.name===b.type&&P.target===b.target&&Ase(P.delta,y)})[0];if(m&&m.should){b.cancelable&&b.preventDefault();return}if(!m){var g=(o.current.shards||[]).map(wP).filter(Boolean).filter(function(P){return P.contains(b.target)}),S=g.length>0?a(b,g[0]):!o.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),l=C.useCallback(function(v,b,y,m){var g={name:v,delta:b,target:y,should:m};e.current.push(g),setTimeout(function(){e.current=e.current.filter(function(S){return S!==g})},1)},[]),u=C.useCallback(function(v){r.current=Hp(v),n.current=void 0},[]),f=C.useCallback(function(v){l(v.type,bP(v),v.target,a(v,t.lockRef.current))},[]),d=C.useCallback(function(v){l(v.type,Hp(v),v.target,a(v,t.lockRef.current))},[]);C.useEffect(function(){return yu.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",c,mu),document.addEventListener("touchmove",c,mu),document.addEventListener("touchstart",u,mu),function(){yu=yu.filter(function(v){return v!==s}),document.removeEventListener("wheel",c,mu),document.removeEventListener("touchmove",c,mu),document.removeEventListener("touchstart",u,mu)}},[]);var h=t.removeScrollBar,p=t.inert;return C.createElement(C.Fragment,null,p?C.createElement(s,{styles:_se(i)}):null,h?C.createElement(gse,{gapMode:"margin"}):null)}const Ise=ose(rD,Tse);var aD=C.forwardRef(function(t,e){return C.createElement(Vg,Ks({},t,{ref:e,sideCar:Ise}))});aD.classNames=Vg.classNames;const cD=aD,Ose=["Enter"," "],Gg="Menu",[Rse,gPe,Mse]=zg(Gg),[nu,lD]=Sn(Gg,[Mse,fd,dd]);fd();const $se=dd();nu(Gg);const[bPe,Nse]=nu(Gg),Dse="MenuPortal";nu(Dse,{forceMount:void 0});const Lse="MenuContent",[wPe,uD]=nu(Lse),nC="MenuItem",EP="menu.itemSelect",fD=C.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...i}=t,s=C.useRef(null),o=Nse(nC,t.__scopeMenu),a=uD(nC,t.__scopeMenu),c=Gt(e,s),l=C.useRef(!1),u=()=>{const f=s.current;if(!r&&f){const d=new CustomEvent(EP,{bubbles:!0,cancelable:!0});f.addEventListener(EP,h=>n==null?void 0:n(h),{once:!0}),W3(f,d),d.defaultPrevented?l.current=!1:o.onClose()}};return C.createElement(Bse,ke({},i,{ref:c,disabled:r,onClick:Ee(t.onClick,u),onPointerDown:f=>{var d;(d=t.onPointerDown)===null||d===void 0||d.call(t,f),l.current=!0},onPointerUp:Ee(t.onPointerUp,f=>{var d;l.current||(d=f.currentTarget)===null||d===void 0||d.click()}),onKeyDown:Ee(t.onKeyDown,f=>{const d=a.searchRef.current!=="";r||d&&f.key===" "||Ose.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),Bse=C.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=t,o=uD(nC,r),a=$se(r),c=C.useRef(null),l=Gt(e,c),[u,f]=C.useState(!1),[d,h]=C.useState("");return C.useEffect(()=>{const p=c.current;if(p){var v;h(((v=p.textContent)!==null&&v!==void 0?v:"").trim())}},[s.children]),C.createElement(Rse.ItemSlot,{scope:r,disabled:n,textValue:i??d},C.createElement(X3,ke({asChild:!0},a,{focusable:!n}),C.createElement(Ze.div,ke({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0},s,{ref:l,onPointerMove:Ee(t.onPointerMove,xP(p=>{n?o.onItemLeave(p):(o.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus())})),onPointerLeave:Ee(t.onPointerLeave,xP(p=>o.onItemLeave(p))),onFocus:Ee(t.onFocus,()=>f(!0)),onBlur:Ee(t.onBlur,()=>f(!1))}))))}),Fse=C.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return C.createElement(hD,{scope:t.__scopeMenu,checked:r},C.createElement(fD,ke({role:"menuitemcheckbox","aria-checked":ny(r)?"mixed":r},i,{ref:e,"data-state":Z3(r),onSelect:Ee(i.onSelect,()=>n==null?void 0:n(ny(r)?!0:!r),{checkForDefaultPrevented:!1})})))}),jse="MenuRadioGroup",[EPe,Use]=nu(jse,{value:void 0,onValueChange:()=>{}}),zse="MenuRadioItem",Wse=C.forwardRef((t,e)=>{const{value:r,...n}=t,i=Use(zse,t.__scopeMenu),s=r===i.value;return C.createElement(hD,{scope:t.__scopeMenu,checked:s},C.createElement(fD,ke({role:"menuitemradio","aria-checked":s},n,{ref:e,"data-state":Z3(s),onSelect:Ee(n.onSelect,()=>{var o;return(o=i.onValueChange)===null||o===void 0?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})))}),dD="MenuItemIndicator",[hD,Hse]=nu(dD,{checked:!1}),qse=C.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,s=Hse(dD,r);return C.createElement(Oc,{present:n||ny(s.checked)||s.checked===!0},C.createElement(Ze.span,ke({},i,{ref:e,"data-state":Z3(s.checked)})))}),Vse="MenuSub";nu(Vse);function ny(t){return t==="indeterminate"}function Z3(t){return ny(t)?"indeterminate":t?"checked":"unchecked"}function xP(t){return e=>e.pointerType==="mouse"?t(e):void 0}const Gse=Fse,Kse=Wse,Qse=qse,pD="DropdownMenu",[Yse,xPe]=Sn(pD,[lD]),eS=lD();Yse(pD);const Jse=C.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=eS(r);return C.createElement(Gse,ke({},i,n,{ref:e}))}),Xse=C.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=eS(r);return C.createElement(Kse,ke({},i,n,{ref:e}))}),Zse=C.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=eS(r);return C.createElement(Qse,ke({},i,n,{ref:e}))}),eoe=Jse,toe=Xse,vD=Zse;var mD="_1k2mbvi5",yD="_1k2mbvi4 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr1x4 fyvr1yk fyvr1ss fyvr1uo fyvr12wk fyvr12we fyvr11h0 fyvr11ko fyvr11jw fyvr12uz fyvr11n2 fyvr11hw fyvr12rz";const roe=({children:t})=>G.jsx(vD,{className:mD,children:t});C.forwardRef(({className:t,children:e,...r},n)=>G.jsxs(eoe,{className:Si(yD,t),...r,ref:n,children:[G.jsx(roe,{children:G.jsx(cd,{size:"xs"})}),G.jsx(ne,{variant:"small",children:e})]}));C.forwardRef(({className:t,children:e,...r},n)=>G.jsxs(toe,{className:Si(yD,t),...r,ref:n,children:[G.jsx(vD,{className:mD,children:G.jsx(ne,{children:"•"})}),G.jsx(ne,{variant:"small",children:e})]}));const Xo=C.forwardRef((t,e)=>{const{icon:r,size:n="md",...i}=t;return G.jsx(tt,{leftIcon:r,size:n,flexShrink:"0",ref:e,...i})}),noe=(...t)=>e=>t.forEach(r=>{r&&(typeof r=="function"?r(e):r.current=e)});var ioe="fyvr12wh fyvr12wb fyvr11ho fyvr12vb fyvr1ko fyvr1oo fyvr1mo fyvr1qo",soe="_1hq71vk1 _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr12n5 fyvr12ft fyvr1215 fyvr128h fyvr12nn fyvr12gb fyvr121n fyvr128z fyvr11ko fyvr11hc fyvr11ic fyvr11jc fyvr1g0 fyvr11hw",ooe=fr({defaultClassName:"_1hq71vk5",variantClassNames:{borderRadius:{xs:"fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]});const aoe={png:".png,image/png",jpeg:".jpeg,image/jpeg",jpg:".jpg,image/jpg",images:"image/*",pdf:".pdf,application/pdf"};C.forwardRef((t,e)=>{const{borderRadius:r="md",description:n,disabled:i=!1,id:s,label:o="",labelLocation:a="hidden",name:c,onValueChange:l,placeholder:u="Upload a file",validExtensions:f,...d}=t,h=C.useRef(null),p=noe(h,e),[v,b]=C.useState(null),y=g=>{const S=g.currentTarget.files;if(!S||!S[0])return;const P=S[0],T=P.name,w=P.size/1e3;b({name:T,size:w,extension:T.split(".").pop()??""}),l==null||l(P)},m=f.map(g=>aoe[g]).join(",");return G.jsx(tu,{description:n,disabled:i,display:"grid",id:s??c,label:o,labelLocation:a,children:G.jsx(z,{width:"full",children:G.jsxs(z,{justifyContent:v?"space-between":"flex-start",color:v?"text100":"text50",className:Si(soe,ooe({borderRadius:r})),children:[v?G.jsxs(z,{flexDirection:"row",gap:"2",alignItems:"baseline",children:[G.jsx(ne,{children:v.name}),G.jsxs(ne,{color:"text50",variant:"xsmall",children:[v.size.toFixed(2)," kb"]})]}):G.jsx(ne,{children:u}),G.jsx(z,{accept:m,as:"input",className:ioe,cursor:v?"text":"pointer",disabled:i||!!v,id:s??c,name:c,onChange:y,ref:p,type:"file",...d}),v&&G.jsx(Xo,{cursor:"pointer",icon:ru,size:"xs",onClick:g=>{var S;g.preventDefault(),g.stopPropagation(),(S=h.current)!=null&&S.value&&(h.current.value=""),l==null||l(null),b(null)},zIndex:"10"})]})})})});var coe=fr({defaultClassName:"_1bhyzin0",variantClassNames:{size:{xs:"_1bhyzin1",sm:"_1bhyzin2",md:"_1bhyzin3",lg:"_1bhyzin4",xl:"_1bhyzin5"}},defaultVariants:{},compoundVariants:[]});const iC=1e3,hf=64,I2=hf/2,O2=(t,e=iC)=>t%e/(iC/hf),rl=(t,e=0)=>{let r=3735928559^e,n=1103547991^e;for(let i=0,s;i>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},loe=(t,e,r)=>{const n=Math.random().toString(36).slice(2,12),i=t%360,s=(t+120)%360,o=r%360;return{id:rl(n),a:`hsl(${i}deg 100% 40%)`,b:`hsl(${s}deg 100% 50%)`,c:`hsl(${o}deg 100% 50%)`}},uoe=(t,e)=>{const r=[];for(let n=0;n{const s=hf/10+O2(n.r,iC*1.5/(i+1));return{...loe(n.a,n.b,n.c),x:O2(n.x),y:O2(n.y),r:s}})},M1=C.memo(t=>{const{className:e,address:r,size:n="md",complexity:i=1,...s}=t,o=uoe(r,i);return G.jsxs(z,{as:"svg",className:Si(e,coe({size:n})),viewBox:`0 0 ${hf} ${hf}`,version:"1.1",flexShrink:"0",borderRadius:"circle",overflow:"hidden",xmlns:"http://www.w3.org/2000/svg",...s,children:[G.jsxs("defs",{children:[G.jsx("clipPath",{id:"circle-clip",children:G.jsx("circle",{cx:I2,cy:I2,r:I2})}),G.jsxs("filter",{id:"blur",x:"-10%",y:"-10%",width:"120%",height:"120%",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[G.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),G.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),G.jsx("feGaussianBlur",{stdDeviation:hf/10,result:"effect1_foregroundBlur"})]}),G.jsxs("linearGradient",{id:`gradient-background-${o[0].id}`,x1:"0",y1:"0",x2:"1",y2:"1",children:[G.jsx("stop",{offset:"0",stopColor:o[0].c}),G.jsx("stop",{offset:"1",stopColor:o[0].a})]}),o.map(a=>G.jsxs(C.Fragment,{children:[G.jsxs("radialGradient",{id:`gradient-primary-${a.id}`,children:[G.jsx("stop",{offset:"0",stopColor:a.a}),G.jsx("stop",{offset:"1",stopColor:a.b})]}),G.jsxs("radialGradient",{id:`gradient-secondary-${a.id}`,children:[G.jsx("stop",{offset:"0",stopColor:a.c}),G.jsx("stop",{offset:"1",stopColor:a.b})]})]},a.id))]}),G.jsxs("g",{clipPath:"url(#circle-clip)",children:[G.jsx("rect",{width:"100%",height:"100%",fill:`url(#gradient-background-${o[0].id})`}),G.jsx("g",{filter:"url(#blur)",children:o.map(a=>G.jsxs(C.Fragment,{children:[G.jsx("circle",{fill:`url(#gradient-primary-${a.id})`,cx:a.x,cy:a.y,r:a.r}),G.jsx("circle",{fill:`url(#gradient-secondary-${a.id})`,cx:a.y,cy:a.x,r:a.r/2})]},a.id))})]})]})}),mr=t=>{const{disableAnimation:e=!1,onLoad:r,...n}=t,[i,s]=C.useState(!1),o=a=>{s(!0),r==null||r(a)};return G.jsx(z,{as:O0.img,initial:e?void 0:{opacity:0},animate:e?void 0:{opacity:i?1:0},transition:{duration:.2},onLoad:e?void 0:o,...n})},gD="Dialog",[bD,CPe]=Sn(gD),[foe,Rc]=bD(gD),doe=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=C.useRef(null),c=C.useRef(null),[l=!1,u]=fc({prop:n,defaultProp:i,onChange:s});return C.createElement(foe,{scope:e,triggerRef:a,contentRef:c,contentId:tc(),titleId:tc(),descriptionId:tc(),open:l,onOpenChange:u,onOpenToggle:C.useCallback(()=>u(f=>!f),[u]),modal:o},r)},wD="DialogPortal",[hoe,ED]=bD(wD,{forceMount:void 0}),poe=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:i}=t,s=Rc(wD,e);return C.createElement(hoe,{scope:e,forceMount:r},C.Children.map(n,o=>C.createElement(Oc,{present:r||s.open},C.createElement(KN,{asChild:!0,container:i},o))))},sC="DialogOverlay",voe=C.forwardRef((t,e)=>{const r=ED(sC,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=Rc(sC,t.__scopeDialog);return s.modal?C.createElement(Oc,{present:n||s.open},C.createElement(moe,ke({},i,{ref:e}))):null}),moe=C.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Rc(sC,r);return C.createElement(cD,{as:Lf,allowPinchZoom:!0,shards:[i.contentRef]},C.createElement(Ze.div,ke({"data-state":CD(i.open)},n,{ref:e,style:{pointerEvents:"auto",...n.style}})))}),N0="DialogContent",yoe=C.forwardRef((t,e)=>{const r=ED(N0,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=Rc(N0,t.__scopeDialog);return C.createElement(Oc,{present:n||s.open},s.modal?C.createElement(goe,ke({},i,{ref:e})):C.createElement(boe,ke({},i,{ref:e})))}),goe=C.forwardRef((t,e)=>{const r=Rc(N0,t.__scopeDialog),n=C.useRef(null),i=Gt(e,r.contentRef,n);return C.useEffect(()=>{const s=n.current;if(s)return ZN(s)},[]),C.createElement(xD,ke({},t,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=r.triggerRef.current)===null||o===void 0||o.focus()}),onPointerDownOutside:Ee(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:Ee(t.onFocusOutside,s=>s.preventDefault())}))}),boe=C.forwardRef((t,e)=>{const r=Rc(N0,t.__scopeDialog),n=C.useRef(!1),i=C.useRef(!1);return C.createElement(xD,ke({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,s),!s.defaultPrevented){var a;n.current||(a=r.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)===null||o===void 0||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=s.target;((a=r.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),xD=C.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=Rc(N0,r),c=C.useRef(null),l=Gt(e,c);return ON(),C.createElement(C.Fragment,null,C.createElement(RN,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s},C.createElement(H3,ke({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":CD(a.open)},o,{ref:l,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),woe="DialogClose",Eoe=C.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Rc(woe,r);return C.createElement(Ze.button,ke({type:"button"},n,{ref:e,onClick:Ee(t.onClick,()=>i.onOpenChange(!1))}))});function CD(t){return t?"open":"closed"}const xoe=doe,Coe=poe,Soe=voe,koe=yoe,Aoe=Eoe;var _oe=fr({defaultClassName:"_1vqx0w94",variantClassNames:{shadows:{true:"_1vqx0w95",false:"_1vqx0w96"},direction:{vertical:"_1vqx0w97",horizontal:"_1vqx0w98"}},defaultVariants:{},compoundVariants:[]}),Poe=fr({defaultClassName:"_1vqx0w91 fyvr128 fyvr15o",variantClassNames:{direction:{vertical:"_1vqx0w92",horizontal:"_1vqx0w93"}},defaultVariants:{},compoundVariants:[]});const SD=t=>{const{children:e,shadows:r=!0,direction:n="vertical",contentProps:i,...s}=t;return G.jsx(z,{className:_oe({direction:n,shadows:r}),position:"relative",width:"full",height:"full",...s,children:G.jsx(z,{className:Poe({direction:n}),background:"backgroundPrimary",...i,children:e})})};function Toe(t){var e=t.match(/^var\((.*)\)$/);return e?e[1]:t}function Ioe(t,e){var r=t;for(var n of e){if(!(n in r))throw new Error("Path ".concat(e.join(" -> ")," does not exist in object"));r=r[n]}return r}function kD(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=t.constructor();for(var i in t){var s=t[i],o=[...r,i];typeof s=="string"||typeof s=="number"||s==null?n[i]=e(s,o):typeof s=="object"&&!Array.isArray(s)?n[i]=kD(s,e,o):console.warn('Skipping invalid key "'.concat(o.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(s)?"Array":typeof s,'"'))}return n}function CP(t,e,r){t.style.setProperty(Toe(e),r)}function SP(t,e,r){if(typeof r=="object"){var n=e;kD(r,(o,a)=>{CP(t,Ioe(n,a),String(o))})}else{var i=e;for(var s in i)CP(t,s,i[s])}}const tS=["dark","light"],Ooe="dark",Roe="data-theme",kP="@sequence.theme",Moe=t=>tS.includes(t),$oe=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),AD=t=>t?`${kP}.${t}`:kP,Noe=t=>{const e=localStorage.getItem(AD(t));return e&&tS.includes(e)?e:Ooe},_D=C.createContext(null),Kg=t=>{const[e,r]=C.useState(t.theme||Noe(t.scope));C.useEffect(()=>{/Mac/.test(window.navigator.userAgent)&&window.document.documentElement.classList.add("is-apple")},[]),C.useEffect(()=>{t.theme&&r(t.theme)},[t.theme]),C.useEffect(()=>{const i=document.querySelector(t.root||":root");i&&(Moe(e)?(i.setAttribute(Roe,e),SP(i,Y_,{colors:are[e]})):$oe(e)&&SP(i,Y_,{colors:e}))},[e,t.root]);const n=C.useMemo(()=>({theme:e,root:t.root,setTheme:i=>{tS.includes(i)&&(localStorage.setItem(AD(t.scope),i),r(i))}}),[e,t.root,t.scope]);return G.jsx(_D.Provider,{value:n,children:t.children})},$1=()=>{const t=C.useContext(_D);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t};var Doe="fyvr110o fyvr112o fyvr114o fyvr116o fyvr11ho fyvr1qo fyvr1ko fyvr11ni",Loe=fr({defaultClassName:"_5b32m95 fyvr11d8 fyvr11dw fyvr11bg fyvr11by fyvr11c4 fyvr11cm fyvr11ls fyvr11m8 fyvr12wk fyvr12we fyvr11h0 fyvr11i4 fyvr11hs fyvr11sb fyvr1mo fyvr1om",variantClassNames:{size:{sm:"_5b32m96",lg:"_5b32m97"},autoHeight:{true:"_5b32m98"}},defaultVariants:{},compoundVariants:[[{autoHeight:!0,size:"lg"},"_5b32m99"]]}),Boe="fyvr11hs fyvr1ko fyvr1oo fyvr1qo fyvr1mo",Foe="fyvr11jg fyvr11ko fyvr11h0 fyvr11hs fyvr11ni fyvr1ko fyvr1oo fyvr1qo fyvr1mo";const rS=t=>{const{autoHeight:e=!1,backdropColor:r="backgroundBackdrop",children:n,disableAnimation:i=!1,isDismissible:s=!0,onClose:o,scroll:a=!0,size:c="lg",overlayProps:l,contentProps:u}=t,{root:f}=$1(),d=document.querySelector(f||"body");return G.jsx(xoe,{modal:!0,defaultOpen:!0,onOpenChange:o,children:G.jsx(Coe,{forceMount:!0,container:d,children:G.jsxs(z,{className:Foe,children:[G.jsx(z,{as:Soe,asChild:!0,background:r,className:Boe,forceMount:!0,children:G.jsx(O0.div,{initial:i?!1:{opacity:0},animate:i?!1:{opacity:1},exit:i?void 0:{opacity:0},transition:{type:"tween",ease:"linear"},...l},"modal-overlay")}),G.jsx(koe,{asChild:!0,className:Loe({autoHeight:e,size:c}),forceMount:!0,onEscapeKeyDown:h=>{s?o==null||o():h.preventDefault()},onInteractOutside:h=>{s||h.preventDefault()},children:G.jsxs(O0.div,{initial:i?!1:{y:"100%",opacity:c==="sm"?0:1},animate:i?!1:{y:0,opacity:1},exit:i?void 0:{y:"100%",opacity:c==="sm"?0:1},transition:{type:"tween",ease:"easeOut"},...u,children:[a?G.jsx(SD,{children:n}):n,s&&G.jsx(Aoe,{asChild:!0,children:G.jsx(Xo,{icon:ru,backdropFilter:"blur",size:"xs",className:Doe,"aria-label":"Close"})})]},"modal-content")})]})})})};var joe=fr({defaultClassName:"_1acm19ya fyvr1t4 fyvr1v0 fyvr12wh fyvr12wb fyvr11gw fyvr128 fyvr15o",variantClassNames:{numeric:{false:"_1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0",true:"_1qxj1ib9 fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8"}},defaultVariants:{},compoundVariants:[]}),Uoe="_1acm19y1 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1ww fyvr1ys fyvr11hc fyvr11ko fyvr11ob fyvr12rt fyvr1g0 fyvr118g",zoe=fr({defaultClassName:"_1acm19y5",variantClassNames:{borderRadius:{xs:"fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]});const Mc=C.forwardRef((t,e)=>{const{as:r="input",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",leftIcon:u,rightIcon:f,name:d,controls:h,type:p="text",numeric:v=!1,...b}=t;return G.jsx(tu,{description:s,disabled:o,display:"grid",id:a??d,label:c,labelLocation:l,children:G.jsx(z,{width:"full",children:G.jsxs(z,{className:Si(Uoe,zoe({borderRadius:i})),children:[u&&G.jsx(u,{size:"sm"}),G.jsx(z,{as:r,autoComplete:n,spellCheck:"false",className:joe({numeric:v}),disabled:o,id:a??d,name:d,ref:e,type:p,...b}),f&&G.jsx(f,{size:"sm"}),h]})})})}),Woe=RegExp("^\\d*(?:\\\\[.])?\\d*$");function Hoe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const PD=C.forwardRef((t,e)=>{const{name:r="amount",placeholder:n,onChange:i,onBlur:s,...o}=t,a=l=>{let{value:u}=l.target;u=u.replace(/,/g,"."),u.startsWith(".")&&(u="0"+u),u.startsWith("0")&&(u=u.replace(/^0+(?=\d)/,"")),(u===""||Woe.test(Hoe(u)))&&(i==null||i({...l,target:{...l.target,value:u}}))},c=l=>{const{value:u}=l.target;let f=u;f.endsWith(".")&&(f=f.slice(0,-1)),f.endsWith(".0")&&(f=f.slice(0,-2)),f==="0"&&(f=""),s==null||s(l),f!==u&&(i==null||i({...l,target:{...l.target,value:f}}))};return G.jsx(Mc,{name:r,onChange:a,onBlur:c,inputMode:"decimal",autoComplete:"off",autoCorrect:"off",type:"text",pattern:"^[0-9]*[.,]?[0-9]*$",placeholder:n||"0",minLength:1,maxLength:79,spellCheck:"false",numeric:!0,ref:e,...o})});fr({defaultClassName:"dtv8gt1",variantClassNames:{size:{sm:"dtv8gt2",normal:"dtv8gt3",md:"dtv8gt4",lg:"dtv8gt5",xl:"dtv8gt6"}},defaultVariants:{},compoundVariants:[]});const TD="Progress",Qg=100,[qoe,SPe]=Sn(TD),[Voe,kPe]=qoe(TD),Goe=C.forwardRef((t,e)=>{const{__scopeProgress:r,value:n,max:i,getValueLabel:s=Koe,...o}=t,a=oC(i)?i:Qg,c=ID(n,a)?n:null,l=iy(c)?s(c,a):void 0;return C.createElement(Voe,{scope:r,value:c,max:a},C.createElement(Ze.div,ht({"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":iy(c)?c:void 0,"aria-valuetext":l,role:"progressbar","data-state":Qoe(c,a),"data-value":c??void 0,"data-max":a},o,{ref:e})))});Goe.propTypes={max(t,e,r){const n=t[e],i=String(n);return n&&!oC(n)?new Error(Yoe(i,r)):null},value(t,e,r){const n=t[e],i=String(n),s=oC(t.max)?t.max:Qg;return n!=null&&!ID(n,s)?new Error(Joe(i,r)):null}};function Koe(t,e){return`${Math.round(t/e*100)}%`}function Qoe(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function iy(t){return typeof t=="number"}function oC(t){return iy(t)&&!isNaN(t)&&t>0}function ID(t,e){return iy(t)&&!isNaN(t)&&t<=e&&t>=0}function Yoe(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Qg}\`.`}function Joe(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: +`)},uoe=0,gu=[];function foe(t){var e=C.useRef([]),r=C.useRef([0,0]),n=C.useRef(),i=C.useState(uoe++)[0],s=C.useState(function(){return $D()})[0],o=C.useRef(t);C.useEffect(function(){o.current=t},[t]),C.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var v=$se([t.lockRef.current],(t.shards||[]).map(IP),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=C.useCallback(function(v,b){if("touches"in v&&v.touches.length===2)return!o.current.allowPinchZoom;var y=Qp(v),m=r.current,g="deltaX"in v?v.deltaX:m[0]-y[0],S="deltaY"in v?v.deltaY:m[1]-y[1],P,T=v.target,w=Math.abs(g)>Math.abs(S)?"h":"v";if("touches"in v&&w==="h"&&T.type==="range")return!1;var I=PP(w,T);if(!I)return!0;if(I?P=w:(P=w==="v"?"h":"v",I=PP(w,T)),!I)return!1;if(!n.current&&"changedTouches"in v&&(g||S)&&(n.current=P),!P)return!0;var F=n.current||P;return aoe(F,b,v,F==="h"?g:S,!0)},[]),c=C.useCallback(function(v){var b=v;if(!(!gu.length||gu[gu.length-1]!==s)){var y="deltaY"in b?TP(b):Qp(b),m=e.current.filter(function(P){return P.name===b.type&&P.target===b.target&&coe(P.delta,y)})[0];if(m&&m.should){b.cancelable&&b.preventDefault();return}if(!m){var g=(o.current.shards||[]).map(IP).filter(Boolean).filter(function(P){return P.contains(b.target)}),S=g.length>0?a(b,g[0]):!o.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),l=C.useCallback(function(v,b,y,m){var g={name:v,delta:b,target:y,should:m};e.current.push(g),setTimeout(function(){e.current=e.current.filter(function(S){return S!==g})},1)},[]),u=C.useCallback(function(v){r.current=Qp(v),n.current=void 0},[]),f=C.useCallback(function(v){l(v.type,TP(v),v.target,a(v,t.lockRef.current))},[]),d=C.useCallback(function(v){l(v.type,Qp(v),v.target,a(v,t.lockRef.current))},[]);C.useEffect(function(){return gu.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",c,yu),document.addEventListener("touchmove",c,yu),document.addEventListener("touchstart",u,yu),function(){gu=gu.filter(function(v){return v!==s}),document.removeEventListener("wheel",c,yu),document.removeEventListener("touchmove",c,yu),document.removeEventListener("touchstart",u,yu)}},[]);var h=t.removeScrollBar,p=t.inert;return C.createElement(C.Fragment,null,p?C.createElement(s,{styles:loe(i)}):null,h?C.createElement(eoe,{gapMode:"margin"}):null)}const doe=zse(RD,foe);var LD=C.forwardRef(function(t,e){return C.createElement(eb,Qs({},t,{ref:e,sideCar:doe}))});LD.classNames=eb.classNames;const FD=LD,hoe=["Enter"," "],tb="Menu",[poe,rTe,voe]=Yg(tb),[iu,BD]=Sn(tb,[voe,pd,vd]);pd();const moe=vd();iu(tb);const[nTe,yoe]=iu(tb),goe="MenuPortal";iu(goe,{forceMount:void 0});const boe="MenuContent",[iTe,jD]=iu(boe),fC="MenuItem",OP="menu.itemSelect",UD=C.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...i}=t,s=C.useRef(null),o=yoe(fC,t.__scopeMenu),a=jD(fC,t.__scopeMenu),c=Gt(e,s),l=C.useRef(!1),u=()=>{const f=s.current;if(!r&&f){const d=new CustomEvent(OP,{bubbles:!0,cancelable:!0});f.addEventListener(OP,h=>n==null?void 0:n(h),{once:!0}),Z3(f,d),d.defaultPrevented?l.current=!1:o.onClose()}};return C.createElement(woe,Ae({},i,{ref:c,disabled:r,onClick:Ee(t.onClick,u),onPointerDown:f=>{var d;(d=t.onPointerDown)===null||d===void 0||d.call(t,f),l.current=!0},onPointerUp:Ee(t.onPointerUp,f=>{var d;l.current||(d=f.currentTarget)===null||d===void 0||d.click()}),onKeyDown:Ee(t.onKeyDown,f=>{const d=a.searchRef.current!=="";r||d&&f.key===" "||hoe.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),woe=C.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=t,o=jD(fC,r),a=moe(r),c=C.useRef(null),l=Gt(e,c),[u,f]=C.useState(!1),[d,h]=C.useState("");return C.useEffect(()=>{const p=c.current;if(p){var v;h(((v=p.textContent)!==null&&v!==void 0?v:"").trim())}},[s.children]),C.createElement(poe.ItemSlot,{scope:r,disabled:n,textValue:i??d},C.createElement(cS,Ae({asChild:!0},a,{focusable:!n}),C.createElement(et.div,Ae({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0},s,{ref:l,onPointerMove:Ee(t.onPointerMove,RP(p=>{n?o.onItemLeave(p):(o.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus())})),onPointerLeave:Ee(t.onPointerLeave,RP(p=>o.onItemLeave(p))),onFocus:Ee(t.onFocus,()=>f(!0)),onBlur:Ee(t.onBlur,()=>f(!1))}))))}),Eoe=C.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return C.createElement(WD,{scope:t.__scopeMenu,checked:r},C.createElement(UD,Ae({role:"menuitemcheckbox","aria-checked":ly(r)?"mixed":r},i,{ref:e,"data-state":lS(r),onSelect:Ee(i.onSelect,()=>n==null?void 0:n(ly(r)?!0:!r),{checkForDefaultPrevented:!1})})))}),xoe="MenuRadioGroup",[sTe,Coe]=iu(xoe,{value:void 0,onValueChange:()=>{}}),Soe="MenuRadioItem",koe=C.forwardRef((t,e)=>{const{value:r,...n}=t,i=Coe(Soe,t.__scopeMenu),s=r===i.value;return C.createElement(WD,{scope:t.__scopeMenu,checked:s},C.createElement(UD,Ae({role:"menuitemradio","aria-checked":s},n,{ref:e,"data-state":lS(s),onSelect:Ee(n.onSelect,()=>{var o;return(o=i.onValueChange)===null||o===void 0?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})))}),zD="MenuItemIndicator",[WD,Aoe]=iu(zD,{checked:!1}),_oe=C.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,s=Aoe(zD,r);return C.createElement(Oc,{present:n||ly(s.checked)||s.checked===!0},C.createElement(et.span,Ae({},i,{ref:e,"data-state":lS(s.checked)})))}),Poe="MenuSub";iu(Poe);function ly(t){return t==="indeterminate"}function lS(t){return ly(t)?"indeterminate":t?"checked":"unchecked"}function RP(t){return e=>e.pointerType==="mouse"?t(e):void 0}const Toe=Eoe,Ioe=koe,Ooe=_oe,HD="DropdownMenu",[Roe,oTe]=Sn(HD,[BD]),uS=BD();Roe(HD);const $oe=C.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=uS(r);return C.createElement(Toe,Ae({},i,n,{ref:e}))}),Moe=C.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=uS(r);return C.createElement(Ioe,Ae({},i,n,{ref:e}))}),Noe=C.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=uS(r);return C.createElement(Ooe,Ae({},i,n,{ref:e}))}),Doe=$oe,Loe=Moe,qD=Noe;var VD="_1k2mbvi5",GD="_1k2mbvi4 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr1x4 fyvr1yk fyvr1ss fyvr1uo fyvr12wk fyvr12we fyvr11h0 fyvr11ko fyvr11jw fyvr12uz fyvr11n2 fyvr11hw fyvr12rz";const Foe=({children:t})=>G.jsx(qD,{className:VD,children:t});C.forwardRef(({className:t,children:e,...r},n)=>G.jsxs(Doe,{className:ki(GD,t),...r,ref:n,children:[G.jsx(Foe,{children:G.jsx(fd,{size:"xs"})}),G.jsx(ne,{variant:"small",children:e})]}));C.forwardRef(({className:t,children:e,...r},n)=>G.jsxs(Loe,{className:ki(GD,t),...r,ref:n,children:[G.jsx(qD,{className:VD,children:G.jsx(ne,{children:"•"})}),G.jsx(ne,{variant:"small",children:e})]}));const Xo=C.forwardRef((t,e)=>{const{icon:r,size:n="md",...i}=t;return G.jsx(rt,{leftIcon:r,size:n,flexShrink:"0",ref:e,...i})}),Boe=(...t)=>e=>t.forEach(r=>{r&&(typeof r=="function"?r(e):r.current=e)});var joe="fyvr12wh fyvr12wb fyvr11ho fyvr12vb fyvr1ko fyvr1oo fyvr1mo fyvr1qo",Uoe="_1hq71vk1 _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr12n5 fyvr12ft fyvr1215 fyvr128h fyvr12nn fyvr12gb fyvr121n fyvr128z fyvr11ko fyvr11hc fyvr11ic fyvr11jc fyvr1g0 fyvr11hw",zoe=fr({defaultClassName:"_1hq71vk5",variantClassNames:{borderRadius:{xs:"fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]});const Woe={png:".png,image/png",jpeg:".jpeg,image/jpeg",jpg:".jpg,image/jpg",images:"image/*",pdf:".pdf,application/pdf"};C.forwardRef((t,e)=>{const{borderRadius:r="md",description:n,disabled:i=!1,id:s,label:o="",labelLocation:a="hidden",name:c,onValueChange:l,placeholder:u="Upload a file",validExtensions:f,...d}=t,h=C.useRef(null),p=Boe(h,e),[v,b]=C.useState(null),y=g=>{const S=g.currentTarget.files;if(!S||!S[0])return;const P=S[0],T=P.name,w=P.size/1e3;b({name:T,size:w,extension:T.split(".").pop()??""}),l==null||l(P)},m=f.map(g=>Woe[g]).join(",");return G.jsx(ru,{description:n,disabled:i,display:"grid",id:s??c,label:o,labelLocation:a,children:G.jsx(z,{width:"full",children:G.jsxs(z,{justifyContent:v?"space-between":"flex-start",color:v?"text100":"text50",className:ki(Uoe,zoe({borderRadius:r})),children:[v?G.jsxs(z,{flexDirection:"row",gap:"2",alignItems:"baseline",children:[G.jsx(ne,{children:v.name}),G.jsxs(ne,{color:"text50",variant:"xsmall",children:[v.size.toFixed(2)," kb"]})]}):G.jsx(ne,{children:u}),G.jsx(z,{accept:m,as:"input",className:joe,cursor:v?"text":"pointer",disabled:i||!!v,id:s??c,name:c,onChange:y,ref:p,type:"file",...d}),v&&G.jsx(Xo,{cursor:"pointer",icon:nu,size:"xs",onClick:g=>{var S;g.preventDefault(),g.stopPropagation(),(S=h.current)!=null&&S.value&&(h.current.value=""),l==null||l(null),b(null)},zIndex:"10"})]})})})});var Hoe=fr({defaultClassName:"_1bhyzin0",variantClassNames:{size:{xs:"_1bhyzin1",sm:"_1bhyzin2",md:"_1bhyzin3",lg:"_1bhyzin4",xl:"_1bhyzin5"}},defaultVariants:{},compoundVariants:[]});const dC=1e3,vf=64,L2=vf/2,F2=(t,e=dC)=>t%e/(dC/vf),rl=(t,e=0)=>{let r=3735928559^e,n=1103547991^e;for(let i=0,s;i>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},qoe=(t,e,r)=>{const n=Math.random().toString(36).slice(2,12),i=t%360,s=(t+120)%360,o=r%360;return{id:rl(n),a:`hsl(${i}deg 100% 40%)`,b:`hsl(${s}deg 100% 50%)`,c:`hsl(${o}deg 100% 50%)`}},Voe=(t,e)=>{const r=[];for(let n=0;n{const s=vf/10+F2(n.r,dC*1.5/(i+1));return{...qoe(n.a,n.b,n.c),x:F2(n.x),y:F2(n.y),r:s}})},D1=C.memo(t=>{const{className:e,address:r,size:n="md",complexity:i=1,...s}=t,o=Voe(r,i);return G.jsxs(z,{as:"svg",className:ki(e,Hoe({size:n})),viewBox:`0 0 ${vf} ${vf}`,version:"1.1",flexShrink:"0",borderRadius:"circle",overflow:"hidden",xmlns:"http://www.w3.org/2000/svg",...s,children:[G.jsxs("defs",{children:[G.jsx("clipPath",{id:"circle-clip",children:G.jsx("circle",{cx:L2,cy:L2,r:L2})}),G.jsxs("filter",{id:"blur",x:"-10%",y:"-10%",width:"120%",height:"120%",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[G.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),G.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),G.jsx("feGaussianBlur",{stdDeviation:vf/10,result:"effect1_foregroundBlur"})]}),G.jsxs("linearGradient",{id:`gradient-background-${o[0].id}`,x1:"0",y1:"0",x2:"1",y2:"1",children:[G.jsx("stop",{offset:"0",stopColor:o[0].c}),G.jsx("stop",{offset:"1",stopColor:o[0].a})]}),o.map(a=>G.jsxs(C.Fragment,{children:[G.jsxs("radialGradient",{id:`gradient-primary-${a.id}`,children:[G.jsx("stop",{offset:"0",stopColor:a.a}),G.jsx("stop",{offset:"1",stopColor:a.b})]}),G.jsxs("radialGradient",{id:`gradient-secondary-${a.id}`,children:[G.jsx("stop",{offset:"0",stopColor:a.c}),G.jsx("stop",{offset:"1",stopColor:a.b})]})]},a.id))]}),G.jsxs("g",{clipPath:"url(#circle-clip)",children:[G.jsx("rect",{width:"100%",height:"100%",fill:`url(#gradient-background-${o[0].id})`}),G.jsx("g",{filter:"url(#blur)",children:o.map(a=>G.jsxs(C.Fragment,{children:[G.jsx("circle",{fill:`url(#gradient-primary-${a.id})`,cx:a.x,cy:a.y,r:a.r}),G.jsx("circle",{fill:`url(#gradient-secondary-${a.id})`,cx:a.y,cy:a.x,r:a.r/2})]},a.id))})]})]})}),mr=t=>{const{disableAnimation:e=!1,onLoad:r,...n}=t,[i,s]=C.useState(!1),o=a=>{s(!0),r==null||r(a)};return G.jsx(z,{as:M0.img,initial:e?void 0:{opacity:0},animate:e?void 0:{opacity:i?1:0},transition:{duration:.2},onLoad:e?void 0:o,...n})},KD="Dialog",[QD,aTe]=Sn(KD),[Goe,Rc]=QD(KD),Koe=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=C.useRef(null),c=C.useRef(null),[l=!1,u]=dc({prop:n,defaultProp:i,onChange:s});return C.createElement(Goe,{scope:e,triggerRef:a,contentRef:c,contentId:rc(),titleId:rc(),descriptionId:rc(),open:l,onOpenChange:u,onOpenToggle:C.useCallback(()=>u(f=>!f),[u]),modal:o},r)},YD="DialogPortal",[Qoe,JD]=QD(YD,{forceMount:void 0}),Yoe=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:i}=t,s=Rc(YD,e);return C.createElement(Qoe,{scope:e,forceMount:r},C.Children.map(n,o=>C.createElement(Oc,{present:r||s.open},C.createElement(SD,{asChild:!0,container:i},o))))},hC="DialogOverlay",Joe=C.forwardRef((t,e)=>{const r=JD(hC,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=Rc(hC,t.__scopeDialog);return s.modal?C.createElement(Oc,{present:n||s.open},C.createElement(Xoe,Ae({},i,{ref:e}))):null}),Xoe=C.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Rc(hC,r);return C.createElement(FD,{as:jf,allowPinchZoom:!0,shards:[i.contentRef]},C.createElement(et.div,Ae({"data-state":ZD(i.open)},n,{ref:e,style:{pointerEvents:"auto",...n.style}})))}),F0="DialogContent",Zoe=C.forwardRef((t,e)=>{const r=JD(F0,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=Rc(F0,t.__scopeDialog);return C.createElement(Oc,{present:n||s.open},s.modal?C.createElement(eae,Ae({},i,{ref:e})):C.createElement(tae,Ae({},i,{ref:e})))}),eae=C.forwardRef((t,e)=>{const r=Rc(F0,t.__scopeDialog),n=C.useRef(null),i=Gt(e,r.contentRef,n);return C.useEffect(()=>{const s=n.current;if(s)return TD(s)},[]),C.createElement(XD,Ae({},t,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=r.triggerRef.current)===null||o===void 0||o.focus()}),onPointerDownOutside:Ee(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:Ee(t.onFocusOutside,s=>s.preventDefault())}))}),tae=C.forwardRef((t,e)=>{const r=Rc(F0,t.__scopeDialog),n=C.useRef(!1),i=C.useRef(!1);return C.createElement(XD,Ae({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,s),!s.defaultPrevented){var a;n.current||(a=r.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)===null||o===void 0||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=s.target;((a=r.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),XD=C.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=Rc(F0,r),c=C.useRef(null),l=Gt(e,c);return aD(),C.createElement(C.Fragment,null,C.createElement(cD,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s},C.createElement(eS,Ae({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ZD(a.open)},o,{ref:l,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),rae="DialogClose",nae=C.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Rc(rae,r);return C.createElement(et.button,Ae({type:"button"},n,{ref:e,onClick:Ee(t.onClick,()=>i.onOpenChange(!1))}))});function ZD(t){return t?"open":"closed"}const iae=Koe,sae=Yoe,oae=Joe,aae=Zoe,cae=nae;var lae=fr({defaultClassName:"_1vqx0w94",variantClassNames:{shadows:{true:"_1vqx0w95",false:"_1vqx0w96"},direction:{vertical:"_1vqx0w97",horizontal:"_1vqx0w98"}},defaultVariants:{},compoundVariants:[]}),uae=fr({defaultClassName:"_1vqx0w91 fyvr128 fyvr15o",variantClassNames:{direction:{vertical:"_1vqx0w92",horizontal:"_1vqx0w93"}},defaultVariants:{},compoundVariants:[]});const eL=t=>{const{children:e,shadows:r=!0,direction:n="vertical",contentProps:i,...s}=t;return G.jsx(z,{className:lae({direction:n,shadows:r}),position:"relative",width:"full",height:"full",...s,children:G.jsx(z,{className:uae({direction:n}),background:"backgroundPrimary",...i,children:e})})};function fae(t){var e=t.match(/^var\((.*)\)$/);return e?e[1]:t}function dae(t,e){var r=t;for(var n of e){if(!(n in r))throw new Error("Path ".concat(e.join(" -> ")," does not exist in object"));r=r[n]}return r}function tL(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=t.constructor();for(var i in t){var s=t[i],o=[...r,i];typeof s=="string"||typeof s=="number"||s==null?n[i]=e(s,o):typeof s=="object"&&!Array.isArray(s)?n[i]=tL(s,e,o):console.warn('Skipping invalid key "'.concat(o.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(s)?"Array":typeof s,'"'))}return n}function $P(t,e,r){t.style.setProperty(fae(e),r)}function MP(t,e,r){if(typeof r=="object"){var n=e;tL(r,(o,a)=>{$P(t,dae(n,a),String(o))})}else{var i=e;for(var s in i)$P(t,s,i[s])}}const fS=["dark","light"],hae="dark",pae="data-theme",NP="@sequence.theme",vae=t=>fS.includes(t),mae=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),rL=t=>t?`${NP}.${t}`:NP,yae=t=>{const e=localStorage.getItem(rL(t));return e&&fS.includes(e)?e:hae},nL=C.createContext(null),rb=t=>{const[e,r]=C.useState(t.theme||yae(t.scope));C.useEffect(()=>{/Mac/.test(window.navigator.userAgent)&&window.document.documentElement.classList.add("is-apple")},[]),C.useEffect(()=>{t.theme&&r(t.theme)},[t.theme]),C.useEffect(()=>{const i=document.querySelector(t.root||":root");i&&(vae(e)?(i.setAttribute(pae,e),MP(i,oP,{colors:Wre[e]})):mae(e)&&MP(i,oP,{colors:e}))},[e,t.root]);const n=C.useMemo(()=>({theme:e,root:t.root,setTheme:i=>{fS.includes(i)&&(localStorage.setItem(rL(t.scope),i),r(i))}}),[e,t.root,t.scope]);return G.jsx(nL.Provider,{value:n,children:t.children})},L1=()=>{const t=C.useContext(nL);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t};var gae="fyvr110o fyvr112o fyvr114o fyvr116o fyvr11ho fyvr1qo fyvr1ko fyvr11ni",bae=fr({defaultClassName:"_5b32m95 fyvr11d8 fyvr11dw fyvr11bg fyvr11by fyvr11c4 fyvr11cm fyvr11ls fyvr11m8 fyvr12wk fyvr12we fyvr11h0 fyvr11i4 fyvr11hs fyvr11sb fyvr1mo fyvr1om",variantClassNames:{size:{sm:"_5b32m96",lg:"_5b32m97"},autoHeight:{true:"_5b32m98"}},defaultVariants:{},compoundVariants:[[{autoHeight:!0,size:"lg"},"_5b32m99"]]}),wae="fyvr11hs fyvr1ko fyvr1oo fyvr1qo fyvr1mo",Eae="fyvr11jg fyvr11ko fyvr11h0 fyvr11hs fyvr11ni fyvr1ko fyvr1oo fyvr1qo fyvr1mo";const dS=t=>{const{autoHeight:e=!1,backdropColor:r="backgroundBackdrop",children:n,disableAnimation:i=!1,isDismissible:s=!0,onClose:o,scroll:a=!0,size:c="lg",overlayProps:l,contentProps:u}=t,{root:f}=L1(),d=document.querySelector(f||"body");return G.jsx(iae,{modal:!0,defaultOpen:!0,onOpenChange:o,children:G.jsx(sae,{forceMount:!0,container:d,children:G.jsxs(z,{className:Eae,children:[G.jsx(z,{as:oae,asChild:!0,background:r,className:wae,forceMount:!0,children:G.jsx(M0.div,{initial:i?!1:{opacity:0},animate:i?!1:{opacity:1},exit:i?void 0:{opacity:0},transition:{type:"tween",ease:"linear"},...l},"modal-overlay")}),G.jsx(aae,{asChild:!0,className:bae({autoHeight:e,size:c}),forceMount:!0,onEscapeKeyDown:h=>{s?o==null||o():h.preventDefault()},onInteractOutside:h=>{s||h.preventDefault()},children:G.jsxs(M0.div,{initial:i?!1:{y:"100%",opacity:c==="sm"?0:1},animate:i?!1:{y:0,opacity:1},exit:i?void 0:{y:"100%",opacity:c==="sm"?0:1},transition:{type:"tween",ease:"easeOut"},...u,children:[a?G.jsx(eL,{children:n}):n,s&&G.jsx(cae,{asChild:!0,children:G.jsx(Xo,{icon:nu,backdropFilter:"blur",size:"xs",className:gae,"aria-label":"Close"})})]},"modal-content")})]})})})};var xae=fr({defaultClassName:"_1acm19ya fyvr1t4 fyvr1v0 fyvr12wh fyvr12wb fyvr11gw fyvr128 fyvr15o",variantClassNames:{numeric:{false:"_1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0",true:"_1qxj1ib9 fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8"}},defaultVariants:{},compoundVariants:[]}),Cae="_1acm19y1 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1ww fyvr1ys fyvr11hc fyvr11ko fyvr11ob fyvr12rt fyvr1g0 fyvr118g",Sae=fr({defaultClassName:"_1acm19y5",variantClassNames:{borderRadius:{xs:"fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]});const $c=C.forwardRef((t,e)=>{const{as:r="input",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",leftIcon:u,rightIcon:f,name:d,controls:h,type:p="text",numeric:v=!1,...b}=t;return G.jsx(ru,{description:s,disabled:o,display:"grid",id:a??d,label:c,labelLocation:l,children:G.jsx(z,{width:"full",children:G.jsxs(z,{className:ki(Cae,Sae({borderRadius:i})),children:[u&&G.jsx(u,{size:"sm"}),G.jsx(z,{as:r,autoComplete:n,spellCheck:"false",className:xae({numeric:v}),disabled:o,id:a??d,name:d,ref:e,type:p,...b}),f&&G.jsx(f,{size:"sm"}),h]})})})}),kae=RegExp("^\\d*(?:\\\\[.])?\\d*$");function Aae(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const iL=C.forwardRef((t,e)=>{const{name:r="amount",placeholder:n,onChange:i,onBlur:s,...o}=t,a=l=>{let{value:u}=l.target;u=u.replace(/,/g,"."),u.startsWith(".")&&(u="0"+u),u.startsWith("0")&&(u=u.replace(/^0+(?=\d)/,"")),(u===""||kae.test(Aae(u)))&&(i==null||i({...l,target:{...l.target,value:u}}))},c=l=>{const{value:u}=l.target;let f=u;f.endsWith(".")&&(f=f.slice(0,-1)),f.endsWith(".0")&&(f=f.slice(0,-2)),f==="0"&&(f=""),s==null||s(l),f!==u&&(i==null||i({...l,target:{...l.target,value:f}}))};return G.jsx($c,{name:r,onChange:a,onBlur:c,inputMode:"decimal",autoComplete:"off",autoCorrect:"off",type:"text",pattern:"^[0-9]*[.,]?[0-9]*$",placeholder:n||"0",minLength:1,maxLength:79,spellCheck:"false",numeric:!0,ref:e,...o})});fr({defaultClassName:"dtv8gt1",variantClassNames:{size:{sm:"dtv8gt2",normal:"dtv8gt3",md:"dtv8gt4",lg:"dtv8gt5",xl:"dtv8gt6"}},defaultVariants:{},compoundVariants:[]});const sL="Progress",nb=100,[_ae,cTe]=Sn(sL),[Pae,lTe]=_ae(sL),Tae=C.forwardRef((t,e)=>{const{__scopeProgress:r,value:n,max:i,getValueLabel:s=Iae,...o}=t,a=pC(i)?i:nb,c=oL(n,a)?n:null,l=uy(c)?s(c,a):void 0;return C.createElement(Pae,{scope:r,value:c,max:a},C.createElement(et.div,ht({"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":uy(c)?c:void 0,"aria-valuetext":l,role:"progressbar","data-state":Oae(c,a),"data-value":c??void 0,"data-max":a},o,{ref:e})))});Tae.propTypes={max(t,e,r){const n=t[e],i=String(n);return n&&!pC(n)?new Error(Rae(i,r)):null},value(t,e,r){const n=t[e],i=String(n),s=pC(t.max)?t.max:nb;return n!=null&&!oL(n,s)?new Error($ae(i,r)):null}};function Iae(t,e){return`${Math.round(t/e*100)}%`}function Oae(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function uy(t){return typeof t=="number"}function pC(t){return uy(t)&&!isNaN(t)&&t>0}function oL(t,e){return uy(t)&&!isNaN(t)&&t<=e&&t>=0}function Rae(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${nb}\`.`}function $ae(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: - a positive number - - less than the value passed to \`max\` (or ${Qg} if no \`max\` prop is set) + - less than the value passed to \`max\` (or ${nb} if no \`max\` prop is set) - \`null\` if the progress is indeterminate. -Defaulting to \`null\`.`}const OD="Radio",[Xoe,RD]=Sn(OD),[Zoe,eae]=Xoe(OD),tae=C.forwardRef((t,e)=>{const{__scopeRadio:r,name:n,checked:i=!1,required:s,disabled:o,value:a="on",onCheck:c,...l}=t,[u,f]=C.useState(null),d=Gt(e,v=>f(v)),h=C.useRef(!1),p=u?!!u.closest("form"):!0;return C.createElement(Zoe,{scope:r,checked:i,disabled:o},C.createElement(Ze.button,ht({type:"button",role:"radio","aria-checked":i,"data-state":MD(i),"data-disabled":o?"":void 0,disabled:o,value:a},l,{ref:d,onClick:Ee(t.onClick,v=>{i||c==null||c(),p&&(h.current=v.isPropagationStopped(),h.current||v.stopPropagation())})})),p&&C.createElement(iae,{control:u,bubbles:!h.current,name:n,value:a,checked:i,required:s,disabled:o,style:{transform:"translateX(-100%)"}}))}),rae="RadioIndicator",nae=C.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...i}=t,s=eae(rae,r);return C.createElement(Oc,{present:n||s.checked},C.createElement(Ze.span,ht({"data-state":MD(s.checked),"data-disabled":s.disabled?"":void 0},i,{ref:e})))}),iae=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=C.useRef(null),o=Dg(r),a=Lg(e);return C.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(d)}},[o,r,n]),C.createElement("input",ht({type:"radio","aria-hidden":!0,defaultChecked:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function MD(t){return t?"checked":"unchecked"}const sae=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],$D="RadioGroup",[oae,APe]=Sn($D,[dd,RD]),ND=dd(),DD=RD(),[aae,cae]=oae($D),lae=C.forwardRef((t,e)=>{const{__scopeRadioGroup:r,name:n,defaultValue:i,value:s,required:o=!1,disabled:a=!1,orientation:c,dir:l,loop:u=!0,onValueChange:f,...d}=t,h=ND(r),p=Wg(l),[v,b]=fc({prop:s,defaultProp:i,onChange:f});return C.createElement(aae,{scope:r,name:n,required:o,disabled:a,value:v,onValueChange:b},C.createElement(JN,ht({asChild:!0},h,{orientation:c,dir:p,loop:u}),C.createElement(Ze.div,ht({role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":a?"":void 0,dir:p},d,{ref:e}))))}),uae="RadioGroupItem",fae=C.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...i}=t,s=cae(uae,r),o=s.disabled||n,a=ND(r),c=DD(r),l=C.useRef(null),u=Gt(e,l),f=s.value===i.value,d=C.useRef(!1);return C.useEffect(()=>{const h=v=>{sae.includes(v.key)&&(d.current=!0)},p=()=>d.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",p)}},[]),C.createElement(X3,ht({asChild:!0},a,{focusable:!o,active:f}),C.createElement(tae,ht({disabled:o,required:s.required,checked:f},c,i,{name:s.name,ref:u,onCheck:()=>s.onValueChange(i.value),onKeyDown:Ee(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Ee(i.onFocus,()=>{var h;d.current&&((h=l.current)===null||h===void 0||h.click())})})))}),dae=C.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,i=DD(r);return C.createElement(nae,ht({},i,n,{ref:e}))}),hae=lae,pae=fae,vae=dae;var mae=fr({defaultClassName:"io59uy8 io59uy7 fyvr11h0 fyvr11ko fyvr11jg fyvr11hw fyvr128 fyvr15o fyvr12rt",variantClassNames:{size:{sm:"io59uy9",lg:"io59uya"}},defaultVariants:{},compoundVariants:[]}),yae=fr({defaultClassName:"io59uy3 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr12nb fyvr12fz fyvr121b fyvr128n fyvr12nh fyvr12g5 fyvr121h fyvr128t fyvr11ob fyvr12uz fyvr12uv fyvr12vj",variantClassNames:{size:{sm:"io59uy4 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8",lg:"io59uy5 fyvr11ac fyvr11ao fyvr11b0 fyvr11bc"}},defaultVariants:{},compoundVariants:[]});const gae=t=>{const{id:e,label:r,size:n="sm",value:i,disabled:s}=t;return G.jsx(z,{alignItems:"center",children:G.jsx(tu,{disabled:s,display:"flex",id:e,label:r,labelLocation:"right",children:G.jsx(pae,{className:yae({size:n}),value:i,id:e,disabled:s,children:G.jsx(vae,{className:mae({size:n})})})})})};C.forwardRef((t,e)=>{const{flexDirection:r="column",disabled:n=!1,gap:i="2",name:s,options:o,size:a="sm",...c}=t;return G.jsx(hae,{disabled:n,name:s,ref:e,...c,children:G.jsx(z,{flexDirection:r,gap:i,children:o.map(({label:l,value:u,disabled:f})=>G.jsx(gae,{id:`${s}-${u}`,label:l,size:a,value:u,disabled:f},u))})})});function AP(t,[e,r]){return Math.min(r,Math.max(e,t))}const LD=C.forwardRef((t,e)=>C.createElement(Ze.span,ke({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}))),bae=[" ","Enter","ArrowUp","ArrowDown"],wae=[" ","Enter"],Yg="Select",[Jg,nS,Eae]=zg(Yg),[hd,_Pe]=Sn(Yg,[Eae,fd]),iS=fd(),[xae,iu]=hd(Yg),[Cae,Sae]=hd(Yg),kae=t=>{const{__scopeSelect:e,children:r,open:n,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:f,disabled:d,required:h}=t,p=iS(e),[v,b]=C.useState(null),[y,m]=C.useState(null),[g,S]=C.useState(!1),P=Wg(l),[T=!1,w]=fc({prop:n,defaultProp:i,onChange:s}),[I,B]=fc({prop:o,defaultProp:a,onChange:c}),j=C.useRef(null),H=v?!!v.closest("form"):!0,[K,F]=C.useState(new Set),E=Array.from(K).map(_=>_.props.value).join(";");return C.createElement(Rie,p,C.createElement(xae,{required:h,scope:e,trigger:v,onTriggerChange:b,valueNode:y,onValueNodeChange:m,valueNodeHasChildren:g,onValueNodeHasChildrenChange:S,contentId:tc(),value:I,onValueChange:B,open:T,onOpenChange:w,dir:P,triggerPointerDownPosRef:j,disabled:d},C.createElement(Jg.Provider,{scope:e},C.createElement(Cae,{scope:t.__scopeSelect,onNativeOptionAdd:C.useCallback(_=>{F(O=>new Set(O).add(_))},[]),onNativeOptionRemove:C.useCallback(_=>{F(O=>{const N=new Set(O);return N.delete(_),N})},[])},r)),H?C.createElement(jD,{key:E,"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:f,value:I,onChange:_=>B(_.target.value),disabled:d},I===void 0?C.createElement("option",{value:""}):null,Array.from(K)):null))},Aae="SelectTrigger",_ae=C.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...i}=t,s=iS(r),o=iu(Aae,r),a=o.disabled||n,c=Gt(e,o.onTriggerChange),l=nS(r),[u,f,d]=UD(p=>{const v=l().filter(m=>!m.disabled),b=v.find(m=>m.value===o.value),y=zD(v,p,b);y!==void 0&&o.onValueChange(y.value)}),h=()=>{a||(o.onOpenChange(!0),d())};return C.createElement(Mie,ke({asChild:!0},s),C.createElement(Ze.button,ke({type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":FD(o.value)?"":void 0},i,{ref:c,onClick:Ee(i.onClick,p=>{p.currentTarget.focus()}),onPointerDown:Ee(i.onPointerDown,p=>{const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&(h(),o.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)},p.preventDefault())}),onKeyDown:Ee(i.onKeyDown,p=>{const v=u.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&f(p.key),!(v&&p.key===" ")&&bae.includes(p.key)&&(h(),p.preventDefault())})})))}),Pae="SelectValue",Tae=C.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...a}=t,c=iu(Pae,r),{onValueNodeHasChildrenChange:l}=c,u=s!==void 0,f=Gt(e,c.onValueNodeChange);return Wi(()=>{l(u)},[l,u]),C.createElement(Ze.span,ke({},a,{ref:f,style:{pointerEvents:"none"}}),FD(c.value)?C.createElement(C.Fragment,null,o):s)}),Iae=C.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...i}=t;return C.createElement(Ze.span,ke({"aria-hidden":!0},i,{ref:e}),n||"▼")}),Ff="SelectContent",Oae=C.forwardRef((t,e)=>{const r=iu(Ff,t.__scopeSelect),[n,i]=C.useState();if(Wi(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?As.createPortal(C.createElement(BD,{scope:t.__scopeSelect},C.createElement(Jg.Slot,{scope:t.__scopeSelect},C.createElement("div",null,t.children))),s):null}return C.createElement(Rae,ke({},t,{ref:e}))}),So=10,[BD,Xg]=hd(Ff),Rae=C.forwardRef((t,e)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:p,hideWhenDetached:v,avoidCollisions:b,...y}=t,m=iu(Ff,r),[g,S]=C.useState(null),[P,T]=C.useState(null),w=Gt(e,W=>S(W)),[I,B]=C.useState(null),[j,H]=C.useState(null),K=nS(r),[F,E]=C.useState(!1),_=C.useRef(!1);C.useEffect(()=>{if(g)return ZN(g)},[g]),ON();const O=C.useCallback(W=>{const[q,...Y]=K().map(Z=>Z.ref.current),[X]=Y.slice(-1),Q=document.activeElement;for(const Z of W)if(Z===Q||(Z==null||Z.scrollIntoView({block:"nearest"}),Z===q&&P&&(P.scrollTop=0),Z===X&&P&&(P.scrollTop=P.scrollHeight),Z==null||Z.focus(),document.activeElement!==Q))return},[K,P]),N=C.useCallback(()=>O([I,g]),[O,I,g]);C.useEffect(()=>{F&&N()},[F,N]);const{onOpenChange:k,triggerPointerDownPosRef:M}=m;C.useEffect(()=>{if(g){let W={x:0,y:0};const q=X=>{var Q,Z,ae,se;W={x:Math.abs(Math.round(X.pageX)-((Q=(Z=M.current)===null||Z===void 0?void 0:Z.x)!==null&&Q!==void 0?Q:0)),y:Math.abs(Math.round(X.pageY)-((ae=(se=M.current)===null||se===void 0?void 0:se.y)!==null&&ae!==void 0?ae:0))}},Y=X=>{W.x<=10&&W.y<=10?X.preventDefault():g.contains(X.target)||k(!1),document.removeEventListener("pointermove",q),M.current=null};return M.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",Y,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",Y,{capture:!0})}}},[g,k,M]),C.useEffect(()=>{const W=()=>k(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[k]);const[L,$]=UD(W=>{const q=K().filter(Q=>!Q.disabled),Y=q.find(Q=>Q.ref.current===document.activeElement),X=zD(q,W,Y);X&&setTimeout(()=>X.ref.current.focus())}),A=C.useCallback((W,q,Y)=>{const X=!_.current&&!Y;(m.value!==void 0&&m.value===q||X)&&(B(W),X&&(_.current=!0))},[m.value]),D=C.useCallback(()=>g==null?void 0:g.focus(),[g]),V=C.useCallback((W,q,Y)=>{const X=!_.current&&!Y;(m.value!==void 0&&m.value===q||X)&&H(W)},[m.value]),R=n==="popper"?_P:Mae,U=R===_P?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:p,hideWhenDetached:v,avoidCollisions:b}:{};return C.createElement(BD,{scope:r,content:g,viewport:P,onViewportChange:T,itemRefCallback:A,selectedItem:I,onItemLeave:D,itemTextRefCallback:V,focusSelectedItem:N,selectedItemText:j,position:n,isPositioned:F,searchRef:L},C.createElement(cD,{as:Lf,allowPinchZoom:!0},C.createElement(RN,{asChild:!0,trapped:m.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:Ee(i,W=>{var q;(q=m.trigger)===null||q===void 0||q.focus({preventScroll:!0}),W.preventDefault()})},C.createElement(H3,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>m.onOpenChange(!1)},C.createElement(R,ke({role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:W=>W.preventDefault()},y,U,{onPlaced:()=>E(!0),ref:w,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Ee(y.onKeyDown,W=>{const q=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!q&&W.key.length===1&&$(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let X=K().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes(W.key)&&(X=X.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const Q=W.target,Z=X.indexOf(Q);X=X.slice(Z+1)}setTimeout(()=>O(X)),W.preventDefault()}})}))))))}),Mae=C.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:n,...i}=t,s=iu(Ff,r),o=Xg(Ff,r),[a,c]=C.useState(null),[l,u]=C.useState(null),f=Gt(e,w=>u(w)),d=nS(r),h=C.useRef(!1),p=C.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:y,focusSelectedItem:m}=o,g=C.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&v&&b&&y){const w=s.trigger.getBoundingClientRect(),I=l.getBoundingClientRect(),B=s.valueNode.getBoundingClientRect(),j=y.getBoundingClientRect();if(s.dir!=="rtl"){const Q=j.left-I.left,Z=B.left-Q,ae=w.left-Z,se=w.width+ae,ue=Math.max(se,I.width),ot=window.innerWidth-So,Pe=AP(Z,[So,ot-ue]);a.style.minWidth=se+"px",a.style.left=Pe+"px"}else{const Q=I.right-j.right,Z=window.innerWidth-B.right-Q,ae=window.innerWidth-w.right-Z,se=w.width+ae,ue=Math.max(se,I.width),ot=window.innerWidth-So,Pe=AP(Z,[So,ot-ue]);a.style.minWidth=se+"px",a.style.right=Pe+"px"}const H=d(),K=window.innerHeight-So*2,F=v.scrollHeight,E=window.getComputedStyle(l),_=parseInt(E.borderTopWidth,10),O=parseInt(E.paddingTop,10),N=parseInt(E.borderBottomWidth,10),k=parseInt(E.paddingBottom,10),M=_+O+F+k+N,L=Math.min(b.offsetHeight*5,M),$=window.getComputedStyle(v),A=parseInt($.paddingTop,10),D=parseInt($.paddingBottom,10),V=w.top+w.height/2-So,R=K-V,U=b.offsetHeight/2,W=b.offsetTop+U,q=_+O+W,Y=M-q;if(q<=V){const Q=b===H[H.length-1].ref.current;a.style.bottom="0px";const Z=l.clientHeight-v.offsetTop-v.offsetHeight,ae=Math.max(R,U+(Q?D:0)+Z+N),se=q+ae;a.style.height=se+"px"}else{const Q=b===H[0].ref.current;a.style.top="0px";const ae=Math.max(V,_+v.offsetTop+(Q?A:0)+U)+Y;a.style.height=ae+"px",v.scrollTop=q-V+v.offsetTop}a.style.margin=`${So}px 0`,a.style.minHeight=L+"px",a.style.maxHeight=K+"px",n==null||n(),requestAnimationFrame(()=>h.current=!0)}},[d,s.trigger,s.valueNode,a,l,v,b,y,s.dir,n]);Wi(()=>g(),[g]);const[S,P]=C.useState();Wi(()=>{l&&P(window.getComputedStyle(l).zIndex)},[l]);const T=C.useCallback(w=>{w&&p.current===!0&&(g(),m==null||m(),p.current=!1)},[g,m]);return C.createElement($ae,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:T},C.createElement("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S}},C.createElement(Ze.div,ke({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),_P=C.forwardRef((t,e)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=So,...s}=t,o=iS(r);return C.createElement($ie,ke({},o,s,{ref:e,align:n,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[$ae,Nae]=hd(Ff,{}),PP="SelectViewport",Dae=C.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=Xg(PP,r),s=Nae(PP,r),o=Gt(e,i.onViewportChange),a=C.useRef(0);return C.createElement(C.Fragment,null,C.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),C.createElement(Jg.Slot,{scope:r},C.createElement(Ze.div,ke({"data-radix-select-viewport":"",role:"presentation"},n,{ref:o,style:{position:"relative",flex:1,overflow:"auto",...n.style},onScroll:Ee(n.onScroll,c=>{const l=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=s;if(f!=null&&f.current&&u){const d=Math.abs(a.current-l.scrollTop);if(d>0){const h=window.innerHeight-So*2,p=parseFloat(u.style.minHeight),v=parseFloat(u.style.height),b=Math.max(p,v);if(b0?g:0,u.style.justifyContent="flex-end")}}}a.current=l.scrollTop})}))))}),Lae="SelectGroup",[Bae,PPe]=hd(Lae),Fae=C.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=tc();return C.createElement(Bae,{scope:r,id:i},C.createElement(Ze.div,ke({role:"group","aria-labelledby":i},n,{ref:e})))}),aC="SelectItem",[jae,Uae]=hd(aC),zae=C.forwardRef((t,e)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...o}=t,a=iu(aC,r),c=Xg(aC,r),l=a.value===n,[u,f]=C.useState(s??""),[d,h]=C.useState(!1),p=Gt(e,y=>{var m;return(m=c.itemRefCallback)===null||m===void 0?void 0:m.call(c,y,n,i)}),v=tc(),b=()=>{i||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return C.createElement(jae,{scope:r,value:n,disabled:i,textId:v,isSelected:l,onItemTextChange:C.useCallback(y=>{f(m=>{var g;return m||((g=y==null?void 0:y.textContent)!==null&&g!==void 0?g:"").trim()})},[])},C.createElement(Jg.ItemSlot,{scope:r,value:n,disabled:i,textValue:u},C.createElement(Ze.div,ke({role:"option","aria-labelledby":v,"data-highlighted":d?"":void 0,"aria-selected":l&&d,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},o,{ref:p,onFocus:Ee(o.onFocus,()=>h(!0)),onBlur:Ee(o.onBlur,()=>h(!1)),onPointerUp:Ee(o.onPointerUp,b),onPointerMove:Ee(o.onPointerMove,y=>{if(i){var m;(m=c.onItemLeave)===null||m===void 0||m.call(c)}else y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ee(o.onPointerLeave,y=>{if(y.currentTarget===document.activeElement){var m;(m=c.onItemLeave)===null||m===void 0||m.call(c)}}),onKeyDown:Ee(o.onKeyDown,y=>{var m;((m=c.searchRef)===null||m===void 0?void 0:m.current)!==""&&y.key===" "||(wae.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})}))))}),qp="SelectItemText",Wae=C.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,...s}=t,o=iu(qp,r),a=Xg(qp,r),c=Uae(qp,r),l=Sae(qp,r),[u,f]=C.useState(null),d=Gt(e,y=>f(y),c.onItemTextChange,y=>{var m;return(m=a.itemTextRefCallback)===null||m===void 0?void 0:m.call(a,y,c.value,c.disabled)}),h=u==null?void 0:u.textContent,p=C.useMemo(()=>C.createElement("option",{key:c.value,value:c.value,disabled:c.disabled},h),[c.disabled,c.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=l;return Wi(()=>(v(p),()=>b(p)),[v,b,p]),C.createElement(C.Fragment,null,C.createElement(Ze.span,ke({id:c.textId},s,{ref:d})),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?As.createPortal(s.children,o.valueNode):null)});function FD(t){return t===""||t===void 0}const jD=C.forwardRef((t,e)=>{const{value:r,...n}=t,i=C.useRef(null),s=Gt(e,i),o=Dg(r);return C.useEffect(()=>{const a=i.current,c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==r&&u){const f=new Event("change",{bubbles:!0});u.call(a,r),a.dispatchEvent(f)}},[o,r]),C.createElement(LD,{asChild:!0},C.createElement("select",ke({},n,{ref:s,defaultValue:r})))});jD.displayName="BubbleSelect";function UD(t){const e=zi(t),r=C.useRef(""),n=C.useRef(0),i=C.useCallback(o=>{const a=r.current+o;e(a),function c(l){r.current=l,window.clearTimeout(n.current),l!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(a)},[e]),s=C.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function zD(t,e,r){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let o=Hae(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function Hae(t,e){return t.map((r,n)=>t[(e+n)%t.length])}const qae=kae,Vae=_ae,Gae=Tae,Kae=Iae,Qae=Oae,Yae=Dae,Jae=Fae,Xae=zae,Zae=Wae;var ece="gohwuma fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr11ls fyvr11m8 fyvr11ms fyvr11tt fyvr12rt fyvr11nj",tce="gohwume _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1ww fyvr1ys fyvr1t0 fyvr1uw fyvr12wk fyvr12wl fyvr12we fyvr12wf fyvr11h0 fyvr11jw fyvr11ko fyvr12uz fyvr12uv fyvr12rt fyvr12vt fyvr12vj",rce="gohwum1 _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11ko fyvr11ob fyvr11hc fyvr11f4 fyvr12rt fyvr118c fyvr11jw fyvr11n2 fyvr12uz",nce=fr({defaultClassName:"gohwum5",variantClassNames:{borderRadius:{xs:"fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]});const ice=C.forwardRef(({children:t,className:e,...r},n)=>G.jsx(Xae,{className:Si(tce,e),...r,ref:n,children:G.jsx(Zae,{children:t})}));C.forwardRef((t,e)=>{const{borderRadius:r="md",disabled:n=!1,id:i,label:s="",description:o,labelLocation:a="hidden",name:c,options:l,placeholder:u,...f}=t;return G.jsx(tu,{disabled:n,display:"grid",id:i??c,label:s,labelLocation:a,description:o,whiteSpace:"nowrap",children:G.jsxs(qae,{disabled:n,name:c,...f,children:[G.jsxs(Vae,{id:i??c,className:Si(rce,nce({borderRadius:r})),ref:e,children:[G.jsx(Gae,{placeholder:u}),G.jsx(z,{as:Kae,display:"inline-flex",children:G.jsx(kN,{})})]}),G.jsx(Qae,{className:ece,children:G.jsx(Yae,{children:G.jsx(Jae,{children:l.map(({value:d,label:h,...p})=>G.jsx(ice,{value:d,...p,children:h},d))})})})]})})});C.forwardRef((t,e)=>{const{controls:r,onChange:n,placeholder:i="Search",name:s="search",value:o,...a}=t,c=o?G.jsx(Xo,{icon:ru,size:"xs",onClick:()=>n==null?void 0:n({target:{value:""}})}):void 0;return G.jsx(Mc,{ref:e,name:s,leftIcon:jg,controls:r||c,placeholder:i,value:o,onChange:l=>n==null?void 0:n(l),...a})});var sce=fr({defaultClassName:"en4abt1",variantClassNames:{size:{sm:"en4abt2",md:"en4abt3",lg:"en4abt4"}},defaultVariants:{},compoundVariants:[]});const sS=C.forwardRef((t,e)=>{const{size:r="md",...n}=t;return G.jsx(z,{className:sce({size:r}),color:"text50",ref:e,...n,children:G.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:[G.jsx("circle",{cx:"12",cy:"12",fill:"none",r:"10.5",strokeDasharray:"42",strokeLinecap:"round"}),G.jsx("circle",{cx:"12",cy:"12",fill:"none",opacity:"0.25",r:"10.5",strokeLinecap:"round"})]})})});C.forwardRef(({children:t},e)=>G.jsx(z,{ref:e,width:"fit",height:"fit",onClick:r=>{r.preventDefault(),r.stopPropagation()},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation())},children:t}));const WD="Switch",[oce,TPe]=Sn(WD),[ace,cce]=oce(WD),lce=C.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...u}=t,[f,d]=C.useState(null),h=Gt(e,m=>d(m)),p=C.useRef(!1),v=f?!!f.closest("form"):!0,[b=!1,y]=fc({prop:i,defaultProp:s,onChange:l});return C.createElement(ace,{scope:r,checked:b,disabled:a},C.createElement(Ze.button,ht({type:"button",role:"switch","aria-checked":b,"aria-required":o,"data-state":HD(b),"data-disabled":a?"":void 0,disabled:a,value:c},u,{ref:h,onClick:Ee(t.onClick,m=>{y(g=>!g),v&&(p.current=m.isPropagationStopped(),p.current||m.stopPropagation())})})),v&&C.createElement(dce,{control:f,bubbles:!p.current,name:n,value:c,checked:b,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),uce="SwitchThumb",fce=C.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,i=cce(uce,r);return C.createElement(Ze.span,ht({"data-state":HD(i.checked),"data-disabled":i.disabled?"":void 0},n,{ref:e}))}),dce=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=C.useRef(null),o=Dg(r),a=Lg(e);return C.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(d)}},[o,r,n]),C.createElement("input",ht({type:"checkbox","aria-hidden":!0,defaultChecked:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function HD(t){return t?"checked":"unchecked"}const hce=lce,pce=fce;var vce="_1lp2u8e1 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr1ss fyvr1uo fyvr1wk fyvr1yg fyvr11sz fyvr11hw fyvr12uz",mce="_1lp2u8e3 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr11ho fyvr1ko fyvr1oo fyvr1k fyvr140 fyvr11nz";const TP=t=>{const{disabled:e,label:r,labelLocation:n="left",description:i,id:s,name:o,...a}=t;return G.jsx(tu,{disabled:e,display:"flex",id:s??o,label:r,labelLocation:n,description:i,whiteSpace:"nowrap",children:G.jsx(hce,{className:vce,disabled:e,...a,children:G.jsx(z,{position:"relative",width:"full",height:"full",children:G.jsx(pce,{className:mce})})})})};fr({defaultClassName:"nwwh3z7",variantClassNames:{variant:{pill:"nwwh3z8",line:"nwwh3z9 fyvr11g0"},active:{true:"fyvr12vx",false:"nwwh3zb"},disabled:{true:"fyvr12vh"}},defaultVariants:{},compoundVariants:[[{active:!0,variant:"pill"},"fyvr11u5 fyvr12sb"],[{active:!1,variant:"pill"},"fyvr11ob fyvr12rz"],[{active:!0,variant:"line"},"fyvr12rt"],[{active:!1,variant:"line"},"fyvr12rz"]]});const qD="Tabs",[yce,IPe]=Sn(qD,[dd]),VD=dd(),[gce,oS]=yce(qD),bce=C.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:a,activationMode:c="automatic",...l}=t,u=Wg(a),[f,d]=fc({prop:n,onChange:i,defaultProp:s});return C.createElement(gce,{scope:r,baseId:tc(),value:f,onValueChange:d,orientation:o,dir:u,activationMode:c},C.createElement(Ze.div,ht({dir:u,"data-orientation":o},l,{ref:e})))}),wce="TabsList",Ece=C.forwardRef((t,e)=>{const{__scopeTabs:r,loop:n=!0,...i}=t,s=oS(wce,r),o=VD(r);return C.createElement(JN,ht({asChild:!0},o,{orientation:s.orientation,dir:s.dir,loop:n}),C.createElement(Ze.div,ht({role:"tablist","aria-orientation":s.orientation},i,{ref:e})))}),xce="TabsTrigger",Cce=C.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...s}=t,o=oS(xce,r),a=VD(r),c=GD(o.baseId,n),l=KD(o.baseId,n),u=n===o.value;return C.createElement(X3,ht({asChild:!0},a,{focusable:!i,active:u}),C.createElement(Ze.button,ht({type:"button",role:"tab","aria-selected":u,"aria-controls":l,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c},s,{ref:e,onMouseDown:Ee(t.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?o.onValueChange(n):f.preventDefault()}),onKeyDown:Ee(t.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(n)}),onFocus:Ee(t.onFocus,()=>{const f=o.activationMode!=="manual";!u&&!i&&f&&o.onValueChange(n)})})))}),Sce="TabsContent",kce=C.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,forceMount:i,children:s,...o}=t,a=oS(Sce,r),c=GD(a.baseId,n),l=KD(a.baseId,n),u=n===a.value,f=C.useRef(u);return C.useEffect(()=>{const d=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(d)},[]),C.createElement(Oc,{present:i||u},({present:d})=>C.createElement(Ze.div,ht({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:l,tabIndex:0},o,{ref:e,style:{...t.style,animationDuration:f.current?"0s":void 0}}),d&&s))});function GD(t,e){return`${t}-trigger-${e}`}function KD(t,e){return`${t}-content-${e}`}const Ace=bce,_ce=Ece,Pce=Cce;var Tce="_10c8o0n1 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr11h0 fyvr11hw fyvr128 fyvr11sh fyvr14o",Ice="_10c8o0n5 fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr11ho fyvr1ko fyvr1oo fyvr14c fyvr11tt fyvr12vz",Oce="_10c8o0n3 fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr12wh fyvr12wb fyvr128 fyvr15o fyvr12uz fyvr11hw fyvr11ob fyvr11n2 fyvr12rz";const Rce=t=>{const{tabs:e,value:r}=t;if(!e.length)return null;const n=100/e.length,i=e.findIndex(s=>s.value===r);return G.jsxs(_ce,{className:Tce,style:{outline:void 0},children:[G.jsx(z,{display:"flex",position:"absolute",inset:"2",height:"8",children:G.jsx("div",{className:Ice,style:{width:`${n}%`,transform:`translateX(${i*100}%)`}})}),e.map(s=>G.jsx(Pce,{className:Oce,value:s.value,children:G.jsx(ne,{variant:"normal",fontWeight:"bold",children:s.label})},s.value))]})},Mce=Ace,IP=kce;var $ce="_1qxj1ib9 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr1wo fyvr1yk fyvr1ss fyvr1uo fyvr11hc fyvr118c fyvr11n7";C.forwardRef((t,e)=>{const{icon:r,label:n,...i}=t;return G.jsxs(z,{className:$ce,ref:e,background:"buttonGlass",...i,children:[r&&G.jsx(r,{size:"xs"}),G.jsx(ne,{children:n})]})});const Nce="ToastProvider",[Dce,OPe,Lce]=zg("Toast"),[QD,RPe]=Sn("Toast",[Lce]),[MPe,YD]=QD(Nce),OP="toast.viewportPause",RP="toast.viewportResume",Zg="Toast",Bce="toast.swipeStart",Fce="toast.swipeMove",jce="toast.swipeCancel",Uce="toast.swipeEnd",[zce,Wce]=QD(Zg,{onClose(){}}),Hce=C.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:d,onSwipeEnd:h,...p}=t,v=YD(Zg,r),[b,y]=C.useState(null),m=Gt(e,E=>y(E)),g=C.useRef(null),S=C.useRef(null),P=i||v.duration,T=C.useRef(0),w=C.useRef(P),I=C.useRef(0),{onToastAdd:B,onToastRemove:j}=v,H=zi(()=>{var E;(b==null?void 0:b.contains(document.activeElement))&&((E=v.viewport)===null||E===void 0||E.focus()),o()}),K=C.useCallback(E=>{!E||E===1/0||(window.clearTimeout(I.current),T.current=new Date().getTime(),I.current=window.setTimeout(H,E))},[H]);C.useEffect(()=>{const E=v.viewport;if(E){const _=()=>{K(w.current),l==null||l()},O=()=>{const N=new Date().getTime()-T.current;w.current=w.current-N,window.clearTimeout(I.current),c==null||c()};return E.addEventListener(OP,O),E.addEventListener(RP,_),()=>{E.removeEventListener(OP,O),E.removeEventListener(RP,_)}}},[v.viewport,P,c,l,K]),C.useEffect(()=>{s&&!v.isClosePausedRef.current&&K(P)},[s,P,v.isClosePausedRef,K]),C.useEffect(()=>(B(),()=>j()),[B,j]);const F=C.useMemo(()=>b?XD(b):null,[b]);return v.viewport?C.createElement(C.Fragment,null,F&&C.createElement(qce,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0},F),C.createElement(zce,{scope:r,onClose:H},As.createPortal(C.createElement(Dce.ItemSlot,{scope:r},C.createElement($ne,{asChild:!0,onEscapeKeyDown:Ee(a,()=>{v.isFocusedToastEscapeKeyDownRef.current||H(),v.isFocusedToastEscapeKeyDownRef.current=!1})},C.createElement(Ze.li,ke({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":v.swipeDirection},p,{ref:m,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Ee(t.onKeyDown,E=>{E.key==="Escape"&&(a==null||a(E.nativeEvent),E.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,H()))}),onPointerDown:Ee(t.onPointerDown,E=>{E.button===0&&(g.current={x:E.clientX,y:E.clientY})}),onPointerMove:Ee(t.onPointerMove,E=>{if(!g.current)return;const _=E.clientX-g.current.x,O=E.clientY-g.current.y,N=!!S.current,k=["left","right"].includes(v.swipeDirection),M=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,L=k?M(0,_):0,$=k?0:M(0,O),A=E.pointerType==="touch"?10:2,D={x:L,y:$},V={originalEvent:E,delta:D};N?(S.current=D,Vp(Fce,f,V,{discrete:!1})):MP(D,v.swipeDirection,A)?(S.current=D,Vp(Bce,u,V,{discrete:!1}),E.target.setPointerCapture(E.pointerId)):(Math.abs(_)>A||Math.abs(O)>A)&&(g.current=null)}),onPointerUp:Ee(t.onPointerUp,E=>{const _=S.current,O=E.target;if(O.hasPointerCapture(E.pointerId)&&O.releasePointerCapture(E.pointerId),S.current=null,g.current=null,_){const N=E.currentTarget,k={originalEvent:E,delta:_};MP(_,v.swipeDirection,v.swipeThreshold)?Vp(Uce,h,k,{discrete:!0}):Vp(jce,d,k,{discrete:!0}),N.addEventListener("click",M=>M.preventDefault(),{once:!0})}})})))),v.viewport))):null});Hce.propTypes={type(t){if(t.type&&!["foreground","background"].includes(t.type)){const e=`Invalid prop \`type\` supplied to \`${Zg}\`. Expected \`foreground | background\`.`;return new Error(e)}return null}};const qce=t=>{const{__scopeToast:e,children:r,...n}=t,i=YD(Zg,e),[s,o]=C.useState(!1),[a,c]=C.useState(!1);return Yce(()=>o(!0)),C.useEffect(()=>{const l=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:C.createElement(KN,{asChild:!0},C.createElement(LD,n,s&&C.createElement(C.Fragment,null,i.label," ",r)))},Vce="ToastAction",Gce=C.forwardRef((t,e)=>{const{altText:r,...n}=t;return r?C.createElement(JD,{altText:r,asChild:!0},C.createElement(Qce,ke({},n,{ref:e}))):null});Gce.propTypes={altText(t){return t.altText?null:new Error(`Missing prop \`altText\` expected on \`${Vce}\``)}};const Kce="ToastClose",Qce=C.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,i=Wce(Kce,r);return C.createElement(JD,{asChild:!0},C.createElement(Ze.button,ke({type:"button"},n,{ref:e,onClick:Ee(t.onClick,i.onClose)})))}),JD=C.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...i}=t;return C.createElement(Ze.div,ke({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0},i,{ref:e}))});function XD(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),Jce(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...XD(n))}}),e}function Vp(t,e,r,{discrete:n}){const i=r.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?W3(i,s):i.dispatchEvent(s)}const MP=(t,e,r=0)=>{const n=Math.abs(t.x),i=Math.abs(t.y),s=n>i;return e==="left"||e==="right"?s&&n>r:!s&&i>r};function Yce(t=()=>{}){const e=zi(t);Wi(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function Jce(t){return t.nodeType===t.ELEMENT_NODE}fr({defaultClassName:"_6wut8v3",variantClassNames:{variant:{normal:"_6wut8v4",success:"_6wut8v5",error:"_6wut8v6"}},defaultVariants:{},compoundVariants:[]});C.createContext(null);var Xce="_15pztn2",Zce="_15pztn1 _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11ko fyvr11ob fyvr12rt fyvr128 fyvr11h0";C.forwardRef((t,e)=>{const{as:r="textarea",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",name:u,rows:f,resize:d=!1,...h}=t;return G.jsx(tu,{description:s,disabled:o,display:"grid",id:a??u,label:c,labelLocation:l,children:G.jsx(z,{as:r,autoComplete:n,spellCheck:"false",className:Si(Zce,d&&Xce),disabled:o,id:a??u,name:u,ref:e,rows:f,borderRadius:i,...h})})});var ele="bnrrebg fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr11ls fyvr11m8 fyvr11jg fyvr11ko fyvr11sh fyvr128 fyvr15o fyvr11h0",tle="bnrrebe",rle=fr({defaultClassName:"bnrreb5 fyvr11ls fyvr11m8 fyvr11jg fyvr11ko fyvr11h0",variantClassNames:{size:{xs:"bnrreb6",sm:"bnrreb7",md:"bnrreb8",lg:"bnrreb9"},borderRadius:{circle:"fyvr11dc fyvr11e0 fyvr11c0 fyvr11co",lg:"fyvr11d8 fyvr11dw fyvr11bw fyvr11ck",md:"fyvr11d4 fyvr11ds fyvr11bs fyvr11cg",sm:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc"}},defaultVariants:{},compoundVariants:[]});C.memo(t=>{const{borderRadius:e="circle",className:r,disableAnimation:n=!1,style:i,src:s,symbol:o,size:a="md",...c}=t;return G.jsx(z,{className:Si(r,rle({borderRadius:e,size:a})),style:i,flexShrink:"0",...c,children:s?G.jsx(mr,{className:tle,disableAnimation:n,src:s}):G.jsx(ne,{className:ele,variant:"normal",fontWeight:"medium",color:"text50",uppercase:!0,children:o==null?void 0:o.replace(/\s/,"").slice(0,4)})})});const[eb,$Pe]=Sn("Tooltip",[fd]);fd();const nle="TooltipProvider";eb(nle);const ZD="Tooltip";eb(ZD);const ile="TooltipPortal";eb(ile,{forceMount:void 0});eb(ZD,{isInside:!1});const sle=(t,e={})=>{const r=new Map().set("isMobile",`@media screen and (max-width: ${Q_.lg-1}px)`).set("isDesktop",`@media screen and (min-width: ${Q_.lg}px)`);if(!t.startsWith("@media")){const c=r.get(t);if(!c||c==="")throw new Error(`useMediaQuery failed to get breakpoint from theme for: ${t}`);t=c}const n=t.replace(/^@media( ?)/m,""),i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:s=!1}=e,[o,a]=C.useState(()=>i?window.matchMedia(n).matches:s);return C.useEffect(()=>{let c=!0;if(!i)return;const l=window.matchMedia(n),u=()=>{c&&a(l.matches)};return u(),l.addListener(u),()=>{c=!1,l.removeListener(u)}},[n,i]),o};function ole({storage:t,key:e="REACT_QUERY_OFFLINE_CACHE",throttleTime:r=1e3,serialize:n=JSON.stringify,deserialize:i=JSON.parse,retry:s}){if(t){const o=a=>{try{t.setItem(e,n(a));return}catch(c){return c}};return{persistClient:ale(a=>{let c=a,l=o(c),u=0;for(;l&&c;)u++,c=s==null?void 0:s({persistedClient:c,error:l,errorCount:u}),c&&(l=o(c))},r),restoreClient:()=>{const a=t.getItem(e);if(a)return i(a)},removeClient:()=>{t.removeItem(e)}}}return{persistClient:$P,restoreClient:()=>{},removeClient:$P}}function ale(t,e=100){let r=null,n;return function(...i){n=i,r===null&&(r=setTimeout(()=>{t(...n),r=null},e))}}function $P(){}class pd{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){const r={listener:e};return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const D0=typeof window>"u"||"Deno"in window;function Ii(){}function cle(t,e){return typeof t=="function"?t(e):t}function cC(t){return typeof t=="number"&&t>=0&&t!==1/0}function eL(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Yu(t,e,r){return N1(t)?typeof e=="function"?{...r,queryKey:t,queryFn:e}:{...e,queryKey:t}:t}function tL(t,e,r){return N1(t)?typeof e=="function"?{...r,mutationKey:t,mutationFn:e}:{...e,mutationKey:t}:typeof t=="function"?{...e,mutationFn:t}:{...t}}function Ra(t,e,r){return N1(t)?[{...e,queryKey:t},r]:[t||{},e]}function NP(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(N1(o)){if(n){if(e.queryHash!==aS(o,e.options))return!1}else if(!sy(e.queryKey,o))return!1}if(r!=="all"){const c=e.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||typeof i<"u"&&i!==e.state.fetchStatus||s&&!s(e))}function DP(t,e){const{exact:r,fetching:n,predicate:i,mutationKey:s}=t;if(N1(s)){if(!e.options.mutationKey)return!1;if(r){if(vl(e.options.mutationKey)!==vl(s))return!1}else if(!sy(e.options.mutationKey,s))return!1}return!(typeof n=="boolean"&&e.state.status==="loading"!==n||i&&!i(e))}function aS(t,e){return((e==null?void 0:e.queryKeyHashFn)||vl)(t)}function vl(t){return JSON.stringify(t,(e,r)=>lC(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function sy(t,e){return rL(t,e)}function rL(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!rL(t[r],e[r])):!1}function nL(t,e){if(t===e)return t;const r=LP(t)&&LP(e);if(r||lC(t)&&lC(e)){const n=r?t.length:Object.keys(t).length,i=r?e:Object.keys(e),s=i.length,o=r?[]:{};let a=0;for(let c=0;c"u")return!0;const r=e.prototype;return!(!BP(r)||!r.hasOwnProperty("isPrototypeOf"))}function BP(t){return Object.prototype.toString.call(t)==="[object Object]"}function N1(t){return Array.isArray(t)}function iL(t){return new Promise(e=>{setTimeout(e,t)})}function FP(t){iL(0).then(t)}function lle(){if(typeof AbortController=="function")return new AbortController}function uC(t,e,r){return r.isDataEqual!=null&&r.isDataEqual(t,e)?t:typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?nL(t,e):e}class ule extends pd{constructor(){super(),this.setup=e=>{if(!D0&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),window.addEventListener("focus",r,!1),()=>{window.removeEventListener("visibilitychange",r),window.removeEventListener("focus",r)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var r;this.setup=e,(r=this.cleanup)==null||r.call(this),this.cleanup=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.focused!==e&&(this.focused=e,this.onFocus())}onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const ay=new ule,jP=["online","offline"];class fle extends pd{constructor(){super(),this.setup=e=>{if(!D0&&window.addEventListener){const r=()=>e();return jP.forEach(n=>{window.addEventListener(n,r,!1)}),()=>{jP.forEach(n=>{window.removeEventListener(n,r)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var r;this.setup=e,(r=this.cleanup)==null||r.call(this),this.cleanup=e(n=>{typeof n=="boolean"?this.setOnline(n):this.onOnline()})}setOnline(e){this.online!==e&&(this.online=e,this.onOnline())}onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const cy=new fle;function dle(t){return Math.min(1e3*2**t,3e4)}function tb(t){return(t??"online")==="online"?cy.isOnline():!0}class sL{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}}function Dv(t){return t instanceof sL}function oL(t){let e=!1,r=0,n=!1,i,s,o;const a=new Promise((b,y)=>{s=b,o=y}),c=b=>{n||(h(new sL(b)),t.abort==null||t.abort())},l=()=>{e=!0},u=()=>{e=!1},f=()=>!ay.isFocused()||t.networkMode!=="always"&&!cy.isOnline(),d=b=>{n||(n=!0,t.onSuccess==null||t.onSuccess(b),i==null||i(),s(b))},h=b=>{n||(n=!0,t.onError==null||t.onError(b),i==null||i(),o(b))},p=()=>new Promise(b=>{i=y=>{const m=n||!f();return m&&b(y),m},t.onPause==null||t.onPause()}).then(()=>{i=void 0,n||t.onContinue==null||t.onContinue()}),v=()=>{if(n)return;let b;try{b=t.fn()}catch(y){b=Promise.reject(y)}Promise.resolve(b).then(d).catch(y=>{var m,g;if(n)return;const S=(m=t.retry)!=null?m:3,P=(g=t.retryDelay)!=null?g:dle,T=typeof P=="function"?P(r,y):P,w=S===!0||typeof S=="number"&&r{if(f())return p()}).then(()=>{e?h(y):v()})})};return tb(t.networkMode)?v():p().then(v),{promise:a,cancel:c,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:l,continueRetry:u}}const cS=console;function hle(){let t=[],e=0,r=u=>{u()},n=u=>{u()};const i=u=>{let f;e++;try{f=u()}finally{e--,e||a()}return f},s=u=>{e?t.push(u):FP(()=>{r(u)})},o=u=>(...f)=>{s(()=>{u(...f)})},a=()=>{const u=t;t=[],u.length&&FP(()=>{n(()=>{u.forEach(f=>{r(f)})})})};return{batch:i,batchCalls:o,schedule:s,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u}}}const yt=hle();class aL{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cC(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,e??(D0?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class ple extends aL{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||cS,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||vle(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&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(e,r){const n=uC(this.state.data,e,this.options);return this.dispatch({data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){this.dispatch({type:"setState",state:e,setStateOptions:r})}cancel(e){var r;const n=this.promise;return(r=this.retryer)==null||r.cancel(e),n?n.then(Ii).catch(Ii):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>e.options.enabled!==!1)}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||!eL(this.state.dataUpdatedAt,e)}onFocus(){var e;const r=this.observers.find(n=>n.shouldFetchOnWindowFocus());r&&r.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}onOnline(){var e;const r=this.observers.find(n=>n.shouldFetchOnReconnect());r&&r.refetch({cancelRefetch:!1}),(e=this.retryer)==null||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(r=>r!==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,r){var n,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&r!=null&&r.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var s;return(s=this.retryer)==null||s.continueRetry(),this.promise}}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const o=lle(),a={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},c=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>{if(o)return this.abortSignalConsumed=!0,o.signal}})};c(a);const l=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(a)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),u={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:l};if(c(u),(n=this.options.behavior)==null||n.onFetch(u),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=u.fetchOptions)==null?void 0:i.meta)){var f;this.dispatch({type:"fetch",meta:(f=u.fetchOptions)==null?void 0:f.meta})}const d=h=>{if(Dv(h)&&h.silent||this.dispatch({type:"error",error:h}),!Dv(h)){var p,v,b,y;(p=(v=this.cache.config).onError)==null||p.call(v,h,this),(b=(y=this.cache.config).onSettled)==null||b.call(y,this.state.data,h,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=oL({fn:u.fetchFn,abort:o==null?void 0:o.abort.bind(o),onSuccess:h=>{var p,v,b,y;if(typeof h>"u"){d(new Error(this.queryHash+" data is undefined"));return}this.setData(h),(p=(v=this.cache.config).onSuccess)==null||p.call(v,h,this),(b=(y=this.cache.config).onSettled)==null||b.call(y,h,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:d,onFail:(h,p)=>{this.dispatch({type:"failed",failureCount:h,error:p})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){const r=n=>{var i,s;switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=e.meta)!=null?i:null,fetchStatus:tb(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:(s=e.dataUpdatedAt)!=null?s:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=e.error;return Dv(o)&&o.revert&&this.revertState?{...this.revertState,fetchStatus:"idle"}:{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),yt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}function vle(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=typeof e<"u",n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}class mle extends pd{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,r,n){var i;const s=r.queryKey,o=(i=r.queryHash)!=null?i:aS(s,r);let a=this.get(o);return a||(a=new ple({cache:this,logger:e.getLogger(),queryKey:s,queryHash:o,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){const r=this.queriesMap[e.queryHash];r&&(e.destroy(),this.queries=this.queries.filter(n=>n!==e),r===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){yt.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,r){const[n]=Ra(e,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(i=>NP(n,i))}findAll(e,r){const[n]=Ra(e,r);return Object.keys(n).length>0?this.queries.filter(i=>NP(n,i)):this.queries}notify(e){yt.batch(()=>{this.listeners.forEach(({listener:r})=>{r(e)})})}onFocus(){yt.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){yt.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class yle extends aL{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||cS,this.observers=[],this.state=e.state||cL(),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(r=>r!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,r;return(e=(r=this.retryer)==null?void 0:r.continue())!=null?e:this.execute()}async execute(){const e=()=>{var w;return this.retryer=oL({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(I,B)=>{this.dispatch({type:"failed",failureCount:I,error:B})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(w=this.options.retry)!=null?w:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},r=this.state.status==="loading";try{var n,i,s,o,a,c,l,u;if(!r){var f,d,h,p;this.dispatch({type:"loading",variables:this.options.variables}),await((f=(d=this.mutationCache.config).onMutate)==null?void 0:f.call(d,this.state.variables,this));const I=await((h=(p=this.options).onMutate)==null?void 0:h.call(p,this.state.variables));I!==this.state.context&&this.dispatch({type:"loading",context:I,variables:this.state.variables})}const w=await e();return await((n=(i=this.mutationCache.config).onSuccess)==null?void 0:n.call(i,w,this.state.variables,this.state.context,this)),await((s=(o=this.options).onSuccess)==null?void 0:s.call(o,w,this.state.variables,this.state.context)),await((a=(c=this.mutationCache.config).onSettled)==null?void 0:a.call(c,w,null,this.state.variables,this.state.context,this)),await((l=(u=this.options).onSettled)==null?void 0:l.call(u,w,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:w}),w}catch(w){try{var v,b,y,m,g,S,P,T;throw await((v=(b=this.mutationCache.config).onError)==null?void 0:v.call(b,w,this.state.variables,this.state.context,this)),await((y=(m=this.options).onError)==null?void 0:y.call(m,w,this.state.variables,this.state.context)),await((g=(S=this.mutationCache.config).onSettled)==null?void 0:g.call(S,void 0,w,this.state.variables,this.state.context,this)),await((P=(T=this.options).onSettled)==null?void 0:P.call(T,void 0,w,this.state.variables,this.state.context)),w}finally{this.dispatch({type:"error",error:w})}}}dispatch(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"loading":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!tb(this.options.networkMode),status:"loading",variables:e.variables};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"};case"setState":return{...n,...e.state}}};this.state=r(this.state),yt.batch(()=>{this.observers.forEach(n=>{n.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function cL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class gle extends pd{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,r,n){const i=new yle({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(r),state:n,defaultOptions:r.mutationKey?e.getMutationDefaults(r.mutationKey):void 0});return this.add(i),i}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(r=>r!==e),this.notify({type:"removed",mutation:e})}clear(){yt.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return typeof e.exact>"u"&&(e.exact=!0),this.mutations.find(r=>DP(e,r))}findAll(e){return this.mutations.filter(r=>DP(e,r))}notify(e){yt.batch(()=>{this.listeners.forEach(({listener:r})=>{r(e)})})}resumePausedMutations(){var e;return this.resuming=((e=this.resuming)!=null?e:Promise.resolve()).then(()=>{const r=this.mutations.filter(n=>n.state.isPaused);return yt.batch(()=>r.reduce((n,i)=>n.then(()=>i.continue().catch(Ii)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function fC(){return{onFetch:t=>{t.fetchFn=()=>{var e,r,n,i,s,o;const a=(e=t.fetchOptions)==null||(r=e.meta)==null?void 0:r.refetchPage,c=(n=t.fetchOptions)==null||(i=n.meta)==null?void 0:i.fetchMore,l=c==null?void 0:c.pageParam,u=(c==null?void 0:c.direction)==="forward",f=(c==null?void 0:c.direction)==="backward",d=((s=t.state.data)==null?void 0:s.pages)||[],h=((o=t.state.data)==null?void 0:o.pageParams)||[];let p=h,v=!1;const b=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>{var w;if((w=t.signal)!=null&&w.aborted)v=!0;else{var I;(I=t.signal)==null||I.addEventListener("abort",()=>{v=!0})}return t.signal}})},y=t.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+t.options.queryHash+"'")),m=(T,w,I,B)=>(p=B?[w,...p]:[...p,w],B?[I,...T]:[...T,I]),g=(T,w,I,B)=>{if(v)return Promise.reject("Cancelled");if(typeof I>"u"&&!w&&T.length)return Promise.resolve(T);const j={queryKey:t.queryKey,pageParam:I,meta:t.options.meta};b(j);const H=y(j);return Promise.resolve(H).then(F=>m(T,I,F,B))};let S;if(!d.length)S=g([]);else if(u){const T=typeof l<"u",w=T?l:dC(t.options,d);S=g(d,T,w)}else if(f){const T=typeof l<"u",w=T?l:lL(t.options,d);S=g(d,T,w,!0)}else{p=[];const T=typeof t.options.getNextPageParam>"u";S=(a&&d[0]?a(d[0],0,d):!0)?g([],T,h[0]):Promise.resolve(m([],h[0],d[0]));for(let I=1;I{if(a&&d[I]?a(d[I],I,d):!0){const H=T?h[I]:dC(t.options,B);return g(B,T,H)}return Promise.resolve(m(B,h[I],d[I]))})}return S.then(T=>({pages:T,pageParams:p}))}}}}function dC(t,e){return t.getNextPageParam==null?void 0:t.getNextPageParam(e[e.length-1],e)}function lL(t,e){return t.getPreviousPageParam==null?void 0:t.getPreviousPageParam(e[0],e)}function ble(t,e){if(t.getNextPageParam&&Array.isArray(e)){const r=dC(t,e);return typeof r<"u"&&r!==null&&r!==!1}}function wle(t,e){if(t.getPreviousPageParam&&Array.isArray(e)){const r=lL(t,e);return typeof r<"u"&&r!==null&&r!==!1}}class lS{constructor(e={}){this.queryCache=e.queryCache||new mle,this.mutationCache=e.mutationCache||new gle,this.logger=e.logger||cS,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=ay.subscribe(()=>{ay.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=cy.subscribe(()=>{cy.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,r;this.mountCount--,this.mountCount===0&&((e=this.unsubscribeFocus)==null||e.call(this),this.unsubscribeFocus=void 0,(r=this.unsubscribeOnline)==null||r.call(this),this.unsubscribeOnline=void 0)}isFetching(e,r){const[n]=Ra(e,r);return n.fetchStatus="fetching",this.queryCache.findAll(n).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,r){var n;return(n=this.queryCache.find(e,r))==null?void 0:n.state.data}ensureQueryData(e,r,n){const i=Yu(e,r,n),s=this.getQueryData(i.queryKey);return s?Promise.resolve(s):this.fetchQuery(i)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:r,state:n})=>{const i=n.data;return[r,i]})}setQueryData(e,r,n){const i=this.queryCache.find(e),s=i==null?void 0:i.state.data,o=cle(r,s);if(typeof o>"u")return;const a=Yu(e),c=this.defaultQueryOptions(a);return this.queryCache.build(this,c).setData(o,{...n,manual:!0})}setQueriesData(e,r,n){return yt.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,r,n)]))}getQueryState(e,r){var n;return(n=this.queryCache.find(e,r))==null?void 0:n.state}removeQueries(e,r){const[n]=Ra(e,r),i=this.queryCache;yt.batch(()=>{i.findAll(n).forEach(s=>{i.remove(s)})})}resetQueries(e,r,n){const[i,s]=Ra(e,r,n),o=this.queryCache,a={type:"active",...i};return yt.batch(()=>(o.findAll(i).forEach(c=>{c.reset()}),this.refetchQueries(a,s)))}cancelQueries(e,r,n){const[i,s={}]=Ra(e,r,n);typeof s.revert>"u"&&(s.revert=!0);const o=yt.batch(()=>this.queryCache.findAll(i).map(a=>a.cancel(s)));return Promise.all(o).then(Ii).catch(Ii)}invalidateQueries(e,r,n){const[i,s]=Ra(e,r,n);return yt.batch(()=>{var o,a;if(this.queryCache.findAll(i).forEach(l=>{l.invalidate()}),i.refetchType==="none")return Promise.resolve();const c={...i,type:(o=(a=i.refetchType)!=null?a:i.type)!=null?o:"active"};return this.refetchQueries(c,s)})}refetchQueries(e,r,n){const[i,s]=Ra(e,r,n),o=yt.batch(()=>this.queryCache.findAll(i).filter(c=>!c.isDisabled()).map(c=>{var l;return c.fetch(void 0,{...s,cancelRefetch:(l=s==null?void 0:s.cancelRefetch)!=null?l:!0,meta:{refetchPage:i.refetchPage}})}));let a=Promise.all(o).then(Ii);return s!=null&&s.throwOnError||(a=a.catch(Ii)),a}fetchQuery(e,r,n){const i=Yu(e,r,n),s=this.defaultQueryOptions(i);typeof s.retry>"u"&&(s.retry=!1);const o=this.queryCache.build(this,s);return o.isStaleByTime(s.staleTime)?o.fetch(s):Promise.resolve(o.state.data)}prefetchQuery(e,r,n){return this.fetchQuery(e,r,n).then(Ii).catch(Ii)}fetchInfiniteQuery(e,r,n){const i=Yu(e,r,n);return i.behavior=fC(),this.fetchQuery(i)}prefetchInfiniteQuery(e,r,n){return this.fetchInfiniteQuery(e,r,n).then(Ii).catch(Ii)}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,r){const n=this.queryDefaults.find(i=>vl(e)===vl(i.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:e,defaultOptions:r})}getQueryDefaults(e){if(!e)return;const r=this.queryDefaults.find(n=>sy(e,n.queryKey));return r==null?void 0:r.defaultOptions}setMutationDefaults(e,r){const n=this.mutationDefaults.find(i=>vl(e)===vl(i.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:e,defaultOptions:r})}getMutationDefaults(e){if(!e)return;const r=this.mutationDefaults.find(n=>sy(e,n.mutationKey));return r==null?void 0:r.defaultOptions}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const r={...this.defaultOptions.queries,...this.getQueryDefaults(e==null?void 0:e.queryKey),...e,_defaulted:!0};return!r.queryHash&&r.queryKey&&(r.queryHash=aS(r.queryKey,r)),typeof r.refetchOnReconnect>"u"&&(r.refetchOnReconnect=r.networkMode!=="always"),typeof r.useErrorBoundary>"u"&&(r.useErrorBoundary=!!r.suspense),r}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(e==null?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class uS extends pd{constructor(e,r){super(),this.client=e,this.options=r,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(r)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),UP(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return hC(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return hC(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,r){const n=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),oy(n,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),this.updateQuery();const s=this.hasListeners();s&&zP(this.currentQuery,i,this.options,n)&&this.executeFetch(),this.updateResult(r),s&&(this.currentQuery!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&this.updateStaleTimeout();const o=this.computeRefetchInterval();s&&(this.currentQuery!==i||this.options.enabled!==n.enabled||o!==this.currentRefetchInterval)&&this.updateRefetchInterval(o)}getOptimisticResult(e){const r=this.client.getQueryCache().build(this.client,e),n=this.createResult(r,e);return xle(this,n,e)&&(this.currentResult=n,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),n}getCurrentResult(){return this.currentResult}trackResult(e){const r={};return Object.keys(e).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(n),e[n])})}),r}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...r}={}){return this.fetch({...r,meta:{refetchPage:e}})}fetchOptimistic(e){const r=this.client.defaultQueryOptions(e),n=this.client.getQueryCache().build(this.client,r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(e){var r;return this.executeFetch({...e,cancelRefetch:(r=e.cancelRefetch)!=null?r:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let r=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(Ii)),r}updateStaleTimeout(){if(this.clearStaleTimeout(),D0||this.currentResult.isStale||!cC(this.options.staleTime))return;const r=eL(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},r)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(D0||this.options.enabled===!1||!cC(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||ay.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,r){const n=this.currentQuery,i=this.options,s=this.currentResult,o=this.currentResultState,a=this.currentResultOptions,c=e!==n,l=c?e.state:this.currentQueryInitialState,u=c?this.currentResult:this.previousQueryResult,{state:f}=e;let{dataUpdatedAt:d,error:h,errorUpdatedAt:p,fetchStatus:v,status:b}=f,y=!1,m=!1,g;if(r._optimisticResults){const I=this.hasListeners(),B=!I&&UP(e,r),j=I&&zP(e,n,r,i);(B||j)&&(v=tb(e.options.networkMode)?"fetching":"paused",d||(b="loading")),r._optimisticResults==="isRestoring"&&(v="idle")}if(r.keepPreviousData&&!f.dataUpdatedAt&&u!=null&&u.isSuccess&&b!=="error")g=u.data,d=u.dataUpdatedAt,b=u.status,y=!0;else if(r.select&&typeof f.data<"u")if(s&&f.data===(o==null?void 0:o.data)&&r.select===this.selectFn)g=this.selectResult;else try{this.selectFn=r.select,g=r.select(f.data),g=uC(s==null?void 0:s.data,g,r),this.selectResult=g,this.selectError=null}catch(I){this.selectError=I}else g=f.data;if(typeof r.placeholderData<"u"&&typeof g>"u"&&b==="loading"){let I;if(s!=null&&s.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData))I=s.data;else if(I=typeof r.placeholderData=="function"?r.placeholderData():r.placeholderData,r.select&&typeof I<"u")try{I=r.select(I),this.selectError=null}catch(B){this.selectError=B}typeof I<"u"&&(b="success",g=uC(s==null?void 0:s.data,I,r),m=!0)}this.selectError&&(h=this.selectError,g=this.selectResult,p=Date.now(),b="error");const S=v==="fetching",P=b==="loading",T=b==="error";return{status:b,fetchStatus:v,isLoading:P,isSuccess:b==="success",isError:T,isInitialLoading:P&&S,data:g,dataUpdatedAt:d,error:h,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>l.dataUpdateCount||f.errorUpdateCount>l.errorUpdateCount,isFetching:S,isRefetching:S&&!P,isLoadingError:T&&f.dataUpdatedAt===0,isPaused:v==="paused",isPlaceholderData:m,isPreviousData:y,isRefetchError:T&&f.dataUpdatedAt!==0,isStale:fS(e,r),refetch:this.refetch,remove:this.remove}}updateResult(e){const r=this.currentResult,n=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,oy(n,r))return;this.currentResult=n;const i={cache:!0},s=()=>{if(!r)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!this.trackedProps.size)return!0;const c=new Set(a??this.trackedProps);return this.options.useErrorBoundary&&c.add("error"),Object.keys(this.currentResult).some(l=>{const u=l;return this.currentResult[u]!==r[u]&&c.has(u)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),this.notify({...i,...e})}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const r=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const r={};e.type==="success"?r.onSuccess=!e.manual:e.type==="error"&&!Dv(e.error)&&(r.onError=!0),this.updateResult(r),this.hasListeners()&&this.updateTimers()}notify(e){yt.batch(()=>{if(e.onSuccess){var r,n,i,s;(r=(n=this.options).onSuccess)==null||r.call(n,this.currentResult.data),(i=(s=this.options).onSettled)==null||i.call(s,this.currentResult.data,null)}else if(e.onError){var o,a,c,l;(o=(a=this.options).onError)==null||o.call(a,this.currentResult.error),(c=(l=this.options).onSettled)==null||c.call(l,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:u})=>{u(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function Ele(t,e){return e.enabled!==!1&&!t.state.dataUpdatedAt&&!(t.state.status==="error"&&e.retryOnMount===!1)}function UP(t,e){return Ele(t,e)||t.state.dataUpdatedAt>0&&hC(t,e,e.refetchOnMount)}function hC(t,e,r){if(e.enabled!==!1){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&fS(t,e)}return!1}function zP(t,e,r,n){return r.enabled!==!1&&(t!==e||n.enabled===!1)&&(!r.suspense||t.state.status!=="error")&&fS(t,r)}function fS(t,e){return t.isStaleByTime(e.staleTime)}function xle(t,e,r){return r.keepPreviousData?!1:r.placeholderData!==void 0?e.isPlaceholderData:!oy(t.getCurrentResult(),e)}class Cle extends uS{constructor(e,r){super(e,r)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,r){super.setOptions({...e,behavior:fC()},r)}getOptimisticResult(e){return e.behavior=fC(),super.getOptimisticResult(e)}fetchNextPage({pageParam:e,...r}={}){return this.fetch({...r,meta:{fetchMore:{direction:"forward",pageParam:e}}})}fetchPreviousPage({pageParam:e,...r}={}){return this.fetch({...r,meta:{fetchMore:{direction:"backward",pageParam:e}}})}createResult(e,r){var n,i,s,o,a,c;const{state:l}=e,u=super.createResult(e,r),{isFetching:f,isRefetching:d}=u,h=f&&((n=l.fetchMeta)==null||(i=n.fetchMore)==null?void 0:i.direction)==="forward",p=f&&((s=l.fetchMeta)==null||(o=s.fetchMore)==null?void 0:o.direction)==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:ble(r,(a=l.data)==null?void 0:a.pages),hasPreviousPage:wle(r,(c=l.data)==null?void 0:c.pages),isFetchingNextPage:h,isFetchingPreviousPage:p,isRefetching:d&&!h&&!p}}}let Sle=class extends pd{constructor(e,r){super(),this.client=e,this.setOptions(r),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var r;const n=this.options;this.options=this.client.defaultMutationOptions(e),oy(n,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),(r=this.currentMutation)==null||r.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.currentMutation)==null||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();const r={listeners:!0};e.type==="success"?r.onSuccess=!0:e.type==="error"&&(r.onError=!0),this.notify(r)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,r){return this.mutateOptions=r,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof e<"u"?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const e=this.currentMutation?this.currentMutation.state:cL(),r={...e,isLoading:e.status==="loading",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=r}notify(e){yt.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(e.onSuccess){var r,n,i,s;(r=(n=this.mutateOptions).onSuccess)==null||r.call(n,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(i=(s=this.mutateOptions).onSettled)==null||i.call(s,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(e.onError){var o,a,c,l;(o=(a=this.mutateOptions).onError)==null||o.call(a,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(c=(l=this.mutateOptions).onSettled)==null||c.call(l,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}e.listeners&&this.listeners.forEach(({listener:u})=>{u(this.currentResult)})})}};function kle(t){return{mutationKey:t.options.mutationKey,state:t.state}}function Ale(t){return{state:t.state,queryKey:t.queryKey,queryHash:t.queryHash}}function _le(t){return t.state.isPaused}function Ple(t){return t.state.status==="success"}function Tle(t,e={}){const r=[],n=[];if(e.dehydrateMutations!==!1){const i=e.shouldDehydrateMutation||_le;t.getMutationCache().getAll().forEach(s=>{i(s)&&r.push(kle(s))})}if(e.dehydrateQueries!==!1){const i=e.shouldDehydrateQuery||Ple;t.getQueryCache().getAll().forEach(s=>{i(s)&&n.push(Ale(s))})}return{mutations:r,queries:n}}function Ile(t,e,r){if(typeof e!="object"||e===null)return;const n=t.getMutationCache(),i=t.getQueryCache(),s=e.mutations||[],o=e.queries||[];s.forEach(a=>{var c;n.build(t,{...r==null||(c=r.defaultOptions)==null?void 0:c.mutations,mutationKey:a.mutationKey},a.state)}),o.forEach(({queryKey:a,state:c,queryHash:l})=>{var u;const f=i.get(l);if(f){if(f.state.dataUpdatedAt{const{__scopeRadio:r,name:n,checked:i=!1,required:s,disabled:o,value:a="on",onCheck:c,...l}=t,[u,f]=C.useState(null),d=Gt(e,v=>f(v)),h=C.useRef(!1),p=u?!!u.closest("form"):!0;return C.createElement(Nae,{scope:r,checked:i,disabled:o},C.createElement(et.button,ht({type:"button",role:"radio","aria-checked":i,"data-state":lL(i),"data-disabled":o?"":void 0,disabled:o,value:a},l,{ref:d,onClick:Ee(t.onClick,v=>{i||c==null||c(),p&&(h.current=v.isPropagationStopped(),h.current||v.stopPropagation())})})),p&&C.createElement(jae,{control:u,bubbles:!h.current,name:n,value:a,checked:i,required:s,disabled:o,style:{transform:"translateX(-100%)"}}))}),Fae="RadioIndicator",Bae=C.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...i}=t,s=Dae(Fae,r);return C.createElement(Oc,{present:n||s.checked},C.createElement(et.span,ht({"data-state":lL(s.checked),"data-disabled":s.disabled?"":void 0},i,{ref:e})))}),jae=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=C.useRef(null),o=Hg(r),a=qg(e);return C.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(d)}},[o,r,n]),C.createElement("input",ht({type:"radio","aria-hidden":!0,defaultChecked:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function lL(t){return t?"checked":"unchecked"}const Uae=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],uL="RadioGroup",[zae,uTe]=Sn(uL,[vd,cL]),fL=vd(),dL=cL(),[Wae,Hae]=zae(uL),qae=C.forwardRef((t,e)=>{const{__scopeRadioGroup:r,name:n,defaultValue:i,value:s,required:o=!1,disabled:a=!1,orientation:c,dir:l,loop:u=!0,onValueChange:f,...d}=t,h=fL(r),p=Jg(l),[v,b]=dc({prop:s,defaultProp:i,onChange:f});return C.createElement(Wae,{scope:r,name:n,required:o,disabled:a,value:v,onValueChange:b},C.createElement(_D,ht({asChild:!0},h,{orientation:c,dir:p,loop:u}),C.createElement(et.div,ht({role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":a?"":void 0,dir:p},d,{ref:e}))))}),Vae="RadioGroupItem",Gae=C.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...i}=t,s=Hae(Vae,r),o=s.disabled||n,a=fL(r),c=dL(r),l=C.useRef(null),u=Gt(e,l),f=s.value===i.value,d=C.useRef(!1);return C.useEffect(()=>{const h=v=>{Uae.includes(v.key)&&(d.current=!0)},p=()=>d.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",p)}},[]),C.createElement(cS,ht({asChild:!0},a,{focusable:!o,active:f}),C.createElement(Lae,ht({disabled:o,required:s.required,checked:f},c,i,{name:s.name,ref:u,onCheck:()=>s.onValueChange(i.value),onKeyDown:Ee(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Ee(i.onFocus,()=>{var h;d.current&&((h=l.current)===null||h===void 0||h.click())})})))}),Kae=C.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,i=dL(r);return C.createElement(Bae,ht({},i,n,{ref:e}))}),Qae=qae,Yae=Gae,Jae=Kae;var Xae=fr({defaultClassName:"io59uy8 io59uy7 fyvr11h0 fyvr11ko fyvr11jg fyvr11hw fyvr128 fyvr15o fyvr12rt",variantClassNames:{size:{sm:"io59uy9",lg:"io59uya"}},defaultVariants:{},compoundVariants:[]}),Zae=fr({defaultClassName:"io59uy3 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr12nb fyvr12fz fyvr121b fyvr128n fyvr12nh fyvr12g5 fyvr121h fyvr128t fyvr11ob fyvr12uz fyvr12uv fyvr12vj",variantClassNames:{size:{sm:"io59uy4 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8",lg:"io59uy5 fyvr11ac fyvr11ao fyvr11b0 fyvr11bc"}},defaultVariants:{},compoundVariants:[]});const ece=t=>{const{id:e,label:r,size:n="sm",value:i,disabled:s}=t;return G.jsx(z,{alignItems:"center",children:G.jsx(ru,{disabled:s,display:"flex",id:e,label:r,labelLocation:"right",children:G.jsx(Yae,{className:Zae({size:n}),value:i,id:e,disabled:s,children:G.jsx(Jae,{className:Xae({size:n})})})})})};C.forwardRef((t,e)=>{const{flexDirection:r="column",disabled:n=!1,gap:i="2",name:s,options:o,size:a="sm",...c}=t;return G.jsx(Qae,{disabled:n,name:s,ref:e,...c,children:G.jsx(z,{flexDirection:r,gap:i,children:o.map(({label:l,value:u,disabled:f})=>G.jsx(ece,{id:`${s}-${u}`,label:l,size:a,value:u,disabled:f},u))})})});function DP(t,[e,r]){return Math.min(r,Math.max(e,t))}const hL=C.forwardRef((t,e)=>C.createElement(et.span,Ae({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}))),tce=[" ","Enter","ArrowUp","ArrowDown"],rce=[" ","Enter"],ib="Select",[sb,hS,nce]=Yg(ib),[md,fTe]=Sn(ib,[nce,pd]),pS=pd(),[ice,su]=md(ib),[sce,oce]=md(ib),ace=t=>{const{__scopeSelect:e,children:r,open:n,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:f,disabled:d,required:h}=t,p=pS(e),[v,b]=C.useState(null),[y,m]=C.useState(null),[g,S]=C.useState(!1),P=Jg(l),[T=!1,w]=dc({prop:n,defaultProp:i,onChange:s}),[I,F]=dc({prop:o,defaultProp:a,onChange:c}),j=C.useRef(null),H=v?!!v.closest("form"):!0,[K,B]=C.useState(new Set),E=Array.from(K).map(_=>_.props.value).join(";");return C.createElement(pse,p,C.createElement(ice,{required:h,scope:e,trigger:v,onTriggerChange:b,valueNode:y,onValueNodeChange:m,valueNodeHasChildren:g,onValueNodeHasChildrenChange:S,contentId:rc(),value:I,onValueChange:F,open:T,onOpenChange:w,dir:P,triggerPointerDownPosRef:j,disabled:d},C.createElement(sb.Provider,{scope:e},C.createElement(sce,{scope:t.__scopeSelect,onNativeOptionAdd:C.useCallback(_=>{B(O=>new Set(O).add(_))},[]),onNativeOptionRemove:C.useCallback(_=>{B(O=>{const N=new Set(O);return N.delete(_),N})},[])},r)),H?C.createElement(mL,{key:E,"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:f,value:I,onChange:_=>F(_.target.value),disabled:d},I===void 0?C.createElement("option",{value:""}):null,Array.from(K)):null))},cce="SelectTrigger",lce=C.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...i}=t,s=pS(r),o=su(cce,r),a=o.disabled||n,c=Gt(e,o.onTriggerChange),l=hS(r),[u,f,d]=yL(p=>{const v=l().filter(m=>!m.disabled),b=v.find(m=>m.value===o.value),y=gL(v,p,b);y!==void 0&&o.onValueChange(y.value)}),h=()=>{a||(o.onOpenChange(!0),d())};return C.createElement(vse,Ae({asChild:!0},s),C.createElement(et.button,Ae({type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":vL(o.value)?"":void 0},i,{ref:c,onClick:Ee(i.onClick,p=>{p.currentTarget.focus()}),onPointerDown:Ee(i.onPointerDown,p=>{const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&(h(),o.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)},p.preventDefault())}),onKeyDown:Ee(i.onKeyDown,p=>{const v=u.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&f(p.key),!(v&&p.key===" ")&&tce.includes(p.key)&&(h(),p.preventDefault())})})))}),uce="SelectValue",fce=C.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...a}=t,c=su(uce,r),{onValueNodeHasChildrenChange:l}=c,u=s!==void 0,f=Gt(e,c.onValueNodeChange);return Hi(()=>{l(u)},[l,u]),C.createElement(et.span,Ae({},a,{ref:f,style:{pointerEvents:"none"}}),vL(c.value)?C.createElement(C.Fragment,null,o):s)}),dce=C.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...i}=t;return C.createElement(et.span,Ae({"aria-hidden":!0},i,{ref:e}),n||"▼")}),zf="SelectContent",hce=C.forwardRef((t,e)=>{const r=su(zf,t.__scopeSelect),[n,i]=C.useState();if(Hi(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?Ts.createPortal(C.createElement(pL,{scope:t.__scopeSelect},C.createElement(sb.Slot,{scope:t.__scopeSelect},C.createElement("div",null,t.children))),s):null}return C.createElement(pce,Ae({},t,{ref:e}))}),ko=10,[pL,ob]=md(zf),pce=C.forwardRef((t,e)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:p,hideWhenDetached:v,avoidCollisions:b,...y}=t,m=su(zf,r),[g,S]=C.useState(null),[P,T]=C.useState(null),w=Gt(e,W=>S(W)),[I,F]=C.useState(null),[j,H]=C.useState(null),K=hS(r),[B,E]=C.useState(!1),_=C.useRef(!1);C.useEffect(()=>{if(g)return TD(g)},[g]),aD();const O=C.useCallback(W=>{const[q,...Y]=K().map(Z=>Z.ref.current),[X]=Y.slice(-1),Q=document.activeElement;for(const Z of W)if(Z===Q||(Z==null||Z.scrollIntoView({block:"nearest"}),Z===q&&P&&(P.scrollTop=0),Z===X&&P&&(P.scrollTop=P.scrollHeight),Z==null||Z.focus(),document.activeElement!==Q))return},[K,P]),N=C.useCallback(()=>O([I,g]),[O,I,g]);C.useEffect(()=>{B&&N()},[B,N]);const{onOpenChange:k,triggerPointerDownPosRef:$}=m;C.useEffect(()=>{if(g){let W={x:0,y:0};const q=X=>{var Q,Z,ae,se;W={x:Math.abs(Math.round(X.pageX)-((Q=(Z=$.current)===null||Z===void 0?void 0:Z.x)!==null&&Q!==void 0?Q:0)),y:Math.abs(Math.round(X.pageY)-((ae=(se=$.current)===null||se===void 0?void 0:se.y)!==null&&ae!==void 0?ae:0))}},Y=X=>{W.x<=10&&W.y<=10?X.preventDefault():g.contains(X.target)||k(!1),document.removeEventListener("pointermove",q),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",Y,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",Y,{capture:!0})}}},[g,k,$]),C.useEffect(()=>{const W=()=>k(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[k]);const[L,M]=yL(W=>{const q=K().filter(Q=>!Q.disabled),Y=q.find(Q=>Q.ref.current===document.activeElement),X=gL(q,W,Y);X&&setTimeout(()=>X.ref.current.focus())}),A=C.useCallback((W,q,Y)=>{const X=!_.current&&!Y;(m.value!==void 0&&m.value===q||X)&&(F(W),X&&(_.current=!0))},[m.value]),D=C.useCallback(()=>g==null?void 0:g.focus(),[g]),V=C.useCallback((W,q,Y)=>{const X=!_.current&&!Y;(m.value!==void 0&&m.value===q||X)&&H(W)},[m.value]),R=n==="popper"?LP:vce,U=R===LP?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:p,hideWhenDetached:v,avoidCollisions:b}:{};return C.createElement(pL,{scope:r,content:g,viewport:P,onViewportChange:T,itemRefCallback:A,selectedItem:I,onItemLeave:D,itemTextRefCallback:V,focusSelectedItem:N,selectedItemText:j,position:n,isPositioned:B,searchRef:L},C.createElement(FD,{as:jf,allowPinchZoom:!0},C.createElement(cD,{asChild:!0,trapped:m.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:Ee(i,W=>{var q;(q=m.trigger)===null||q===void 0||q.focus({preventScroll:!0}),W.preventDefault()})},C.createElement(eS,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>m.onOpenChange(!1)},C.createElement(R,Ae({role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:W=>W.preventDefault()},y,U,{onPlaced:()=>E(!0),ref:w,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Ee(y.onKeyDown,W=>{const q=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!q&&W.key.length===1&&M(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let X=K().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes(W.key)&&(X=X.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const Q=W.target,Z=X.indexOf(Q);X=X.slice(Z+1)}setTimeout(()=>O(X)),W.preventDefault()}})}))))))}),vce=C.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:n,...i}=t,s=su(zf,r),o=ob(zf,r),[a,c]=C.useState(null),[l,u]=C.useState(null),f=Gt(e,w=>u(w)),d=hS(r),h=C.useRef(!1),p=C.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:y,focusSelectedItem:m}=o,g=C.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&v&&b&&y){const w=s.trigger.getBoundingClientRect(),I=l.getBoundingClientRect(),F=s.valueNode.getBoundingClientRect(),j=y.getBoundingClientRect();if(s.dir!=="rtl"){const Q=j.left-I.left,Z=F.left-Q,ae=w.left-Z,se=w.width+ae,ue=Math.max(se,I.width),ot=window.innerWidth-ko,Te=DP(Z,[ko,ot-ue]);a.style.minWidth=se+"px",a.style.left=Te+"px"}else{const Q=I.right-j.right,Z=window.innerWidth-F.right-Q,ae=window.innerWidth-w.right-Z,se=w.width+ae,ue=Math.max(se,I.width),ot=window.innerWidth-ko,Te=DP(Z,[ko,ot-ue]);a.style.minWidth=se+"px",a.style.right=Te+"px"}const H=d(),K=window.innerHeight-ko*2,B=v.scrollHeight,E=window.getComputedStyle(l),_=parseInt(E.borderTopWidth,10),O=parseInt(E.paddingTop,10),N=parseInt(E.borderBottomWidth,10),k=parseInt(E.paddingBottom,10),$=_+O+B+k+N,L=Math.min(b.offsetHeight*5,$),M=window.getComputedStyle(v),A=parseInt(M.paddingTop,10),D=parseInt(M.paddingBottom,10),V=w.top+w.height/2-ko,R=K-V,U=b.offsetHeight/2,W=b.offsetTop+U,q=_+O+W,Y=$-q;if(q<=V){const Q=b===H[H.length-1].ref.current;a.style.bottom="0px";const Z=l.clientHeight-v.offsetTop-v.offsetHeight,ae=Math.max(R,U+(Q?D:0)+Z+N),se=q+ae;a.style.height=se+"px"}else{const Q=b===H[0].ref.current;a.style.top="0px";const ae=Math.max(V,_+v.offsetTop+(Q?A:0)+U)+Y;a.style.height=ae+"px",v.scrollTop=q-V+v.offsetTop}a.style.margin=`${ko}px 0`,a.style.minHeight=L+"px",a.style.maxHeight=K+"px",n==null||n(),requestAnimationFrame(()=>h.current=!0)}},[d,s.trigger,s.valueNode,a,l,v,b,y,s.dir,n]);Hi(()=>g(),[g]);const[S,P]=C.useState();Hi(()=>{l&&P(window.getComputedStyle(l).zIndex)},[l]);const T=C.useCallback(w=>{w&&p.current===!0&&(g(),m==null||m(),p.current=!1)},[g,m]);return C.createElement(mce,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:T},C.createElement("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S}},C.createElement(et.div,Ae({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),LP=C.forwardRef((t,e)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=ko,...s}=t,o=pS(r);return C.createElement(mse,Ae({},o,s,{ref:e,align:n,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[mce,yce]=md(zf,{}),FP="SelectViewport",gce=C.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=ob(FP,r),s=yce(FP,r),o=Gt(e,i.onViewportChange),a=C.useRef(0);return C.createElement(C.Fragment,null,C.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),C.createElement(sb.Slot,{scope:r},C.createElement(et.div,Ae({"data-radix-select-viewport":"",role:"presentation"},n,{ref:o,style:{position:"relative",flex:1,overflow:"auto",...n.style},onScroll:Ee(n.onScroll,c=>{const l=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=s;if(f!=null&&f.current&&u){const d=Math.abs(a.current-l.scrollTop);if(d>0){const h=window.innerHeight-ko*2,p=parseFloat(u.style.minHeight),v=parseFloat(u.style.height),b=Math.max(p,v);if(b0?g:0,u.style.justifyContent="flex-end")}}}a.current=l.scrollTop})}))))}),bce="SelectGroup",[wce,dTe]=md(bce),Ece=C.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=rc();return C.createElement(wce,{scope:r,id:i},C.createElement(et.div,Ae({role:"group","aria-labelledby":i},n,{ref:e})))}),vC="SelectItem",[xce,Cce]=md(vC),Sce=C.forwardRef((t,e)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...o}=t,a=su(vC,r),c=ob(vC,r),l=a.value===n,[u,f]=C.useState(s??""),[d,h]=C.useState(!1),p=Gt(e,y=>{var m;return(m=c.itemRefCallback)===null||m===void 0?void 0:m.call(c,y,n,i)}),v=rc(),b=()=>{i||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return C.createElement(xce,{scope:r,value:n,disabled:i,textId:v,isSelected:l,onItemTextChange:C.useCallback(y=>{f(m=>{var g;return m||((g=y==null?void 0:y.textContent)!==null&&g!==void 0?g:"").trim()})},[])},C.createElement(sb.ItemSlot,{scope:r,value:n,disabled:i,textValue:u},C.createElement(et.div,Ae({role:"option","aria-labelledby":v,"data-highlighted":d?"":void 0,"aria-selected":l&&d,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},o,{ref:p,onFocus:Ee(o.onFocus,()=>h(!0)),onBlur:Ee(o.onBlur,()=>h(!1)),onPointerUp:Ee(o.onPointerUp,b),onPointerMove:Ee(o.onPointerMove,y=>{if(i){var m;(m=c.onItemLeave)===null||m===void 0||m.call(c)}else y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ee(o.onPointerLeave,y=>{if(y.currentTarget===document.activeElement){var m;(m=c.onItemLeave)===null||m===void 0||m.call(c)}}),onKeyDown:Ee(o.onKeyDown,y=>{var m;((m=c.searchRef)===null||m===void 0?void 0:m.current)!==""&&y.key===" "||(rce.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})}))))}),Yp="SelectItemText",kce=C.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,...s}=t,o=su(Yp,r),a=ob(Yp,r),c=Cce(Yp,r),l=oce(Yp,r),[u,f]=C.useState(null),d=Gt(e,y=>f(y),c.onItemTextChange,y=>{var m;return(m=a.itemTextRefCallback)===null||m===void 0?void 0:m.call(a,y,c.value,c.disabled)}),h=u==null?void 0:u.textContent,p=C.useMemo(()=>C.createElement("option",{key:c.value,value:c.value,disabled:c.disabled},h),[c.disabled,c.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=l;return Hi(()=>(v(p),()=>b(p)),[v,b,p]),C.createElement(C.Fragment,null,C.createElement(et.span,Ae({id:c.textId},s,{ref:d})),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Ts.createPortal(s.children,o.valueNode):null)});function vL(t){return t===""||t===void 0}const mL=C.forwardRef((t,e)=>{const{value:r,...n}=t,i=C.useRef(null),s=Gt(e,i),o=Hg(r);return C.useEffect(()=>{const a=i.current,c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==r&&u){const f=new Event("change",{bubbles:!0});u.call(a,r),a.dispatchEvent(f)}},[o,r]),C.createElement(hL,{asChild:!0},C.createElement("select",Ae({},n,{ref:s,defaultValue:r})))});mL.displayName="BubbleSelect";function yL(t){const e=Wi(t),r=C.useRef(""),n=C.useRef(0),i=C.useCallback(o=>{const a=r.current+o;e(a),function c(l){r.current=l,window.clearTimeout(n.current),l!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(a)},[e]),s=C.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function gL(t,e,r){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let o=Ace(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function Ace(t,e){return t.map((r,n)=>t[(e+n)%t.length])}const _ce=ace,Pce=lce,Tce=fce,Ice=dce,Oce=hce,Rce=gce,$ce=Ece,Mce=Sce,Nce=kce;var Dce="gohwuma fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr11ls fyvr11m8 fyvr11ms fyvr11tt fyvr12rt fyvr11nj",Lce="gohwume _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1ww fyvr1ys fyvr1t0 fyvr1uw fyvr12wk fyvr12wl fyvr12we fyvr12wf fyvr11h0 fyvr11jw fyvr11ko fyvr12uz fyvr12uv fyvr12rt fyvr12vt fyvr12vj",Fce="gohwum1 _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11ko fyvr11ob fyvr11hc fyvr11f4 fyvr12rt fyvr118c fyvr11jw fyvr11n2 fyvr12uz",Bce=fr({defaultClassName:"gohwum5",variantClassNames:{borderRadius:{xs:"fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]});const jce=C.forwardRef(({children:t,className:e,...r},n)=>G.jsx(Mce,{className:ki(Lce,e),...r,ref:n,children:G.jsx(Nce,{children:t})}));C.forwardRef((t,e)=>{const{borderRadius:r="md",disabled:n=!1,id:i,label:s="",description:o,labelLocation:a="hidden",name:c,options:l,placeholder:u,...f}=t;return G.jsx(ru,{disabled:n,display:"grid",id:i??c,label:s,labelLocation:a,description:o,whiteSpace:"nowrap",children:G.jsxs(_ce,{disabled:n,name:c,...f,children:[G.jsxs(Pce,{id:i??c,className:ki(Fce,Bce({borderRadius:r})),ref:e,children:[G.jsx(Tce,{placeholder:u}),G.jsx(z,{as:Ice,display:"inline-flex",children:G.jsx(tD,{})})]}),G.jsx(Oce,{className:Dce,children:G.jsx(Rce,{children:G.jsx($ce,{children:l.map(({value:d,label:h,...p})=>G.jsx(jce,{value:d,...p,children:h},d))})})})]})})});C.forwardRef((t,e)=>{const{controls:r,onChange:n,placeholder:i="Search",name:s="search",value:o,...a}=t,c=o?G.jsx(Xo,{icon:nu,size:"xs",onClick:()=>n==null?void 0:n({target:{value:""}})}):void 0;return G.jsx($c,{ref:e,name:s,leftIcon:Kg,controls:r||c,placeholder:i,value:o,onChange:l=>n==null?void 0:n(l),...a})});var Uce=fr({defaultClassName:"en4abt1",variantClassNames:{size:{sm:"en4abt2",md:"en4abt3",lg:"en4abt4"}},defaultVariants:{},compoundVariants:[]});const vS=C.forwardRef((t,e)=>{const{size:r="md",...n}=t;return G.jsx(z,{className:Uce({size:r}),color:"text50",ref:e,...n,children:G.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:[G.jsx("circle",{cx:"12",cy:"12",fill:"none",r:"10.5",strokeDasharray:"42",strokeLinecap:"round"}),G.jsx("circle",{cx:"12",cy:"12",fill:"none",opacity:"0.25",r:"10.5",strokeLinecap:"round"})]})})});C.forwardRef(({children:t},e)=>G.jsx(z,{ref:e,width:"fit",height:"fit",onClick:r=>{r.preventDefault(),r.stopPropagation()},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation())},children:t}));const bL="Switch",[zce,hTe]=Sn(bL),[Wce,Hce]=zce(bL),qce=C.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...u}=t,[f,d]=C.useState(null),h=Gt(e,m=>d(m)),p=C.useRef(!1),v=f?!!f.closest("form"):!0,[b=!1,y]=dc({prop:i,defaultProp:s,onChange:l});return C.createElement(Wce,{scope:r,checked:b,disabled:a},C.createElement(et.button,ht({type:"button",role:"switch","aria-checked":b,"aria-required":o,"data-state":wL(b),"data-disabled":a?"":void 0,disabled:a,value:c},u,{ref:h,onClick:Ee(t.onClick,m=>{y(g=>!g),v&&(p.current=m.isPropagationStopped(),p.current||m.stopPropagation())})})),v&&C.createElement(Kce,{control:f,bubbles:!p.current,name:n,value:c,checked:b,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),Vce="SwitchThumb",Gce=C.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,i=Hce(Vce,r);return C.createElement(et.span,ht({"data-state":wL(i.checked),"data-disabled":i.disabled?"":void 0},n,{ref:e}))}),Kce=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=C.useRef(null),o=Hg(r),a=qg(e);return C.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(d)}},[o,r,n]),C.createElement("input",ht({type:"checkbox","aria-hidden":!0,defaultChecked:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function wL(t){return t?"checked":"unchecked"}const Qce=qce,Yce=Gce;var Jce="_1lp2u8e1 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr1ss fyvr1uo fyvr1wk fyvr1yg fyvr11sz fyvr11hw fyvr12uz",Xce="_1lp2u8e3 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr11ho fyvr1ko fyvr1oo fyvr1k fyvr140 fyvr11nz";const BP=t=>{const{disabled:e,label:r,labelLocation:n="left",description:i,id:s,name:o,...a}=t;return G.jsx(ru,{disabled:e,display:"flex",id:s??o,label:r,labelLocation:n,description:i,whiteSpace:"nowrap",children:G.jsx(Qce,{className:Jce,disabled:e,...a,children:G.jsx(z,{position:"relative",width:"full",height:"full",children:G.jsx(Yce,{className:Xce})})})})};fr({defaultClassName:"nwwh3z7",variantClassNames:{variant:{pill:"nwwh3z8",line:"nwwh3z9 fyvr11g0"},active:{true:"fyvr12vx",false:"nwwh3zb"},disabled:{true:"fyvr12vh"}},defaultVariants:{},compoundVariants:[[{active:!0,variant:"pill"},"fyvr11u5 fyvr12sb"],[{active:!1,variant:"pill"},"fyvr11ob fyvr12rz"],[{active:!0,variant:"line"},"fyvr12rt"],[{active:!1,variant:"line"},"fyvr12rz"]]});const EL="Tabs",[Zce,pTe]=Sn(EL,[vd]),xL=vd(),[ele,mS]=Zce(EL),tle=C.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:a,activationMode:c="automatic",...l}=t,u=Jg(a),[f,d]=dc({prop:n,onChange:i,defaultProp:s});return C.createElement(ele,{scope:r,baseId:rc(),value:f,onValueChange:d,orientation:o,dir:u,activationMode:c},C.createElement(et.div,ht({dir:u,"data-orientation":o},l,{ref:e})))}),rle="TabsList",nle=C.forwardRef((t,e)=>{const{__scopeTabs:r,loop:n=!0,...i}=t,s=mS(rle,r),o=xL(r);return C.createElement(_D,ht({asChild:!0},o,{orientation:s.orientation,dir:s.dir,loop:n}),C.createElement(et.div,ht({role:"tablist","aria-orientation":s.orientation},i,{ref:e})))}),ile="TabsTrigger",sle=C.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...s}=t,o=mS(ile,r),a=xL(r),c=CL(o.baseId,n),l=SL(o.baseId,n),u=n===o.value;return C.createElement(cS,ht({asChild:!0},a,{focusable:!i,active:u}),C.createElement(et.button,ht({type:"button",role:"tab","aria-selected":u,"aria-controls":l,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c},s,{ref:e,onMouseDown:Ee(t.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?o.onValueChange(n):f.preventDefault()}),onKeyDown:Ee(t.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(n)}),onFocus:Ee(t.onFocus,()=>{const f=o.activationMode!=="manual";!u&&!i&&f&&o.onValueChange(n)})})))}),ole="TabsContent",ale=C.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,forceMount:i,children:s,...o}=t,a=mS(ole,r),c=CL(a.baseId,n),l=SL(a.baseId,n),u=n===a.value,f=C.useRef(u);return C.useEffect(()=>{const d=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(d)},[]),C.createElement(Oc,{present:i||u},({present:d})=>C.createElement(et.div,ht({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:l,tabIndex:0},o,{ref:e,style:{...t.style,animationDuration:f.current?"0s":void 0}}),d&&s))});function CL(t,e){return`${t}-trigger-${e}`}function SL(t,e){return`${t}-content-${e}`}const cle=tle,lle=nle,ule=sle;var fle="_10c8o0n1 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr11h0 fyvr11hw fyvr128 fyvr11sh fyvr14o",dle="_10c8o0n5 fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr11ho fyvr1ko fyvr1oo fyvr14c fyvr11tt fyvr12vz",hle="_10c8o0n3 fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr12wh fyvr12wb fyvr128 fyvr15o fyvr12uz fyvr11hw fyvr11ob fyvr11n2 fyvr12rz";const ple=t=>{const{tabs:e,value:r}=t;if(!e.length)return null;const n=100/e.length,i=e.findIndex(s=>s.value===r);return G.jsxs(lle,{className:fle,style:{outline:void 0},children:[G.jsx(z,{display:"flex",position:"absolute",inset:"2",height:"8",children:G.jsx("div",{className:dle,style:{width:`${n}%`,transform:`translateX(${i*100}%)`}})}),e.map(s=>G.jsx(ule,{className:hle,value:s.value,children:G.jsx(ne,{variant:"normal",fontWeight:"bold",children:s.label})},s.value))]})},vle=cle,jP=ale;var mle="_1qxj1ib9 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr1wo fyvr1yk fyvr1ss fyvr1uo fyvr11hc fyvr118c fyvr11n7";C.forwardRef((t,e)=>{const{icon:r,label:n,...i}=t;return G.jsxs(z,{className:mle,ref:e,background:"buttonGlass",...i,children:[r&&G.jsx(r,{size:"xs"}),G.jsx(ne,{children:n})]})});const yle="ToastProvider",[gle,vTe,ble]=Yg("Toast"),[kL,mTe]=Sn("Toast",[ble]),[yTe,AL]=kL(yle),UP="toast.viewportPause",zP="toast.viewportResume",ab="Toast",wle="toast.swipeStart",Ele="toast.swipeMove",xle="toast.swipeCancel",Cle="toast.swipeEnd",[Sle,kle]=kL(ab,{onClose(){}}),Ale=C.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:d,onSwipeEnd:h,...p}=t,v=AL(ab,r),[b,y]=C.useState(null),m=Gt(e,E=>y(E)),g=C.useRef(null),S=C.useRef(null),P=i||v.duration,T=C.useRef(0),w=C.useRef(P),I=C.useRef(0),{onToastAdd:F,onToastRemove:j}=v,H=Wi(()=>{var E;(b==null?void 0:b.contains(document.activeElement))&&((E=v.viewport)===null||E===void 0||E.focus()),o()}),K=C.useCallback(E=>{!E||E===1/0||(window.clearTimeout(I.current),T.current=new Date().getTime(),I.current=window.setTimeout(H,E))},[H]);C.useEffect(()=>{const E=v.viewport;if(E){const _=()=>{K(w.current),l==null||l()},O=()=>{const N=new Date().getTime()-T.current;w.current=w.current-N,window.clearTimeout(I.current),c==null||c()};return E.addEventListener(UP,O),E.addEventListener(zP,_),()=>{E.removeEventListener(UP,O),E.removeEventListener(zP,_)}}},[v.viewport,P,c,l,K]),C.useEffect(()=>{s&&!v.isClosePausedRef.current&&K(P)},[s,P,v.isClosePausedRef,K]),C.useEffect(()=>(F(),()=>j()),[F,j]);const B=C.useMemo(()=>b?PL(b):null,[b]);return v.viewport?C.createElement(C.Fragment,null,B&&C.createElement(_le,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0},B),C.createElement(Sle,{scope:r,onClose:H},Ts.createPortal(C.createElement(gle.ItemSlot,{scope:r},C.createElement(mie,{asChild:!0,onEscapeKeyDown:Ee(a,()=>{v.isFocusedToastEscapeKeyDownRef.current||H(),v.isFocusedToastEscapeKeyDownRef.current=!1})},C.createElement(et.li,Ae({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":v.swipeDirection},p,{ref:m,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Ee(t.onKeyDown,E=>{E.key==="Escape"&&(a==null||a(E.nativeEvent),E.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,H()))}),onPointerDown:Ee(t.onPointerDown,E=>{E.button===0&&(g.current={x:E.clientX,y:E.clientY})}),onPointerMove:Ee(t.onPointerMove,E=>{if(!g.current)return;const _=E.clientX-g.current.x,O=E.clientY-g.current.y,N=!!S.current,k=["left","right"].includes(v.swipeDirection),$=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,L=k?$(0,_):0,M=k?0:$(0,O),A=E.pointerType==="touch"?10:2,D={x:L,y:M},V={originalEvent:E,delta:D};N?(S.current=D,Jp(Ele,f,V,{discrete:!1})):WP(D,v.swipeDirection,A)?(S.current=D,Jp(wle,u,V,{discrete:!1}),E.target.setPointerCapture(E.pointerId)):(Math.abs(_)>A||Math.abs(O)>A)&&(g.current=null)}),onPointerUp:Ee(t.onPointerUp,E=>{const _=S.current,O=E.target;if(O.hasPointerCapture(E.pointerId)&&O.releasePointerCapture(E.pointerId),S.current=null,g.current=null,_){const N=E.currentTarget,k={originalEvent:E,delta:_};WP(_,v.swipeDirection,v.swipeThreshold)?Jp(Cle,h,k,{discrete:!0}):Jp(xle,d,k,{discrete:!0}),N.addEventListener("click",$=>$.preventDefault(),{once:!0})}})})))),v.viewport))):null});Ale.propTypes={type(t){if(t.type&&!["foreground","background"].includes(t.type)){const e=`Invalid prop \`type\` supplied to \`${ab}\`. Expected \`foreground | background\`.`;return new Error(e)}return null}};const _le=t=>{const{__scopeToast:e,children:r,...n}=t,i=AL(ab,e),[s,o]=C.useState(!1),[a,c]=C.useState(!1);return Rle(()=>o(!0)),C.useEffect(()=>{const l=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:C.createElement(SD,{asChild:!0},C.createElement(hL,n,s&&C.createElement(C.Fragment,null,i.label," ",r)))},Ple="ToastAction",Tle=C.forwardRef((t,e)=>{const{altText:r,...n}=t;return r?C.createElement(_L,{altText:r,asChild:!0},C.createElement(Ole,Ae({},n,{ref:e}))):null});Tle.propTypes={altText(t){return t.altText?null:new Error(`Missing prop \`altText\` expected on \`${Ple}\``)}};const Ile="ToastClose",Ole=C.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,i=kle(Ile,r);return C.createElement(_L,{asChild:!0},C.createElement(et.button,Ae({type:"button"},n,{ref:e,onClick:Ee(t.onClick,i.onClose)})))}),_L=C.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...i}=t;return C.createElement(et.div,Ae({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0},i,{ref:e}))});function PL(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),$le(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...PL(n))}}),e}function Jp(t,e,r,{discrete:n}){const i=r.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?Z3(i,s):i.dispatchEvent(s)}const WP=(t,e,r=0)=>{const n=Math.abs(t.x),i=Math.abs(t.y),s=n>i;return e==="left"||e==="right"?s&&n>r:!s&&i>r};function Rle(t=()=>{}){const e=Wi(t);Hi(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function $le(t){return t.nodeType===t.ELEMENT_NODE}fr({defaultClassName:"_6wut8v3",variantClassNames:{variant:{normal:"_6wut8v4",success:"_6wut8v5",error:"_6wut8v6"}},defaultVariants:{},compoundVariants:[]});C.createContext(null);var Mle="_15pztn2",Nle="_15pztn1 _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11ko fyvr11ob fyvr12rt fyvr128 fyvr11h0";C.forwardRef((t,e)=>{const{as:r="textarea",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",name:u,rows:f,resize:d=!1,...h}=t;return G.jsx(ru,{description:s,disabled:o,display:"grid",id:a??u,label:c,labelLocation:l,children:G.jsx(z,{as:r,autoComplete:n,spellCheck:"false",className:ki(Nle,d&&Mle),disabled:o,id:a??u,name:u,ref:e,rows:f,borderRadius:i,...h})})});var Dle="bnrrebg fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr11ls fyvr11m8 fyvr11jg fyvr11ko fyvr11sh fyvr128 fyvr15o fyvr11h0",Lle="bnrrebe",Fle=fr({defaultClassName:"bnrreb5 fyvr11ls fyvr11m8 fyvr11jg fyvr11ko fyvr11h0",variantClassNames:{size:{xs:"bnrreb6",sm:"bnrreb7",md:"bnrreb8",lg:"bnrreb9"},borderRadius:{circle:"fyvr11dc fyvr11e0 fyvr11c0 fyvr11co",lg:"fyvr11d8 fyvr11dw fyvr11bw fyvr11ck",md:"fyvr11d4 fyvr11ds fyvr11bs fyvr11cg",sm:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc"}},defaultVariants:{},compoundVariants:[]});C.memo(t=>{const{borderRadius:e="circle",className:r,disableAnimation:n=!1,style:i,src:s,symbol:o,size:a="md",...c}=t;return G.jsx(z,{className:ki(r,Fle({borderRadius:e,size:a})),style:i,flexShrink:"0",...c,children:s?G.jsx(mr,{className:Lle,disableAnimation:n,src:s}):G.jsx(ne,{className:Dle,variant:"normal",fontWeight:"medium",color:"text50",uppercase:!0,children:o==null?void 0:o.replace(/\s/,"").slice(0,4)})})});const[cb,gTe]=Sn("Tooltip",[pd]);pd();const Ble="TooltipProvider";cb(Ble);const TL="Tooltip";cb(TL);const jle="TooltipPortal";cb(jle,{forceMount:void 0});cb(TL,{isInside:!1});const Ule=(t,e={})=>{const r=new Map().set("isMobile",`@media screen and (max-width: ${sP.lg-1}px)`).set("isDesktop",`@media screen and (min-width: ${sP.lg}px)`);if(!t.startsWith("@media")){const c=r.get(t);if(!c||c==="")throw new Error(`useMediaQuery failed to get breakpoint from theme for: ${t}`);t=c}const n=t.replace(/^@media( ?)/m,""),i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:s=!1}=e,[o,a]=C.useState(()=>i?window.matchMedia(n).matches:s);return C.useEffect(()=>{let c=!0;if(!i)return;const l=window.matchMedia(n),u=()=>{c&&a(l.matches)};return u(),l.addListener(u),()=>{c=!1,l.removeListener(u)}},[n,i]),o};function zle({storage:t,key:e="REACT_QUERY_OFFLINE_CACHE",throttleTime:r=1e3,serialize:n=JSON.stringify,deserialize:i=JSON.parse,retry:s}){if(t){const o=a=>{try{t.setItem(e,n(a));return}catch(c){return c}};return{persistClient:Wle(a=>{let c=a,l=o(c),u=0;for(;l&&c;)u++,c=s==null?void 0:s({persistedClient:c,error:l,errorCount:u}),c&&(l=o(c))},r),restoreClient:()=>{const a=t.getItem(e);if(a)return i(a)},removeClient:()=>{t.removeItem(e)}}}return{persistClient:HP,restoreClient:()=>{},removeClient:HP}}function Wle(t,e=100){let r=null,n;return function(...i){n=i,r===null&&(r=setTimeout(()=>{t(...n),r=null},e))}}function HP(){}class yd{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){const r={listener:e};return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const B0=typeof window>"u"||"Deno"in window;function Oi(){}function Hle(t,e){return typeof t=="function"?t(e):t}function mC(t){return typeof t=="number"&&t>=0&&t!==1/0}function IL(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Xu(t,e,r){return F1(t)?typeof e=="function"?{...r,queryKey:t,queryFn:e}:{...e,queryKey:t}:t}function OL(t,e,r){return F1(t)?typeof e=="function"?{...r,mutationKey:t,mutationFn:e}:{...e,mutationKey:t}:typeof t=="function"?{...e,mutationFn:t}:{...t}}function $a(t,e,r){return F1(t)?[{...e,queryKey:t},r]:[t||{},e]}function qP(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(F1(o)){if(n){if(e.queryHash!==yS(o,e.options))return!1}else if(!fy(e.queryKey,o))return!1}if(r!=="all"){const c=e.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||typeof i<"u"&&i!==e.state.fetchStatus||s&&!s(e))}function VP(t,e){const{exact:r,fetching:n,predicate:i,mutationKey:s}=t;if(F1(s)){if(!e.options.mutationKey)return!1;if(r){if(vl(e.options.mutationKey)!==vl(s))return!1}else if(!fy(e.options.mutationKey,s))return!1}return!(typeof n=="boolean"&&e.state.status==="loading"!==n||i&&!i(e))}function yS(t,e){return((e==null?void 0:e.queryKeyHashFn)||vl)(t)}function vl(t){return JSON.stringify(t,(e,r)=>yC(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function fy(t,e){return RL(t,e)}function RL(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!RL(t[r],e[r])):!1}function $L(t,e){if(t===e)return t;const r=GP(t)&&GP(e);if(r||yC(t)&&yC(e)){const n=r?t.length:Object.keys(t).length,i=r?e:Object.keys(e),s=i.length,o=r?[]:{};let a=0;for(let c=0;c"u")return!0;const r=e.prototype;return!(!KP(r)||!r.hasOwnProperty("isPrototypeOf"))}function KP(t){return Object.prototype.toString.call(t)==="[object Object]"}function F1(t){return Array.isArray(t)}function ML(t){return new Promise(e=>{setTimeout(e,t)})}function QP(t){ML(0).then(t)}function qle(){if(typeof AbortController=="function")return new AbortController}function gC(t,e,r){return r.isDataEqual!=null&&r.isDataEqual(t,e)?t:typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?$L(t,e):e}class Vle extends yd{constructor(){super(),this.setup=e=>{if(!B0&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),window.addEventListener("focus",r,!1),()=>{window.removeEventListener("visibilitychange",r),window.removeEventListener("focus",r)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var r;this.setup=e,(r=this.cleanup)==null||r.call(this),this.cleanup=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.focused!==e&&(this.focused=e,this.onFocus())}onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const hy=new Vle,YP=["online","offline"];class Gle extends yd{constructor(){super(),this.setup=e=>{if(!B0&&window.addEventListener){const r=()=>e();return YP.forEach(n=>{window.addEventListener(n,r,!1)}),()=>{YP.forEach(n=>{window.removeEventListener(n,r)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var r;this.setup=e,(r=this.cleanup)==null||r.call(this),this.cleanup=e(n=>{typeof n=="boolean"?this.setOnline(n):this.onOnline()})}setOnline(e){this.online!==e&&(this.online=e,this.onOnline())}onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const py=new Gle;function Kle(t){return Math.min(1e3*2**t,3e4)}function lb(t){return(t??"online")==="online"?py.isOnline():!0}class NL{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}}function Uv(t){return t instanceof NL}function DL(t){let e=!1,r=0,n=!1,i,s,o;const a=new Promise((b,y)=>{s=b,o=y}),c=b=>{n||(h(new NL(b)),t.abort==null||t.abort())},l=()=>{e=!0},u=()=>{e=!1},f=()=>!hy.isFocused()||t.networkMode!=="always"&&!py.isOnline(),d=b=>{n||(n=!0,t.onSuccess==null||t.onSuccess(b),i==null||i(),s(b))},h=b=>{n||(n=!0,t.onError==null||t.onError(b),i==null||i(),o(b))},p=()=>new Promise(b=>{i=y=>{const m=n||!f();return m&&b(y),m},t.onPause==null||t.onPause()}).then(()=>{i=void 0,n||t.onContinue==null||t.onContinue()}),v=()=>{if(n)return;let b;try{b=t.fn()}catch(y){b=Promise.reject(y)}Promise.resolve(b).then(d).catch(y=>{var m,g;if(n)return;const S=(m=t.retry)!=null?m:3,P=(g=t.retryDelay)!=null?g:Kle,T=typeof P=="function"?P(r,y):P,w=S===!0||typeof S=="number"&&r{if(f())return p()}).then(()=>{e?h(y):v()})})};return lb(t.networkMode)?v():p().then(v),{promise:a,cancel:c,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:l,continueRetry:u}}const gS=console;function Qle(){let t=[],e=0,r=u=>{u()},n=u=>{u()};const i=u=>{let f;e++;try{f=u()}finally{e--,e||a()}return f},s=u=>{e?t.push(u):QP(()=>{r(u)})},o=u=>(...f)=>{s(()=>{u(...f)})},a=()=>{const u=t;t=[],u.length&&QP(()=>{n(()=>{u.forEach(f=>{r(f)})})})};return{batch:i,batchCalls:o,schedule:s,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u}}}const yt=Qle();class LL{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mC(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,e??(B0?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class Yle extends LL{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||gS,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||Jle(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&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(e,r){const n=gC(this.state.data,e,this.options);return this.dispatch({data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){this.dispatch({type:"setState",state:e,setStateOptions:r})}cancel(e){var r;const n=this.promise;return(r=this.retryer)==null||r.cancel(e),n?n.then(Oi).catch(Oi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>e.options.enabled!==!1)}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||!IL(this.state.dataUpdatedAt,e)}onFocus(){var e;const r=this.observers.find(n=>n.shouldFetchOnWindowFocus());r&&r.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}onOnline(){var e;const r=this.observers.find(n=>n.shouldFetchOnReconnect());r&&r.refetch({cancelRefetch:!1}),(e=this.retryer)==null||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(r=>r!==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,r){var n,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&r!=null&&r.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var s;return(s=this.retryer)==null||s.continueRetry(),this.promise}}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const o=qle(),a={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},c=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>{if(o)return this.abortSignalConsumed=!0,o.signal}})};c(a);const l=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(a)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),u={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:l};if(c(u),(n=this.options.behavior)==null||n.onFetch(u),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=u.fetchOptions)==null?void 0:i.meta)){var f;this.dispatch({type:"fetch",meta:(f=u.fetchOptions)==null?void 0:f.meta})}const d=h=>{if(Uv(h)&&h.silent||this.dispatch({type:"error",error:h}),!Uv(h)){var p,v,b,y;(p=(v=this.cache.config).onError)==null||p.call(v,h,this),(b=(y=this.cache.config).onSettled)==null||b.call(y,this.state.data,h,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=DL({fn:u.fetchFn,abort:o==null?void 0:o.abort.bind(o),onSuccess:h=>{var p,v,b,y;if(typeof h>"u"){d(new Error(this.queryHash+" data is undefined"));return}this.setData(h),(p=(v=this.cache.config).onSuccess)==null||p.call(v,h,this),(b=(y=this.cache.config).onSettled)==null||b.call(y,h,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:d,onFail:(h,p)=>{this.dispatch({type:"failed",failureCount:h,error:p})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){const r=n=>{var i,s;switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=e.meta)!=null?i:null,fetchStatus:lb(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:(s=e.dataUpdatedAt)!=null?s:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=e.error;return Uv(o)&&o.revert&&this.revertState?{...this.revertState,fetchStatus:"idle"}:{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),yt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}function Jle(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=typeof e<"u",n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}class Xle extends yd{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,r,n){var i;const s=r.queryKey,o=(i=r.queryHash)!=null?i:yS(s,r);let a=this.get(o);return a||(a=new Yle({cache:this,logger:e.getLogger(),queryKey:s,queryHash:o,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){const r=this.queriesMap[e.queryHash];r&&(e.destroy(),this.queries=this.queries.filter(n=>n!==e),r===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){yt.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,r){const[n]=$a(e,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(i=>qP(n,i))}findAll(e,r){const[n]=$a(e,r);return Object.keys(n).length>0?this.queries.filter(i=>qP(n,i)):this.queries}notify(e){yt.batch(()=>{this.listeners.forEach(({listener:r})=>{r(e)})})}onFocus(){yt.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){yt.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class Zle extends LL{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||gS,this.observers=[],this.state=e.state||FL(),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(r=>r!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,r;return(e=(r=this.retryer)==null?void 0:r.continue())!=null?e:this.execute()}async execute(){const e=()=>{var w;return this.retryer=DL({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(I,F)=>{this.dispatch({type:"failed",failureCount:I,error:F})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(w=this.options.retry)!=null?w:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},r=this.state.status==="loading";try{var n,i,s,o,a,c,l,u;if(!r){var f,d,h,p;this.dispatch({type:"loading",variables:this.options.variables}),await((f=(d=this.mutationCache.config).onMutate)==null?void 0:f.call(d,this.state.variables,this));const I=await((h=(p=this.options).onMutate)==null?void 0:h.call(p,this.state.variables));I!==this.state.context&&this.dispatch({type:"loading",context:I,variables:this.state.variables})}const w=await e();return await((n=(i=this.mutationCache.config).onSuccess)==null?void 0:n.call(i,w,this.state.variables,this.state.context,this)),await((s=(o=this.options).onSuccess)==null?void 0:s.call(o,w,this.state.variables,this.state.context)),await((a=(c=this.mutationCache.config).onSettled)==null?void 0:a.call(c,w,null,this.state.variables,this.state.context,this)),await((l=(u=this.options).onSettled)==null?void 0:l.call(u,w,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:w}),w}catch(w){try{var v,b,y,m,g,S,P,T;throw await((v=(b=this.mutationCache.config).onError)==null?void 0:v.call(b,w,this.state.variables,this.state.context,this)),await((y=(m=this.options).onError)==null?void 0:y.call(m,w,this.state.variables,this.state.context)),await((g=(S=this.mutationCache.config).onSettled)==null?void 0:g.call(S,void 0,w,this.state.variables,this.state.context,this)),await((P=(T=this.options).onSettled)==null?void 0:P.call(T,void 0,w,this.state.variables,this.state.context)),w}finally{this.dispatch({type:"error",error:w})}}}dispatch(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"loading":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!lb(this.options.networkMode),status:"loading",variables:e.variables};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"};case"setState":return{...n,...e.state}}};this.state=r(this.state),yt.batch(()=>{this.observers.forEach(n=>{n.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function FL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class eue extends yd{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,r,n){const i=new Zle({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(r),state:n,defaultOptions:r.mutationKey?e.getMutationDefaults(r.mutationKey):void 0});return this.add(i),i}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(r=>r!==e),this.notify({type:"removed",mutation:e})}clear(){yt.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return typeof e.exact>"u"&&(e.exact=!0),this.mutations.find(r=>VP(e,r))}findAll(e){return this.mutations.filter(r=>VP(e,r))}notify(e){yt.batch(()=>{this.listeners.forEach(({listener:r})=>{r(e)})})}resumePausedMutations(){var e;return this.resuming=((e=this.resuming)!=null?e:Promise.resolve()).then(()=>{const r=this.mutations.filter(n=>n.state.isPaused);return yt.batch(()=>r.reduce((n,i)=>n.then(()=>i.continue().catch(Oi)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function bC(){return{onFetch:t=>{t.fetchFn=()=>{var e,r,n,i,s,o;const a=(e=t.fetchOptions)==null||(r=e.meta)==null?void 0:r.refetchPage,c=(n=t.fetchOptions)==null||(i=n.meta)==null?void 0:i.fetchMore,l=c==null?void 0:c.pageParam,u=(c==null?void 0:c.direction)==="forward",f=(c==null?void 0:c.direction)==="backward",d=((s=t.state.data)==null?void 0:s.pages)||[],h=((o=t.state.data)==null?void 0:o.pageParams)||[];let p=h,v=!1;const b=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>{var w;if((w=t.signal)!=null&&w.aborted)v=!0;else{var I;(I=t.signal)==null||I.addEventListener("abort",()=>{v=!0})}return t.signal}})},y=t.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+t.options.queryHash+"'")),m=(T,w,I,F)=>(p=F?[w,...p]:[...p,w],F?[I,...T]:[...T,I]),g=(T,w,I,F)=>{if(v)return Promise.reject("Cancelled");if(typeof I>"u"&&!w&&T.length)return Promise.resolve(T);const j={queryKey:t.queryKey,pageParam:I,meta:t.options.meta};b(j);const H=y(j);return Promise.resolve(H).then(B=>m(T,I,B,F))};let S;if(!d.length)S=g([]);else if(u){const T=typeof l<"u",w=T?l:wC(t.options,d);S=g(d,T,w)}else if(f){const T=typeof l<"u",w=T?l:BL(t.options,d);S=g(d,T,w,!0)}else{p=[];const T=typeof t.options.getNextPageParam>"u";S=(a&&d[0]?a(d[0],0,d):!0)?g([],T,h[0]):Promise.resolve(m([],h[0],d[0]));for(let I=1;I{if(a&&d[I]?a(d[I],I,d):!0){const H=T?h[I]:wC(t.options,F);return g(F,T,H)}return Promise.resolve(m(F,h[I],d[I]))})}return S.then(T=>({pages:T,pageParams:p}))}}}}function wC(t,e){return t.getNextPageParam==null?void 0:t.getNextPageParam(e[e.length-1],e)}function BL(t,e){return t.getPreviousPageParam==null?void 0:t.getPreviousPageParam(e[0],e)}function tue(t,e){if(t.getNextPageParam&&Array.isArray(e)){const r=wC(t,e);return typeof r<"u"&&r!==null&&r!==!1}}function rue(t,e){if(t.getPreviousPageParam&&Array.isArray(e)){const r=BL(t,e);return typeof r<"u"&&r!==null&&r!==!1}}class bS{constructor(e={}){this.queryCache=e.queryCache||new Xle,this.mutationCache=e.mutationCache||new eue,this.logger=e.logger||gS,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=hy.subscribe(()=>{hy.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=py.subscribe(()=>{py.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,r;this.mountCount--,this.mountCount===0&&((e=this.unsubscribeFocus)==null||e.call(this),this.unsubscribeFocus=void 0,(r=this.unsubscribeOnline)==null||r.call(this),this.unsubscribeOnline=void 0)}isFetching(e,r){const[n]=$a(e,r);return n.fetchStatus="fetching",this.queryCache.findAll(n).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,r){var n;return(n=this.queryCache.find(e,r))==null?void 0:n.state.data}ensureQueryData(e,r,n){const i=Xu(e,r,n),s=this.getQueryData(i.queryKey);return s?Promise.resolve(s):this.fetchQuery(i)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:r,state:n})=>{const i=n.data;return[r,i]})}setQueryData(e,r,n){const i=this.queryCache.find(e),s=i==null?void 0:i.state.data,o=Hle(r,s);if(typeof o>"u")return;const a=Xu(e),c=this.defaultQueryOptions(a);return this.queryCache.build(this,c).setData(o,{...n,manual:!0})}setQueriesData(e,r,n){return yt.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,r,n)]))}getQueryState(e,r){var n;return(n=this.queryCache.find(e,r))==null?void 0:n.state}removeQueries(e,r){const[n]=$a(e,r),i=this.queryCache;yt.batch(()=>{i.findAll(n).forEach(s=>{i.remove(s)})})}resetQueries(e,r,n){const[i,s]=$a(e,r,n),o=this.queryCache,a={type:"active",...i};return yt.batch(()=>(o.findAll(i).forEach(c=>{c.reset()}),this.refetchQueries(a,s)))}cancelQueries(e,r,n){const[i,s={}]=$a(e,r,n);typeof s.revert>"u"&&(s.revert=!0);const o=yt.batch(()=>this.queryCache.findAll(i).map(a=>a.cancel(s)));return Promise.all(o).then(Oi).catch(Oi)}invalidateQueries(e,r,n){const[i,s]=$a(e,r,n);return yt.batch(()=>{var o,a;if(this.queryCache.findAll(i).forEach(l=>{l.invalidate()}),i.refetchType==="none")return Promise.resolve();const c={...i,type:(o=(a=i.refetchType)!=null?a:i.type)!=null?o:"active"};return this.refetchQueries(c,s)})}refetchQueries(e,r,n){const[i,s]=$a(e,r,n),o=yt.batch(()=>this.queryCache.findAll(i).filter(c=>!c.isDisabled()).map(c=>{var l;return c.fetch(void 0,{...s,cancelRefetch:(l=s==null?void 0:s.cancelRefetch)!=null?l:!0,meta:{refetchPage:i.refetchPage}})}));let a=Promise.all(o).then(Oi);return s!=null&&s.throwOnError||(a=a.catch(Oi)),a}fetchQuery(e,r,n){const i=Xu(e,r,n),s=this.defaultQueryOptions(i);typeof s.retry>"u"&&(s.retry=!1);const o=this.queryCache.build(this,s);return o.isStaleByTime(s.staleTime)?o.fetch(s):Promise.resolve(o.state.data)}prefetchQuery(e,r,n){return this.fetchQuery(e,r,n).then(Oi).catch(Oi)}fetchInfiniteQuery(e,r,n){const i=Xu(e,r,n);return i.behavior=bC(),this.fetchQuery(i)}prefetchInfiniteQuery(e,r,n){return this.fetchInfiniteQuery(e,r,n).then(Oi).catch(Oi)}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,r){const n=this.queryDefaults.find(i=>vl(e)===vl(i.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:e,defaultOptions:r})}getQueryDefaults(e){if(!e)return;const r=this.queryDefaults.find(n=>fy(e,n.queryKey));return r==null?void 0:r.defaultOptions}setMutationDefaults(e,r){const n=this.mutationDefaults.find(i=>vl(e)===vl(i.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:e,defaultOptions:r})}getMutationDefaults(e){if(!e)return;const r=this.mutationDefaults.find(n=>fy(e,n.mutationKey));return r==null?void 0:r.defaultOptions}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const r={...this.defaultOptions.queries,...this.getQueryDefaults(e==null?void 0:e.queryKey),...e,_defaulted:!0};return!r.queryHash&&r.queryKey&&(r.queryHash=yS(r.queryKey,r)),typeof r.refetchOnReconnect>"u"&&(r.refetchOnReconnect=r.networkMode!=="always"),typeof r.useErrorBoundary>"u"&&(r.useErrorBoundary=!!r.suspense),r}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(e==null?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class wS extends yd{constructor(e,r){super(),this.client=e,this.options=r,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(r)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),JP(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return EC(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return EC(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,r){const n=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),dy(n,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),this.updateQuery();const s=this.hasListeners();s&&XP(this.currentQuery,i,this.options,n)&&this.executeFetch(),this.updateResult(r),s&&(this.currentQuery!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&this.updateStaleTimeout();const o=this.computeRefetchInterval();s&&(this.currentQuery!==i||this.options.enabled!==n.enabled||o!==this.currentRefetchInterval)&&this.updateRefetchInterval(o)}getOptimisticResult(e){const r=this.client.getQueryCache().build(this.client,e),n=this.createResult(r,e);return iue(this,n,e)&&(this.currentResult=n,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),n}getCurrentResult(){return this.currentResult}trackResult(e){const r={};return Object.keys(e).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(n),e[n])})}),r}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...r}={}){return this.fetch({...r,meta:{refetchPage:e}})}fetchOptimistic(e){const r=this.client.defaultQueryOptions(e),n=this.client.getQueryCache().build(this.client,r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(e){var r;return this.executeFetch({...e,cancelRefetch:(r=e.cancelRefetch)!=null?r:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let r=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(Oi)),r}updateStaleTimeout(){if(this.clearStaleTimeout(),B0||this.currentResult.isStale||!mC(this.options.staleTime))return;const r=IL(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},r)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(B0||this.options.enabled===!1||!mC(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||hy.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,r){const n=this.currentQuery,i=this.options,s=this.currentResult,o=this.currentResultState,a=this.currentResultOptions,c=e!==n,l=c?e.state:this.currentQueryInitialState,u=c?this.currentResult:this.previousQueryResult,{state:f}=e;let{dataUpdatedAt:d,error:h,errorUpdatedAt:p,fetchStatus:v,status:b}=f,y=!1,m=!1,g;if(r._optimisticResults){const I=this.hasListeners(),F=!I&&JP(e,r),j=I&&XP(e,n,r,i);(F||j)&&(v=lb(e.options.networkMode)?"fetching":"paused",d||(b="loading")),r._optimisticResults==="isRestoring"&&(v="idle")}if(r.keepPreviousData&&!f.dataUpdatedAt&&u!=null&&u.isSuccess&&b!=="error")g=u.data,d=u.dataUpdatedAt,b=u.status,y=!0;else if(r.select&&typeof f.data<"u")if(s&&f.data===(o==null?void 0:o.data)&&r.select===this.selectFn)g=this.selectResult;else try{this.selectFn=r.select,g=r.select(f.data),g=gC(s==null?void 0:s.data,g,r),this.selectResult=g,this.selectError=null}catch(I){this.selectError=I}else g=f.data;if(typeof r.placeholderData<"u"&&typeof g>"u"&&b==="loading"){let I;if(s!=null&&s.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData))I=s.data;else if(I=typeof r.placeholderData=="function"?r.placeholderData():r.placeholderData,r.select&&typeof I<"u")try{I=r.select(I),this.selectError=null}catch(F){this.selectError=F}typeof I<"u"&&(b="success",g=gC(s==null?void 0:s.data,I,r),m=!0)}this.selectError&&(h=this.selectError,g=this.selectResult,p=Date.now(),b="error");const S=v==="fetching",P=b==="loading",T=b==="error";return{status:b,fetchStatus:v,isLoading:P,isSuccess:b==="success",isError:T,isInitialLoading:P&&S,data:g,dataUpdatedAt:d,error:h,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>l.dataUpdateCount||f.errorUpdateCount>l.errorUpdateCount,isFetching:S,isRefetching:S&&!P,isLoadingError:T&&f.dataUpdatedAt===0,isPaused:v==="paused",isPlaceholderData:m,isPreviousData:y,isRefetchError:T&&f.dataUpdatedAt!==0,isStale:ES(e,r),refetch:this.refetch,remove:this.remove}}updateResult(e){const r=this.currentResult,n=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,dy(n,r))return;this.currentResult=n;const i={cache:!0},s=()=>{if(!r)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!this.trackedProps.size)return!0;const c=new Set(a??this.trackedProps);return this.options.useErrorBoundary&&c.add("error"),Object.keys(this.currentResult).some(l=>{const u=l;return this.currentResult[u]!==r[u]&&c.has(u)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),this.notify({...i,...e})}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const r=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const r={};e.type==="success"?r.onSuccess=!e.manual:e.type==="error"&&!Uv(e.error)&&(r.onError=!0),this.updateResult(r),this.hasListeners()&&this.updateTimers()}notify(e){yt.batch(()=>{if(e.onSuccess){var r,n,i,s;(r=(n=this.options).onSuccess)==null||r.call(n,this.currentResult.data),(i=(s=this.options).onSettled)==null||i.call(s,this.currentResult.data,null)}else if(e.onError){var o,a,c,l;(o=(a=this.options).onError)==null||o.call(a,this.currentResult.error),(c=(l=this.options).onSettled)==null||c.call(l,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:u})=>{u(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function nue(t,e){return e.enabled!==!1&&!t.state.dataUpdatedAt&&!(t.state.status==="error"&&e.retryOnMount===!1)}function JP(t,e){return nue(t,e)||t.state.dataUpdatedAt>0&&EC(t,e,e.refetchOnMount)}function EC(t,e,r){if(e.enabled!==!1){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&ES(t,e)}return!1}function XP(t,e,r,n){return r.enabled!==!1&&(t!==e||n.enabled===!1)&&(!r.suspense||t.state.status!=="error")&&ES(t,r)}function ES(t,e){return t.isStaleByTime(e.staleTime)}function iue(t,e,r){return r.keepPreviousData?!1:r.placeholderData!==void 0?e.isPlaceholderData:!dy(t.getCurrentResult(),e)}class sue extends wS{constructor(e,r){super(e,r)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,r){super.setOptions({...e,behavior:bC()},r)}getOptimisticResult(e){return e.behavior=bC(),super.getOptimisticResult(e)}fetchNextPage({pageParam:e,...r}={}){return this.fetch({...r,meta:{fetchMore:{direction:"forward",pageParam:e}}})}fetchPreviousPage({pageParam:e,...r}={}){return this.fetch({...r,meta:{fetchMore:{direction:"backward",pageParam:e}}})}createResult(e,r){var n,i,s,o,a,c;const{state:l}=e,u=super.createResult(e,r),{isFetching:f,isRefetching:d}=u,h=f&&((n=l.fetchMeta)==null||(i=n.fetchMore)==null?void 0:i.direction)==="forward",p=f&&((s=l.fetchMeta)==null||(o=s.fetchMore)==null?void 0:o.direction)==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:tue(r,(a=l.data)==null?void 0:a.pages),hasPreviousPage:rue(r,(c=l.data)==null?void 0:c.pages),isFetchingNextPage:h,isFetchingPreviousPage:p,isRefetching:d&&!h&&!p}}}let oue=class extends yd{constructor(e,r){super(),this.client=e,this.setOptions(r),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var r;const n=this.options;this.options=this.client.defaultMutationOptions(e),dy(n,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),(r=this.currentMutation)==null||r.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.currentMutation)==null||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();const r={listeners:!0};e.type==="success"?r.onSuccess=!0:e.type==="error"&&(r.onError=!0),this.notify(r)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,r){return this.mutateOptions=r,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof e<"u"?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const e=this.currentMutation?this.currentMutation.state:FL(),r={...e,isLoading:e.status==="loading",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=r}notify(e){yt.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(e.onSuccess){var r,n,i,s;(r=(n=this.mutateOptions).onSuccess)==null||r.call(n,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(i=(s=this.mutateOptions).onSettled)==null||i.call(s,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(e.onError){var o,a,c,l;(o=(a=this.mutateOptions).onError)==null||o.call(a,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(c=(l=this.mutateOptions).onSettled)==null||c.call(l,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}e.listeners&&this.listeners.forEach(({listener:u})=>{u(this.currentResult)})})}};function aue(t){return{mutationKey:t.options.mutationKey,state:t.state}}function cue(t){return{state:t.state,queryKey:t.queryKey,queryHash:t.queryHash}}function lue(t){return t.state.isPaused}function uue(t){return t.state.status==="success"}function fue(t,e={}){const r=[],n=[];if(e.dehydrateMutations!==!1){const i=e.shouldDehydrateMutation||lue;t.getMutationCache().getAll().forEach(s=>{i(s)&&r.push(aue(s))})}if(e.dehydrateQueries!==!1){const i=e.shouldDehydrateQuery||uue;t.getQueryCache().getAll().forEach(s=>{i(s)&&n.push(cue(s))})}return{mutations:r,queries:n}}function due(t,e,r){if(typeof e!="object"||e===null)return;const n=t.getMutationCache(),i=t.getQueryCache(),s=e.mutations||[],o=e.queries||[];s.forEach(a=>{var c;n.build(t,{...r==null||(c=r.defaultOptions)==null?void 0:c.mutations,mutationKey:a.mutationKey},a.state)}),o.forEach(({queryKey:a,state:c,queryHash:l})=>{var u;const f=i.get(l);if(f){if(f.state.dataUpdatedAt"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Ble:Lle;fL.useSyncExternalStore=jf.useSyncExternalStore!==void 0?jf.useSyncExternalStore:Fle;uL.exports=fL;var dS=uL.exports;const dL=dS.useSyncExternalStore,WP=C.createContext(void 0),hL=C.createContext(!1);function pL(t,e){return t||(e&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=WP),window.ReactQueryClientContext):WP)}const rb=({context:t}={})=>{const e=C.useContext(pL(t,C.useContext(hL)));if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},hS=({client:t,children:e,context:r,contextSharing:n=!1})=>{C.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]);const i=pL(r,n);return C.createElement(hL.Provider,{value:!r&&n},C.createElement(i.Provider,{value:t},e))},vL=C.createContext(!1),mL=()=>C.useContext(vL);vL.Provider;function jle(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const Ule=C.createContext(jle()),yL=()=>C.useContext(Ule);function gL(t,e){return typeof t=="function"?t(...e):!!t}const zle=(t,e)=>{(t.suspense||t.useErrorBoundary)&&(e.isReset()||(t.retryOnMount=!1))},Wle=t=>{C.useEffect(()=>{t.clearReset()},[t])},Hle=({result:t,errorResetBoundary:e,useErrorBoundary:r,query:n})=>t.isError&&!e.isReset()&&!t.isFetching&&gL(r,[t.error,n]),qle=t=>{t.suspense&&typeof t.staleTime!="number"&&(t.staleTime=1e3)},Vle=(t,e)=>t.isLoading&&t.isFetching&&!e,Gle=(t,e,r)=>(t==null?void 0:t.suspense)&&Vle(e,r),Kle=(t,e,r)=>e.fetchOptimistic(t).then(({data:n})=>{t.onSuccess==null||t.onSuccess(n),t.onSettled==null||t.onSettled(n,null)}).catch(n=>{r.clearReset(),t.onError==null||t.onError(n),t.onSettled==null||t.onSettled(void 0,n)});function bL(t,e){const r=rb({context:t.context}),n=mL(),i=yL(),s=r.defaultQueryOptions(t);s._optimisticResults=n?"isRestoring":"optimistic",s.onError&&(s.onError=yt.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=yt.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=yt.batchCalls(s.onSettled)),qle(s),zle(s,i),Wle(i);const[o]=C.useState(()=>new e(r,s)),a=o.getOptimisticResult(s);if(dL(C.useCallback(c=>{const l=n?()=>{}:o.subscribe(yt.batchCalls(c));return o.updateResult(),l},[o,n]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),C.useEffect(()=>{o.setOptions(s,{listeners:!1})},[s,o]),Gle(s,a,n))throw Kle(s,o,i);if(Hle({result:a,errorResetBoundary:i,useErrorBoundary:s.useErrorBoundary,query:o.getCurrentQuery()}))throw a.error;return s.notifyOnChangeProps?a:o.trackResult(a)}function si(t,e,r){const n=Yu(t,e,r);return bL(n,uS)}function Qle(t,e,r){const n=tL(t,e,r),i=rb({context:n.context}),[s]=C.useState(()=>new Sle(i,n));C.useEffect(()=>{s.setOptions(n)},[s,n]);const o=dL(C.useCallback(c=>s.subscribe(yt.batchCalls(c)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),a=C.useCallback((c,l)=>{s.mutate(c,l).catch(Yle)},[s]);if(o.error&&gL(s.options.useErrorBoundary,[o.error]))throw o.error;return{...o,mutate:a,mutateAsync:o.mutate}}function Yle(){}function Jle(t,e,r){const n=Yu(t,e,r);return bL(n,Cle)}const Xle=["added","removed","updated"];function HP(t){return Xle.includes(t)}async function Zle({queryClient:t,persister:e,maxAge:r=1e3*60*60*24,buster:n="",hydrateOptions:i}){try{const s=await e.restoreClient();if(s)if(s.timestamp){const o=Date.now()-s.timestamp>r,a=s.buster!==n;o||a?e.removeClient():Ile(t,s.clientState,i)}else e.removeClient()}catch{e.removeClient()}}async function qP({queryClient:t,persister:e,buster:r="",dehydrateOptions:n}){const i={buster:r,timestamp:Date.now(),clientState:Tle(t,n)};await e.persistClient(i)}function eue(t){const e=t.queryClient.getQueryCache().subscribe(n=>{HP(n.type)&&qP(t)}),r=t.queryClient.getMutationCache().subscribe(n=>{HP(n.type)&&qP(t)});return()=>{e(),r()}}function tue(t){let e=!1,r;const n=()=>{e=!0,r==null||r()},i=Zle(t).then(()=>{e||(r=eue(t))});return[n,i]}var wL={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function s(c,l,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,f||c,d),p=r?r+l:l;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],h]:c._events[p].push(h):(c._events[p]=h,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new n:delete c._events[l]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],u,f;if(this._eventsCount===0)return l;for(f in u=this._events)e.call(u,f)&&l.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},a.prototype.listeners=function(l){var u=r?r+l:l,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);dt,nb=t=>t,sue=()=>`viem@${nue}`;class le extends Error{constructor(e,r={}){var s;super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:sue()});const n=r.cause instanceof le?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof le&&r.cause.docsPath||r.docsPath;this.message=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://viem.sh${i}.html${r.docsSlug?`#${r.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(` -`),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}walk(e){return xL(this,e)}}function xL(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t?xL(t.cause,e):e?null:t}class pC extends le{constructor({blockNumber:e,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class oue extends le{constructor({chain:e,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e.id} – ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class aue extends le{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class CL extends le{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}function SL({chain:t,currentChainId:e}){if(!t)throw new aue;if(e!==t.id)throw new oue({chain:t,currentChainId:e})}function pS(t,e={}){const{fees:r=t.fees,formatters:n=t.formatters,serializers:i=t.serializers}=e;return{...t,fees:r,formatters:n,serializers:i}}function vd({blockNumber:t,chain:e,contract:r}){var i;const n=(i=e==null?void 0:e.contracts)==null?void 0:i[r];if(!n)throw new pC({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new pC({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}class cue extends le{constructor({max:e,min:r,signed:n,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class lue extends le{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidHexBooleanError"})}}class uue extends le{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}function vo(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function Lr(t){return vo(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}function pf(t,{dir:e="left"}={}){let r=typeof t=="string"?t.replace("0x",""):t,n=0;for(let i=0;ir*2)throw new AL({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function fue(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new AL({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;ie.toString(16).padStart(2,"0"));function fa(t,e={}){return typeof t=="number"||typeof t=="bigint"?ze(t,e):typeof t=="string"?vS(t,e):typeof t=="boolean"?_L(t,e):L0(t,e)}function _L(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?($c(r,{size:e.size}),md(r,{size:e.size})):r}function L0(t,e={}){let r="";for(let i=0;is||ie)throw new uue({givenSize:Lr(t),maxSize:e})}function ib(t,e={}){const{signed:r}=e;e.size&&$c(t,{size:e.size});const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,s=(1n<typeof n=="string"?n:TL(n));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,difficulty:t.difficulty?BigInt(t.difficulty):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:e,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}function xs(t,{args:e,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:e,eventName:r}:{}}}const bue={"0x0":"reverted","0x1":"success"};function wue(t){return{...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(e=>xs(e)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Nn(t.transactionIndex):null,status:t.status?bue[t.status]:null,type:t.type?PL[t.type]||t.type:null}}const Eue={legacy:"0x0",eip2930:"0x1",eip1559:"0x2"};function sb(t){return{...t,gas:typeof t.gas<"u"?ze(t.gas):void 0,gasPrice:typeof t.gasPrice<"u"?ze(t.gasPrice):void 0,maxFeePerGas:typeof t.maxFeePerGas<"u"?ze(t.maxFeePerGas):void 0,maxPriorityFeePerGas:typeof t.maxPriorityFeePerGas<"u"?ze(t.maxPriorityFeePerGas):void 0,nonce:typeof t.nonce<"u"?ze(t.nonce):void 0,type:typeof t.type<"u"?Eue[t.type]:void 0,value:typeof t.value<"u"?ze(t.value):void 0}}class B0 extends le{constructor({address:e}){super(`Address "${e}" is invalid.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}const xue={gwei:9,wei:18},Cue={ether:-9,wei:9};function OL(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,s]=[r.slice(0,r.length-e),r.slice(r.length-e)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${s?`.${s}`:""}`}function ei(t,e="wei"){return OL(t,Cue[e])}class Ju extends le{constructor({cause:e,message:r}={}){var i;const n=(i=r==null?void 0:r.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(Ju,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Ju,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class ly extends le{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${ei(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(ly,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class vC extends le{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${ei(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(vC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class mC extends le{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(mC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class yC extends le{constructor({cause:e,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` -`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(yC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class gC extends le{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(gC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class bC extends le{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` -`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(bC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class wC extends le{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(wC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class EC extends le{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(EC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class xC extends le{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(xC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class uy extends le{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${ei(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${ei(n)} gwei`:""}).`].join(` -`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(uy,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class ob extends le{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}const Sue=/^0x[a-fA-F0-9]{40}$/;function Uf(t){return Sue.test(t)}function Zo(t){return typeof t[0]=="string"?yS(t):kue(t)}function kue(t){let e=0;for(const i of t)e+=i.length;const r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function yS(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function gS(t,e="wei"){return OL(t,xue[e])}function D1(t){const e=Object.entries(t).map(([n,i])=>i===void 0||i===!1?null:[n,i]).filter(Boolean),r=e.reduce((n,[i])=>Math.max(n,i.length),0);return e.map(([n,i])=>` ${`${n}:`.padEnd(r+1)} ${i}`).join(` -`)}class Aue extends le{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class _ue extends le{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",D1(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class Pue extends le{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){const h=D1({chain:i&&`${i==null?void 0:i.name} (id: ${i==null?void 0:i.id})`,from:r==null?void 0:r.address,to:f,value:typeof d<"u"&&`${gS(d)} ${(i==null?void 0:i.nativeCurrency.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${ei(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${ei(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${ei(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=e}}class RL extends le{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){let o="Transaction";n&&s!==void 0&&(o=`Transaction at block time "${n}" at index "${s}"`),e&&s!==void 0&&(o=`Transaction at block hash "${e}" at index "${s}"`),r&&s!==void 0&&(o=`Transaction at block number "${r}" at index "${s}"`),i&&(o=`Transaction with hash "${i}"`),super(`${o} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class ML extends le{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class Tue extends le{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}function Iue(t){if(t.type)return t.type;if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")return"eip1559";if(typeof t.gasPrice<"u")return typeof t.accessList<"u"?"eip2930":"legacy";throw new _ue({transaction:t})}const Oue=pS({id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x56522D00C410a43BFfDF00a9A569489297385790",blockCreated:8765204},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}),Rue=pS({id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62",blockCreated:16966585},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),Mue=pS({id:137,name:"Polygon",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}});var $ue=Object.defineProperty,Nue=(t,e,r)=>e in t?$ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,st=(t,e,r)=>(Nue(t,typeof e!="symbol"?e+"":e,r),r),bS=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},Je=(t,e,r)=>(bS(t,e,"read from private field"),r?r.call(t):e.get(t)),Jr=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Mo=(t,e,r,n)=>(bS(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Or=(t,e,r)=>(bS(t,e,"access private method"),r),ab=class extends EL{constructor({chains:t=[Rue,Oue],options:e}){super(),st(this,"chains"),st(this,"options"),st(this,"storage"),this.chains=t,this.options=e}getBlockExplorerUrls(t){const{default:e,...r}=t.blockExplorers??{};if(e)return[e.url,...Object.values(r).map(n=>n.url)]}isChainUnsupported(t){return!this.chains.some(e=>e.id===t)}setStorage(t){this.storage=t}},Due=class extends Error{constructor({chainId:t,connectorId:e}){super(`Chain "${t}" not configured for connector "${e}".`),st(this,"name","ChainNotConfiguredForConnectorError")}},Ma=class extends Error{constructor(){super(...arguments),st(this,"name","ConnectorNotFoundError"),st(this,"message","Connector not found")}};function Fh(t){return typeof t=="string"?Number.parseInt(t,t.trim().substring(0,2)==="0x"?16:10):typeof t=="bigint"?Number(t):t}function Nc(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new Que(t.type);return`${t.name}(${cb(t.inputs,{includeName:e})})`}function cb(t,{includeName:e=!1}={}){return t?t.map(r=>Lue(r,{includeName:e})).join(e?", ":","):""}function Lue(t,{includeName:e}){return t.type.startsWith("tuple")?`(${cb(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}class Bue extends le{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` -`),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class VP extends le{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` -`),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class wS extends le{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` -`),{metaMessages:[`Params: (${cb(r,{includeName:!0})})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=r,this.size=n}}class lb extends le{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class Fue extends le{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class jue extends le{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${Lr(r)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class Uue extends le{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class $L extends le{constructor(e,{docsPath:r}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class zue extends le{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class Wue extends le{constructor(e,{docsPath:r}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class GP extends le{constructor(e,{docsPath:r}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class fy extends le{constructor(e,{docsPath:r}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class Hue extends le{constructor(e,{docsPath:r}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class que extends le{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class Ul extends le{constructor({abiItem:e,data:r,params:n,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join(` -`),{metaMessages:[`Params: (${cb(n,{includeName:!0})})`,`Data: ${r} (${i} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=r,this.params=n,this.size=i}}class yd extends le{constructor({abiItem:e,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${Nc(e,{includeName:!0})}".`].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class Vue extends le{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class Gue extends le{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class Kue extends le{constructor(e){super([`Value "${e}" is not a valid array.`].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class Que extends le{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}class Yue extends le{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}const Jue=/((function|event)\s)?(.*)(\((.*)\))/;function NL(t){const e=t.match(Jue),r=(e==null?void 0:e[2])||void 0,n=e==null?void 0:e[3],i=(e==null?void 0:e[5])||void 0;return{type:r,name:n,params:i}}function Xue(t){return NL(t).name}function Zue(t){const e=NL(t).params,r=e==null?void 0:e.split(",").map(n=>n.trim().split(" "));return r==null?void 0:r.map(n=>({type:n[0],name:n[1]==="indexed"?n[2]:n[1],...n[1]==="indexed"?{indexed:!0}:{}}))}function KP(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function DL(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function QP(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function efe(t,e){DL(t);const r=e.outputLen;if(t.length>YP&Gp)}:{h:Number(t>>YP&Gp)|0,l:Number(t&Gp)|0}}function rfe(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,ife=(t,e,r)=>e<>>32-r,sfe=(t,e,r)=>e<>>64-r,ofe=(t,e,r)=>t<>>64-r;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const afe=t=>t instanceof Uint8Array,cfe=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),lfe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!lfe)throw new Error("Non little-endian hardware is not supported");function ufe(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function LL(t){if(typeof t=="string"&&(t=ufe(t)),!afe(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}class ffe{clone(){return this._cloneInto()}}function dfe(t){const e=n=>t().update(LL(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}const[BL,FL,jL]=[[],[],[]],hfe=BigInt(0),Xd=BigInt(1),pfe=BigInt(2),vfe=BigInt(7),mfe=BigInt(256),yfe=BigInt(113);for(let t=0,e=Xd,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],BL.push(2*(5*n+r)),FL.push((t+1)*(t+2)/2%64);let i=hfe;for(let s=0;s<7;s++)e=(e<>vfe)*yfe)%mfe,e&pfe&&(i^=Xd<<(Xd<r>32?sfe(t,e,r):nfe(t,e,r),XP=(t,e,r)=>r>32?ofe(t,e,r):ife(t,e,r);function wfe(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=r[c],u=r[c+1],f=JP(l,u,1)^r[a],d=XP(l,u,1)^r[a+1];for(let h=0;h<50;h+=10)t[o+h]^=f,t[o+h+1]^=d}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=FL[o],c=JP(i,s,a),l=XP(i,s,a),u=BL[o];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=gfe[n],t[1]^=bfe[n]}r.fill(0)}class ES extends ffe{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,KP(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=cfe(this.state)}keccak(){wfe(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){QP(this);const{blockLen:r,state:n}=this;e=LL(e);const i=e.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return KP(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(efe(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new ES(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Efe=(t,e,r)=>dfe(()=>new ES(e,t,r)),xfe=Efe(1,136,256/8);function Qn(t,e){const r=e||"hex",n=xfe(vo(t,{strict:!1})?jl(t):t);return r==="bytes"?n:fa(n)}const UL=t=>Qn(jl(t));function zL(t){const e=Xue(t),r=Zue(t)||[];return UL(`${e}(${r.map(({type:n})=>n).join(",")})`)}function WL(t){return UL(Nc(t))}const xS=t=>typeof t=="string"?zL(t):WL(t);function Er(t,e,r,{strict:n}={}){return vo(t,{strict:!1})?Sfe(t,e,r,{strict:n}):Cfe(t,e,r,{strict:n})}function HL(t,e){if(typeof e=="number"&&e>0&&e>Lr(t)-1)throw new kL({offset:e,position:"start",size:Lr(t)})}function qL(t,e,r){if(typeof e=="number"&&typeof r=="number"&&Lr(t)!==r-e)throw new kL({offset:r,position:"end",size:Lr(t)})}function Cfe(t,e,r,{strict:n}={}){HL(t,e);const i=t.slice(e,r);return n&&qL(i,e,r),i}function Sfe(t,e,r,{strict:n}={}){HL(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&qL(i,e,r),i}function L1(t,e){if(t.length!==e.length)throw new Uue({expectedLength:t.length,givenLength:e.length});const r=kfe({params:t,values:e}),n=SS(r);return n.length===0?"0x":n}function kfe({params:t,values:e}){const r=[];for(let n=0;n0?Zo([a,o]):a}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:Zo(s.map(({encoded:o})=>o))}}function Pfe(t,{param:e}){const[,r]=e.type.split("bytes"),n=Lr(t);if(!r){let i=t;return n%32!==0&&(i=rc(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:Zo([rc(ze(n,{size:32})),i])}}if(n!==parseInt(r))throw new jue({expectedSize:parseInt(r),value:t});return{dynamic:!1,encoded:rc(t,{dir:"right"})}}function Tfe(t){return{dynamic:!1,encoded:rc(_L(t))}}function Ife(t,{signed:e}){return{dynamic:!1,encoded:ze(t,{size:32,signed:e})}}function Ofe(t){const e=vS(t),r=Math.ceil(Lr(e)/32),n=[];for(let i=0;ii))}}function ub(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const kS=t=>Er(typeof t=="string"?zL(t):WL(t),0,4);function B1({abi:t,args:e=[],name:r}){const n=vo(r,{strict:!1}),i=t.filter(s=>n?s.type==="function"?kS(s)===r:s.type==="event"?xS(s)===r:!1:"name"in s&&s.name===r);if(i.length!==0){if(i.length===1)return i[0];for(const s of i){if(!("inputs"in s))continue;if(!e||e.length===0){if(!s.inputs||s.inputs.length===0)return s;continue}if(!s.inputs||s.inputs.length===0||s.inputs.length!==e.length)continue;if(e.every((a,c)=>{const l="inputs"in s&&s.inputs[c];return l?CC(a,l):!1}))return s}return i[0]}}function CC(t,e){const r=typeof t,n=e.type;switch(n){case"address":return Uf(t);case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((i,s)=>CC(Object.values(t)[s],i)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(i=>CC(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function F1({abi:t,eventName:e,args:r}){var a;let n=t[0];if(e&&(n=B1({abi:t,args:r,name:e}),!n))throw new GP(e,{docsPath:"/docs/contract/encodeEventTopics"});if(n.type!=="event")throw new GP(void 0,{docsPath:"/docs/contract/encodeEventTopics"});const i=Nc(n),s=xS(i);let o=[];if(r&&"inputs"in n){const c=(a=n.inputs)==null?void 0:a.filter(u=>"indexed"in u&&u.indexed),l=Array.isArray(r)?r:Object.values(r).length>0?(c==null?void 0:c.map(u=>r[u.name]))??[]:[];l.length>0&&(o=(c==null?void 0:c.map((u,f)=>Array.isArray(l[f])?l[f].map((d,h)=>ZP({param:u,value:l[f][h]})):l[f]?ZP({param:u,value:l[f]}):null))??[])}return[s,...o]}function ZP({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return Qn(jl(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new Yue(t.type);return L1([t],[e])}function fb(t,{method:e}){var n,i;const r={};return t.transport.type==="fallback"&&((i=(n=t.transport).onResponse)==null||i.call(n,({method:s,response:o,status:a,transport:c})=>{a==="success"&&e===s&&(r[o]=c.request)})),s=>r[s]||t.request}async function VL(t,{address:e,abi:r,args:n,eventName:i,fromBlock:s,strict:o,toBlock:a}){const c=fb(t,{method:"eth_newFilter"}),l=i?F1({abi:r,args:n,eventName:i}):void 0,u=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof s=="bigint"?ze(s):s,toBlock:typeof a=="bigint"?ze(a):a,topics:l}]});return{abi:r,args:n,eventName:i,id:u,request:c(u),strict:o,type:"event"}}function Qi(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}function Dc({abi:t,args:e,functionName:r}){let n=t[0];if(r&&(n=B1({abi:t,args:e,name:r}),!n))throw new fy(r,{docsPath:"/docs/contract/encodeFunctionData"});if(n.type!=="function")throw new fy(void 0,{docsPath:"/docs/contract/encodeFunctionData"});const i=Nc(n),s=kS(i),o="inputs"in n&&n.inputs?L1(n.inputs,e??[]):void 0;return yS([s,o??"0x"])}const GL={1:"An `assert` condition failed.",17:"Arithmic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},Mfe={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},$fe={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function AS(t,e){const r=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),n=Qn(Bo(r),"bytes"),i=(e?r.substring(`${e}0x`.length):r).split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&i[s]&&(i[s]=i[s].toUpperCase()),(n[s>>1]&15)>=8&&i[s+1]&&(i[s+1]=i[s+1].toUpperCase());return`0x${i.join("")}`}function Li(t,e){if(!Uf(t))throw new B0({address:t});return AS(t,e)}function db(t,e){if(e==="0x"&&t.length>0)throw new lb;if(Lr(e)&&Lr(e)<32)throw new wS({data:e,params:t,size:Lr(e)});return Nfe({data:e,params:t})}function Nfe({data:t,params:e}){const r=[];let n=0;for(let i=0;i=Lr(t))throw new wS({data:t,params:e,size:Lr(t)});const s=e[i],{consumed:o,value:a}=vf({data:t,param:s,position:n});r.push(a),n+=o}return r}function vf({data:t,param:e,position:r}){const n=ub(e.type);if(n){const[s,o]=n;return Lfe(t,{length:s,param:{...e,type:o},position:r})}if(e.type==="tuple")return zfe(t,{param:e,position:r});if(e.type==="string")return Ufe(t,{position:r});if(e.type.startsWith("bytes"))return Ffe(t,{param:e,position:r});const i=Er(t,r,r+32,{strict:!0});if(e.type.startsWith("uint")||e.type.startsWith("int"))return jfe(i,{param:e});if(e.type==="address")return Dfe(i);if(e.type==="bool")return Bfe(i);throw new Gue(e.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function Dfe(t){return{consumed:32,value:AS(Er(t,-20))}}function Lfe(t,{param:e,length:r,position:n}){if(!r){const o=Nn(Er(t,n,n+32,{strict:!0})),a=Nn(Er(t,o,o+32,{strict:!0}));let c=0;const l=[];for(let u=0;u48?ib(t,{signed:r}):Nn(t,{signed:r})}}function Ufe(t,{position:e}){const r=Nn(Er(t,e,e+32,{strict:!0})),n=Nn(Er(t,r,r+32,{strict:!0}));return n===0?{consumed:32,value:""}:{consumed:32,value:gue(pf(Er(t,r+32,r+32+n,{strict:!0})))}}function zfe(t,{param:e,position:r}){const n=e.components.length===0||e.components.some(({name:o})=>!o),i=n?[]:{};let s=0;if(dy(e)){const o=Nn(Er(t,r,r+32,{strict:!0}));for(let a=0;as.type==="error"&&r===kS(Nc(s)));if(!i)throw new $L(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?db(i.inputs,Er(e,4)):void 0,errorName:i.name}}const Dn=(t,e,r)=>JSON.stringify(t,(n,i)=>{const s=typeof i=="bigint"?i.toString():i;return typeof e=="function"?e(n,s):s},r);function KL({abiItem:t,args:e,includeFunctionName:r=!0,includeName:n=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${r?t.name:""}(${t.inputs.map((i,s)=>`${n&&i.name?`${i.name}: `:""}${typeof e[s]=="object"?Dn(e[s]):e[s]}`).join(", ")})`}class QL extends le{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){const h=r?Qi(r):void 0,p=D1({from:h==null?void 0:h.address,to:f,value:typeof d<"u"&&`${gS(d)} ${(i==null?void 0:i.nativeCurrency.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${ei(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${ei(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${ei(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}}class Hfe extends le{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:s,functionName:o,sender:a}){const c=B1({abi:r,args:n,name:o}),l=c?KL({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=c?Nc(c,{includeName:!0}):void 0,f=D1({address:i&&iue(i),function:u,args:l&&l!=="()"&&`${[...Array((o==null?void 0:o.length)??0).keys()].map(()=>" ").join("")}${l}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",f].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=r,this.args=n,this.cause=e,this.contractAddress=i,this.functionName=o,this.sender=a}}class SC extends le{constructor({abi:e,data:r,functionName:n,message:i}){let s,o,a,c;if(r&&r!=="0x")try{o=Wfe({abi:e,data:r});const{abiItem:u,errorName:f,args:d}=o;if(f==="Error")c=d[0];else if(f==="Panic"){const[h]=d;c=GL[h]}else{const h=u?Nc(u,{includeName:!0}):void 0,p=u&&d?KL({abiItem:u,args:d,includeFunctionName:!1,includeName:!1}):void 0;a=[h?`Error: ${h}`:"",p&&p!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${p}`:""]}}catch(u){s=u}else i&&(c=i);let l;s instanceof $L&&(l=s.signature,a=[`Unable to decode signature "${l}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${l}.`]),super(c&&c!=="execution reverted"||l?[`The contract function "${n}" reverted with the following ${l?"signature":"reason"}:`,c||l].join(` -`):`The contract function "${n}" reverted.`,{cause:s,metaMessages:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.reason=c,this.signature=l}}class qfe extends le{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class _S extends le{constructor({data:e,message:r}){super(r||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}class jh extends le{constructor({body:e,details:r,headers:n,status:i,url:s}){super("HTTP request failed.",{details:r,metaMessages:[i&&`Status: ${i}`,`URL: ${nb(s)}`,e&&`Request body: ${Dn(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=i,this.url=s}}class Vfe extends le{constructor({body:e,details:r,url:n}){super("WebSocket request failed.",{details:r,metaMessages:[`URL: ${nb(n)}`,`Request body: ${Dn(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WebSocketRequestError"})}}class PS extends le{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${nb(n)}`,`Request body: ${Dn(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code}}class kC extends le{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${nb(r)}`,`Request body: ${Dn(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}const Gfe=-1;class oi extends le{constructor(e,{code:r,docsPath:n,metaMessages:i,shortMessage:s}){super(s,{cause:e,docsPath:n,metaMessages:i||(e==null?void 0:e.metaMessages)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof PS?e.code:r??Gfe}}class gd extends oi{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class F0 extends oi{constructor(e){super(e,{code:F0.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(F0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class j0 extends oi{constructor(e){super(e,{code:j0.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(j0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class U0 extends oi{constructor(e){super(e,{code:U0.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(U0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class z0 extends oi{constructor(e){super(e,{code:z0.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` -`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(z0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class zf extends oi{constructor(e){super(e,{code:zf.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(zf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class zl extends oi{constructor(e){super(e,{code:zl.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` -`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(zl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class W0 extends oi{constructor(e){super(e,{code:W0.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(W0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class vc extends oi{constructor(e){super(e,{code:vc.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(vc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class H0 extends oi{constructor(e){super(e,{code:H0.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(H0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class q0 extends oi{constructor(e){super(e,{code:q0.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(q0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class V0 extends oi{constructor(e){super(e,{code:V0.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(V0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class G0 extends oi{constructor(e){super(e,{code:G0.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(G0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Vr extends gd{constructor(e){super(e,{code:Vr.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(Vr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class K0 extends gd{constructor(e){super(e,{code:K0.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(K0,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Q0 extends gd{constructor(e){super(e,{code:Q0.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(Q0,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class Y0 extends gd{constructor(e){super(e,{code:Y0.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(Y0,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class J0 extends gd{constructor(e){super(e,{code:J0.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(J0,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class mc extends gd{constructor(e){super(e,{code:mc.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(mc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class Kfe extends oi{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}const Qfe=3;function X0(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:o}){const{code:a,data:c,message:l,shortMessage:u}=t instanceof _S?t:t instanceof le?t.walk(d=>"data"in d)||t.walk():{};let f=t;return t instanceof lb?f=new qfe({functionName:s}):[Qfe,zf.code].includes(a)&&(c||l||u)&&(f=new SC({abi:e,data:typeof c=="object"?c.data:c,functionName:s,message:u??l})),new Hfe(f,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:o})}class bd extends le{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join(` -`),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}class Yfe extends le{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){const h=D1({from:r==null?void 0:r.address,to:f,value:typeof d<"u"&&`${gS(d)} ${(i==null?void 0:i.nativeCurrency.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${ei(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${ei(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${ei(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}}function TS(t,e){const r=(t.details||"").toLowerCase(),n=t.walk(i=>i.code===Ju.code);return n instanceof le?new Ju({cause:t,message:n.details}):Ju.nodeMessage.test(r)?new Ju({cause:t,message:t.details}):ly.nodeMessage.test(r)?new ly({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):vC.nodeMessage.test(r)?new vC({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):mC.nodeMessage.test(r)?new mC({cause:t,nonce:e==null?void 0:e.nonce}):yC.nodeMessage.test(r)?new yC({cause:t,nonce:e==null?void 0:e.nonce}):gC.nodeMessage.test(r)?new gC({cause:t,nonce:e==null?void 0:e.nonce}):bC.nodeMessage.test(r)?new bC({cause:t}):wC.nodeMessage.test(r)?new wC({cause:t,gas:e==null?void 0:e.gas}):EC.nodeMessage.test(r)?new EC({cause:t,gas:e==null?void 0:e.gas}):xC.nodeMessage.test(r)?new xC({cause:t}):uy.nodeMessage.test(r)?new uy({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new ob({cause:t})}function Jfe(t,{docsPath:e,...r}){let n=TS(t,r);return n instanceof ob&&(n=t),new Yfe(n,{docsPath:e,...r})}function IS(t,{format:e}){return e?Object.keys(e({})).reduce((n,i)=>(t!=null&&t.hasOwnProperty(i)&&(n[i]=t[i]),n),{}):{}}function j1(t){const{account:e,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i,to:s}=t,o=e?Qi(e):void 0;if(o&&!Uf(o.address))throw new B0({address:o.address});if(s&&!Uf(s))throw new B0({address:s});if(typeof r<"u"&&(typeof n<"u"||typeof i<"u"))throw new Aue;if(n&&n>2n**256n-1n)throw new ly({maxFeePerGas:n});if(i&&n&&i>n)throw new uy({maxFeePerGas:n,maxPriorityFeePerGas:i})}class Xfe extends le{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class OS extends le{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class Zfe extends le{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${ei(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class ede extends le{constructor({blockHash:e,blockNumber:r}){let n="Block";e&&(n=`Block at hash "${e}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}async function yc(t,{blockHash:e,blockNumber:r,blockTag:n,includeTransactions:i}={}){var u,f,d;const s=n??"latest",o=i??!1,a=r!==void 0?ze(r):void 0;let c=null;if(e?c=await t.request({method:"eth_getBlockByHash",params:[e,o]}):c=await t.request({method:"eth_getBlockByNumber",params:[a||s,o]}),!c)throw new ede({blockHash:e,blockNumber:r});return(((d=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.block)==null?void 0:d.format)||IL)(c)}async function RS(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function tde(t,e){return YL(t,e)}async function YL(t,e){var s,o,a;const{block:r,chain:n=t.chain,request:i}=e||{};if(typeof((s=n==null?void 0:n.fees)==null?void 0:s.defaultPriorityFee)=="function"){const c=r||await yc(t);return n.fees.defaultPriorityFee({block:c,client:t,request:i})}else if((o=n==null?void 0:n.fees)!=null&&o.defaultPriorityFee)return(a=n==null?void 0:n.fees)==null?void 0:a.defaultPriorityFee;try{const c=await t.request({method:"eth_maxPriorityFeePerGas"});return ib(c)}catch{const[c,l]=await Promise.all([r?Promise.resolve(r):yc(t),RS(t)]);if(typeof c.baseFeePerGas!="bigint")throw new OS;const u=l-c.baseFeePerGas;return u<0n?0n:u}}async function rde(t,e){return AC(t,e)}async function AC(t,e){var d;const{block:r,chain:n=t.chain,request:i,type:s="eip1559"}=e||{},o=await(async()=>{var h,p;return typeof((h=n==null?void 0:n.fees)==null?void 0:h.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:i}):((p=n==null?void 0:n.fees)==null?void 0:p.baseFeeMultiplier)??1.2})();if(o<1)throw new Xfe;const c=10**o.toString().split(".")[1].length,l=h=>h*BigInt(o*c)/BigInt(c),u=r||await yc(t);if(typeof((d=n==null?void 0:n.fees)==null?void 0:d.estimateFeesPerGas)=="function")return n.fees.estimateFeesPerGas({block:r,client:t,multiply:l,request:i,type:s});if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new OS;const h=i!=null&&i.maxPriorityFeePerGas?i.maxPriorityFeePerGas:await YL(t,{block:u,chain:n,request:i}),p=l(u.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??p+h,maxPriorityFeePerGas:h}}return{gasPrice:(i==null?void 0:i.gasPrice)??l(await RS(t))}}async function JL(t,{address:e,blockTag:r="latest",blockNumber:n}){const i=await t.request({method:"eth_getTransactionCount",params:[e,n?ze(n):r]});return Nn(i)}async function hb(t,e){const{account:r=t.account,chain:n,gas:i,nonce:s,type:o}=e;if(!r)throw new bd;const a=Qi(r),c=await yc(t,{blockTag:"latest"}),l={...e,from:a.address};if(typeof s>"u"&&(l.nonce=await JL(t,{address:a.address,blockTag:"pending"})),typeof o>"u")try{l.type=Iue(l)}catch{l.type=typeof c.baseFeePerGas=="bigint"?"eip1559":"legacy"}if(l.type==="eip1559"){const{maxFeePerGas:u,maxPriorityFeePerGas:f}=await AC(t,{block:c,chain:n,request:l});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(l.gas=await MS(t,{...l,account:{address:a.address,type:"json-rpc"}})),j1(l),l}async function MS(t,e){var i,s,o;const r=e.account??t.account;if(!r)throw new bd({docsPath:"/docs/actions/public/estimateGas"});const n=Qi(r);try{const{accessList:a,blockNumber:c,blockTag:l,data:u,gas:f,gasPrice:d,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:v,to:b,value:y,...m}=n.type==="local"?await hb(t,e):e,S=(c?ze(c):void 0)||l;j1(e);const P=((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionRequest)==null?void 0:o.format)||sb,T=P({...IS(m,{format:P}),from:n.address,accessList:a,data:u,gas:f,gasPrice:d,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:v,to:b,value:y}),w=await t.request({method:"eth_estimateGas",params:S?[T,S]:[T]});return BigInt(w)}catch(a){throw Jfe(a,{...e,account:n,chain:t.chain})}}async function nde(t,{abi:e,address:r,args:n,functionName:i,...s}){const o=Dc({abi:e,args:n,functionName:i});try{return await MS(t,{data:o,to:r,...s})}catch(a){const c=s.account?Qi(s.account):void 0;throw X0(a,{abi:e,address:r,args:n,docsPath:"/docs/contract/estimateContractGas",functionName:i,sender:c==null?void 0:c.address})}}const M2="/docs/contract/decodeFunctionResult";function wd({abi:t,args:e,functionName:r,data:n}){let i=t[0];if(r&&(i=B1({abi:t,args:e,name:r}),!i))throw new fy(r,{docsPath:M2});if(i.type!=="function")throw new fy(void 0,{docsPath:M2});if(!i.outputs)throw new Hue(i.name,{docsPath:M2});const s=db(i.outputs,n);if(s&&s.length>1)return s;if(s&&s.length===1)return s[0]}const ide="modulepreload",sde=function(t,e){return new URL(t,e).href},eT={},XL=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(s=>{if(s=sde(s,n),s in eT)return;eT[s]=!0;const o=s.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!n)for(let u=i.length-1;u>=0;u--){const f=i[u];if(f.href===s&&(!o||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${a}`))return;const l=document.createElement("link");if(l.rel=o?"stylesheet":ide,o||(l.as="script",l.crossOrigin=""),l.href=s,document.head.appendChild(l),o)return new Promise((u,f)=>{l.addEventListener("load",u),l.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})},_C=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],ZL=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"}],eB=[...ZL,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],ode=[...ZL,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],tT=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],rT=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],ade=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],cde="0x82ad56cb";function lde(t,{docsPath:e,...r}){let n=TS(t,r);return n instanceof ob&&(n=t),new QL(n,{docsPath:e,...r})}const $2=new Map;function $S({fn:t,id:e,shouldSplitBatch:r,wait:n=0}){const i=async()=>{const l=a();s();const u=l.map(({args:f})=>f);u.length!==0&&t(u).then(f=>{l.forEach(({pendingPromise:d},h)=>{var p;return(p=d.resolve)==null?void 0:p.call(d,[f[h],f])})}).catch(f=>{l.forEach(({pendingPromise:d})=>{var h;return(h=d.reject)==null?void 0:h.call(d,f)})})},s=()=>$2.delete(e),o=()=>a().map(({args:l})=>l),a=()=>$2.get(e)||[],c=l=>$2.set(e,[...a(),l]);return{flush:s,async schedule(l){const u={},f=new Promise((p,v)=>{u.resolve=p,u.reject=v});return(r==null?void 0:r([...o(),l]))&&i(),a().length>0?(c({args:l,pendingPromise:u}),f):(c({args:l,pendingPromise:u}),setTimeout(i,n),f)}}}async function pb(t,e){var y,m,g,S;const{account:r=t.account,batch:n=!!((y=t.batch)!=null&&y.multicall),blockNumber:i,blockTag:s="latest",accessList:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:f,nonce:d,to:h,value:p,...v}=e,b=r?Qi(r):void 0;try{j1(e);const T=(i?ze(i):void 0)||s,w=((S=(g=(m=t.chain)==null?void 0:m.formatters)==null?void 0:g.transactionRequest)==null?void 0:S.format)||sb,I=w({...IS(v,{format:w}),from:b==null?void 0:b.address,accessList:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:f,nonce:d,to:h,value:p});if(n&&ude({request:I}))try{return await fde(t,{...I,blockNumber:i,blockTag:s})}catch(j){if(!(j instanceof CL)&&!(j instanceof pC))throw j}const B=await t.request({method:"eth_call",params:T?[I,T]:[I]});return B==="0x"?{data:void 0}:{data:B}}catch(P){const T=dde(P),{offchainLookup:w,offchainLookupSignature:I}=await XL(()=>import("./ccip-a56349b9.js"),[],import.meta.url);if((T==null?void 0:T.slice(0,10))===I&&h)return{data:await w(t,{data:T,to:h})};throw lde(P,{...e,account:b,chain:t.chain})}}function ude({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(cde)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function fde(t,e){var v;const{batchSize:r=1024,wait:n=0}=typeof((v=t.batch)==null?void 0:v.multicall)=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:s="latest",data:o,multicallAddress:a,to:c}=e;let l=a;if(!l){if(!t.chain)throw new CL;l=vd({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?ze(i):void 0)||s,{schedule:d}=$S({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(b){return b.reduce((m,{data:g})=>m+(g.length-2),0)>r*2},fn:async b=>{const y=b.map(S=>({allowFailure:!0,callData:S.data,target:S.to})),m=Dc({abi:_C,args:[y],functionName:"aggregate3"}),g=await t.request({method:"eth_call",params:[{data:m,to:l},f]});return wd({abi:_C,args:[y],functionName:"aggregate3",data:g||"0x"})}}),[{returnData:h,success:p}]=await d({data:o,to:c});if(!p)throw new _S({data:h});return h==="0x"?{data:void 0}:{data:h}}function dde(t){if(!(t instanceof le))return;const e=t.walk();return typeof e.data=="object"?e.data.data:e.data}async function gc(t,{abi:e,address:r,args:n,functionName:i,...s}){const o=Dc({abi:e,args:n,functionName:i});try{const{data:a}=await pb(t,{data:o,to:r,...s});return wd({abi:e,args:n,functionName:i,data:a||"0x"})}catch(a){throw X0(a,{abi:e,address:r,args:n,docsPath:"/docs/contract/readContract",functionName:i})}}async function hde(t,{abi:e,address:r,args:n,dataSuffix:i,functionName:s,...o}){const a=o.account?Qi(o.account):void 0,c=Dc({abi:e,args:n,functionName:s});try{const{data:l}=await pb(t,{batch:!1,data:`${c}${i?i.replace("0x",""):""}`,to:r,...o});return{result:wd({abi:e,args:n,functionName:s,data:l||"0x"}),request:{abi:e,address:r,args:n,dataSuffix:i,functionName:s,...o}}}catch(l){throw X0(l,{abi:e,address:r,args:n,docsPath:"/docs/contract/simulateContract",functionName:s,sender:a==null?void 0:a.address})}}const N2=new Map,nT=new Map;let pde=0;function Ed(t,e,r){const n=++pde,i=()=>N2.get(t)||[],s=()=>{const u=i();N2.set(t,u.filter(f=>f.id!==n))},o=()=>{const u=nT.get(t);i().length===1&&u&&u(),s()},a=i();if(N2.set(t,[...a,{id:n,fns:e}]),a&&a.length>0)return o;const c={};for(const u in e)c[u]=(...f)=>{const d=i();d.length!==0&&d.forEach(h=>{var p,v;return(v=(p=h.fns)[u])==null?void 0:v.call(p,...f)})};const l=r(c);return typeof l=="function"&&nT.set(t,l),o}async function hy(t){return new Promise(e=>setTimeout(e,t))}function U1(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const s=()=>i=!1;return(async()=>{let a;e&&(a=await t({unpoll:s}));const c=await(r==null?void 0:r(a))??n;await hy(c);const l=async()=>{i&&(await t({unpoll:s}),await hy(n),l())};l()})(),s}const iT="/docs/contract/decodeEventLog";function z1({abi:t,data:e,strict:r,topics:n}){const i=r??!0,[s,...o]=n;if(!s)throw new zue({docsPath:iT});const a=t.find(p=>p.type==="event"&&s===xS(Nc(p)));if(!(a&&"name"in a)||a.type!=="event")throw new Wue(s,{docsPath:iT});const{name:c,inputs:l}=a,u=l==null?void 0:l.some(p=>!("name"in p&&p.name));let f=u?[]:{};const d=l.filter(p=>"indexed"in p&&p.indexed);if(o.length>0)for(let p=0;p!("indexed"in p&&p.indexed));if(h.length>0){if(e&&e!=="0x")try{const p=db(h,e);if(p)if(u)f=[...f,...p];else for(let v=0;v0?f:void 0}}function vde({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(db([t],e)||[])[0]}const mde=new Map,yde=new Map;function gde(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:o=>s.set(i,o)}),r=e(t,mde),n=e(t,yde);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function bde(t,{cacheKey:e,cacheTime:r=1/0}){const n=gde(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function W1(t,{cacheTime:e=t.cacheTime,maxAge:r}={}){const n=await bde(()=>t.request({method:"eth_blockNumber"}),{cacheKey:wde(t.uid),cacheTime:r??e});return BigInt(n)}async function vb(t,{filter:e}){const r="strict"in e&&e.strict;return(await e.request({method:"eth_getFilterChanges",params:[e.id]})).map(i=>{var s;if(typeof i=="string")return i;try{const{eventName:o,args:a}="abi"in e&&e.abi?z1({abi:e.abi,data:i.data,topics:i.topics,strict:r}):{eventName:void 0,args:void 0};return xs(i,{args:a,eventName:o})}catch(o){let a,c;if(o instanceof Ul||o instanceof yd){if("strict"in e&&e.strict)return;a=o.abiItem.name,c=(s=o.abiItem.inputs)==null?void 0:s.some(l=>!("name"in l&&l.name))}return xs(i,{args:c?[]:{},eventName:a})}}).filter(Boolean)}async function NS(t,{address:e,blockHash:r,fromBlock:n,toBlock:i,event:s,events:o,args:a,strict:c}={}){const l=c??!1,u=o??(s?[s]:void 0);let f=[];u&&(f=[u.flatMap(h=>F1({abi:[h],eventName:h.name,args:a}))],s&&(f=f[0]));let d;return r?d=await t.request({method:"eth_getLogs",params:[{address:e,topics:f,blockHash:r}]}):d=await t.request({method:"eth_getLogs",params:[{address:e,topics:f,fromBlock:typeof n=="bigint"?ze(n):n,toBlock:typeof i=="bigint"?ze(i):i}]}),d.map(h=>{var p;try{const{eventName:v,args:b}=u?z1({abi:u,data:h.data,topics:h.topics,strict:l}):{eventName:void 0,args:void 0};return xs(h,{args:b,eventName:v})}catch(v){let b,y;if(v instanceof Ul||v instanceof yd){if(l)return;b=v.abiItem.name,y=(p=v.abiItem.inputs)==null?void 0:p.some(m=>!("name"in m&&m.name))}return xs(h,{args:y?[]:{},eventName:b})}}).filter(Boolean)}async function mb(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function Ede(t,{abi:e,address:r,args:n,batch:i=!0,eventName:s,onError:o,onLogs:a,poll:c,pollingInterval:l=t.pollingInterval,strict:u}){return(typeof c<"u"?c:t.transport.type!=="webSocket")?(()=>{const p=Dn(["watchContractEvent",r,n,i,t.uid,s,l]),v=u??!1;return Ed(p,{onLogs:a,onError:o},b=>{let y,m,g=!1;const S=U1(async()=>{var P;if(!g){try{m=await VL(t,{abi:e,address:r,args:n,eventName:s,strict:v})}catch{}g=!0;return}try{let T;if(m)T=await vb(t,{filter:m});else{const w=await W1(t);y&&y!==w?T=await NS(t,{address:r,args:n,fromBlock:y+1n,toBlock:w,event:B1({abi:e,name:s})}):T=[],y=w}if(T.length===0)return;i?b.onLogs(T):T.forEach(w=>b.onLogs([w]))}catch(T){m&&T instanceof zl&&(g=!1),(P=b.onError)==null||P.call(b,T)}},{emitOnBegin:!0,interval:l});return async()=>{m&&await mb(t,{filter:m}),S()}})})():(()=>{let p=!0,v=()=>p=!1;return(async()=>{try{const b=s?F1({abi:e,eventName:s,args:n}):[],{unsubscribe:y}=await t.transport.subscribe({params:["logs",{address:r,topics:b}],onData(m){var S;if(!p)return;const g=m.result;try{const{eventName:P,args:T}=z1({abi:e,data:g.data,topics:g.topics,strict:u}),w=xs(g,{args:T,eventName:P});a([w])}catch(P){let T,w;if(P instanceof Ul||P instanceof yd){if(u)return;T=P.abiItem.name,w=(S=P.abiItem.inputs)==null?void 0:S.some(B=>!("name"in B&&B.name))}const I=xs(g,{args:w?[]:{},eventName:T});a([I])}},onError(m){o==null||o(m)}});v=y,p||v()}catch(b){o==null||o(b)}})(),v})()}function xde(t,{docsPath:e,...r}){let n=TS(t,r);return n instanceof ob&&(n=t),new Pue(n,{docsPath:e,...r})}async function Z0(t){const e=await t.request({method:"eth_chainId"});return Nn(e)}async function DS(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]})}async function LS(t,e){var v,b,y;const{account:r=t.account,chain:n=t.chain,accessList:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d,...h}=e;if(!r)throw new bd({docsPath:"/docs/actions/wallet/sendTransaction"});const p=Qi(r);try{j1(e);let m;if(n!==null&&(m=await Z0(t),SL({currentChainId:m,chain:n})),p.type==="local"){const P=await hb(t,{account:p,accessList:i,chain:n,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d,...h});m||(m=await Z0(t));const T=(v=n==null?void 0:n.serializers)==null?void 0:v.transaction,w=await p.signTransaction({...P,chainId:m},{serializer:T});return await DS(t,{serializedTransaction:w})}const g=((y=(b=n==null?void 0:n.formatters)==null?void 0:b.transactionRequest)==null?void 0:y.format)||sb,S=g({...IS(h,{format:g}),accessList:i,data:s,from:p.address,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d});return await t.request({method:"eth_sendTransaction",params:[S]})}catch(m){throw xde(m,{...e,account:p,chain:e.chain||void 0})}}async function Cde(t,{abi:e,address:r,args:n,dataSuffix:i,functionName:s,...o}){const a=Dc({abi:e,args:n,functionName:s});return await LS(t,{data:`${a}${i?i.replace("0x",""):""}`,to:r,...o})}async function Sde(t,{chain:e}){const{id:r,name:n,nativeCurrency:i,rpcUrls:s,blockExplorers:o}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:ze(r),chainName:n,nativeCurrency:i,rpcUrls:s.default.http,blockExplorerUrls:o?Object.values(o).map(({url:a})=>a):void 0}]})}const PC=256;let Kp=PC,Qp;function kde(t=11){if(!Qp||Kp+t>PC*2){Qp="",Kp=0;for(let e=0;e{const y=b(v);for(const g in h)delete y[g];const m={...v,...y};return Object.assign(m,{extend:p(m)})}}return Object.assign(h,{extend:p(h)})}function rB(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,s)=>{const o=async({count:a=0}={})=>{const c=async({error:l})=>{const u=typeof e=="function"?e({count:a,error:l}):e;u&&await hy(u),o({count:a+1})};try{const l=await t();i(l)}catch(l){if(a"code"in t?t.code!==-1&&t.code!==-32004&&t.code!==-32005&&t.code!==-32042&&t.code!==-32603:t instanceof jh&&t.status?t.status!==403&&t.status!==408&&t.status!==413&&t.status!==429&&t.status!==500&&t.status!==502&&t.status!==503&&t.status!==504:!1;function Ade(t,{retryDelay:e=150,retryCount:r=3}={}){return async n=>rB(async()=>{try{return await t(n)}catch(i){const s=i;switch(s.code){case F0.code:throw new F0(s);case j0.code:throw new j0(s);case U0.code:throw new U0(s);case z0.code:throw new z0(s);case zf.code:throw new zf(s);case zl.code:throw new zl(s);case W0.code:throw new W0(s);case vc.code:throw new vc(s);case H0.code:throw new H0(s);case q0.code:throw new q0(s);case V0.code:throw new V0(s);case G0.code:throw new G0(s);case Vr.code:throw new Vr(s);case K0.code:throw new K0(s);case Q0.code:throw new Q0(s);case Y0.code:throw new Y0(s);case J0.code:throw new J0(s);case mc.code:throw new mc(s);case 5e3:throw new Vr(s);default:throw i instanceof le?i:new Kfe(s)}}},{delay:({count:i,error:s})=>{var o;if(s&&s instanceof jh){const a=(o=s==null?void 0:s.headers)==null?void 0:o.get("Retry-After");if(a!=null&&a.match(/\d/))return parseInt(a)*1e3}return~~(1<!nB(i)})}function yb({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:s,type:o},a){return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:s,type:o},request:Ade(r,{retryCount:n,retryDelay:i}),value:a}}function BS(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:s})=>yb({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??s,retryDelay:i,type:"custom"})}function sT(t,e={}){const{key:r="fallback",name:n="Fallback",rank:i=!1,retryCount:s,retryDelay:o}=e;return({chain:a,pollingInterval:c=4e3,timeout:l})=>{let u=t,f=()=>{};const d=yb({key:r,name:n,async request({method:h,params:p}){const v=async(b=0)=>{const y=u[b]({chain:a,retryCount:0,timeout:l});try{const m=await y.request({method:h,params:p});return f({method:h,params:p,response:m,transport:y,status:"success"}),m}catch(m){if(f({error:m,method:h,params:p,transport:y,status:"error"}),nB(m)||b===u.length-1)throw m;return v(b+1)}};return v()},retryCount:s,retryDelay:o,type:"fallback"},{onResponse:h=>f=h,transports:u.map(h=>h({chain:a,retryCount:0}))});if(i){const h=typeof i=="object"?i:{};_de({chain:a,interval:h.interval??c,onTransports:p=>u=p,sampleCount:h.sampleCount,timeout:h.timeout,transports:u,weights:h.weights})}return d}}function _de({chain:t,interval:e=4e3,onTransports:r,sampleCount:n=10,timeout:i=1e3,transports:s,weights:o={}}){const{stability:a=.7,latency:c=.3}=o,l=[],u=async()=>{const f=await Promise.all(s.map(async p=>{const v=p({chain:t,retryCount:0,timeout:i}),b=Date.now();let y,m;try{await v.request({method:"net_listening"}),m=1}catch{m=0}finally{y=Date.now()}return{latency:y-b,success:m}}));l.push(f),l.length>n&&l.shift();const d=Math.max(...l.map(p=>Math.max(...p.map(({latency:v})=>v)))),h=s.map((p,v)=>{const b=l.map(P=>P[v].latency),m=1-b.reduce((P,T)=>P+T,0)/b.length/d,g=l.map(P=>P[v].success),S=g.reduce((P,T)=>P+T,0)/g.length;return S===0?[0,v]:[c*m+a*S,v]}).sort((p,v)=>v[0]-p[0]);r(h.map(([,p])=>s[p])),await hy(e),u()};u()}class iB extends le{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}var Iu=null;typeof WebSocket<"u"?Iu=WebSocket:typeof MozWebSocket<"u"?Iu=MozWebSocket:typeof global<"u"?Iu=global.WebSocket||global.MozWebSocket:typeof window<"u"?Iu=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(Iu=self.WebSocket||self.MozWebSocket);const oT=Iu;function sB(t,{errorInstance:e,timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let o;try{const a=new AbortController;r>0&&(o=setTimeout(()=>{n?a.abort():s(e)},r)),i(await t({signal:a==null?void 0:a.signal}))}catch(a){a.name==="AbortError"&&s(e),s(a)}finally{clearTimeout(o)}})()})}let TC=0;async function Pde(t,{body:e,fetchOptions:r={},timeout:n=1e4}){var a;const{headers:i,method:s,signal:o}=r;try{const c=await sB(async({signal:u})=>await fetch(t,{...r,body:Array.isArray(e)?Dn(e.map(d=>({jsonrpc:"2.0",id:d.id??TC++,...d}))):Dn({jsonrpc:"2.0",id:e.id??TC++,...e}),headers:{...i,"Content-Type":"application/json"},method:s||"POST",signal:o||(n>0?u:void 0)}),{errorInstance:new kC({body:e,url:t}),timeout:n,signal:!0});let l;if((a=c.headers.get("Content-Type"))!=null&&a.startsWith("application/json")?l=await c.json():l=await c.text(),!c.ok)throw new jh({body:e,details:Dn(l.error)||c.statusText,headers:c.headers,status:c.status,url:t});return l}catch(c){throw c instanceof jh||c instanceof kC?c:new jh({body:e,details:c.message,url:t})}}const D2=new Map;async function L2(t){let e=D2.get(t);if(e)return e;const{schedule:r}=$S({id:t,fn:async()=>{const s=new oT(t),o=new Map,a=new Map,c=({data:u})=>{const f=JSON.parse(u),d=f.method==="eth_subscription",h=d?f.params.subscription:f.id,p=d?a:o,v=p.get(h);v&&v({data:u}),d||p.delete(h)},l=()=>{D2.delete(t),s.removeEventListener("close",l),s.removeEventListener("message",c)};return s.addEventListener("close",l),s.addEventListener("message",c),s.readyState===oT.CONNECTING&&await new Promise((u,f)=>{s&&(s.onopen=u,s.onerror=f)}),e=Object.assign(s,{requests:o,subscriptions:a}),D2.set(t,e),[e]}}),[n,[i]]=await r();return i}function Tde(t,{body:e,onResponse:r}){if(t.readyState===t.CLOSED||t.readyState===t.CLOSING)throw new Vfe({body:e,url:t.url,details:"Socket is closed."});const n=TC++,i=({data:s})=>{var a;const o=JSON.parse(s);typeof o.id=="number"&&n!==o.id||(r==null||r(o),e.method==="eth_subscribe"&&typeof o.result=="string"&&t.subscriptions.set(o.result,i),e.method==="eth_unsubscribe"&&t.subscriptions.delete((a=e.params)==null?void 0:a[0]))};return t.requests.set(n,i),t.send(JSON.stringify({jsonrpc:"2.0",...e,id:n})),t}async function Ide(t,{body:e,timeout:r=1e4}){return sB(()=>new Promise(n=>mf.webSocket(t,{body:e,onResponse:n})),{errorInstance:new kC({body:e,url:t.url}),timeout:r})}const mf={http:Pde,webSocket:Tde,webSocketAsync:Ide};function oB(t,e={}){const{batch:r,fetchOptions:n,key:i="http",name:s="HTTP JSON-RPC",retryDelay:o}=e;return({chain:a,retryCount:c,timeout:l})=>{const{batchSize:u=1e3,wait:f=0}=typeof r=="object"?r:{},d=e.retryCount??c,h=l??e.timeout??1e4,p=t||(a==null?void 0:a.rpcUrls.default.http[0]);if(!p)throw new iB;return yb({key:i,name:s,async request({method:v,params:b}){const y={method:v,params:b},{schedule:m}=$S({id:`${t}`,wait:f,shouldSplitBatch(T){return T.length>u},fn:T=>mf.http(p,{body:T,fetchOptions:n,timeout:h})}),g=async T=>r?m(T):[await mf.http(p,{body:T,fetchOptions:n,timeout:h})],[{error:S,result:P}]=await g(y);if(S)throw new PS({body:y,error:S,url:p});return P},retryCount:d,retryDelay:o,timeout:h,type:"http"},{url:t})}}function FS(t,e){var n,i,s;if(!(t instanceof le))return!1;const r=t.walk(o=>o instanceof SC);return r instanceof SC?!!(((n=r.data)==null?void 0:n.errorName)==="ResolverNotFound"||((i=r.data)==null?void 0:i.errorName)==="ResolverWildcardNotSupported"||(s=r.reason)!=null&&s.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&r.reason===GL[50]):!1}function aB(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return vo(e)?e:null}function Lv(t){let e=new Uint8Array(32).fill(0);if(!t)return L0(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=aB(r[n]),s=i?jl(i):Qn(Bo(r[n]),"bytes");e=Qn(Zo([e,s]),"bytes")}return L0(e)}function Ode(t){return`[${t.slice(2)}]`}function Rde(t){const e=new Uint8Array(32).fill(0);return t?aB(t)||Qn(Bo(t)):L0(e)}function gb(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(Bo(e).byteLength+2);let n=0;const i=e.split(".");for(let s=0;s255&&(o=Bo(Ode(Rde(i[s])))),r[n]=o.length,r.set(o,n+1),n+=o.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}async function Mde(t,{blockNumber:e,blockTag:r,coinType:n,name:i,universalResolverAddress:s}){let o=s;if(!o){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=vd({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const a=Dc({abi:rT,functionName:"addr",...n!=null?{args:[Lv(i),BigInt(n)]}:{args:[Lv(i)]}}),c=await gc(t,{address:o,abi:eB,functionName:"resolve",args:[fa(gb(i)),a],blockNumber:e,blockTag:r});if(c[0]==="0x")return null;const l=wd({abi:rT,args:n!=null?[Lv(i),BigInt(n)]:void 0,functionName:"addr",data:c[0]});return l==="0x"||pf(l)==="0x00"?null:l}catch(a){if(FS(a,"resolve"))return null;throw a}}class $de extends le{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class Zd extends le{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class jS extends le{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class Nde extends le{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const Dde=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,Lde=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,Bde=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Fde=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function jde(t){try{const e=await fetch(t,{method:"HEAD"});if(e.status===200){const r=e.headers.get("content-type");return r==null?void 0:r.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=t})}}function aT(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function cB({uri:t,gatewayUrls:e}){const r=Bde.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=aT(e==null?void 0:e.ipfs,"https://ipfs.io"),i=aT(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(Dde),{protocol:o,subpath:a,target:c,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=o==="ipns:/"||a==="ipns/",f=o==="ipfs:/"||a==="ipfs/"||Lde.test(t);if(t.startsWith("http")&&!u&&!f){let h=t;return e!=null&&e.arweave&&(h=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:h,isOnChain:!1,isEncoded:!1}}if((u||f)&&c)return{uri:`${n}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${i}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let d=t.replace(Fde,"");if(d.startsWith("i.json());return await US({gatewayUrls:t,uri:lB(r)})}catch{throw new jS({uri:e})}}async function US({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=cB({uri:e,gatewayUrls:t});if(n||await jde(r))return r;throw new jS({uri:e})}function zde(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[s,o]=r.split(":"),[a,c]=n.split(":");if(!s||s.toLowerCase()!=="eip155")throw new Zd({reason:"Only EIP-155 supported"});if(!o)throw new Zd({reason:"Chain ID not found"});if(!c)throw new Zd({reason:"Contract address not found"});if(!i)throw new Zd({reason:"Token ID not found"});if(!a)throw new Zd({reason:"ERC namespace not found"});return{chainID:parseInt(o),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}async function Wde(t,{nft:e}){if(e.namespace==="erc721")return gc(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return gc(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new Nde({namespace:e.namespace})}async function Hde(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?qde(t,{gatewayUrls:e,record:r}):US({uri:r,gatewayUrls:e})}async function qde(t,{gatewayUrls:e,record:r}){const n=zde(r),i=await Wde(t,{nft:n}),{uri:s,isOnChain:o,isEncoded:a}=cB({uri:i,gatewayUrls:e});if(o&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const l=a?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(l);return US({uri:lB(u),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),Ude({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,c)})}async function uB(t,{blockNumber:e,blockTag:r,name:n,key:i,universalResolverAddress:s}){let o=s;if(!o){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=vd({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const a=await gc(t,{address:o,abi:eB,functionName:"resolve",args:[fa(gb(n)),Dc({abi:tT,functionName:"text",args:[Lv(n),i]})],blockNumber:e,blockTag:r});if(a[0]==="0x")return null;const c=wd({abi:tT,functionName:"text",data:a[0]});return c===""?null:c}catch(a){if(FS(a,"resolve"))return null;throw a}}async function Vde(t,{blockNumber:e,blockTag:r,gatewayUrls:n,name:i,universalResolverAddress:s}){const o=await uB(t,{blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:s});if(!o)return null;try{return await Hde(t,{record:o,gatewayUrls:n})}catch{return null}}async function Gde(t,{address:e,blockNumber:r,blockTag:n,universalResolverAddress:i}){let s=i;if(!s){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");s=vd({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const o=`${e.toLowerCase().substring(2)}.addr.reverse`;try{return(await gc(t,{address:s,abi:ode,functionName:"reverse",args:[fa(gb(o))],blockNumber:r,blockTag:n}))[0]}catch(a){if(FS(a,"reverse"))return null;throw a}}async function Kde(t,{blockNumber:e,blockTag:r,name:n,universalResolverAddress:i}){let s=i;if(!s){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");s=vd({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}const[o]=await gc(t,{address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[fa(gb(n))],blockNumber:e,blockTag:r});return o}async function Qde(t){const e=fb(t,{method:"eth_newBlockFilter"}),r=await t.request({method:"eth_newBlockFilter"});return{id:r,request:e(r),type:"block"}}async function fB(t,{address:e,args:r,event:n,events:i,fromBlock:s,strict:o,toBlock:a}={}){const c=i??(n?[n]:void 0),l=fb(t,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap(d=>F1({abi:[d],eventName:d.name,args:r}))],n&&(u=u[0]));const f=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof s=="bigint"?ze(s):s,toBlock:typeof a=="bigint"?ze(a):a,...u.length?{topics:u}:{}}]});return{abi:c,args:r,eventName:n?n.name:void 0,fromBlock:s,id:f,request:l(f),strict:o,toBlock:a,type:"event"}}async function dB(t){const e=fb(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}async function Yde(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r?ze(r):void 0,s=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(s)}async function Jde(t,{blockHash:e,blockNumber:r,blockTag:n="latest"}={}){const i=r!==void 0?ze(r):void 0;let s;return e?s=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]}):s=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[i||n]}),Nn(s)}async function Xde(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r!==void 0?ze(r):void 0,s=await t.request({method:"eth_getCode",params:[e,i||n]});if(s!=="0x")return s}function Zde(t){var e;return{baseFeePerGas:t.baseFeePerGas.map(r=>BigInt(r)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:(e=t.reward)==null?void 0:e.map(r=>r.map(n=>BigInt(n)))}}async function ehe(t,{blockCount:e,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const s=r?ze(r):void 0,o=await t.request({method:"eth_feeHistory",params:[ze(e),s||n,i]});return Zde(o)}async function the(t,{filter:e}){const r=e.strict??!1;return(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(i=>{var s;try{const{eventName:o,args:a}="abi"in e&&e.abi?z1({abi:e.abi,data:i.data,topics:i.topics,strict:r}):{eventName:void 0,args:void 0};return xs(i,{args:a,eventName:o})}catch(o){let a,c;if(o instanceof Ul||o instanceof yd){if("strict"in e&&e.strict)return;a=o.abiItem.name,c=(s=o.abiItem.inputs)==null?void 0:s.some(l=>!("name"in l&&l.name))}return xs(i,{args:c?[]:{},eventName:a})}}).filter(Boolean)}async function rhe(t,{address:e,blockNumber:r,blockTag:n="latest",slot:i}){const s=r!==void 0?ze(r):void 0;return await t.request({method:"eth_getStorageAt",params:[e,i,s||n]})}async function zS(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){var u,f,d;const o=n||"latest",a=r!==void 0?ze(r):void 0;let c=null;if(i?c=await t.request({method:"eth_getTransactionByHash",params:[i]}):e?c=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,ze(s)]}):(a||o)&&(c=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||o,ze(s)]})),!c)throw new RL({blockHash:e,blockNumber:r,blockTag:o,hash:i,index:s});return(((d=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.transaction)==null?void 0:d.format)||TL)(c)}async function nhe(t,{hash:e,transactionReceipt:r}){const[n,i]=await Promise.all([W1(t),e?zS(t,{hash:e}):void 0]),s=(r==null?void 0:r.blockNumber)||(i==null?void 0:i.blockNumber);return s?n-s+1n:0n}async function IC(t,{hash:e}){var i,s,o;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]});if(!r)throw new ML({hash:e});return(((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:o.format)||wue)(r)}async function ihe(t,e){var v;const{allowFailure:r=!0,batchSize:n,blockNumber:i,blockTag:s,contracts:o,multicallAddress:a}=e,c=n??(typeof((v=t.batch)==null?void 0:v.multicall)=="object"&&t.batch.multicall.batchSize||1024);let l=a;if(!l){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");l=vd({blockNumber:i,chain:t.chain,contract:"multicall3"})}const u=[[]];let f=0,d=0;for(let b=0;b0&&d>c&&u[f].length>0&&(f++,d=(P.length-2)/2,u[f]=[]),u[f]=[...u[f],{allowFailure:!0,callData:P,target:m}]}catch(P){const T=X0(P,{abi:y,address:m,args:g,docsPath:"/docs/contract/multicall",functionName:S});if(!r)throw T;u[f]=[...u[f],{allowFailure:!0,callData:"0x",target:m}]}}const h=await Promise.allSettled(u.map(b=>gc(t,{abi:_C,address:l,args:[b],blockNumber:i,blockTag:s,functionName:"aggregate3"}))),p=[];for(let b=0;b"u"?{}:t,s={EIP712Domain:gB({domain:i}),...n};yB({domain:i,message:e,primaryType:r,types:s});const o=["0x1901"];return i&&o.push(che({domain:i,types:s})),r!=="EIP712Domain"&&o.push(hB({data:e,primaryType:r,types:s})),Qn(Zo(o))}function che({domain:t,types:e}){return hB({data:t,primaryType:"EIP712Domain",types:e})}function hB({data:t,primaryType:e,types:r}){const n=pB({data:t,primaryType:e,types:r});return Qn(n)}function pB({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[lhe({primaryType:e,types:r})];for(const s of r[e]){const[o,a]=mB({types:r,name:s.name,type:s.type,value:t[s.name]});n.push(o),i.push(a)}return L1(n,i)}function lhe({primaryType:t,types:e}){const r=fa(uhe({primaryType:t,types:e}));return Qn(r)}function uhe({primaryType:t,types:e}){let r="";const n=vB({primaryType:t,types:e});n.delete(t);const i=[t,...Array.from(n).sort()];for(const s of i)r+=`${s}(${e[s].map(({name:o,type:a})=>`${a} ${o}`).join(",")})`;return r}function vB({primaryType:t,types:e},r=new Set){const n=t.match(/^\w*/u),i=n==null?void 0:n[0];if(r.has(i)||e[i]===void 0)return r;r.add(i);for(const s of e[i])vB({primaryType:s.type,types:e},r);return r}function mB({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},Qn(pB({data:n,primaryType:r,types:t}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},Qn(n)];if(r==="string")return[{type:"bytes32"},Qn(fa(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),s=n.map(o=>mB({name:e,type:i,types:t,value:o}));return[{type:"bytes32"},Qn(L1(s.map(([o])=>o),s.map(([,o])=>o)))]}return[{type:r},n]}function yB({domain:t,message:e,primaryType:r,types:n}){const i=n,s=(o,a)=>{for(const c of o){const{name:l,type:u}=c,f=u,d=a[l],h=f.match(ohe);if(h&&(typeof d=="number"||typeof d=="bigint")){const[b,y,m]=h;ze(d,{signed:y==="int",size:parseInt(m)/8})}if(f==="address"&&typeof d=="string"&&!Uf(d))throw new B0({address:d});const p=f.match(she);if(p){const[b,y]=p;if(y&&Lr(d)!==parseInt(y))throw new que({expectedSize:parseInt(y),givenSize:Lr(d)})}const v=i[f];v&&s(v,d)}};if(i.EIP712Domain&&t&&s(i.EIP712Domain,t),r!=="EIP712Domain"){const o=i[r];s(o,e)}}function gB({domain:t}){return[typeof(t==null?void 0:t.name)=="string"&&{name:"name",type:"string"},(t==null?void 0:t.version)&&{name:"version",type:"string"},typeof(t==null?void 0:t.chainId)=="number"&&{name:"chainId",type:"uint256"},(t==null?void 0:t.verifyingContract)&&{name:"verifyingContract",type:"address"},(t==null?void 0:t.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}const B2="/docs/contract/encodeDeployData";function bB({abi:t,args:e,bytecode:r}){if(!e||e.length===0)return r;const n=t.find(s=>"type"in s&&s.type==="constructor");if(!n)throw new Bue({docsPath:B2});if(!("inputs"in n))throw new VP({docsPath:B2});if(!n.inputs||n.inputs.length===0)throw new VP({docsPath:B2});const i=L1(n.inputs,e);return yS([r,i])}function fhe(t,e){const r=(()=>typeof t=="string"?Bo(t):t.raw instanceof Uint8Array?t.raw:jl(t.raw))(),n=Bo(`Ethereum Signed Message: -${r.length}`);return Qn(Zo([n,r]),e)}const dhe="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */BigInt(0);BigInt(1);BigInt(2);function hhe(t,e){if(t.length!==e.length)return!1;for(let r=0;r{const f=Dn(["watchBlockNumber",t.uid,e,r,o]);return Ed(f,{onBlockNumber:n,onError:i},d=>U1(async()=>{var h;try{const p=await W1(t,{cacheTime:0});if(c){if(p===c)return;if(p-c>1&&r)for(let v=c+1n;vc)&&(d.onBlockNumber(p,c),c=p)}catch(p){(h=d.onError)==null||h.call(d,p)}},{emitOnBegin:e,interval:o}))})():(()=>{let f=!0,d=()=>f=!1;return(async()=>{try{const{unsubscribe:h}=await t.transport.subscribe({params:["newHeads"],onData(p){var b;if(!f)return;const v=ib((b=p.result)==null?void 0:b.number);n(v,c),c=v},onError(p){i==null||i(p)}});d=h,f||d()}catch(h){i==null||i(h)}})(),d})()}async function yhe(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,timeout:s}){const o=Dn(["waitForTransactionReceipt",t.uid,r]);let a,c,l,u=!1;return new Promise((f,d)=>{s&&setTimeout(()=>d(new Tue({hash:r})),s);const h=Ed(o,{onReplaced:n,resolve:f,reject:d},p=>{const v=EB(t,{emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(b){if(u)return;let y=b;const m=g=>{v(),g(),h()};try{if(l){if(y-l.blockNumber+1np.resolve(l));return}if(a||(u=!0,await rB(async()=>{a=await zS(t,{hash:r}),a.blockNumber&&(y=a.blockNumber)},{delay:({count:g})=>~~(1<0&&y-l.blockNumber+1np.resolve(l))}catch(g){if(a&&(g instanceof RL||g instanceof ML))try{c=a;const P=(await yc(t,{blockNumber:y,includeTransactions:!0})).transactions.find(({from:w,nonce:I})=>w===c.from&&I===c.nonce);if(!P||(l=await IC(t,{hash:P.hash}),y-l.blockNumber+1n{var w;(w=p.onReplaced)==null||w.call(p,{reason:T,replacedTransaction:c,transaction:P,transactionReceipt:l}),p.resolve(l)})}catch(S){m(()=>p.reject(S))}else m(()=>p.reject(g))}}})})})}function ghe(t,{blockTag:e="latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:s,includeTransactions:o,poll:a,pollingInterval:c=t.pollingInterval}){const l=typeof a<"u"?a:t.transport.type!=="webSocket",u=o??!1;let f;return l?(()=>{const p=Dn(["watchBlocks",t.uid,r,n,u,c]);return Ed(p,{onBlock:i,onError:s},v=>U1(async()=>{var b;try{const y=await yc(t,{blockTag:e,includeTransactions:u});if(y.number&&(f!=null&&f.number)){if(y.number===f.number)return;if(y.number-f.number>1&&r)for(let m=(f==null?void 0:f.number)+1n;mf.number)&&(v.onBlock(y,f),f=y)}catch(y){(b=v.onError)==null||b.call(v,y)}},{emitOnBegin:n,interval:c}))})():(()=>{let p=!0,v=()=>p=!1;return(async()=>{try{const{unsubscribe:b}=await t.transport.subscribe({params:["newHeads"],onData(y){var S,P,T;if(!p)return;const g=(((T=(P=(S=t.chain)==null?void 0:S.formatters)==null?void 0:P.block)==null?void 0:T.format)||IL)(y.result);i(g,f),f=g},onError(y){s==null||s(y)}});v=b,p||v()}catch(b){s==null||s(b)}})(),v})()}function bhe(t,{address:e,args:r,batch:n=!0,event:i,events:s,onError:o,onLogs:a,poll:c,pollingInterval:l=t.pollingInterval,strict:u}){const f=typeof c<"u"?c:t.transport.type!=="webSocket",d=u??!1;return f?(()=>{const v=Dn(["watchEvent",e,r,n,t.uid,i,l]);return Ed(v,{onLogs:a,onError:o},b=>{let y,m,g=!1;const S=U1(async()=>{var P;if(!g){try{m=await fB(t,{address:e,args:r,event:i,events:s,strict:d})}catch{}g=!0;return}try{let T;if(m)T=await vb(t,{filter:m});else{const w=await W1(t);y&&y!==w?T=await NS(t,{address:e,args:r,event:i,events:s,fromBlock:y+1n,toBlock:w}):T=[],y=w}if(T.length===0)return;n?b.onLogs(T):T.forEach(w=>b.onLogs([w]))}catch(T){m&&T instanceof zl&&(g=!1),(P=b.onError)==null||P.call(b,T)}},{emitOnBegin:!0,interval:l});return async()=>{m&&await mb(t,{filter:m}),S()}})})():(()=>{let v=!0,b=()=>v=!1;return(async()=>{try{const y=s??(i?[i]:void 0);let m=[];y&&(m=[y.flatMap(S=>F1({abi:[S],eventName:S.name,args:r}))],i&&(m=m[0]));const{unsubscribe:g}=await t.transport.subscribe({params:["logs",{address:e,topics:m}],onData(S){var T;if(!v)return;const P=S.result;try{const{eventName:w,args:I}=z1({abi:y,data:P.data,topics:P.topics,strict:d}),B=xs(P,{args:I,eventName:w});a([B])}catch(w){let I,B;if(w instanceof Ul||w instanceof yd){if(u)return;I=w.abiItem.name,B=(T=w.abiItem.inputs)==null?void 0:T.some(H=>!("name"in H&&H.name))}const j=xs(P,{args:B?[]:{},eventName:I});a([j])}},onError(S){o==null||o(S)}});b=g,v||b()}catch(y){o==null||o(y)}})(),b})()}function whe(t,{batch:e=!0,onError:r,onTransactions:n,poll:i,pollingInterval:s=t.pollingInterval}){return(typeof i<"u"?i:t.transport.type!=="webSocket")?(()=>{const l=Dn(["watchPendingTransactions",t.uid,e,s]);return Ed(l,{onTransactions:n,onError:r},u=>{let f;const d=U1(async()=>{var h;try{if(!f)try{f=await dB(t);return}catch(v){throw d(),v}const p=await vb(t,{filter:f});if(p.length===0)return;e?u.onTransactions(p):p.forEach(v=>u.onTransactions([v]))}catch(p){(h=u.onError)==null||h.call(u,p)}},{emitOnBegin:!0,interval:s});return async()=>{f&&await mb(t,{filter:f}),d()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{const{unsubscribe:f}=await t.transport.subscribe({params:["newPendingTransactions"],onData(d){if(!l)return;const h=d.result;n([h])},onError(d){r==null||r(d)}});u=f,l||u()}catch(f){r==null||r(f)}})(),u})()}function Ehe(t){return{call:e=>pb(t,e),createBlockFilter:()=>Qde(t),createContractEventFilter:e=>VL(t,e),createEventFilter:e=>fB(t,e),createPendingTransactionFilter:()=>dB(t),estimateContractGas:e=>nde(t,e),estimateGas:e=>MS(t,e),getBalance:e=>Yde(t,e),getBlock:e=>yc(t,e),getBlockNumber:e=>W1(t,e),getBlockTransactionCount:e=>Jde(t,e),getBytecode:e=>Xde(t,e),getChainId:()=>Z0(t),getEnsAddress:e=>Mde(t,e),getEnsAvatar:e=>Vde(t,e),getEnsName:e=>Gde(t,e),getEnsResolver:e=>Kde(t,e),getEnsText:e=>uB(t,e),getFeeHistory:e=>ehe(t,e),estimateFeesPerGas:e=>rde(t,e),getFilterChanges:e=>vb(t,e),getFilterLogs:e=>the(t,e),getGasPrice:()=>RS(t),getLogs:e=>NS(t,e),estimateMaxPriorityFeePerGas:e=>tde(t,e),getStorageAt:e=>rhe(t,e),getTransaction:e=>zS(t,e),getTransactionConfirmations:e=>nhe(t,e),getTransactionCount:e=>JL(t,e),getTransactionReceipt:e=>IC(t,e),multicall:e=>ihe(t,e),prepareTransactionRequest:e=>hb(t,e),readContract:e=>gc(t,e),sendRawTransaction:e=>DS(t,e),simulateContract:e=>hde(t,e),verifyMessage:e=>vhe(t,e),verifyTypedData:e=>mhe(t,e),uninstallFilter:e=>mb(t,e),waitForTransactionReceipt:e=>yhe(t,e),watchBlocks:e=>ghe(t,e),watchBlockNumber:e=>EB(t,e),watchContractEvent:e=>Ede(t,e),watchEvent:e=>bhe(t,e),watchPendingTransactions:e=>whe(t,e)}}function cT(t){const{key:e="public",name:r="Public Client"}=t;return tB({...t,key:e,name:r,type:"publicClient"}).extend(Ehe)}function xhe(t,{abi:e,args:r,bytecode:n,...i}){const s=bB({abi:e,args:r,bytecode:n});return LS(t,{...i,data:s})}async function Che(t){return(await t.request({method:"eth_accounts"})).map(r=>AS(r))}async function She(t){return await t.request({method:"wallet_getPermissions"})}async function khe(t){return(await t.request({method:"eth_requestAccounts"})).map(r=>Li(r))}async function Ahe(t,e){return t.request({method:"wallet_requestPermissions",params:[e]})}async function _he(t,{account:e=t.account,message:r}){if(!e)throw new bd({docsPath:"/docs/actions/wallet/signMessage"});const n=Qi(e);if(n.type==="local")return n.signMessage({message:r});const i=(()=>typeof r=="string"?vS(r):r.raw instanceof Uint8Array?fa(r.raw):r.raw)();return t.request({method:"personal_sign",params:[i,n.address]})}async function Phe(t,e){var l,u,f,d;const{account:r=t.account,chain:n=t.chain,...i}=e;if(!r)throw new bd({docsPath:"/docs/actions/wallet/signTransaction"});const s=Qi(r);j1({account:s,...e});const o=await Z0(t);n!==null&&SL({currentChainId:o,chain:n});const a=(n==null?void 0:n.formatters)||((l=t.chain)==null?void 0:l.formatters),c=((u=a==null?void 0:a.transactionRequest)==null?void 0:u.format)||sb;return s.type==="local"?s.signTransaction({chainId:o,...i},{serializer:(d=(f=t.chain)==null?void 0:f.serializers)==null?void 0:d.transaction}):await t.request({method:"eth_signTransaction",params:[{...c(i),chainId:ze(o),from:s.address}]})}async function The(t,{account:e=t.account,domain:r,message:n,primaryType:i,types:s}){if(!e)throw new bd({docsPath:"/docs/actions/wallet/signTypedData"});const o=Qi(e),a={EIP712Domain:gB({domain:r}),...s};if(yB({domain:r,message:n,primaryType:i,types:a}),o.type==="local")return o.signTypedData({domain:r,primaryType:i,types:a,message:n});const c=Dn({domain:r??{},primaryType:i,types:a,message:n},(l,u)=>vo(u)?u.toLowerCase():u);return t.request({method:"eth_signTypedData_v4",params:[o.address,c]})}async function Ihe(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:ze(e)}]})}async function Ohe(t,e){return await t.request({method:"wallet_watchAsset",params:e})}function Rhe(t){return{addChain:e=>Sde(t,e),deployContract:e=>xhe(t,e),getAddresses:()=>Che(t),getChainId:()=>Z0(t),getPermissions:()=>She(t),prepareTransactionRequest:e=>hb(t,e),requestAddresses:()=>khe(t),requestPermissions:e=>Ahe(t,e),sendRawTransaction:e=>DS(t,e),sendTransaction:e=>LS(t,e),signMessage:e=>_he(t,e),signTransaction:e=>Phe(t,e),signTypedData:e=>The(t,e),switchChain:e=>Ihe(t,e),watchAsset:e=>Ohe(t,e),writeContract:e=>Cde(t,e)}}function bb(t){const{key:e="wallet",name:r="Wallet Client",transport:n}=t;return tB({...t,key:e,name:r,transport:s=>n({...s,retryCount:0}),type:"walletClient"}).extend(Rhe)}function Mhe(t,e={}){const{key:r="webSocket",name:n="WebSocket JSON-RPC",retryDelay:i}=e;return({chain:s,retryCount:o,timeout:a})=>{var f;const c=e.retryCount??o,l=a??e.timeout??1e4,u=t||((f=s==null?void 0:s.rpcUrls.default.webSocket)==null?void 0:f[0]);if(!u)throw new iB;return yb({key:r,name:n,async request({method:d,params:h}){const p={method:d,params:h},v=await L2(u),{error:b,result:y}=await mf.webSocketAsync(v,{body:p,timeout:l});if(b)throw new PS({body:p,error:b,url:u});return y},retryCount:c,retryDelay:i,timeout:l,type:"webSocket"},{getSocket(){return L2(u)},async subscribe({params:d,onData:h,onError:p}){const v=await L2(u),{result:b}=await new Promise((y,m)=>mf.webSocket(v,{body:{method:"eth_subscribe",params:d},onResponse(g){if(g.error){m(g.error),p==null||p(g.error);return}if(typeof g.id=="number"){y(g);return}g.method==="eth_subscription"&&h(g.params)}}));return{subscriptionId:b,async unsubscribe(){return new Promise(y=>mf.webSocket(v,{body:{method:"eth_unsubscribe",params:[b]},onResponse:y}))}}}})}}function $he(t){var r;if(!t)return"Injected";const e=n=>{if(n.isApexWallet)return"Apex Wallet";if(n.isAvalanche)return"Core Wallet";if(n.isBackpack)return"Backpack";if(n.isBifrost)return"Bifrost Wallet";if(n.isBitKeep)return"BitKeep";if(n.isBitski)return"Bitski";if(n.isBlockWallet)return"BlockWallet";if(n.isBraveWallet)return"Brave Wallet";if(n.isCoinbaseWallet)return"Coinbase Wallet";if(n.isDawn)return"Dawn Wallet";if(n.isDefiant)return"Defiant";if(n.isEnkrypt)return"Enkrypt";if(n.isExodus)return"Exodus";if(n.isFrame)return"Frame";if(n.isFrontier)return"Frontier Wallet";if(n.isGamestop)return"GameStop Wallet";if(n.isHaqqWallet)return"HAQQ Wallet";if(n.isHyperPay)return"HyperPay Wallet";if(n.isImToken)return"ImToken";if(n.isHaloWallet)return"Halo Wallet";if(n.isKuCoinWallet)return"KuCoin Wallet";if(n.isMathWallet)return"MathWallet";if(n.isNovaWallet)return"Nova Wallet";if(n.isOkxWallet||n.isOKExWallet)return"OKX Wallet";if(n.isOneInchIOSWallet||n.isOneInchAndroidWallet)return"1inch Wallet";if(n.isOpera)return"Opera";if(n.isPhantom)return"Phantom";if(n.isPortal)return"Ripio Portal";if(n.isRabby)return"Rabby Wallet";if(n.isRainbow)return"Rainbow";if(n.isStatus)return"Status";if(n.isTalisman)return"Talisman";if(n.isTally)return"Taho";if(n.isTokenPocket)return"TokenPocket";if(n.isTokenary)return"Tokenary";if(n.isTrust||n.isTrustWallet)return"Trust Wallet";if(n.isTTWallet)return"TTWallet";if(n.isXDEFI)return"XDEFI Wallet";if(n.isZerion)return"Zerion";if(n.isMetaMask)return"MetaMask"};if((r=t.providers)!=null&&r.length){const n=new Set;let i=1;for(const o of t.providers){let a=e(o);a||(a=`Unknown Wallet #${i}`,i+=1),n.add(a)}const s=[...n];return s.length?s:s[0]??"Injected"}return e(t)??"Injected"}var Bv,xB=class extends ab{constructor({chains:t,options:e}={}){const r={shimDisconnect:!0,getProvider(){if(typeof window>"u")return;const i=window.ethereum;return i!=null&&i.providers?i.providers[0]:i},...e};super({chains:t,options:r}),st(this,"id","injected"),st(this,"name"),st(this,"ready"),Jr(this,Bv,void 0),st(this,"shimDisconnectKey",`${this.id}.shimDisconnect`),st(this,"onAccountsChanged",i=>{i.length===0?this.emit("disconnect"):this.emit("change",{account:Li(i[0])})}),st(this,"onChainChanged",i=>{const s=Fh(i),o=this.isChainUnsupported(s);this.emit("change",{chain:{id:s,unsupported:o}})}),st(this,"onDisconnect",async i=>{var s;i.code===1013&&await this.getProvider()&&await this.getAccount()||(this.emit("disconnect"),this.options.shimDisconnect&&((s=this.storage)==null||s.removeItem(this.shimDisconnectKey)))});const n=r.getProvider();if(typeof r.name=="string")this.name=r.name;else if(n){const i=$he(n);r.name?this.name=r.name(i):typeof i=="string"?this.name=i:this.name=i[0]}else this.name="Injected";this.ready=!!n}async connect({chainId:t}={}){var e;try{const r=await this.getProvider();if(!r)throw new Ma;r.on&&(r.on("accountsChanged",this.onAccountsChanged),r.on("chainChanged",this.onChainChanged),r.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});const n=await r.request({method:"eth_requestAccounts"}),i=Li(n[0]);let s=await this.getChainId(),o=this.isChainUnsupported(s);return t&&s!==t&&(s=(await this.switchChain(t)).id,o=this.isChainUnsupported(s)),this.options.shimDisconnect&&((e=this.storage)==null||e.setItem(this.shimDisconnectKey,!0)),{account:i,chain:{id:s,unsupported:o}}}catch(r){throw this.isUserRejectedRequestError(r)?new Vr(r):r.code===-32002?new vc(r):r}}async disconnect(){var e;const t=await this.getProvider();t!=null&&t.removeListener&&(t.removeListener("accountsChanged",this.onAccountsChanged),t.removeListener("chainChanged",this.onChainChanged),t.removeListener("disconnect",this.onDisconnect),this.options.shimDisconnect&&((e=this.storage)==null||e.removeItem(this.shimDisconnectKey)))}async getAccount(){const t=await this.getProvider();if(!t)throw new Ma;const e=await t.request({method:"eth_accounts"});return Li(e[0])}async getChainId(){const t=await this.getProvider();if(!t)throw new Ma;return t.request({method:"eth_chainId"}).then(Fh)}async getProvider(){const t=this.options.getProvider();return t&&Mo(this,Bv,t),Je(this,Bv)}async getWalletClient({chainId:t}={}){const[e,r]=await Promise.all([this.getProvider(),this.getAccount()]),n=this.chains.find(i=>i.id===t);if(!e)throw new Error("provider is required.");return bb({account:r,chain:n,transport:BS(e)})}async isAuthorized(){var t;try{if(this.options.shimDisconnect&&!((t=this.storage)!=null&&t.getItem(this.shimDisconnectKey)))return!1;if(!await this.getProvider())throw new Ma;return!!await this.getAccount()}catch{return!1}}async switchChain(t){var n,i,s;const e=await this.getProvider();if(!e)throw new Ma;const r=ze(t);try{return await Promise.all([e.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]}),new Promise(o=>this.on("change",({chain:a})=>{(a==null?void 0:a.id)===t&&o()}))]),this.chains.find(o=>o.id===t)??{id:t,name:`Chain ${r}`,network:`${r}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}}catch(o){const a=this.chains.find(c=>c.id===t);if(!a)throw new Due({chainId:t,connectorId:this.id});if(o.code===4902||((i=(n=o==null?void 0:o.data)==null?void 0:n.originalError)==null?void 0:i.code)===4902)try{if(await e.request({method:"wallet_addEthereumChain",params:[{chainId:r,chainName:a.name,nativeCurrency:a.nativeCurrency,rpcUrls:[((s=a.rpcUrls.public)==null?void 0:s.http[0])??""],blockExplorerUrls:this.getBlockExplorerUrls(a)}]}),await this.getChainId()!==t)throw new Vr(new Error("User rejected switch after adding network."));return a}catch(c){throw new Vr(c)}throw this.isUserRejectedRequestError(o)?new Vr(o):new mc(o)}}async watchAsset({address:t,decimals:e=18,image:r,symbol:n}){const i=await this.getProvider();if(!i)throw new Ma;return i.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:t,decimals:e,image:r,symbol:n}}})}isUserRejectedRequestError(t){return t.code===4001}};Bv=new WeakMap;var WS=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},F2=(t,e,r)=>(WS(t,e,"read from private field"),r?r.call(t):e.get(t)),j2=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Yp=(t,e,r,n)=>(WS(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Nhe=(t,e,r)=>(WS(t,e,"access private method"),r);const Dhe=t=>(e,r,n)=>{const i=n.subscribe;return n.subscribe=(o,a,c)=>{let l=o;if(a){const u=(c==null?void 0:c.equalityFn)||Object.is;let f=o(n.getState());l=d=>{const h=o(d);if(!u(f,h)){const p=f;a(f=h,p)}},c!=null&&c.fireImmediately&&a(f,f)}return i(l)},t(e,r,n)},Lhe=Dhe;function Bhe(t,e){let r;try{r=t()}catch{return}return{getItem:i=>{var s;const o=c=>c===null?null:JSON.parse(c,e==null?void 0:e.reviver),a=(s=r.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>r.setItem(i,JSON.stringify(s,e==null?void 0:e.replacer)),removeItem:i=>r.removeItem(i)}}const e1=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return e1(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return e1(n)(r)}}}},Fhe=(t,e)=>(r,n,i)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:b=>b,version:0,merge:(b,y)=>({...y,...b}),...e},o=!1;const a=new Set,c=new Set;let l;try{l=s.getStorage()}catch{}if(!l)return t((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...b)},n,i);const u=e1(s.serialize),f=()=>{const b=s.partialize({...n()});let y;const m=u({state:b,version:s.version}).then(g=>l.setItem(s.name,g)).catch(g=>{y=g});if(y)throw y;return m},d=i.setState;i.setState=(b,y)=>{d(b,y),f()};const h=t((...b)=>{r(...b),f()},n,i);let p;const v=()=>{var b;if(!l)return;o=!1,a.forEach(m=>m(n()));const y=((b=s.onRehydrateStorage)==null?void 0:b.call(s,n()))||void 0;return e1(l.getItem.bind(l))(s.name).then(m=>{if(m)return s.deserialize(m)}).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==s.version){if(s.migrate)return s.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var g;return p=s.merge(m,(g=n())!=null?g:h),r(p,!0),f()}).then(()=>{y==null||y(p,void 0),o=!0,c.forEach(m=>m(p))}).catch(m=>{y==null||y(void 0,m)})};return i.persist={setOptions:b=>{s={...s,...b},b.getStorage&&(l=b.getStorage())},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>v(),hasHydrated:()=>o,onHydrate:b=>(a.add(b),()=>{a.delete(b)}),onFinishHydration:b=>(c.add(b),()=>{c.delete(b)})},v(),p||h},jhe=(t,e)=>(r,n,i)=>{let s={storage:Bhe(()=>localStorage),partialize:v=>v,version:0,merge:(v,b)=>({...b,...v}),...e},o=!1;const a=new Set,c=new Set;let l=s.storage;if(!l)return t((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...v)},n,i);const u=()=>{const v=s.partialize({...n()});return l.setItem(s.name,{state:v,version:s.version})},f=i.setState;i.setState=(v,b)=>{f(v,b),u()};const d=t((...v)=>{r(...v),u()},n,i);let h;const p=()=>{var v,b;if(!l)return;o=!1,a.forEach(m=>{var g;return m((g=n())!=null?g:d)});const y=((b=s.onRehydrateStorage)==null?void 0:b.call(s,(v=n())!=null?v:d))||void 0;return e1(l.getItem.bind(l))(s.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==s.version){if(s.migrate)return s.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var g;return h=s.merge(m,(g=n())!=null?g:d),r(h,!0),u()}).then(()=>{y==null||y(h,void 0),h=n(),o=!0,c.forEach(m=>m(h))}).catch(m=>{y==null||y(void 0,m)})};return i.persist={setOptions:v=>{s={...s,...v},v.storage&&(l=v.storage)},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>p(),hasHydrated:()=>o,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(c.add(v),()=>{c.delete(v)})},s.skipHydration||p(),h||d},Uhe=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?Fhe(t,e):jhe(t,e),zhe=Uhe,lT=t=>{let e;const r=new Set,n=(c,l)=>{const u=typeof c=="function"?c(e):c;if(!Object.is(u,e)){const f=e;e=l??typeof u!="object"?u:Object.assign({},e,u),r.forEach(d=>d(e,f))}},i=()=>e,a={setState:n,getState:i,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{r.clear()}};return e=t(n,i,a),a},Whe=t=>t?lT(t):lT;function HS(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[n,i]of t)if(!Object.is(i,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let n=0;nv===f.id)||(c=[...c,p.chain]),l[f.id]=[...l[f.id]||[],...p.rpcUrls.http],p.rpcUrls.webSocket&&(u[f.id]=[...u[f.id]||[],...p.rpcUrls.webSocket]))}if(!d)throw new Error([`Could not find valid provider configuration for chain "${f.name}". + */var Wf=C;function hue(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var pue=typeof Object.is=="function"?Object.is:hue,vue=Wf.useState,mue=Wf.useEffect,yue=Wf.useLayoutEffect,gue=Wf.useDebugValue;function bue(t,e){var r=e(),n=vue({inst:{value:r,getSnapshot:e}}),i=n[0].inst,s=n[1];return yue(function(){i.value=r,i.getSnapshot=e,B2(i)&&s({inst:i})},[t,r,e]),mue(function(){return B2(i)&&s({inst:i}),t(function(){B2(i)&&s({inst:i})})},[t]),gue(r),r}function B2(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!pue(t,r)}catch{return!0}}function wue(t,e){return e()}var Eue=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?wue:bue;UL.useSyncExternalStore=Wf.useSyncExternalStore!==void 0?Wf.useSyncExternalStore:Eue;jL.exports=UL;var xS=jL.exports;const zL=xS.useSyncExternalStore,ZP=C.createContext(void 0),WL=C.createContext(!1);function HL(t,e){return t||(e&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=ZP),window.ReactQueryClientContext):ZP)}const ub=({context:t}={})=>{const e=C.useContext(HL(t,C.useContext(WL)));if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},CS=({client:t,children:e,context:r,contextSharing:n=!1})=>{C.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]);const i=HL(r,n);return C.createElement(WL.Provider,{value:!r&&n},C.createElement(i.Provider,{value:t},e))},qL=C.createContext(!1),VL=()=>C.useContext(qL);qL.Provider;function xue(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const Cue=C.createContext(xue()),GL=()=>C.useContext(Cue);function KL(t,e){return typeof t=="function"?t(...e):!!t}const Sue=(t,e)=>{(t.suspense||t.useErrorBoundary)&&(e.isReset()||(t.retryOnMount=!1))},kue=t=>{C.useEffect(()=>{t.clearReset()},[t])},Aue=({result:t,errorResetBoundary:e,useErrorBoundary:r,query:n})=>t.isError&&!e.isReset()&&!t.isFetching&&KL(r,[t.error,n]),_ue=t=>{t.suspense&&typeof t.staleTime!="number"&&(t.staleTime=1e3)},Pue=(t,e)=>t.isLoading&&t.isFetching&&!e,Tue=(t,e,r)=>(t==null?void 0:t.suspense)&&Pue(e,r),Iue=(t,e,r)=>e.fetchOptimistic(t).then(({data:n})=>{t.onSuccess==null||t.onSuccess(n),t.onSettled==null||t.onSettled(n,null)}).catch(n=>{r.clearReset(),t.onError==null||t.onError(n),t.onSettled==null||t.onSettled(void 0,n)});function QL(t,e){const r=ub({context:t.context}),n=VL(),i=GL(),s=r.defaultQueryOptions(t);s._optimisticResults=n?"isRestoring":"optimistic",s.onError&&(s.onError=yt.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=yt.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=yt.batchCalls(s.onSettled)),_ue(s),Sue(s,i),kue(i);const[o]=C.useState(()=>new e(r,s)),a=o.getOptimisticResult(s);if(zL(C.useCallback(c=>{const l=n?()=>{}:o.subscribe(yt.batchCalls(c));return o.updateResult(),l},[o,n]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),C.useEffect(()=>{o.setOptions(s,{listeners:!1})},[s,o]),Tue(s,a,n))throw Iue(s,o,i);if(Aue({result:a,errorResetBoundary:i,useErrorBoundary:s.useErrorBoundary,query:o.getCurrentQuery()}))throw a.error;return s.notifyOnChangeProps?a:o.trackResult(a)}function oi(t,e,r){const n=Xu(t,e,r);return QL(n,wS)}function Oue(t,e,r){const n=OL(t,e,r),i=ub({context:n.context}),[s]=C.useState(()=>new oue(i,n));C.useEffect(()=>{s.setOptions(n)},[s,n]);const o=zL(C.useCallback(c=>s.subscribe(yt.batchCalls(c)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),a=C.useCallback((c,l)=>{s.mutate(c,l).catch(Rue)},[s]);if(o.error&&KL(s.options.useErrorBoundary,[o.error]))throw o.error;return{...o,mutate:a,mutateAsync:o.mutate}}function Rue(){}function $ue(t,e,r){const n=Xu(t,e,r);return QL(n,sue)}const Mue=["added","removed","updated"];function eT(t){return Mue.includes(t)}async function Nue({queryClient:t,persister:e,maxAge:r=1e3*60*60*24,buster:n="",hydrateOptions:i}){try{const s=await e.restoreClient();if(s)if(s.timestamp){const o=Date.now()-s.timestamp>r,a=s.buster!==n;o||a?e.removeClient():due(t,s.clientState,i)}else e.removeClient()}catch{e.removeClient()}}async function tT({queryClient:t,persister:e,buster:r="",dehydrateOptions:n}){const i={buster:r,timestamp:Date.now(),clientState:fue(t,n)};await e.persistClient(i)}function Due(t){const e=t.queryClient.getQueryCache().subscribe(n=>{eT(n.type)&&tT(t)}),r=t.queryClient.getMutationCache().subscribe(n=>{eT(n.type)&&tT(t)});return()=>{e(),r()}}function Lue(t){let e=!1,r;const n=()=>{e=!0,r==null||r()},i=Nue(t).then(()=>{e||(r=Due(t))});return[n,i]}var YL={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function s(c,l,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,f||c,d),p=r?r+l:l;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],h]:c._events[p].push(h):(c._events[p]=h,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new n:delete c._events[l]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],u,f;if(this._eventsCount===0)return l;for(f in u=this._events)e.call(u,f)&&l.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},a.prototype.listeners=function(l){var u=r?r+l:l,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);dt,fb=t=>t,Uue=()=>`viem@${Bue}`;class le extends Error{constructor(e,r={}){var s;super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:Uue()});const n=r.cause instanceof le?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof le&&r.cause.docsPath||r.docsPath;this.message=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://viem.sh${i}.html${r.docsSlug?`#${r.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(` +`),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}walk(e){return XL(this,e)}}function XL(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t?XL(t.cause,e):e?null:t}class xC extends le{constructor({blockNumber:e,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class zue extends le{constructor({chain:e,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e.id} – ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class Wue extends le{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class ZL extends le{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}function eF({chain:t,currentChainId:e}){if(!t)throw new Wue;if(e!==t.id)throw new zue({chain:t,currentChainId:e})}function SS(t,e={}){const{fees:r=t.fees,formatters:n=t.formatters,serializers:i=t.serializers}=e;return{...t,fees:r,formatters:n,serializers:i}}function gd({blockNumber:t,chain:e,contract:r}){var i;const n=(i=e==null?void 0:e.contracts)==null?void 0:i[r];if(!n)throw new xC({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new xC({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}class Hue extends le{constructor({max:e,min:r,signed:n,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class que extends le{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidHexBooleanError"})}}class Vue extends le{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}function mo(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function Br(t){return mo(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}function mf(t,{dir:e="left"}={}){let r=typeof t=="string"?t.replace("0x",""):t,n=0;for(let i=0;ir*2)throw new rF({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function Gue(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new rF({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;ie.toString(16).padStart(2,"0"));function da(t,e={}){return typeof t=="number"||typeof t=="bigint"?Ue(t,e):typeof t=="string"?kS(t,e):typeof t=="boolean"?nF(t,e):j0(t,e)}function nF(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(Mc(r,{size:e.size}),bd(r,{size:e.size})):r}function j0(t,e={}){let r="";for(let i=0;is||ie)throw new Vue({givenSize:Br(t),maxSize:e})}function db(t,e={}){const{signed:r}=e;e.size&&Mc(t,{size:e.size});const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,s=(1n<typeof n=="string"?n:sF(n));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,difficulty:t.difficulty?BigInt(t.difficulty):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:e,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}function ks(t,{args:e,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:e,eventName:r}:{}}}const tfe={"0x0":"reverted","0x1":"success"};function rfe(t){return{...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(e=>ks(e)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Nn(t.transactionIndex):null,status:t.status?tfe[t.status]:null,type:t.type?iF[t.type]||t.type:null}}const nfe={legacy:"0x0",eip2930:"0x1",eip1559:"0x2"};function hb(t){return{...t,gas:typeof t.gas<"u"?Ue(t.gas):void 0,gasPrice:typeof t.gasPrice<"u"?Ue(t.gasPrice):void 0,maxFeePerGas:typeof t.maxFeePerGas<"u"?Ue(t.maxFeePerGas):void 0,maxPriorityFeePerGas:typeof t.maxPriorityFeePerGas<"u"?Ue(t.maxPriorityFeePerGas):void 0,nonce:typeof t.nonce<"u"?Ue(t.nonce):void 0,type:typeof t.type<"u"?nfe[t.type]:void 0,value:typeof t.value<"u"?Ue(t.value):void 0}}class U0 extends le{constructor({address:e}){super(`Address "${e}" is invalid.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}const ife={gwei:9,wei:18},sfe={ether:-9,wei:9};function aF(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,s]=[r.slice(0,r.length-e),r.slice(r.length-e)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${s?`.${s}`:""}`}function ti(t,e="wei"){return aF(t,sfe[e])}class Zu extends le{constructor({cause:e,message:r}={}){var i;const n=(i=r==null?void 0:r.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(Zu,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Zu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class vy extends le{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${ti(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(vy,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class CC extends le{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${ti(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(CC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class SC extends le{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(SC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class kC extends le{constructor({cause:e,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` +`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(kC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class AC extends le{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(AC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class _C extends le{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` +`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(_C,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class PC extends le{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(PC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class TC extends le{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(TC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class IC extends le{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(IC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class my extends le{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${ti(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${ti(n)} gwei`:""}).`].join(` +`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(my,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class pb extends le{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}const ofe=/^0x[a-fA-F0-9]{40}$/;function Hf(t){return ofe.test(t)}function Zo(t){return typeof t[0]=="string"?_S(t):afe(t)}function afe(t){let e=0;for(const i of t)e+=i.length;const r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function _S(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function PS(t,e="wei"){return aF(t,ife[e])}function B1(t){const e=Object.entries(t).map(([n,i])=>i===void 0||i===!1?null:[n,i]).filter(Boolean),r=e.reduce((n,[i])=>Math.max(n,i.length),0);return e.map(([n,i])=>` ${`${n}:`.padEnd(r+1)} ${i}`).join(` +`)}class cfe extends le{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class lfe extends le{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",B1(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class ufe extends le{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){const h=B1({chain:i&&`${i==null?void 0:i.name} (id: ${i==null?void 0:i.id})`,from:r==null?void 0:r.address,to:f,value:typeof d<"u"&&`${PS(d)} ${(i==null?void 0:i.nativeCurrency.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${ti(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${ti(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${ti(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=e}}class cF extends le{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){let o="Transaction";n&&s!==void 0&&(o=`Transaction at block time "${n}" at index "${s}"`),e&&s!==void 0&&(o=`Transaction at block hash "${e}" at index "${s}"`),r&&s!==void 0&&(o=`Transaction at block number "${r}" at index "${s}"`),i&&(o=`Transaction with hash "${i}"`),super(`${o} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class lF extends le{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class ffe extends le{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}function dfe(t){if(t.type)return t.type;if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")return"eip1559";if(typeof t.gasPrice<"u")return typeof t.accessList<"u"?"eip2930":"legacy";throw new lfe({transaction:t})}const hfe=SS({id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x56522D00C410a43BFfDF00a9A569489297385790",blockCreated:8765204},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}),pfe=SS({id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62",blockCreated:16966585},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),vfe=SS({id:137,name:"Polygon",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}});var mfe=Object.defineProperty,yfe=(t,e,r)=>e in t?mfe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ke=(t,e,r)=>(yfe(t,typeof e!="symbol"?e+"":e,r),r),TS=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},We=(t,e,r)=>(TS(t,e,"read from private field"),r?r.call(t):e.get(t)),Mr=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},ys=(t,e,r,n)=>(TS(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Rr=(t,e,r)=>(TS(t,e,"access private method"),r),j1=class extends JL{constructor({chains:t=[pfe,hfe],options:e}){super(),Ke(this,"chains"),Ke(this,"options"),Ke(this,"storage"),this.chains=t,this.options=e}getBlockExplorerUrls(t){const{default:e,...r}=t.blockExplorers??{};if(e)return[e.url,...Object.values(r).map(n=>n.url)]}isChainUnsupported(t){return!this.chains.some(e=>e.id===t)}setStorage(t){this.storage=t}},uF=class extends Error{constructor({chainId:t,connectorId:e}){super(`Chain "${t}" not configured for connector "${e}".`),Ke(this,"name","ChainNotConfiguredForConnectorError")}},Ma=class extends Error{constructor(){super(...arguments),Ke(this,"name","ConnectorNotFoundError"),Ke(this,"message","Connector not found")}};function El(t){return typeof t=="string"?Number.parseInt(t,t.trim().substring(0,2)==="0x"?16:10):typeof t=="bigint"?Number(t):t}function Nc(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new Ife(t.type);return`${t.name}(${vb(t.inputs,{includeName:e})})`}function vb(t,{includeName:e=!1}={}){return t?t.map(r=>gfe(r,{includeName:e})).join(e?", ":","):""}function gfe(t,{includeName:e}){return t.type.startsWith("tuple")?`(${vb(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}class bfe extends le{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` +`),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class rT extends le{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` +`),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class IS extends le{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` +`),{metaMessages:[`Params: (${vb(r,{includeName:!0})})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=r,this.size=n}}class mb extends le{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class wfe extends le{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class Efe extends le{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${Br(r)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class xfe extends le{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class fF extends le{constructor(e,{docsPath:r}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class Cfe extends le{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class Sfe extends le{constructor(e,{docsPath:r}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class nT extends le{constructor(e,{docsPath:r}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class yy extends le{constructor(e,{docsPath:r}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class kfe extends le{constructor(e,{docsPath:r}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class Afe extends le{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class zl extends le{constructor({abiItem:e,data:r,params:n,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join(` +`),{metaMessages:[`Params: (${vb(n,{includeName:!0})})`,`Data: ${r} (${i} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=r,this.params=n,this.size=i}}class wd extends le{constructor({abiItem:e,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${Nc(e,{includeName:!0})}".`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class _fe extends le{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class Pfe extends le{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class Tfe extends le{constructor(e){super([`Value "${e}" is not a valid array.`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class Ife extends le{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}class Ofe extends le{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}const Rfe=/((function|event)\s)?(.*)(\((.*)\))/;function dF(t){const e=t.match(Rfe),r=(e==null?void 0:e[2])||void 0,n=e==null?void 0:e[3],i=(e==null?void 0:e[5])||void 0;return{type:r,name:n,params:i}}function $fe(t){return dF(t).name}function Mfe(t){const e=dF(t).params,r=e==null?void 0:e.split(",").map(n=>n.trim().split(" "));return r==null?void 0:r.map(n=>({type:n[0],name:n[1]==="indexed"?n[2]:n[1],...n[1]==="indexed"?{indexed:!0}:{}}))}function iT(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function hF(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function sT(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Nfe(t,e){hF(t);const r=e.outputLen;if(t.length>oT&Xp)}:{h:Number(t>>oT&Xp)|0,l:Number(t&Xp)|0}}function Lfe(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,Bfe=(t,e,r)=>e<>>32-r,jfe=(t,e,r)=>e<>>64-r,Ufe=(t,e,r)=>t<>>64-r;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const zfe=t=>t instanceof Uint8Array,Wfe=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Hfe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Hfe)throw new Error("Non little-endian hardware is not supported");function qfe(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function pF(t){if(typeof t=="string"&&(t=qfe(t)),!zfe(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}class Vfe{clone(){return this._cloneInto()}}function Gfe(t){const e=n=>t().update(pF(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}const[vF,mF,yF]=[[],[],[]],Kfe=BigInt(0),th=BigInt(1),Qfe=BigInt(2),Yfe=BigInt(7),Jfe=BigInt(256),Xfe=BigInt(113);for(let t=0,e=th,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],vF.push(2*(5*n+r)),mF.push((t+1)*(t+2)/2%64);let i=Kfe;for(let s=0;s<7;s++)e=(e<>Yfe)*Xfe)%Jfe,e&Qfe&&(i^=th<<(th<r>32?jfe(t,e,r):Ffe(t,e,r),cT=(t,e,r)=>r>32?Ufe(t,e,r):Bfe(t,e,r);function tde(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=r[c],u=r[c+1],f=aT(l,u,1)^r[a],d=cT(l,u,1)^r[a+1];for(let h=0;h<50;h+=10)t[o+h]^=f,t[o+h+1]^=d}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=mF[o],c=aT(i,s,a),l=cT(i,s,a),u=vF[o];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=Zfe[n],t[1]^=ede[n]}r.fill(0)}class OS extends Vfe{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,iT(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Wfe(this.state)}keccak(){tde(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){sT(this);const{blockLen:r,state:n}=this;e=pF(e);const i=e.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return iT(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Nfe(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new OS(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const rde=(t,e,r)=>Gfe(()=>new OS(e,t,r)),nde=rde(1,136,256/8);function Yn(t,e){const r=e||"hex",n=nde(mo(t,{strict:!1})?Ul(t):t);return r==="bytes"?n:da(n)}const gF=t=>Yn(Ul(t));function bF(t){const e=$fe(t),r=Mfe(t)||[];return gF(`${e}(${r.map(({type:n})=>n).join(",")})`)}function wF(t){return gF(Nc(t))}const RS=t=>typeof t=="string"?bF(t):wF(t);function Er(t,e,r,{strict:n}={}){return mo(t,{strict:!1})?sde(t,e,r,{strict:n}):ide(t,e,r,{strict:n})}function EF(t,e){if(typeof e=="number"&&e>0&&e>Br(t)-1)throw new tF({offset:e,position:"start",size:Br(t)})}function xF(t,e,r){if(typeof e=="number"&&typeof r=="number"&&Br(t)!==r-e)throw new tF({offset:r,position:"end",size:Br(t)})}function ide(t,e,r,{strict:n}={}){EF(t,e);const i=t.slice(e,r);return n&&xF(i,e,r),i}function sde(t,e,r,{strict:n}={}){EF(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&xF(i,e,r),i}function U1(t,e){if(t.length!==e.length)throw new xfe({expectedLength:t.length,givenLength:e.length});const r=ode({params:t,values:e}),n=MS(r);return n.length===0?"0x":n}function ode({params:t,values:e}){const r=[];for(let n=0;n0?Zo([a,o]):a}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:Zo(s.map(({encoded:o})=>o))}}function lde(t,{param:e}){const[,r]=e.type.split("bytes"),n=Br(t);if(!r){let i=t;return n%32!==0&&(i=nc(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:Zo([nc(Ue(n,{size:32})),i])}}if(n!==parseInt(r))throw new Efe({expectedSize:parseInt(r),value:t});return{dynamic:!1,encoded:nc(t,{dir:"right"})}}function ude(t){return{dynamic:!1,encoded:nc(nF(t))}}function fde(t,{signed:e}){return{dynamic:!1,encoded:Ue(t,{size:32,signed:e})}}function dde(t){const e=kS(t),r=Math.ceil(Br(e)/32),n=[];for(let i=0;ii))}}function yb(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const NS=t=>Er(typeof t=="string"?bF(t):wF(t),0,4);function z1({abi:t,args:e=[],name:r}){const n=mo(r,{strict:!1}),i=t.filter(s=>n?s.type==="function"?NS(s)===r:s.type==="event"?RS(s)===r:!1:"name"in s&&s.name===r);if(i.length!==0){if(i.length===1)return i[0];for(const s of i){if(!("inputs"in s))continue;if(!e||e.length===0){if(!s.inputs||s.inputs.length===0)return s;continue}if(!s.inputs||s.inputs.length===0||s.inputs.length!==e.length)continue;if(e.every((a,c)=>{const l="inputs"in s&&s.inputs[c];return l?OC(a,l):!1}))return s}return i[0]}}function OC(t,e){const r=typeof t,n=e.type;switch(n){case"address":return Hf(t);case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((i,s)=>OC(Object.values(t)[s],i)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(i=>OC(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function W1({abi:t,eventName:e,args:r}){var a;let n=t[0];if(e&&(n=z1({abi:t,args:r,name:e}),!n))throw new nT(e,{docsPath:"/docs/contract/encodeEventTopics"});if(n.type!=="event")throw new nT(void 0,{docsPath:"/docs/contract/encodeEventTopics"});const i=Nc(n),s=RS(i);let o=[];if(r&&"inputs"in n){const c=(a=n.inputs)==null?void 0:a.filter(u=>"indexed"in u&&u.indexed),l=Array.isArray(r)?r:Object.values(r).length>0?(c==null?void 0:c.map(u=>r[u.name]))??[]:[];l.length>0&&(o=(c==null?void 0:c.map((u,f)=>Array.isArray(l[f])?l[f].map((d,h)=>lT({param:u,value:l[f][h]})):l[f]?lT({param:u,value:l[f]}):null))??[])}return[s,...o]}function lT({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return Yn(Ul(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new Ofe(t.type);return U1([t],[e])}function gb(t,{method:e}){var n,i;const r={};return t.transport.type==="fallback"&&((i=(n=t.transport).onResponse)==null||i.call(n,({method:s,response:o,status:a,transport:c})=>{a==="success"&&e===s&&(r[o]=c.request)})),s=>r[s]||t.request}async function CF(t,{address:e,abi:r,args:n,eventName:i,fromBlock:s,strict:o,toBlock:a}){const c=gb(t,{method:"eth_newFilter"}),l=i?W1({abi:r,args:n,eventName:i}):void 0,u=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof s=="bigint"?Ue(s):s,toBlock:typeof a=="bigint"?Ue(a):a,topics:l}]});return{abi:r,args:n,eventName:i,id:u,request:c(u),strict:o,type:"event"}}function Yi(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}function Dc({abi:t,args:e,functionName:r}){let n=t[0];if(r&&(n=z1({abi:t,args:e,name:r}),!n))throw new yy(r,{docsPath:"/docs/contract/encodeFunctionData"});if(n.type!=="function")throw new yy(void 0,{docsPath:"/docs/contract/encodeFunctionData"});const i=Nc(n),s=NS(i),o="inputs"in n&&n.inputs?U1(n.inputs,e??[]):void 0;return _S([s,o??"0x"])}const SF={1:"An `assert` condition failed.",17:"Arithmic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},pde={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},vde={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function DS(t,e){const r=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),n=Yn(Fo(r),"bytes"),i=(e?r.substring(`${e}0x`.length):r).split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&i[s]&&(i[s]=i[s].toUpperCase()),(n[s>>1]&15)>=8&&i[s+1]&&(i[s+1]=i[s+1].toUpperCase());return`0x${i.join("")}`}function Dn(t,e){if(!Hf(t))throw new U0({address:t});return DS(t,e)}function bb(t,e){if(e==="0x"&&t.length>0)throw new mb;if(Br(e)&&Br(e)<32)throw new IS({data:e,params:t,size:Br(e)});return mde({data:e,params:t})}function mde({data:t,params:e}){const r=[];let n=0;for(let i=0;i=Br(t))throw new IS({data:t,params:e,size:Br(t)});const s=e[i],{consumed:o,value:a}=yf({data:t,param:s,position:n});r.push(a),n+=o}return r}function yf({data:t,param:e,position:r}){const n=yb(e.type);if(n){const[s,o]=n;return gde(t,{length:s,param:{...e,type:o},position:r})}if(e.type==="tuple")return Cde(t,{param:e,position:r});if(e.type==="string")return xde(t,{position:r});if(e.type.startsWith("bytes"))return wde(t,{param:e,position:r});const i=Er(t,r,r+32,{strict:!0});if(e.type.startsWith("uint")||e.type.startsWith("int"))return Ede(i,{param:e});if(e.type==="address")return yde(i);if(e.type==="bool")return bde(i);throw new Pfe(e.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function yde(t){return{consumed:32,value:DS(Er(t,-20))}}function gde(t,{param:e,length:r,position:n}){if(!r){const o=Nn(Er(t,n,n+32,{strict:!0})),a=Nn(Er(t,o,o+32,{strict:!0}));let c=0;const l=[];for(let u=0;u48?db(t,{signed:r}):Nn(t,{signed:r})}}function xde(t,{position:e}){const r=Nn(Er(t,e,e+32,{strict:!0})),n=Nn(Er(t,r,r+32,{strict:!0}));return n===0?{consumed:32,value:""}:{consumed:32,value:efe(mf(Er(t,r+32,r+32+n,{strict:!0})))}}function Cde(t,{param:e,position:r}){const n=e.components.length===0||e.components.some(({name:o})=>!o),i=n?[]:{};let s=0;if(gy(e)){const o=Nn(Er(t,r,r+32,{strict:!0}));for(let a=0;as.type==="error"&&r===NS(Nc(s)));if(!i)throw new fF(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?bb(i.inputs,Er(e,4)):void 0,errorName:i.name}}const Ln=(t,e,r)=>JSON.stringify(t,(n,i)=>{const s=typeof i=="bigint"?i.toString():i;return typeof e=="function"?e(n,s):s},r);function kF({abiItem:t,args:e,includeFunctionName:r=!0,includeName:n=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${r?t.name:""}(${t.inputs.map((i,s)=>`${n&&i.name?`${i.name}: `:""}${typeof e[s]=="object"?Ln(e[s]):e[s]}`).join(", ")})`}class AF extends le{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){const h=r?Yi(r):void 0,p=B1({from:h==null?void 0:h.address,to:f,value:typeof d<"u"&&`${PS(d)} ${(i==null?void 0:i.nativeCurrency.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${ti(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${ti(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${ti(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}}class kde extends le{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:s,functionName:o,sender:a}){const c=z1({abi:r,args:n,name:o}),l=c?kF({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=c?Nc(c,{includeName:!0}):void 0,f=B1({address:i&&jue(i),function:u,args:l&&l!=="()"&&`${[...Array((o==null?void 0:o.length)??0).keys()].map(()=>" ").join("")}${l}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",f].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=r,this.args=n,this.cause=e,this.contractAddress=i,this.functionName=o,this.sender=a}}class RC extends le{constructor({abi:e,data:r,functionName:n,message:i}){let s,o,a,c;if(r&&r!=="0x")try{o=Sde({abi:e,data:r});const{abiItem:u,errorName:f,args:d}=o;if(f==="Error")c=d[0];else if(f==="Panic"){const[h]=d;c=SF[h]}else{const h=u?Nc(u,{includeName:!0}):void 0,p=u&&d?kF({abiItem:u,args:d,includeFunctionName:!1,includeName:!1}):void 0;a=[h?`Error: ${h}`:"",p&&p!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${p}`:""]}}catch(u){s=u}else i&&(c=i);let l;s instanceof fF&&(l=s.signature,a=[`Unable to decode signature "${l}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${l}.`]),super(c&&c!=="execution reverted"||l?[`The contract function "${n}" reverted with the following ${l?"signature":"reason"}:`,c||l].join(` +`):`The contract function "${n}" reverted.`,{cause:s,metaMessages:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.reason=c,this.signature=l}}class Ade extends le{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class LS extends le{constructor({data:e,message:r}){super(r||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}class Wh extends le{constructor({body:e,details:r,headers:n,status:i,url:s}){super("HTTP request failed.",{details:r,metaMessages:[i&&`Status: ${i}`,`URL: ${fb(s)}`,e&&`Request body: ${Ln(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=i,this.url=s}}class _de extends le{constructor({body:e,details:r,url:n}){super("WebSocket request failed.",{details:r,metaMessages:[`URL: ${fb(n)}`,`Request body: ${Ln(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WebSocketRequestError"})}}class FS extends le{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${fb(n)}`,`Request body: ${Ln(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code}}class $C extends le{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${fb(r)}`,`Request body: ${Ln(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}const Pde=-1;class ai extends le{constructor(e,{code:r,docsPath:n,metaMessages:i,shortMessage:s}){super(s,{cause:e,docsPath:n,metaMessages:i||(e==null?void 0:e.metaMessages)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof FS?e.code:r??Pde}}class Ed extends ai{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class z0 extends ai{constructor(e){super(e,{code:z0.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(z0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class W0 extends ai{constructor(e){super(e,{code:W0.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(W0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class H0 extends ai{constructor(e){super(e,{code:H0.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(H0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class q0 extends ai{constructor(e){super(e,{code:q0.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` +`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(q0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class qf extends ai{constructor(e){super(e,{code:qf.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(qf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Wl extends ai{constructor(e){super(e,{code:Wl.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` +`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(Wl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class V0 extends ai{constructor(e){super(e,{code:V0.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(V0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class mc extends ai{constructor(e){super(e,{code:mc.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(mc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class G0 extends ai{constructor(e){super(e,{code:G0.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(G0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class K0 extends ai{constructor(e){super(e,{code:K0.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(K0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Q0 extends ai{constructor(e){super(e,{code:Q0.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(Q0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Y0 extends ai{constructor(e){super(e,{code:Y0.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(Y0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Pr extends Ed{constructor(e){super(e,{code:Pr.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(Pr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class J0 extends Ed{constructor(e){super(e,{code:J0.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(J0,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class X0 extends Ed{constructor(e){super(e,{code:X0.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(X0,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class Z0 extends Ed{constructor(e){super(e,{code:Z0.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(Z0,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class e1 extends Ed{constructor(e){super(e,{code:e1.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(e1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class ea extends Ed{constructor(e){super(e,{code:ea.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(ea,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class Tde extends ai{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}const Ide=3;function t1(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:o}){const{code:a,data:c,message:l,shortMessage:u}=t instanceof LS?t:t instanceof le?t.walk(d=>"data"in d)||t.walk():{};let f=t;return t instanceof mb?f=new Ade({functionName:s}):[Ide,qf.code].includes(a)&&(c||l||u)&&(f=new RC({abi:e,data:typeof c=="object"?c.data:c,functionName:s,message:u??l})),new kde(f,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:o})}class xd extends le{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join(` +`),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}class Ode extends le{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){const h=B1({from:r==null?void 0:r.address,to:f,value:typeof d<"u"&&`${PS(d)} ${(i==null?void 0:i.nativeCurrency.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${ti(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${ti(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${ti(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}}function BS(t,e){const r=(t.details||"").toLowerCase(),n=t.walk(i=>i.code===Zu.code);return n instanceof le?new Zu({cause:t,message:n.details}):Zu.nodeMessage.test(r)?new Zu({cause:t,message:t.details}):vy.nodeMessage.test(r)?new vy({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):CC.nodeMessage.test(r)?new CC({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):SC.nodeMessage.test(r)?new SC({cause:t,nonce:e==null?void 0:e.nonce}):kC.nodeMessage.test(r)?new kC({cause:t,nonce:e==null?void 0:e.nonce}):AC.nodeMessage.test(r)?new AC({cause:t,nonce:e==null?void 0:e.nonce}):_C.nodeMessage.test(r)?new _C({cause:t}):PC.nodeMessage.test(r)?new PC({cause:t,gas:e==null?void 0:e.gas}):TC.nodeMessage.test(r)?new TC({cause:t,gas:e==null?void 0:e.gas}):IC.nodeMessage.test(r)?new IC({cause:t}):my.nodeMessage.test(r)?new my({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new pb({cause:t})}function Rde(t,{docsPath:e,...r}){let n=BS(t,r);return n instanceof pb&&(n=t),new Ode(n,{docsPath:e,...r})}function jS(t,{format:e}){return e?Object.keys(e({})).reduce((n,i)=>(t!=null&&t.hasOwnProperty(i)&&(n[i]=t[i]),n),{}):{}}function H1(t){const{account:e,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i,to:s}=t,o=e?Yi(e):void 0;if(o&&!Hf(o.address))throw new U0({address:o.address});if(s&&!Hf(s))throw new U0({address:s});if(typeof r<"u"&&(typeof n<"u"||typeof i<"u"))throw new cfe;if(n&&n>2n**256n-1n)throw new vy({maxFeePerGas:n});if(i&&n&&i>n)throw new my({maxFeePerGas:n,maxPriorityFeePerGas:i})}class $de extends le{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class US extends le{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class Mde extends le{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${ti(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class Nde extends le{constructor({blockHash:e,blockNumber:r}){let n="Block";e&&(n=`Block at hash "${e}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}async function yc(t,{blockHash:e,blockNumber:r,blockTag:n,includeTransactions:i}={}){var u,f,d;const s=n??"latest",o=i??!1,a=r!==void 0?Ue(r):void 0;let c=null;if(e?c=await t.request({method:"eth_getBlockByHash",params:[e,o]}):c=await t.request({method:"eth_getBlockByNumber",params:[a||s,o]}),!c)throw new Nde({blockHash:e,blockNumber:r});return(((d=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.block)==null?void 0:d.format)||oF)(c)}async function zS(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function Dde(t,e){return _F(t,e)}async function _F(t,e){var s,o,a;const{block:r,chain:n=t.chain,request:i}=e||{};if(typeof((s=n==null?void 0:n.fees)==null?void 0:s.defaultPriorityFee)=="function"){const c=r||await yc(t);return n.fees.defaultPriorityFee({block:c,client:t,request:i})}else if((o=n==null?void 0:n.fees)!=null&&o.defaultPriorityFee)return(a=n==null?void 0:n.fees)==null?void 0:a.defaultPriorityFee;try{const c=await t.request({method:"eth_maxPriorityFeePerGas"});return db(c)}catch{const[c,l]=await Promise.all([r?Promise.resolve(r):yc(t),zS(t)]);if(typeof c.baseFeePerGas!="bigint")throw new US;const u=l-c.baseFeePerGas;return u<0n?0n:u}}async function Lde(t,e){return MC(t,e)}async function MC(t,e){var d;const{block:r,chain:n=t.chain,request:i,type:s="eip1559"}=e||{},o=await(async()=>{var h,p;return typeof((h=n==null?void 0:n.fees)==null?void 0:h.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:i}):((p=n==null?void 0:n.fees)==null?void 0:p.baseFeeMultiplier)??1.2})();if(o<1)throw new $de;const c=10**o.toString().split(".")[1].length,l=h=>h*BigInt(o*c)/BigInt(c),u=r||await yc(t);if(typeof((d=n==null?void 0:n.fees)==null?void 0:d.estimateFeesPerGas)=="function")return n.fees.estimateFeesPerGas({block:r,client:t,multiply:l,request:i,type:s});if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new US;const h=i!=null&&i.maxPriorityFeePerGas?i.maxPriorityFeePerGas:await _F(t,{block:u,chain:n,request:i}),p=l(u.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??p+h,maxPriorityFeePerGas:h}}return{gasPrice:(i==null?void 0:i.gasPrice)??l(await zS(t))}}async function PF(t,{address:e,blockTag:r="latest",blockNumber:n}){const i=await t.request({method:"eth_getTransactionCount",params:[e,n?Ue(n):r]});return Nn(i)}async function wb(t,e){const{account:r=t.account,chain:n,gas:i,nonce:s,type:o}=e;if(!r)throw new xd;const a=Yi(r),c=await yc(t,{blockTag:"latest"}),l={...e,from:a.address};if(typeof s>"u"&&(l.nonce=await PF(t,{address:a.address,blockTag:"pending"})),typeof o>"u")try{l.type=dfe(l)}catch{l.type=typeof c.baseFeePerGas=="bigint"?"eip1559":"legacy"}if(l.type==="eip1559"){const{maxFeePerGas:u,maxPriorityFeePerGas:f}=await MC(t,{block:c,chain:n,request:l});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(l.gas=await WS(t,{...l,account:{address:a.address,type:"json-rpc"}})),H1(l),l}async function WS(t,e){var i,s,o;const r=e.account??t.account;if(!r)throw new xd({docsPath:"/docs/actions/public/estimateGas"});const n=Yi(r);try{const{accessList:a,blockNumber:c,blockTag:l,data:u,gas:f,gasPrice:d,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:v,to:b,value:y,...m}=n.type==="local"?await wb(t,e):e,S=(c?Ue(c):void 0)||l;H1(e);const P=((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionRequest)==null?void 0:o.format)||hb,T=P({...jS(m,{format:P}),from:n.address,accessList:a,data:u,gas:f,gasPrice:d,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:v,to:b,value:y}),w=await t.request({method:"eth_estimateGas",params:S?[T,S]:[T]});return BigInt(w)}catch(a){throw Rde(a,{...e,account:n,chain:t.chain})}}async function Fde(t,{abi:e,address:r,args:n,functionName:i,...s}){const o=Dc({abi:e,args:n,functionName:i});try{return await WS(t,{data:o,to:r,...s})}catch(a){const c=s.account?Yi(s.account):void 0;throw t1(a,{abi:e,address:r,args:n,docsPath:"/docs/contract/estimateContractGas",functionName:i,sender:c==null?void 0:c.address})}}const j2="/docs/contract/decodeFunctionResult";function Cd({abi:t,args:e,functionName:r,data:n}){let i=t[0];if(r&&(i=z1({abi:t,args:e,name:r}),!i))throw new yy(r,{docsPath:j2});if(i.type!=="function")throw new yy(void 0,{docsPath:j2});if(!i.outputs)throw new kfe(i.name,{docsPath:j2});const s=bb(i.outputs,n);if(s&&s.length>1)return s;if(s&&s.length===1)return s[0]}const Bde="modulepreload",jde=function(t,e){return new URL(t,e).href},uT={},HS=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(s=>{if(s=jde(s,n),s in uT)return;uT[s]=!0;const o=s.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!n)for(let u=i.length-1;u>=0;u--){const f=i[u];if(f.href===s&&(!o||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${a}`))return;const l=document.createElement("link");if(l.rel=o?"stylesheet":Bde,o||(l.as="script",l.crossOrigin=""),l.href=s,document.head.appendChild(l),o)return new Promise((u,f)=>{l.addEventListener("load",u),l.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})},NC=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],TF=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"}],IF=[...TF,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Ude=[...TF,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],fT=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],dT=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],zde=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],Wde="0x82ad56cb";function Hde(t,{docsPath:e,...r}){let n=BS(t,r);return n instanceof pb&&(n=t),new AF(n,{docsPath:e,...r})}const U2=new Map;function qS({fn:t,id:e,shouldSplitBatch:r,wait:n=0}){const i=async()=>{const l=a();s();const u=l.map(({args:f})=>f);u.length!==0&&t(u).then(f=>{l.forEach(({pendingPromise:d},h)=>{var p;return(p=d.resolve)==null?void 0:p.call(d,[f[h],f])})}).catch(f=>{l.forEach(({pendingPromise:d})=>{var h;return(h=d.reject)==null?void 0:h.call(d,f)})})},s=()=>U2.delete(e),o=()=>a().map(({args:l})=>l),a=()=>U2.get(e)||[],c=l=>U2.set(e,[...a(),l]);return{flush:s,async schedule(l){const u={},f=new Promise((p,v)=>{u.resolve=p,u.reject=v});return(r==null?void 0:r([...o(),l]))&&i(),a().length>0?(c({args:l,pendingPromise:u}),f):(c({args:l,pendingPromise:u}),setTimeout(i,n),f)}}}async function Eb(t,e){var y,m,g,S;const{account:r=t.account,batch:n=!!((y=t.batch)!=null&&y.multicall),blockNumber:i,blockTag:s="latest",accessList:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:f,nonce:d,to:h,value:p,...v}=e,b=r?Yi(r):void 0;try{H1(e);const T=(i?Ue(i):void 0)||s,w=((S=(g=(m=t.chain)==null?void 0:m.formatters)==null?void 0:g.transactionRequest)==null?void 0:S.format)||hb,I=w({...jS(v,{format:w}),from:b==null?void 0:b.address,accessList:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:f,nonce:d,to:h,value:p});if(n&&qde({request:I}))try{return await Vde(t,{...I,blockNumber:i,blockTag:s})}catch(j){if(!(j instanceof ZL)&&!(j instanceof xC))throw j}const F=await t.request({method:"eth_call",params:T?[I,T]:[I]});return F==="0x"?{data:void 0}:{data:F}}catch(P){const T=Gde(P),{offchainLookup:w,offchainLookupSignature:I}=await HS(()=>import("./ccip-bb77ee49.js"),[],import.meta.url);if((T==null?void 0:T.slice(0,10))===I&&h)return{data:await w(t,{data:T,to:h})};throw Hde(P,{...e,account:b,chain:t.chain})}}function qde({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(Wde)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function Vde(t,e){var v;const{batchSize:r=1024,wait:n=0}=typeof((v=t.batch)==null?void 0:v.multicall)=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:s="latest",data:o,multicallAddress:a,to:c}=e;let l=a;if(!l){if(!t.chain)throw new ZL;l=gd({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?Ue(i):void 0)||s,{schedule:d}=qS({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(b){return b.reduce((m,{data:g})=>m+(g.length-2),0)>r*2},fn:async b=>{const y=b.map(S=>({allowFailure:!0,callData:S.data,target:S.to})),m=Dc({abi:NC,args:[y],functionName:"aggregate3"}),g=await t.request({method:"eth_call",params:[{data:m,to:l},f]});return Cd({abi:NC,args:[y],functionName:"aggregate3",data:g||"0x"})}}),[{returnData:h,success:p}]=await d({data:o,to:c});if(!p)throw new LS({data:h});return h==="0x"?{data:void 0}:{data:h}}function Gde(t){if(!(t instanceof le))return;const e=t.walk();return typeof e.data=="object"?e.data.data:e.data}async function gc(t,{abi:e,address:r,args:n,functionName:i,...s}){const o=Dc({abi:e,args:n,functionName:i});try{const{data:a}=await Eb(t,{data:o,to:r,...s});return Cd({abi:e,args:n,functionName:i,data:a||"0x"})}catch(a){throw t1(a,{abi:e,address:r,args:n,docsPath:"/docs/contract/readContract",functionName:i})}}async function Kde(t,{abi:e,address:r,args:n,dataSuffix:i,functionName:s,...o}){const a=o.account?Yi(o.account):void 0,c=Dc({abi:e,args:n,functionName:s});try{const{data:l}=await Eb(t,{batch:!1,data:`${c}${i?i.replace("0x",""):""}`,to:r,...o});return{result:Cd({abi:e,args:n,functionName:s,data:l||"0x"}),request:{abi:e,address:r,args:n,dataSuffix:i,functionName:s,...o}}}catch(l){throw t1(l,{abi:e,address:r,args:n,docsPath:"/docs/contract/simulateContract",functionName:s,sender:a==null?void 0:a.address})}}const z2=new Map,hT=new Map;let Qde=0;function Sd(t,e,r){const n=++Qde,i=()=>z2.get(t)||[],s=()=>{const u=i();z2.set(t,u.filter(f=>f.id!==n))},o=()=>{const u=hT.get(t);i().length===1&&u&&u(),s()},a=i();if(z2.set(t,[...a,{id:n,fns:e}]),a&&a.length>0)return o;const c={};for(const u in e)c[u]=(...f)=>{const d=i();d.length!==0&&d.forEach(h=>{var p,v;return(v=(p=h.fns)[u])==null?void 0:v.call(p,...f)})};const l=r(c);return typeof l=="function"&&hT.set(t,l),o}async function by(t){return new Promise(e=>setTimeout(e,t))}function q1(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const s=()=>i=!1;return(async()=>{let a;e&&(a=await t({unpoll:s}));const c=await(r==null?void 0:r(a))??n;await by(c);const l=async()=>{i&&(await t({unpoll:s}),await by(n),l())};l()})(),s}const pT="/docs/contract/decodeEventLog";function V1({abi:t,data:e,strict:r,topics:n}){const i=r??!0,[s,...o]=n;if(!s)throw new Cfe({docsPath:pT});const a=t.find(p=>p.type==="event"&&s===RS(Nc(p)));if(!(a&&"name"in a)||a.type!=="event")throw new Sfe(s,{docsPath:pT});const{name:c,inputs:l}=a,u=l==null?void 0:l.some(p=>!("name"in p&&p.name));let f=u?[]:{};const d=l.filter(p=>"indexed"in p&&p.indexed);if(o.length>0)for(let p=0;p!("indexed"in p&&p.indexed));if(h.length>0){if(e&&e!=="0x")try{const p=bb(h,e);if(p)if(u)f=[...f,...p];else for(let v=0;v0?f:void 0}}function Yde({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(bb([t],e)||[])[0]}const Jde=new Map,Xde=new Map;function Zde(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:o=>s.set(i,o)}),r=e(t,Jde),n=e(t,Xde);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function ehe(t,{cacheKey:e,cacheTime:r=1/0}){const n=Zde(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function G1(t,{cacheTime:e=t.cacheTime,maxAge:r}={}){const n=await ehe(()=>t.request({method:"eth_blockNumber"}),{cacheKey:the(t.uid),cacheTime:r??e});return BigInt(n)}async function xb(t,{filter:e}){const r="strict"in e&&e.strict;return(await e.request({method:"eth_getFilterChanges",params:[e.id]})).map(i=>{var s;if(typeof i=="string")return i;try{const{eventName:o,args:a}="abi"in e&&e.abi?V1({abi:e.abi,data:i.data,topics:i.topics,strict:r}):{eventName:void 0,args:void 0};return ks(i,{args:a,eventName:o})}catch(o){let a,c;if(o instanceof zl||o instanceof wd){if("strict"in e&&e.strict)return;a=o.abiItem.name,c=(s=o.abiItem.inputs)==null?void 0:s.some(l=>!("name"in l&&l.name))}return ks(i,{args:c?[]:{},eventName:a})}}).filter(Boolean)}async function VS(t,{address:e,blockHash:r,fromBlock:n,toBlock:i,event:s,events:o,args:a,strict:c}={}){const l=c??!1,u=o??(s?[s]:void 0);let f=[];u&&(f=[u.flatMap(h=>W1({abi:[h],eventName:h.name,args:a}))],s&&(f=f[0]));let d;return r?d=await t.request({method:"eth_getLogs",params:[{address:e,topics:f,blockHash:r}]}):d=await t.request({method:"eth_getLogs",params:[{address:e,topics:f,fromBlock:typeof n=="bigint"?Ue(n):n,toBlock:typeof i=="bigint"?Ue(i):i}]}),d.map(h=>{var p;try{const{eventName:v,args:b}=u?V1({abi:u,data:h.data,topics:h.topics,strict:l}):{eventName:void 0,args:void 0};return ks(h,{args:b,eventName:v})}catch(v){let b,y;if(v instanceof zl||v instanceof wd){if(l)return;b=v.abiItem.name,y=(p=v.abiItem.inputs)==null?void 0:p.some(m=>!("name"in m&&m.name))}return ks(h,{args:y?[]:{},eventName:b})}}).filter(Boolean)}async function Cb(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function rhe(t,{abi:e,address:r,args:n,batch:i=!0,eventName:s,onError:o,onLogs:a,poll:c,pollingInterval:l=t.pollingInterval,strict:u}){return(typeof c<"u"?c:t.transport.type!=="webSocket")?(()=>{const p=Ln(["watchContractEvent",r,n,i,t.uid,s,l]),v=u??!1;return Sd(p,{onLogs:a,onError:o},b=>{let y,m,g=!1;const S=q1(async()=>{var P;if(!g){try{m=await CF(t,{abi:e,address:r,args:n,eventName:s,strict:v})}catch{}g=!0;return}try{let T;if(m)T=await xb(t,{filter:m});else{const w=await G1(t);y&&y!==w?T=await VS(t,{address:r,args:n,fromBlock:y+1n,toBlock:w,event:z1({abi:e,name:s})}):T=[],y=w}if(T.length===0)return;i?b.onLogs(T):T.forEach(w=>b.onLogs([w]))}catch(T){m&&T instanceof Wl&&(g=!1),(P=b.onError)==null||P.call(b,T)}},{emitOnBegin:!0,interval:l});return async()=>{m&&await Cb(t,{filter:m}),S()}})})():(()=>{let p=!0,v=()=>p=!1;return(async()=>{try{const b=s?W1({abi:e,eventName:s,args:n}):[],{unsubscribe:y}=await t.transport.subscribe({params:["logs",{address:r,topics:b}],onData(m){var S;if(!p)return;const g=m.result;try{const{eventName:P,args:T}=V1({abi:e,data:g.data,topics:g.topics,strict:u}),w=ks(g,{args:T,eventName:P});a([w])}catch(P){let T,w;if(P instanceof zl||P instanceof wd){if(u)return;T=P.abiItem.name,w=(S=P.abiItem.inputs)==null?void 0:S.some(F=>!("name"in F&&F.name))}const I=ks(g,{args:w?[]:{},eventName:T});a([I])}},onError(m){o==null||o(m)}});v=y,p||v()}catch(b){o==null||o(b)}})(),v})()}function nhe(t,{docsPath:e,...r}){let n=BS(t,r);return n instanceof pb&&(n=t),new ufe(n,{docsPath:e,...r})}async function r1(t){const e=await t.request({method:"eth_chainId"});return Nn(e)}async function GS(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]})}async function KS(t,e){var v,b,y;const{account:r=t.account,chain:n=t.chain,accessList:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d,...h}=e;if(!r)throw new xd({docsPath:"/docs/actions/wallet/sendTransaction"});const p=Yi(r);try{H1(e);let m;if(n!==null&&(m=await r1(t),eF({currentChainId:m,chain:n})),p.type==="local"){const P=await wb(t,{account:p,accessList:i,chain:n,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d,...h});m||(m=await r1(t));const T=(v=n==null?void 0:n.serializers)==null?void 0:v.transaction,w=await p.signTransaction({...P,chainId:m},{serializer:T});return await GS(t,{serializedTransaction:w})}const g=((y=(b=n==null?void 0:n.formatters)==null?void 0:b.transactionRequest)==null?void 0:y.format)||hb,S=g({...jS(h,{format:g}),accessList:i,data:s,from:p.address,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d});return await t.request({method:"eth_sendTransaction",params:[S]})}catch(m){throw nhe(m,{...e,account:p,chain:e.chain||void 0})}}async function ihe(t,{abi:e,address:r,args:n,dataSuffix:i,functionName:s,...o}){const a=Dc({abi:e,args:n,functionName:s});return await KS(t,{data:`${a}${i?i.replace("0x",""):""}`,to:r,...o})}async function she(t,{chain:e}){const{id:r,name:n,nativeCurrency:i,rpcUrls:s,blockExplorers:o}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:Ue(r),chainName:n,nativeCurrency:i,rpcUrls:s.default.http,blockExplorerUrls:o?Object.values(o).map(({url:a})=>a):void 0}]})}const DC=256;let Zp=DC,ev;function ohe(t=11){if(!ev||Zp+t>DC*2){ev="",Zp=0;for(let e=0;e{const y=b(v);for(const g in h)delete y[g];const m={...v,...y};return Object.assign(m,{extend:p(m)})}}return Object.assign(h,{extend:p(h)})}function RF(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,s)=>{const o=async({count:a=0}={})=>{const c=async({error:l})=>{const u=typeof e=="function"?e({count:a,error:l}):e;u&&await by(u),o({count:a+1})};try{const l=await t();i(l)}catch(l){if(a"code"in t?t.code!==-1&&t.code!==-32004&&t.code!==-32005&&t.code!==-32042&&t.code!==-32603:t instanceof Wh&&t.status?t.status!==403&&t.status!==408&&t.status!==413&&t.status!==429&&t.status!==500&&t.status!==502&&t.status!==503&&t.status!==504:!1;function ahe(t,{retryDelay:e=150,retryCount:r=3}={}){return async n=>RF(async()=>{try{return await t(n)}catch(i){const s=i;switch(s.code){case z0.code:throw new z0(s);case W0.code:throw new W0(s);case H0.code:throw new H0(s);case q0.code:throw new q0(s);case qf.code:throw new qf(s);case Wl.code:throw new Wl(s);case V0.code:throw new V0(s);case mc.code:throw new mc(s);case G0.code:throw new G0(s);case K0.code:throw new K0(s);case Q0.code:throw new Q0(s);case Y0.code:throw new Y0(s);case Pr.code:throw new Pr(s);case J0.code:throw new J0(s);case X0.code:throw new X0(s);case Z0.code:throw new Z0(s);case e1.code:throw new e1(s);case ea.code:throw new ea(s);case 5e3:throw new Pr(s);default:throw i instanceof le?i:new Tde(s)}}},{delay:({count:i,error:s})=>{var o;if(s&&s instanceof Wh){const a=(o=s==null?void 0:s.headers)==null?void 0:o.get("Retry-After");if(a!=null&&a.match(/\d/))return parseInt(a)*1e3}return~~(1<!$F(i)})}function Sb({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:s,type:o},a){return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:s,type:o},request:ahe(r,{retryCount:n,retryDelay:i}),value:a}}function kb(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:s})=>Sb({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??s,retryDelay:i,type:"custom"})}function vT(t,e={}){const{key:r="fallback",name:n="Fallback",rank:i=!1,retryCount:s,retryDelay:o}=e;return({chain:a,pollingInterval:c=4e3,timeout:l})=>{let u=t,f=()=>{};const d=Sb({key:r,name:n,async request({method:h,params:p}){const v=async(b=0)=>{const y=u[b]({chain:a,retryCount:0,timeout:l});try{const m=await y.request({method:h,params:p});return f({method:h,params:p,response:m,transport:y,status:"success"}),m}catch(m){if(f({error:m,method:h,params:p,transport:y,status:"error"}),$F(m)||b===u.length-1)throw m;return v(b+1)}};return v()},retryCount:s,retryDelay:o,type:"fallback"},{onResponse:h=>f=h,transports:u.map(h=>h({chain:a,retryCount:0}))});if(i){const h=typeof i=="object"?i:{};che({chain:a,interval:h.interval??c,onTransports:p=>u=p,sampleCount:h.sampleCount,timeout:h.timeout,transports:u,weights:h.weights})}return d}}function che({chain:t,interval:e=4e3,onTransports:r,sampleCount:n=10,timeout:i=1e3,transports:s,weights:o={}}){const{stability:a=.7,latency:c=.3}=o,l=[],u=async()=>{const f=await Promise.all(s.map(async p=>{const v=p({chain:t,retryCount:0,timeout:i}),b=Date.now();let y,m;try{await v.request({method:"net_listening"}),m=1}catch{m=0}finally{y=Date.now()}return{latency:y-b,success:m}}));l.push(f),l.length>n&&l.shift();const d=Math.max(...l.map(p=>Math.max(...p.map(({latency:v})=>v)))),h=s.map((p,v)=>{const b=l.map(P=>P[v].latency),m=1-b.reduce((P,T)=>P+T,0)/b.length/d,g=l.map(P=>P[v].success),S=g.reduce((P,T)=>P+T,0)/g.length;return S===0?[0,v]:[c*m+a*S,v]}).sort((p,v)=>v[0]-p[0]);r(h.map(([,p])=>s[p])),await by(e),u()};u()}class MF extends le{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}var Ou=null;typeof WebSocket<"u"?Ou=WebSocket:typeof MozWebSocket<"u"?Ou=MozWebSocket:typeof global<"u"?Ou=global.WebSocket||global.MozWebSocket:typeof window<"u"?Ou=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(Ou=self.WebSocket||self.MozWebSocket);const mT=Ou;function NF(t,{errorInstance:e,timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let o;try{const a=new AbortController;r>0&&(o=setTimeout(()=>{n?a.abort():s(e)},r)),i(await t({signal:a==null?void 0:a.signal}))}catch(a){a.name==="AbortError"&&s(e),s(a)}finally{clearTimeout(o)}})()})}let LC=0;async function lhe(t,{body:e,fetchOptions:r={},timeout:n=1e4}){var a;const{headers:i,method:s,signal:o}=r;try{const c=await NF(async({signal:u})=>await fetch(t,{...r,body:Array.isArray(e)?Ln(e.map(d=>({jsonrpc:"2.0",id:d.id??LC++,...d}))):Ln({jsonrpc:"2.0",id:e.id??LC++,...e}),headers:{...i,"Content-Type":"application/json"},method:s||"POST",signal:o||(n>0?u:void 0)}),{errorInstance:new $C({body:e,url:t}),timeout:n,signal:!0});let l;if((a=c.headers.get("Content-Type"))!=null&&a.startsWith("application/json")?l=await c.json():l=await c.text(),!c.ok)throw new Wh({body:e,details:Ln(l.error)||c.statusText,headers:c.headers,status:c.status,url:t});return l}catch(c){throw c instanceof Wh||c instanceof $C?c:new Wh({body:e,details:c.message,url:t})}}const W2=new Map;async function H2(t){let e=W2.get(t);if(e)return e;const{schedule:r}=qS({id:t,fn:async()=>{const s=new mT(t),o=new Map,a=new Map,c=({data:u})=>{const f=JSON.parse(u),d=f.method==="eth_subscription",h=d?f.params.subscription:f.id,p=d?a:o,v=p.get(h);v&&v({data:u}),d||p.delete(h)},l=()=>{W2.delete(t),s.removeEventListener("close",l),s.removeEventListener("message",c)};return s.addEventListener("close",l),s.addEventListener("message",c),s.readyState===mT.CONNECTING&&await new Promise((u,f)=>{s&&(s.onopen=u,s.onerror=f)}),e=Object.assign(s,{requests:o,subscriptions:a}),W2.set(t,e),[e]}}),[n,[i]]=await r();return i}function uhe(t,{body:e,onResponse:r}){if(t.readyState===t.CLOSED||t.readyState===t.CLOSING)throw new _de({body:e,url:t.url,details:"Socket is closed."});const n=LC++,i=({data:s})=>{var a;const o=JSON.parse(s);typeof o.id=="number"&&n!==o.id||(r==null||r(o),e.method==="eth_subscribe"&&typeof o.result=="string"&&t.subscriptions.set(o.result,i),e.method==="eth_unsubscribe"&&t.subscriptions.delete((a=e.params)==null?void 0:a[0]))};return t.requests.set(n,i),t.send(JSON.stringify({jsonrpc:"2.0",...e,id:n})),t}async function fhe(t,{body:e,timeout:r=1e4}){return NF(()=>new Promise(n=>gf.webSocket(t,{body:e,onResponse:n})),{errorInstance:new $C({body:e,url:t.url}),timeout:r})}const gf={http:lhe,webSocket:uhe,webSocketAsync:fhe};function DF(t,e={}){const{batch:r,fetchOptions:n,key:i="http",name:s="HTTP JSON-RPC",retryDelay:o}=e;return({chain:a,retryCount:c,timeout:l})=>{const{batchSize:u=1e3,wait:f=0}=typeof r=="object"?r:{},d=e.retryCount??c,h=l??e.timeout??1e4,p=t||(a==null?void 0:a.rpcUrls.default.http[0]);if(!p)throw new MF;return Sb({key:i,name:s,async request({method:v,params:b}){const y={method:v,params:b},{schedule:m}=qS({id:`${t}`,wait:f,shouldSplitBatch(T){return T.length>u},fn:T=>gf.http(p,{body:T,fetchOptions:n,timeout:h})}),g=async T=>r?m(T):[await gf.http(p,{body:T,fetchOptions:n,timeout:h})],[{error:S,result:P}]=await g(y);if(S)throw new FS({body:y,error:S,url:p});return P},retryCount:d,retryDelay:o,timeout:h,type:"http"},{url:t})}}function QS(t,e){var n,i,s;if(!(t instanceof le))return!1;const r=t.walk(o=>o instanceof RC);return r instanceof RC?!!(((n=r.data)==null?void 0:n.errorName)==="ResolverNotFound"||((i=r.data)==null?void 0:i.errorName)==="ResolverWildcardNotSupported"||(s=r.reason)!=null&&s.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&r.reason===SF[50]):!1}function LF(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return mo(e)?e:null}function zv(t){let e=new Uint8Array(32).fill(0);if(!t)return j0(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=LF(r[n]),s=i?Ul(i):Yn(Fo(r[n]),"bytes");e=Yn(Zo([e,s]),"bytes")}return j0(e)}function dhe(t){return`[${t.slice(2)}]`}function hhe(t){const e=new Uint8Array(32).fill(0);return t?LF(t)||Yn(Fo(t)):j0(e)}function Ab(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(Fo(e).byteLength+2);let n=0;const i=e.split(".");for(let s=0;s255&&(o=Fo(dhe(hhe(i[s])))),r[n]=o.length,r.set(o,n+1),n+=o.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}async function phe(t,{blockNumber:e,blockTag:r,coinType:n,name:i,universalResolverAddress:s}){let o=s;if(!o){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=gd({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const a=Dc({abi:dT,functionName:"addr",...n!=null?{args:[zv(i),BigInt(n)]}:{args:[zv(i)]}}),c=await gc(t,{address:o,abi:IF,functionName:"resolve",args:[da(Ab(i)),a],blockNumber:e,blockTag:r});if(c[0]==="0x")return null;const l=Cd({abi:dT,args:n!=null?[zv(i),BigInt(n)]:void 0,functionName:"addr",data:c[0]});return l==="0x"||mf(l)==="0x00"?null:l}catch(a){if(QS(a,"resolve"))return null;throw a}}class vhe extends le{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class rh extends le{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class YS extends le{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class mhe extends le{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const yhe=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,ghe=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,bhe=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,whe=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Ehe(t){try{const e=await fetch(t,{method:"HEAD"});if(e.status===200){const r=e.headers.get("content-type");return r==null?void 0:r.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=t})}}function yT(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function FF({uri:t,gatewayUrls:e}){const r=bhe.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=yT(e==null?void 0:e.ipfs,"https://ipfs.io"),i=yT(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(yhe),{protocol:o,subpath:a,target:c,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=o==="ipns:/"||a==="ipns/",f=o==="ipfs:/"||a==="ipfs/"||ghe.test(t);if(t.startsWith("http")&&!u&&!f){let h=t;return e!=null&&e.arweave&&(h=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:h,isOnChain:!1,isEncoded:!1}}if((u||f)&&c)return{uri:`${n}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${i}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let d=t.replace(whe,"");if(d.startsWith("i.json());return await JS({gatewayUrls:t,uri:BF(r)})}catch{throw new YS({uri:e})}}async function JS({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=FF({uri:e,gatewayUrls:t});if(n||await Ehe(r))return r;throw new YS({uri:e})}function Che(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[s,o]=r.split(":"),[a,c]=n.split(":");if(!s||s.toLowerCase()!=="eip155")throw new rh({reason:"Only EIP-155 supported"});if(!o)throw new rh({reason:"Chain ID not found"});if(!c)throw new rh({reason:"Contract address not found"});if(!i)throw new rh({reason:"Token ID not found"});if(!a)throw new rh({reason:"ERC namespace not found"});return{chainID:parseInt(o),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}async function She(t,{nft:e}){if(e.namespace==="erc721")return gc(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return gc(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new mhe({namespace:e.namespace})}async function khe(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?Ahe(t,{gatewayUrls:e,record:r}):JS({uri:r,gatewayUrls:e})}async function Ahe(t,{gatewayUrls:e,record:r}){const n=Che(r),i=await She(t,{nft:n}),{uri:s,isOnChain:o,isEncoded:a}=FF({uri:i,gatewayUrls:e});if(o&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const l=a?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(l);return JS({uri:BF(u),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),xhe({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,c)})}async function jF(t,{blockNumber:e,blockTag:r,name:n,key:i,universalResolverAddress:s}){let o=s;if(!o){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=gd({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const a=await gc(t,{address:o,abi:IF,functionName:"resolve",args:[da(Ab(n)),Dc({abi:fT,functionName:"text",args:[zv(n),i]})],blockNumber:e,blockTag:r});if(a[0]==="0x")return null;const c=Cd({abi:fT,functionName:"text",data:a[0]});return c===""?null:c}catch(a){if(QS(a,"resolve"))return null;throw a}}async function _he(t,{blockNumber:e,blockTag:r,gatewayUrls:n,name:i,universalResolverAddress:s}){const o=await jF(t,{blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:s});if(!o)return null;try{return await khe(t,{record:o,gatewayUrls:n})}catch{return null}}async function Phe(t,{address:e,blockNumber:r,blockTag:n,universalResolverAddress:i}){let s=i;if(!s){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");s=gd({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const o=`${e.toLowerCase().substring(2)}.addr.reverse`;try{return(await gc(t,{address:s,abi:Ude,functionName:"reverse",args:[da(Ab(o))],blockNumber:r,blockTag:n}))[0]}catch(a){if(QS(a,"reverse"))return null;throw a}}async function The(t,{blockNumber:e,blockTag:r,name:n,universalResolverAddress:i}){let s=i;if(!s){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");s=gd({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}const[o]=await gc(t,{address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[da(Ab(n))],blockNumber:e,blockTag:r});return o}async function Ihe(t){const e=gb(t,{method:"eth_newBlockFilter"}),r=await t.request({method:"eth_newBlockFilter"});return{id:r,request:e(r),type:"block"}}async function UF(t,{address:e,args:r,event:n,events:i,fromBlock:s,strict:o,toBlock:a}={}){const c=i??(n?[n]:void 0),l=gb(t,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap(d=>W1({abi:[d],eventName:d.name,args:r}))],n&&(u=u[0]));const f=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof s=="bigint"?Ue(s):s,toBlock:typeof a=="bigint"?Ue(a):a,...u.length?{topics:u}:{}}]});return{abi:c,args:r,eventName:n?n.name:void 0,fromBlock:s,id:f,request:l(f),strict:o,toBlock:a,type:"event"}}async function zF(t){const e=gb(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}async function Ohe(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r?Ue(r):void 0,s=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(s)}async function Rhe(t,{blockHash:e,blockNumber:r,blockTag:n="latest"}={}){const i=r!==void 0?Ue(r):void 0;let s;return e?s=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]}):s=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[i||n]}),Nn(s)}async function $he(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r!==void 0?Ue(r):void 0,s=await t.request({method:"eth_getCode",params:[e,i||n]});if(s!=="0x")return s}function Mhe(t){var e;return{baseFeePerGas:t.baseFeePerGas.map(r=>BigInt(r)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:(e=t.reward)==null?void 0:e.map(r=>r.map(n=>BigInt(n)))}}async function Nhe(t,{blockCount:e,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const s=r?Ue(r):void 0,o=await t.request({method:"eth_feeHistory",params:[Ue(e),s||n,i]});return Mhe(o)}async function Dhe(t,{filter:e}){const r=e.strict??!1;return(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(i=>{var s;try{const{eventName:o,args:a}="abi"in e&&e.abi?V1({abi:e.abi,data:i.data,topics:i.topics,strict:r}):{eventName:void 0,args:void 0};return ks(i,{args:a,eventName:o})}catch(o){let a,c;if(o instanceof zl||o instanceof wd){if("strict"in e&&e.strict)return;a=o.abiItem.name,c=(s=o.abiItem.inputs)==null?void 0:s.some(l=>!("name"in l&&l.name))}return ks(i,{args:c?[]:{},eventName:a})}}).filter(Boolean)}async function Lhe(t,{address:e,blockNumber:r,blockTag:n="latest",slot:i}){const s=r!==void 0?Ue(r):void 0;return await t.request({method:"eth_getStorageAt",params:[e,i,s||n]})}async function XS(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){var u,f,d;const o=n||"latest",a=r!==void 0?Ue(r):void 0;let c=null;if(i?c=await t.request({method:"eth_getTransactionByHash",params:[i]}):e?c=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,Ue(s)]}):(a||o)&&(c=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||o,Ue(s)]})),!c)throw new cF({blockHash:e,blockNumber:r,blockTag:o,hash:i,index:s});return(((d=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.transaction)==null?void 0:d.format)||sF)(c)}async function Fhe(t,{hash:e,transactionReceipt:r}){const[n,i]=await Promise.all([G1(t),e?XS(t,{hash:e}):void 0]),s=(r==null?void 0:r.blockNumber)||(i==null?void 0:i.blockNumber);return s?n-s+1n:0n}async function FC(t,{hash:e}){var i,s,o;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]});if(!r)throw new lF({hash:e});return(((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:o.format)||rfe)(r)}async function Bhe(t,e){var v;const{allowFailure:r=!0,batchSize:n,blockNumber:i,blockTag:s,contracts:o,multicallAddress:a}=e,c=n??(typeof((v=t.batch)==null?void 0:v.multicall)=="object"&&t.batch.multicall.batchSize||1024);let l=a;if(!l){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");l=gd({blockNumber:i,chain:t.chain,contract:"multicall3"})}const u=[[]];let f=0,d=0;for(let b=0;b0&&d>c&&u[f].length>0&&(f++,d=(P.length-2)/2,u[f]=[]),u[f]=[...u[f],{allowFailure:!0,callData:P,target:m}]}catch(P){const T=t1(P,{abi:y,address:m,args:g,docsPath:"/docs/contract/multicall",functionName:S});if(!r)throw T;u[f]=[...u[f],{allowFailure:!0,callData:"0x",target:m}]}}const h=await Promise.allSettled(u.map(b=>gc(t,{abi:NC,address:l,args:[b],blockNumber:i,blockTag:s,functionName:"aggregate3"}))),p=[];for(let b=0;b"u"?{}:t,s={EIP712Domain:KF({domain:i}),...n};GF({domain:i,message:e,primaryType:r,types:s});const o=["0x1901"];return i&&o.push(Whe({domain:i,types:s})),r!=="EIP712Domain"&&o.push(WF({data:e,primaryType:r,types:s})),Yn(Zo(o))}function Whe({domain:t,types:e}){return WF({data:t,primaryType:"EIP712Domain",types:e})}function WF({data:t,primaryType:e,types:r}){const n=HF({data:t,primaryType:e,types:r});return Yn(n)}function HF({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[Hhe({primaryType:e,types:r})];for(const s of r[e]){const[o,a]=VF({types:r,name:s.name,type:s.type,value:t[s.name]});n.push(o),i.push(a)}return U1(n,i)}function Hhe({primaryType:t,types:e}){const r=da(qhe({primaryType:t,types:e}));return Yn(r)}function qhe({primaryType:t,types:e}){let r="";const n=qF({primaryType:t,types:e});n.delete(t);const i=[t,...Array.from(n).sort()];for(const s of i)r+=`${s}(${e[s].map(({name:o,type:a})=>`${a} ${o}`).join(",")})`;return r}function qF({primaryType:t,types:e},r=new Set){const n=t.match(/^\w*/u),i=n==null?void 0:n[0];if(r.has(i)||e[i]===void 0)return r;r.add(i);for(const s of e[i])qF({primaryType:s.type,types:e},r);return r}function VF({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},Yn(HF({data:n,primaryType:r,types:t}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},Yn(n)];if(r==="string")return[{type:"bytes32"},Yn(da(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),s=n.map(o=>VF({name:e,type:i,types:t,value:o}));return[{type:"bytes32"},Yn(U1(s.map(([o])=>o),s.map(([,o])=>o)))]}return[{type:r},n]}function GF({domain:t,message:e,primaryType:r,types:n}){const i=n,s=(o,a)=>{for(const c of o){const{name:l,type:u}=c,f=u,d=a[l],h=f.match(Uhe);if(h&&(typeof d=="number"||typeof d=="bigint")){const[b,y,m]=h;Ue(d,{signed:y==="int",size:parseInt(m)/8})}if(f==="address"&&typeof d=="string"&&!Hf(d))throw new U0({address:d});const p=f.match(jhe);if(p){const[b,y]=p;if(y&&Br(d)!==parseInt(y))throw new Afe({expectedSize:parseInt(y),givenSize:Br(d)})}const v=i[f];v&&s(v,d)}};if(i.EIP712Domain&&t&&s(i.EIP712Domain,t),r!=="EIP712Domain"){const o=i[r];s(o,e)}}function KF({domain:t}){return[typeof(t==null?void 0:t.name)=="string"&&{name:"name",type:"string"},(t==null?void 0:t.version)&&{name:"version",type:"string"},typeof(t==null?void 0:t.chainId)=="number"&&{name:"chainId",type:"uint256"},(t==null?void 0:t.verifyingContract)&&{name:"verifyingContract",type:"address"},(t==null?void 0:t.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}const q2="/docs/contract/encodeDeployData";function QF({abi:t,args:e,bytecode:r}){if(!e||e.length===0)return r;const n=t.find(s=>"type"in s&&s.type==="constructor");if(!n)throw new bfe({docsPath:q2});if(!("inputs"in n))throw new rT({docsPath:q2});if(!n.inputs||n.inputs.length===0)throw new rT({docsPath:q2});const i=U1(n.inputs,e);return _S([r,i])}function Vhe(t,e){const r=(()=>typeof t=="string"?Fo(t):t.raw instanceof Uint8Array?t.raw:Ul(t.raw))(),n=Fo(`Ethereum Signed Message: +${r.length}`);return Yn(Zo([n,r]),e)}const Ghe="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */BigInt(0);BigInt(1);BigInt(2);function Khe(t,e){if(t.length!==e.length)return!1;for(let r=0;r{const f=Ln(["watchBlockNumber",t.uid,e,r,o]);return Sd(f,{onBlockNumber:n,onError:i},d=>q1(async()=>{var h;try{const p=await G1(t,{cacheTime:0});if(c){if(p===c)return;if(p-c>1&&r)for(let v=c+1n;vc)&&(d.onBlockNumber(p,c),c=p)}catch(p){(h=d.onError)==null||h.call(d,p)}},{emitOnBegin:e,interval:o}))})():(()=>{let f=!0,d=()=>f=!1;return(async()=>{try{const{unsubscribe:h}=await t.transport.subscribe({params:["newHeads"],onData(p){var b;if(!f)return;const v=db((b=p.result)==null?void 0:b.number);n(v,c),c=v},onError(p){i==null||i(p)}});d=h,f||d()}catch(h){i==null||i(h)}})(),d})()}async function Xhe(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,timeout:s}){const o=Ln(["waitForTransactionReceipt",t.uid,r]);let a,c,l,u=!1;return new Promise((f,d)=>{s&&setTimeout(()=>d(new ffe({hash:r})),s);const h=Sd(o,{onReplaced:n,resolve:f,reject:d},p=>{const v=JF(t,{emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(b){if(u)return;let y=b;const m=g=>{v(),g(),h()};try{if(l){if(y-l.blockNumber+1np.resolve(l));return}if(a||(u=!0,await RF(async()=>{a=await XS(t,{hash:r}),a.blockNumber&&(y=a.blockNumber)},{delay:({count:g})=>~~(1<0&&y-l.blockNumber+1np.resolve(l))}catch(g){if(a&&(g instanceof cF||g instanceof lF))try{c=a;const P=(await yc(t,{blockNumber:y,includeTransactions:!0})).transactions.find(({from:w,nonce:I})=>w===c.from&&I===c.nonce);if(!P||(l=await FC(t,{hash:P.hash}),y-l.blockNumber+1n{var w;(w=p.onReplaced)==null||w.call(p,{reason:T,replacedTransaction:c,transaction:P,transactionReceipt:l}),p.resolve(l)})}catch(S){m(()=>p.reject(S))}else m(()=>p.reject(g))}}})})})}function Zhe(t,{blockTag:e="latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:s,includeTransactions:o,poll:a,pollingInterval:c=t.pollingInterval}){const l=typeof a<"u"?a:t.transport.type!=="webSocket",u=o??!1;let f;return l?(()=>{const p=Ln(["watchBlocks",t.uid,r,n,u,c]);return Sd(p,{onBlock:i,onError:s},v=>q1(async()=>{var b;try{const y=await yc(t,{blockTag:e,includeTransactions:u});if(y.number&&(f!=null&&f.number)){if(y.number===f.number)return;if(y.number-f.number>1&&r)for(let m=(f==null?void 0:f.number)+1n;mf.number)&&(v.onBlock(y,f),f=y)}catch(y){(b=v.onError)==null||b.call(v,y)}},{emitOnBegin:n,interval:c}))})():(()=>{let p=!0,v=()=>p=!1;return(async()=>{try{const{unsubscribe:b}=await t.transport.subscribe({params:["newHeads"],onData(y){var S,P,T;if(!p)return;const g=(((T=(P=(S=t.chain)==null?void 0:S.formatters)==null?void 0:P.block)==null?void 0:T.format)||oF)(y.result);i(g,f),f=g},onError(y){s==null||s(y)}});v=b,p||v()}catch(b){s==null||s(b)}})(),v})()}function e0e(t,{address:e,args:r,batch:n=!0,event:i,events:s,onError:o,onLogs:a,poll:c,pollingInterval:l=t.pollingInterval,strict:u}){const f=typeof c<"u"?c:t.transport.type!=="webSocket",d=u??!1;return f?(()=>{const v=Ln(["watchEvent",e,r,n,t.uid,i,l]);return Sd(v,{onLogs:a,onError:o},b=>{let y,m,g=!1;const S=q1(async()=>{var P;if(!g){try{m=await UF(t,{address:e,args:r,event:i,events:s,strict:d})}catch{}g=!0;return}try{let T;if(m)T=await xb(t,{filter:m});else{const w=await G1(t);y&&y!==w?T=await VS(t,{address:e,args:r,event:i,events:s,fromBlock:y+1n,toBlock:w}):T=[],y=w}if(T.length===0)return;n?b.onLogs(T):T.forEach(w=>b.onLogs([w]))}catch(T){m&&T instanceof Wl&&(g=!1),(P=b.onError)==null||P.call(b,T)}},{emitOnBegin:!0,interval:l});return async()=>{m&&await Cb(t,{filter:m}),S()}})})():(()=>{let v=!0,b=()=>v=!1;return(async()=>{try{const y=s??(i?[i]:void 0);let m=[];y&&(m=[y.flatMap(S=>W1({abi:[S],eventName:S.name,args:r}))],i&&(m=m[0]));const{unsubscribe:g}=await t.transport.subscribe({params:["logs",{address:e,topics:m}],onData(S){var T;if(!v)return;const P=S.result;try{const{eventName:w,args:I}=V1({abi:y,data:P.data,topics:P.topics,strict:d}),F=ks(P,{args:I,eventName:w});a([F])}catch(w){let I,F;if(w instanceof zl||w instanceof wd){if(u)return;I=w.abiItem.name,F=(T=w.abiItem.inputs)==null?void 0:T.some(H=>!("name"in H&&H.name))}const j=ks(P,{args:F?[]:{},eventName:I});a([j])}},onError(S){o==null||o(S)}});b=g,v||b()}catch(y){o==null||o(y)}})(),b})()}function t0e(t,{batch:e=!0,onError:r,onTransactions:n,poll:i,pollingInterval:s=t.pollingInterval}){return(typeof i<"u"?i:t.transport.type!=="webSocket")?(()=>{const l=Ln(["watchPendingTransactions",t.uid,e,s]);return Sd(l,{onTransactions:n,onError:r},u=>{let f;const d=q1(async()=>{var h;try{if(!f)try{f=await zF(t);return}catch(v){throw d(),v}const p=await xb(t,{filter:f});if(p.length===0)return;e?u.onTransactions(p):p.forEach(v=>u.onTransactions([v]))}catch(p){(h=u.onError)==null||h.call(u,p)}},{emitOnBegin:!0,interval:s});return async()=>{f&&await Cb(t,{filter:f}),d()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{const{unsubscribe:f}=await t.transport.subscribe({params:["newPendingTransactions"],onData(d){if(!l)return;const h=d.result;n([h])},onError(d){r==null||r(d)}});u=f,l||u()}catch(f){r==null||r(f)}})(),u})()}function r0e(t){return{call:e=>Eb(t,e),createBlockFilter:()=>Ihe(t),createContractEventFilter:e=>CF(t,e),createEventFilter:e=>UF(t,e),createPendingTransactionFilter:()=>zF(t),estimateContractGas:e=>Fde(t,e),estimateGas:e=>WS(t,e),getBalance:e=>Ohe(t,e),getBlock:e=>yc(t,e),getBlockNumber:e=>G1(t,e),getBlockTransactionCount:e=>Rhe(t,e),getBytecode:e=>$he(t,e),getChainId:()=>r1(t),getEnsAddress:e=>phe(t,e),getEnsAvatar:e=>_he(t,e),getEnsName:e=>Phe(t,e),getEnsResolver:e=>The(t,e),getEnsText:e=>jF(t,e),getFeeHistory:e=>Nhe(t,e),estimateFeesPerGas:e=>Lde(t,e),getFilterChanges:e=>xb(t,e),getFilterLogs:e=>Dhe(t,e),getGasPrice:()=>zS(t),getLogs:e=>VS(t,e),estimateMaxPriorityFeePerGas:e=>Dde(t,e),getStorageAt:e=>Lhe(t,e),getTransaction:e=>XS(t,e),getTransactionConfirmations:e=>Fhe(t,e),getTransactionCount:e=>PF(t,e),getTransactionReceipt:e=>FC(t,e),multicall:e=>Bhe(t,e),prepareTransactionRequest:e=>wb(t,e),readContract:e=>gc(t,e),sendRawTransaction:e=>GS(t,e),simulateContract:e=>Kde(t,e),verifyMessage:e=>Yhe(t,e),verifyTypedData:e=>Jhe(t,e),uninstallFilter:e=>Cb(t,e),waitForTransactionReceipt:e=>Xhe(t,e),watchBlocks:e=>Zhe(t,e),watchBlockNumber:e=>JF(t,e),watchContractEvent:e=>rhe(t,e),watchEvent:e=>e0e(t,e),watchPendingTransactions:e=>t0e(t,e)}}function gT(t){const{key:e="public",name:r="Public Client"}=t;return OF({...t,key:e,name:r,type:"publicClient"}).extend(r0e)}function n0e(t,{abi:e,args:r,bytecode:n,...i}){const s=QF({abi:e,args:r,bytecode:n});return KS(t,{...i,data:s})}async function i0e(t){return(await t.request({method:"eth_accounts"})).map(r=>DS(r))}async function s0e(t){return await t.request({method:"wallet_getPermissions"})}async function o0e(t){return(await t.request({method:"eth_requestAccounts"})).map(r=>Dn(r))}async function a0e(t,e){return t.request({method:"wallet_requestPermissions",params:[e]})}async function c0e(t,{account:e=t.account,message:r}){if(!e)throw new xd({docsPath:"/docs/actions/wallet/signMessage"});const n=Yi(e);if(n.type==="local")return n.signMessage({message:r});const i=(()=>typeof r=="string"?kS(r):r.raw instanceof Uint8Array?da(r.raw):r.raw)();return t.request({method:"personal_sign",params:[i,n.address]})}async function l0e(t,e){var l,u,f,d;const{account:r=t.account,chain:n=t.chain,...i}=e;if(!r)throw new xd({docsPath:"/docs/actions/wallet/signTransaction"});const s=Yi(r);H1({account:s,...e});const o=await r1(t);n!==null&&eF({currentChainId:o,chain:n});const a=(n==null?void 0:n.formatters)||((l=t.chain)==null?void 0:l.formatters),c=((u=a==null?void 0:a.transactionRequest)==null?void 0:u.format)||hb;return s.type==="local"?s.signTransaction({chainId:o,...i},{serializer:(d=(f=t.chain)==null?void 0:f.serializers)==null?void 0:d.transaction}):await t.request({method:"eth_signTransaction",params:[{...c(i),chainId:Ue(o),from:s.address}]})}async function u0e(t,{account:e=t.account,domain:r,message:n,primaryType:i,types:s}){if(!e)throw new xd({docsPath:"/docs/actions/wallet/signTypedData"});const o=Yi(e),a={EIP712Domain:KF({domain:r}),...s};if(GF({domain:r,message:n,primaryType:i,types:a}),o.type==="local")return o.signTypedData({domain:r,primaryType:i,types:a,message:n});const c=Ln({domain:r??{},primaryType:i,types:a,message:n},(l,u)=>mo(u)?u.toLowerCase():u);return t.request({method:"eth_signTypedData_v4",params:[o.address,c]})}async function f0e(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:Ue(e)}]})}async function d0e(t,e){return await t.request({method:"wallet_watchAsset",params:e})}function h0e(t){return{addChain:e=>she(t,e),deployContract:e=>n0e(t,e),getAddresses:()=>i0e(t),getChainId:()=>r1(t),getPermissions:()=>s0e(t),prepareTransactionRequest:e=>wb(t,e),requestAddresses:()=>o0e(t),requestPermissions:e=>a0e(t,e),sendRawTransaction:e=>GS(t,e),sendTransaction:e=>KS(t,e),signMessage:e=>c0e(t,e),signTransaction:e=>l0e(t,e),signTypedData:e=>u0e(t,e),switchChain:e=>f0e(t,e),watchAsset:e=>d0e(t,e),writeContract:e=>ihe(t,e)}}function K1(t){const{key:e="wallet",name:r="Wallet Client",transport:n}=t;return OF({...t,key:e,name:r,transport:s=>n({...s,retryCount:0}),type:"walletClient"}).extend(h0e)}function p0e(t,e={}){const{key:r="webSocket",name:n="WebSocket JSON-RPC",retryDelay:i}=e;return({chain:s,retryCount:o,timeout:a})=>{var f;const c=e.retryCount??o,l=a??e.timeout??1e4,u=t||((f=s==null?void 0:s.rpcUrls.default.webSocket)==null?void 0:f[0]);if(!u)throw new MF;return Sb({key:r,name:n,async request({method:d,params:h}){const p={method:d,params:h},v=await H2(u),{error:b,result:y}=await gf.webSocketAsync(v,{body:p,timeout:l});if(b)throw new FS({body:p,error:b,url:u});return y},retryCount:c,retryDelay:i,timeout:l,type:"webSocket"},{getSocket(){return H2(u)},async subscribe({params:d,onData:h,onError:p}){const v=await H2(u),{result:b}=await new Promise((y,m)=>gf.webSocket(v,{body:{method:"eth_subscribe",params:d},onResponse(g){if(g.error){m(g.error),p==null||p(g.error);return}if(typeof g.id=="number"){y(g);return}g.method==="eth_subscription"&&h(g.params)}}));return{subscriptionId:b,async unsubscribe(){return new Promise(y=>gf.webSocket(v,{body:{method:"eth_unsubscribe",params:[b]},onResponse:y}))}}}})}}function v0e(t){var r;if(!t)return"Injected";const e=n=>{if(n.isApexWallet)return"Apex Wallet";if(n.isAvalanche)return"Core Wallet";if(n.isBackpack)return"Backpack";if(n.isBifrost)return"Bifrost Wallet";if(n.isBitKeep)return"BitKeep";if(n.isBitski)return"Bitski";if(n.isBlockWallet)return"BlockWallet";if(n.isBraveWallet)return"Brave Wallet";if(n.isCoinbaseWallet)return"Coinbase Wallet";if(n.isDawn)return"Dawn Wallet";if(n.isDefiant)return"Defiant";if(n.isEnkrypt)return"Enkrypt";if(n.isExodus)return"Exodus";if(n.isFrame)return"Frame";if(n.isFrontier)return"Frontier Wallet";if(n.isGamestop)return"GameStop Wallet";if(n.isHaqqWallet)return"HAQQ Wallet";if(n.isHyperPay)return"HyperPay Wallet";if(n.isImToken)return"ImToken";if(n.isHaloWallet)return"Halo Wallet";if(n.isKuCoinWallet)return"KuCoin Wallet";if(n.isMathWallet)return"MathWallet";if(n.isNovaWallet)return"Nova Wallet";if(n.isOkxWallet||n.isOKExWallet)return"OKX Wallet";if(n.isOneInchIOSWallet||n.isOneInchAndroidWallet)return"1inch Wallet";if(n.isOpera)return"Opera";if(n.isPhantom)return"Phantom";if(n.isPortal)return"Ripio Portal";if(n.isRabby)return"Rabby Wallet";if(n.isRainbow)return"Rainbow";if(n.isStatus)return"Status";if(n.isTalisman)return"Talisman";if(n.isTally)return"Taho";if(n.isTokenPocket)return"TokenPocket";if(n.isTokenary)return"Tokenary";if(n.isTrust||n.isTrustWallet)return"Trust Wallet";if(n.isTTWallet)return"TTWallet";if(n.isXDEFI)return"XDEFI Wallet";if(n.isZerion)return"Zerion";if(n.isMetaMask)return"MetaMask"};if((r=t.providers)!=null&&r.length){const n=new Set;let i=1;for(const o of t.providers){let a=e(o);a||(a=`Unknown Wallet #${i}`,i+=1),n.add(a)}const s=[...n];return s.length?s:s[0]??"Injected"}return e(t)??"Injected"}var Wv,XF=class extends j1{constructor({chains:t,options:e}={}){const r={shimDisconnect:!0,getProvider(){if(typeof window>"u")return;const i=window.ethereum;return i!=null&&i.providers?i.providers[0]:i},...e};super({chains:t,options:r}),Ke(this,"id","injected"),Ke(this,"name"),Ke(this,"ready"),Mr(this,Wv,void 0),Ke(this,"shimDisconnectKey",`${this.id}.shimDisconnect`),Ke(this,"onAccountsChanged",i=>{i.length===0?this.emit("disconnect"):this.emit("change",{account:Dn(i[0])})}),Ke(this,"onChainChanged",i=>{const s=El(i),o=this.isChainUnsupported(s);this.emit("change",{chain:{id:s,unsupported:o}})}),Ke(this,"onDisconnect",async i=>{var s;i.code===1013&&await this.getProvider()&&await this.getAccount()||(this.emit("disconnect"),this.options.shimDisconnect&&((s=this.storage)==null||s.removeItem(this.shimDisconnectKey)))});const n=r.getProvider();if(typeof r.name=="string")this.name=r.name;else if(n){const i=v0e(n);r.name?this.name=r.name(i):typeof i=="string"?this.name=i:this.name=i[0]}else this.name="Injected";this.ready=!!n}async connect({chainId:t}={}){var e;try{const r=await this.getProvider();if(!r)throw new Ma;r.on&&(r.on("accountsChanged",this.onAccountsChanged),r.on("chainChanged",this.onChainChanged),r.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});const n=await r.request({method:"eth_requestAccounts"}),i=Dn(n[0]);let s=await this.getChainId(),o=this.isChainUnsupported(s);return t&&s!==t&&(s=(await this.switchChain(t)).id,o=this.isChainUnsupported(s)),this.options.shimDisconnect&&((e=this.storage)==null||e.setItem(this.shimDisconnectKey,!0)),{account:i,chain:{id:s,unsupported:o}}}catch(r){throw this.isUserRejectedRequestError(r)?new Pr(r):r.code===-32002?new mc(r):r}}async disconnect(){var e;const t=await this.getProvider();t!=null&&t.removeListener&&(t.removeListener("accountsChanged",this.onAccountsChanged),t.removeListener("chainChanged",this.onChainChanged),t.removeListener("disconnect",this.onDisconnect),this.options.shimDisconnect&&((e=this.storage)==null||e.removeItem(this.shimDisconnectKey)))}async getAccount(){const t=await this.getProvider();if(!t)throw new Ma;const e=await t.request({method:"eth_accounts"});return Dn(e[0])}async getChainId(){const t=await this.getProvider();if(!t)throw new Ma;return t.request({method:"eth_chainId"}).then(El)}async getProvider(){const t=this.options.getProvider();return t&&ys(this,Wv,t),We(this,Wv)}async getWalletClient({chainId:t}={}){const[e,r]=await Promise.all([this.getProvider(),this.getAccount()]),n=this.chains.find(i=>i.id===t);if(!e)throw new Error("provider is required.");return K1({account:r,chain:n,transport:kb(e)})}async isAuthorized(){var t;try{if(this.options.shimDisconnect&&!((t=this.storage)!=null&&t.getItem(this.shimDisconnectKey)))return!1;if(!await this.getProvider())throw new Ma;return!!await this.getAccount()}catch{return!1}}async switchChain(t){var n,i,s;const e=await this.getProvider();if(!e)throw new Ma;const r=Ue(t);try{return await Promise.all([e.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]}),new Promise(o=>this.on("change",({chain:a})=>{(a==null?void 0:a.id)===t&&o()}))]),this.chains.find(o=>o.id===t)??{id:t,name:`Chain ${r}`,network:`${r}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}}catch(o){const a=this.chains.find(c=>c.id===t);if(!a)throw new uF({chainId:t,connectorId:this.id});if(o.code===4902||((i=(n=o==null?void 0:o.data)==null?void 0:n.originalError)==null?void 0:i.code)===4902)try{if(await e.request({method:"wallet_addEthereumChain",params:[{chainId:r,chainName:a.name,nativeCurrency:a.nativeCurrency,rpcUrls:[((s=a.rpcUrls.public)==null?void 0:s.http[0])??""],blockExplorerUrls:this.getBlockExplorerUrls(a)}]}),await this.getChainId()!==t)throw new Pr(new Error("User rejected switch after adding network."));return a}catch(c){throw new Pr(c)}throw this.isUserRejectedRequestError(o)?new Pr(o):new ea(o)}}async watchAsset({address:t,decimals:e=18,image:r,symbol:n}){const i=await this.getProvider();if(!i)throw new Ma;return i.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:t,decimals:e,image:r,symbol:n}}})}isUserRejectedRequestError(t){return t.code===4001}};Wv=new WeakMap;var ZS=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},V2=(t,e,r)=>(ZS(t,e,"read from private field"),r?r.call(t):e.get(t)),G2=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},tv=(t,e,r,n)=>(ZS(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),m0e=(t,e,r)=>(ZS(t,e,"access private method"),r);const y0e=t=>(e,r,n)=>{const i=n.subscribe;return n.subscribe=(o,a,c)=>{let l=o;if(a){const u=(c==null?void 0:c.equalityFn)||Object.is;let f=o(n.getState());l=d=>{const h=o(d);if(!u(f,h)){const p=f;a(f=h,p)}},c!=null&&c.fireImmediately&&a(f,f)}return i(l)},t(e,r,n)},g0e=y0e;function b0e(t,e){let r;try{r=t()}catch{return}return{getItem:i=>{var s;const o=c=>c===null?null:JSON.parse(c,e==null?void 0:e.reviver),a=(s=r.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>r.setItem(i,JSON.stringify(s,e==null?void 0:e.replacer)),removeItem:i=>r.removeItem(i)}}const n1=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return n1(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return n1(n)(r)}}}},w0e=(t,e)=>(r,n,i)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:b=>b,version:0,merge:(b,y)=>({...y,...b}),...e},o=!1;const a=new Set,c=new Set;let l;try{l=s.getStorage()}catch{}if(!l)return t((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...b)},n,i);const u=n1(s.serialize),f=()=>{const b=s.partialize({...n()});let y;const m=u({state:b,version:s.version}).then(g=>l.setItem(s.name,g)).catch(g=>{y=g});if(y)throw y;return m},d=i.setState;i.setState=(b,y)=>{d(b,y),f()};const h=t((...b)=>{r(...b),f()},n,i);let p;const v=()=>{var b;if(!l)return;o=!1,a.forEach(m=>m(n()));const y=((b=s.onRehydrateStorage)==null?void 0:b.call(s,n()))||void 0;return n1(l.getItem.bind(l))(s.name).then(m=>{if(m)return s.deserialize(m)}).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==s.version){if(s.migrate)return s.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var g;return p=s.merge(m,(g=n())!=null?g:h),r(p,!0),f()}).then(()=>{y==null||y(p,void 0),o=!0,c.forEach(m=>m(p))}).catch(m=>{y==null||y(void 0,m)})};return i.persist={setOptions:b=>{s={...s,...b},b.getStorage&&(l=b.getStorage())},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>v(),hasHydrated:()=>o,onHydrate:b=>(a.add(b),()=>{a.delete(b)}),onFinishHydration:b=>(c.add(b),()=>{c.delete(b)})},v(),p||h},E0e=(t,e)=>(r,n,i)=>{let s={storage:b0e(()=>localStorage),partialize:v=>v,version:0,merge:(v,b)=>({...b,...v}),...e},o=!1;const a=new Set,c=new Set;let l=s.storage;if(!l)return t((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...v)},n,i);const u=()=>{const v=s.partialize({...n()});return l.setItem(s.name,{state:v,version:s.version})},f=i.setState;i.setState=(v,b)=>{f(v,b),u()};const d=t((...v)=>{r(...v),u()},n,i);let h;const p=()=>{var v,b;if(!l)return;o=!1,a.forEach(m=>{var g;return m((g=n())!=null?g:d)});const y=((b=s.onRehydrateStorage)==null?void 0:b.call(s,(v=n())!=null?v:d))||void 0;return n1(l.getItem.bind(l))(s.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==s.version){if(s.migrate)return s.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var g;return h=s.merge(m,(g=n())!=null?g:d),r(h,!0),u()}).then(()=>{y==null||y(h,void 0),h=n(),o=!0,c.forEach(m=>m(h))}).catch(m=>{y==null||y(void 0,m)})};return i.persist={setOptions:v=>{s={...s,...v},v.storage&&(l=v.storage)},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>p(),hasHydrated:()=>o,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(c.add(v),()=>{c.delete(v)})},s.skipHydration||p(),h||d},x0e=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?w0e(t,e):E0e(t,e),C0e=x0e,bT=t=>{let e;const r=new Set,n=(c,l)=>{const u=typeof c=="function"?c(e):c;if(!Object.is(u,e)){const f=e;e=l??typeof u!="object"?u:Object.assign({},e,u),r.forEach(d=>d(e,f))}},i=()=>e,a={setState:n,getState:i,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{r.clear()}};return e=t(n,i,a),a},S0e=t=>t?bT(t):bT;function e8(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[n,i]of t)if(!Object.is(i,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let n=0;nv===f.id)||(c=[...c,p.chain]),l[f.id]=[...l[f.id]||[],...p.rpcUrls.http],p.rpcUrls.webSocket&&(u[f.id]=[...u[f.id]||[],...p.rpcUrls.webSocket]))}if(!d)throw new Error([`Could not find valid provider configuration for chain "${f.name}". `,"You may need to add `jsonRpcProvider` to `configureChains` with the chain's RPC URLs.","Read more: https://wagmi.sh/core/providers/jsonRpc"].join(` -`))}return{chains:c,publicClient:({chainId:f})=>{const d=c.find(v=>v.id===f)??t[0],h=l[d.id];if(!h||!h[0])throw new Error(`No providers configured for chain "${d.id}"`);const p=cT({batch:r,chain:d,transport:sT(h.map(v=>oB(v,{timeout:a})),{rank:i,retryCount:s,retryDelay:o}),pollingInterval:n});return Object.assign(p,{chains:c})},webSocketPublicClient:({chainId:f})=>{const d=c.find(v=>v.id===f)??t[0],h=u[d.id];if(!h||!h[0])return;const p=cT({batch:r,chain:d,transport:sT(h.map(v=>Mhe(v,{timeout:a})),{rank:i,retryCount:s,retryDelay:o}),pollingInterval:n});return Object.assign(p,{chains:c})}}}var qhe=class extends Error{constructor(){super(...arguments),this.name="ConnectorAlreadyConnectedError",this.message="Connector already connected"}},Vhe=class extends Error{constructor({connector:t}){super(`"${t.name}" does not support programmatic chain switching.`),this.name="SwitchChainNotSupportedError"}};function OC(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)&&Array.isArray(e)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!OC(t[n],e[n]))return!1;return!0}if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const i=Object.keys(t);if(r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(s&&!OC(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}var RC=(t,{find:e,replace:r})=>t&&e(t)?r(t):typeof t!="object"?t:Array.isArray(t)?t.map(n=>RC(n,{find:e,replace:r})):t instanceof Object?Object.entries(t).reduce((n,[i,s])=>({...n,[i]:RC(s,{find:e,replace:r})}),{}):t;function Ghe(t){const e=JSON.parse(t);return RC(e,{find:n=>typeof n=="string"&&n.startsWith("#bigint."),replace:n=>BigInt(n.replace("#bigint.",""))})}function uT(t,e){return t.slice(0,e).join(".")||"."}function fT(t,e){const{length:r}=t;for(let n=0;n{const o=typeof s=="bigint"?`#bigint.${s.toString()}`:s;return(e==null?void 0:e(i,o))||o},n),r??void 0)}var CB={getItem:t=>"",setItem:(t,e)=>null,removeItem:t=>null};function SB({deserialize:t=Ghe,key:e="wagmi",serialize:r=Qhe,storage:n}){return{...n,getItem:(i,s=null)=>{const o=n.getItem(`${e}.${i}`);try{return o?t(o):s}catch(a){return console.warn(a),s}},setItem:(i,s)=>{if(s===null)n.removeItem(`${e}.${i}`);else try{n.setItem(`${e}.${i}`,r(s))}catch(o){console.error(o)}},removeItem:i=>n.removeItem(`${e}.${i}`)}}var dT="store",Ou,hh,MC,kB,Yhe=class{constructor({autoConnect:e=!1,connectors:r=[new xB],publicClient:n,storage:i=SB({storage:typeof window<"u"?window.localStorage:CB}),logger:s={warn:console.warn},webSocketPublicClient:o}){var u,f;j2(this,MC),this.publicClients=new Map,this.webSocketPublicClients=new Map,j2(this,Ou,void 0),j2(this,hh,void 0),this.args={autoConnect:e,connectors:r,logger:s,publicClient:n,storage:i,webSocketPublicClient:o};let a="disconnected",c;if(e)try{const d=i.getItem(dT),h=(u=d==null?void 0:d.state)==null?void 0:u.data;a=h!=null&&h.account?"reconnecting":"connecting",c=(f=h==null?void 0:h.chain)==null?void 0:f.id}catch{}const l=typeof r=="function"?r():r;l.forEach(d=>d.setStorage(i)),this.store=Whe(Lhe(zhe(()=>({connectors:l,publicClient:this.getPublicClient({chainId:c}),status:a,webSocketPublicClient:this.getWebSocketPublicClient({chainId:c})}),{name:dT,storage:i,partialize:d=>{var h,p;return{...e&&{data:{account:(h=d==null?void 0:d.data)==null?void 0:h.account,chain:(p=d==null?void 0:d.data)==null?void 0:p.chain}},chains:d==null?void 0:d.chains}},version:2}))),this.storage=i,Yp(this,hh,i==null?void 0:i.getItem("wallet")),Nhe(this,MC,kB).call(this),e&&typeof window<"u"&&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,r;return(r=(e=this.data)==null?void 0:e.chain)==null?void 0:r.id}get publicClient(){return this.store.getState().publicClient}get status(){return this.store.getState().status}get subscribe(){return this.store.subscribe}get webSocketPublicClient(){return this.store.getState().webSocketPublicClient}setState(e){const r=typeof e=="function"?e(this.store.getState()):e;this.store.setState(r,!0)}clearState(){this.setState(e=>({...e,chains:void 0,connector:void 0,data:void 0,error:void 0,status:"disconnected"}))}async destroy(){var e,r;this.connector&&await((r=(e=this.connector).disconnect)==null?void 0:r.call(e)),Yp(this,Ou,!1),this.clearState(),this.store.destroy()}async autoConnect(){if(F2(this,Ou))return;Yp(this,Ou,!0),this.setState(n=>{var i;return{...n,status:(i=n.data)!=null&&i.account?"reconnecting":"connecting"}});const e=F2(this,hh)?[...this.connectors].sort(n=>n.id===F2(this,hh)?-1:1):this.connectors;let r=!1;for(const n of e){if(!n.ready||!n.isAuthorized||!await n.isAuthorized())continue;const s=await n.connect();this.setState(o=>({...o,connector:n,chains:n==null?void 0:n.chains,data:s,status:"connected"})),r=!0;break}return r||this.setState(n=>({...n,data:void 0,status:"disconnected"})),Yp(this,Ou,!1),this.data}setConnectors(e){this.args={...this.args,connectors:e};const r=typeof e=="function"?e():e;r.forEach(n=>n.setStorage(this.args.storage)),this.setState(n=>({...n,connectors:r}))}getPublicClient({chainId:e}={}){let r=this.publicClients.get(-1);if(r&&(r==null?void 0:r.chain.id)===e||(r=this.publicClients.get(e??-1),r))return r;const{publicClient:n}=this.args;return r=typeof n=="function"?n({chainId:e}):n,this.publicClients.set(e??-1,r),r}setPublicClient(e){var n,i;const r=(i=(n=this.data)==null?void 0:n.chain)==null?void 0:i.id;this.args={...this.args,publicClient:e},this.publicClients.clear(),this.setState(s=>({...s,publicClient:this.getPublicClient({chainId:r})}))}getWebSocketPublicClient({chainId:e}={}){let r=this.webSocketPublicClients.get(-1);if(r&&(r==null?void 0:r.chain.id)===e||(r=this.webSocketPublicClients.get(e??-1),r))return r;const{webSocketPublicClient:n}=this.args;return r=typeof n=="function"?n({chainId:e}):n,r&&this.webSocketPublicClients.set(e??-1,r),r}setWebSocketPublicClient(e){var n,i;const r=(i=(n=this.data)==null?void 0:n.chain)==null?void 0:i.id;this.args={...this.args,webSocketPublicClient:e},this.webSocketPublicClients.clear(),this.setState(s=>({...s,webSocketPublicClient:this.getWebSocketPublicClient({chainId:r})}))}setLastUsedConnector(e=null){var r;(r=this.storage)==null||r.setItem("wallet",e)}};Ou=new WeakMap;hh=new WeakMap;MC=new WeakSet;kB=function(){const t=a=>{this.setState(c=>({...c,data:{...c.data,...a}}))},e=()=>{this.clearState()},r=a=>{this.setState(c=>({...c,error:a}))};this.store.subscribe(({connector:a})=>a,(a,c)=>{var l,u,f,d,h,p;(l=c==null?void 0:c.off)==null||l.call(c,"change",t),(u=c==null?void 0:c.off)==null||u.call(c,"disconnect",e),(f=c==null?void 0:c.off)==null||f.call(c,"error",r),a&&((d=a.on)==null||d.call(a,"change",t),(h=a.on)==null||h.call(a,"disconnect",e),(p=a.on)==null||p.call(a,"error",r))});const{publicClient:n,webSocketPublicClient:i}=this.args;(typeof n=="function"||typeof i=="function")&&this.store.subscribe(({data:a})=>{var c;return(c=a==null?void 0:a.chain)==null?void 0:c.id},a=>{this.setState(c=>({...c,publicClient:this.getPublicClient({chainId:a}),webSocketPublicClient:this.getWebSocketPublicClient({chainId:a})}))})};var $C;function Jhe(t){const e=new Yhe(t);return $C=e,e}function qi(){if(!$C)throw new Error("No wagmi config found. Ensure you have set up a config: https://wagmi.sh/react/config");return $C}async function Xhe({chainId:t,connector:e}){const r=qi(),n=r.connector;if(n&&e.id===n.id)throw new qhe;try{r.setState(s=>({...s,status:"connecting"}));const i=await e.connect({chainId:t});return r.setLastUsedConnector(e.id),r.setState(s=>({...s,connector:e,chains:e==null?void 0:e.chains,data:i,status:"connected"})),r.storage.setItem("connected",!0),{...i,connector:e}}catch(i){throw r.setState(s=>({...s,status:s.connector?"connected":"disconnected"})),i}}async function Zhe(){const t=qi();t.connector&&await t.connector.disconnect(),t.clearState(),t.storage.removeItem("connected")}function NC({chainId:t}={}){const e=qi();return t&&e.getPublicClient({chainId:t})||e.publicClient}async function AB({chainId:t}={}){var n,i;return await((i=(n=qi().connector)==null?void 0:n.getWalletClient)==null?void 0:i.call(n,{chainId:t}))||null}function e0e(t,e){const r=qi(),n=async()=>e(NC(t));return r.subscribe(({publicClient:s})=>s,n)}function t0e({chainId:t},e){const r=qi(),n=async({chainId:s})=>{if(t&&s&&t!==s)return;const o=await AB({chainId:t});return qi().connector?e(o):e(null)};return r.subscribe(({data:s,connector:o})=>{var a;return{account:s==null?void 0:s.account,chainId:(a=s==null?void 0:s.chain)==null?void 0:a.id,connector:o}},n,{equalityFn:HS})}function _B(){const{data:t,connector:e,status:r}=qi();switch(r){case"connected":return{address:t==null?void 0:t.account,connector:e,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:r};case"reconnecting":return{address:t==null?void 0:t.account,connector:e,isConnected:!!(t!=null&&t.account),isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:r};case"connecting":return{address:t==null?void 0:t.account,connector:e,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 PB(){var i,s,o,a;const t=qi(),e=(s=(i=t.data)==null?void 0:i.chain)==null?void 0:s.id,r=t.chains??[],n=[...((o=t.publicClient)==null?void 0:o.chains)||[],...r].find(c=>c.id===e)??{id:e,name:`Chain ${e}`,network:`${e}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}};return{chain:e?{...n,...(a=t.data)==null?void 0:a.chain,id:e}:void 0,chains:r}}async function r0e({chainId:t}){const{connector:e}=qi();if(!e)throw new Ma;if(!e.switchChain)throw new Vhe({connector:e});return e.switchChain(t)}function n0e(t,{selector:e=r=>r}={}){const r=qi(),n=()=>t(_B());return r.subscribe(({data:s,connector:o,status:a})=>e({address:s==null?void 0:s.account,connector:o,status:a}),n,{equalityFn:HS})}function i0e(t,{selector:e=r=>r}={}){const r=qi(),n=()=>t(PB());return r.subscribe(({data:s,chains:o})=>{var a;return e({chainId:(a=s==null?void 0:s.chain)==null?void 0:a.id,chains:o})},n,{equalityFn:HS})}var s0e={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62",blockCreated:16966585},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}},hT={id:137,name:"Polygon",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}},TB={exports:{}},IB={};/** +`))}return{chains:c,publicClient:({chainId:f})=>{const d=c.find(v=>v.id===f)??t[0],h=l[d.id];if(!h||!h[0])throw new Error(`No providers configured for chain "${d.id}"`);const p=gT({batch:r,chain:d,transport:vT(h.map(v=>DF(v,{timeout:a})),{rank:i,retryCount:s,retryDelay:o}),pollingInterval:n});return Object.assign(p,{chains:c})},webSocketPublicClient:({chainId:f})=>{const d=c.find(v=>v.id===f)??t[0],h=u[d.id];if(!h||!h[0])return;const p=gT({batch:r,chain:d,transport:vT(h.map(v=>p0e(v,{timeout:a})),{rank:i,retryCount:s,retryDelay:o}),pollingInterval:n});return Object.assign(p,{chains:c})}}}var A0e=class extends Error{constructor(){super(...arguments),this.name="ConnectorAlreadyConnectedError",this.message="Connector already connected"}},_0e=class extends Error{constructor({connector:t}){super(`"${t.name}" does not support programmatic chain switching.`),this.name="SwitchChainNotSupportedError"}};function BC(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)&&Array.isArray(e)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!BC(t[n],e[n]))return!1;return!0}if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const i=Object.keys(t);if(r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(s&&!BC(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}var jC=(t,{find:e,replace:r})=>t&&e(t)?r(t):typeof t!="object"?t:Array.isArray(t)?t.map(n=>jC(n,{find:e,replace:r})):t instanceof Object?Object.entries(t).reduce((n,[i,s])=>({...n,[i]:jC(s,{find:e,replace:r})}),{}):t;function P0e(t){const e=JSON.parse(t);return jC(e,{find:n=>typeof n=="string"&&n.startsWith("#bigint."),replace:n=>BigInt(n.replace("#bigint.",""))})}function wT(t,e){return t.slice(0,e).join(".")||"."}function ET(t,e){const{length:r}=t;for(let n=0;n{const o=typeof s=="bigint"?`#bigint.${s.toString()}`:s;return(e==null?void 0:e(i,o))||o},n),r??void 0)}var ZF={getItem:t=>"",setItem:(t,e)=>null,removeItem:t=>null};function eB({deserialize:t=P0e,key:e="wagmi",serialize:r=I0e,storage:n}){return{...n,getItem:(i,s=null)=>{const o=n.getItem(`${e}.${i}`);try{return o?t(o):s}catch(a){return console.warn(a),s}},setItem:(i,s)=>{if(s===null)n.removeItem(`${e}.${i}`);else try{n.setItem(`${e}.${i}`,r(s))}catch(o){console.error(o)}},removeItem:i=>n.removeItem(`${e}.${i}`)}}var xT="store",Ru,mh,UC,tB,O0e=class{constructor({autoConnect:e=!1,connectors:r=[new XF],publicClient:n,storage:i=eB({storage:typeof window<"u"?window.localStorage:ZF}),logger:s={warn:console.warn},webSocketPublicClient:o}){var u,f;G2(this,UC),this.publicClients=new Map,this.webSocketPublicClients=new Map,G2(this,Ru,void 0),G2(this,mh,void 0),this.args={autoConnect:e,connectors:r,logger:s,publicClient:n,storage:i,webSocketPublicClient:o};let a="disconnected",c;if(e)try{const d=i.getItem(xT),h=(u=d==null?void 0:d.state)==null?void 0:u.data;a=h!=null&&h.account?"reconnecting":"connecting",c=(f=h==null?void 0:h.chain)==null?void 0:f.id}catch{}const l=typeof r=="function"?r():r;l.forEach(d=>d.setStorage(i)),this.store=S0e(g0e(C0e(()=>({connectors:l,publicClient:this.getPublicClient({chainId:c}),status:a,webSocketPublicClient:this.getWebSocketPublicClient({chainId:c})}),{name:xT,storage:i,partialize:d=>{var h,p;return{...e&&{data:{account:(h=d==null?void 0:d.data)==null?void 0:h.account,chain:(p=d==null?void 0:d.data)==null?void 0:p.chain}},chains:d==null?void 0:d.chains}},version:2}))),this.storage=i,tv(this,mh,i==null?void 0:i.getItem("wallet")),m0e(this,UC,tB).call(this),e&&typeof window<"u"&&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,r;return(r=(e=this.data)==null?void 0:e.chain)==null?void 0:r.id}get publicClient(){return this.store.getState().publicClient}get status(){return this.store.getState().status}get subscribe(){return this.store.subscribe}get webSocketPublicClient(){return this.store.getState().webSocketPublicClient}setState(e){const r=typeof e=="function"?e(this.store.getState()):e;this.store.setState(r,!0)}clearState(){this.setState(e=>({...e,chains:void 0,connector:void 0,data:void 0,error:void 0,status:"disconnected"}))}async destroy(){var e,r;this.connector&&await((r=(e=this.connector).disconnect)==null?void 0:r.call(e)),tv(this,Ru,!1),this.clearState(),this.store.destroy()}async autoConnect(){if(V2(this,Ru))return;tv(this,Ru,!0),this.setState(n=>{var i;return{...n,status:(i=n.data)!=null&&i.account?"reconnecting":"connecting"}});const e=V2(this,mh)?[...this.connectors].sort(n=>n.id===V2(this,mh)?-1:1):this.connectors;let r=!1;for(const n of e){if(!n.ready||!n.isAuthorized||!await n.isAuthorized())continue;const s=await n.connect();this.setState(o=>({...o,connector:n,chains:n==null?void 0:n.chains,data:s,status:"connected"})),r=!0;break}return r||this.setState(n=>({...n,data:void 0,status:"disconnected"})),tv(this,Ru,!1),this.data}setConnectors(e){this.args={...this.args,connectors:e};const r=typeof e=="function"?e():e;r.forEach(n=>n.setStorage(this.args.storage)),this.setState(n=>({...n,connectors:r}))}getPublicClient({chainId:e}={}){let r=this.publicClients.get(-1);if(r&&(r==null?void 0:r.chain.id)===e||(r=this.publicClients.get(e??-1),r))return r;const{publicClient:n}=this.args;return r=typeof n=="function"?n({chainId:e}):n,this.publicClients.set(e??-1,r),r}setPublicClient(e){var n,i;const r=(i=(n=this.data)==null?void 0:n.chain)==null?void 0:i.id;this.args={...this.args,publicClient:e},this.publicClients.clear(),this.setState(s=>({...s,publicClient:this.getPublicClient({chainId:r})}))}getWebSocketPublicClient({chainId:e}={}){let r=this.webSocketPublicClients.get(-1);if(r&&(r==null?void 0:r.chain.id)===e||(r=this.webSocketPublicClients.get(e??-1),r))return r;const{webSocketPublicClient:n}=this.args;return r=typeof n=="function"?n({chainId:e}):n,r&&this.webSocketPublicClients.set(e??-1,r),r}setWebSocketPublicClient(e){var n,i;const r=(i=(n=this.data)==null?void 0:n.chain)==null?void 0:i.id;this.args={...this.args,webSocketPublicClient:e},this.webSocketPublicClients.clear(),this.setState(s=>({...s,webSocketPublicClient:this.getWebSocketPublicClient({chainId:r})}))}setLastUsedConnector(e=null){var r;(r=this.storage)==null||r.setItem("wallet",e)}};Ru=new WeakMap;mh=new WeakMap;UC=new WeakSet;tB=function(){const t=a=>{this.setState(c=>({...c,data:{...c.data,...a}}))},e=()=>{this.clearState()},r=a=>{this.setState(c=>({...c,error:a}))};this.store.subscribe(({connector:a})=>a,(a,c)=>{var l,u,f,d,h,p;(l=c==null?void 0:c.off)==null||l.call(c,"change",t),(u=c==null?void 0:c.off)==null||u.call(c,"disconnect",e),(f=c==null?void 0:c.off)==null||f.call(c,"error",r),a&&((d=a.on)==null||d.call(a,"change",t),(h=a.on)==null||h.call(a,"disconnect",e),(p=a.on)==null||p.call(a,"error",r))});const{publicClient:n,webSocketPublicClient:i}=this.args;(typeof n=="function"||typeof i=="function")&&this.store.subscribe(({data:a})=>{var c;return(c=a==null?void 0:a.chain)==null?void 0:c.id},a=>{this.setState(c=>({...c,publicClient:this.getPublicClient({chainId:a}),webSocketPublicClient:this.getWebSocketPublicClient({chainId:a})}))})};var zC;function R0e(t){const e=new O0e(t);return zC=e,e}function Vi(){if(!zC)throw new Error("No wagmi config found. Ensure you have set up a config: https://wagmi.sh/react/config");return zC}async function $0e({chainId:t,connector:e}){const r=Vi(),n=r.connector;if(n&&e.id===n.id)throw new A0e;try{r.setState(s=>({...s,status:"connecting"}));const i=await e.connect({chainId:t});return r.setLastUsedConnector(e.id),r.setState(s=>({...s,connector:e,chains:e==null?void 0:e.chains,data:i,status:"connected"})),r.storage.setItem("connected",!0),{...i,connector:e}}catch(i){throw r.setState(s=>({...s,status:s.connector?"connected":"disconnected"})),i}}async function M0e(){const t=Vi();t.connector&&await t.connector.disconnect(),t.clearState(),t.storage.removeItem("connected")}function WC({chainId:t}={}){const e=Vi();return t&&e.getPublicClient({chainId:t})||e.publicClient}async function rB({chainId:t}={}){var n,i;return await((i=(n=Vi().connector)==null?void 0:n.getWalletClient)==null?void 0:i.call(n,{chainId:t}))||null}function N0e(t,e){const r=Vi(),n=async()=>e(WC(t));return r.subscribe(({publicClient:s})=>s,n)}function D0e({chainId:t},e){const r=Vi(),n=async({chainId:s})=>{if(t&&s&&t!==s)return;const o=await rB({chainId:t});return Vi().connector?e(o):e(null)};return r.subscribe(({data:s,connector:o})=>{var a;return{account:s==null?void 0:s.account,chainId:(a=s==null?void 0:s.chain)==null?void 0:a.id,connector:o}},n,{equalityFn:e8})}function nB(){const{data:t,connector:e,status:r}=Vi();switch(r){case"connected":return{address:t==null?void 0:t.account,connector:e,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:r};case"reconnecting":return{address:t==null?void 0:t.account,connector:e,isConnected:!!(t!=null&&t.account),isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:r};case"connecting":return{address:t==null?void 0:t.account,connector:e,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 iB(){var i,s,o,a;const t=Vi(),e=(s=(i=t.data)==null?void 0:i.chain)==null?void 0:s.id,r=t.chains??[],n=[...((o=t.publicClient)==null?void 0:o.chains)||[],...r].find(c=>c.id===e)??{id:e,name:`Chain ${e}`,network:`${e}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}};return{chain:e?{...n,...(a=t.data)==null?void 0:a.chain,id:e}:void 0,chains:r}}async function L0e({chainId:t}){const{connector:e}=Vi();if(!e)throw new Ma;if(!e.switchChain)throw new _0e({connector:e});return e.switchChain(t)}function F0e(t,{selector:e=r=>r}={}){const r=Vi(),n=()=>t(nB());return r.subscribe(({data:s,connector:o,status:a})=>e({address:s==null?void 0:s.account,connector:o,status:a}),n,{equalityFn:e8})}function B0e(t,{selector:e=r=>r}={}){const r=Vi(),n=()=>t(iB());return r.subscribe(({data:s,chains:o})=>{var a;return e({chainId:(a=s==null?void 0:s.chain)==null?void 0:a.id,chains:o})},n,{equalityFn:e8})}var j0e={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62",blockCreated:16966585},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}},CT={id:137,name:"Polygon",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}},sB={exports:{}},oB={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -159,32 +159,32 @@ ${r.length}`);return Qn(Zo([n,r]),e)}const dhe="0x608060405234801562000011576000 * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var wb=C,o0e=dS;function a0e(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var c0e=typeof Object.is=="function"?Object.is:a0e,l0e=o0e.useSyncExternalStore,u0e=wb.useRef,f0e=wb.useEffect,d0e=wb.useMemo,h0e=wb.useDebugValue;IB.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var s=u0e(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=d0e(function(){function c(h){if(!l){if(l=!0,u=h,h=n(h),i!==void 0&&o.hasValue){var p=o.value;if(i(p,h))return f=p}return f=h}if(p=f,c0e(u,h))return p;var v=n(h);return i!==void 0&&i(p,v)?p:(u=h,f=v)}var l=!1,u,f,d=r===void 0?null:r;return[function(){return c(e())},d===null?void 0:function(){return c(d())}]},[e,r,n,i]);var a=l0e(t,s[0],s[1]);return f0e(function(){o.hasValue=!0,o.value=a},[a]),h0e(a),a};TB.exports=IB;var OB=TB.exports;function p0e({queryClient:t=new lS({defaultOptions:{queries:{cacheTime:1e3*60*60*24,networkMode:"offlineFirst",refetchOnWindowFocus:!1,retry:0},mutations:{networkMode:"offlineFirst"}}}),storage:e=SB({storage:typeof window<"u"&&window.localStorage?window.localStorage:CB}),persister:r=typeof window<"u"?ole({key:"cache",storage:e,serialize:i=>i,deserialize:i=>i}):void 0,...n}){const i=Jhe({...n,storage:e});return r&&tue({queryClient:t,persister:r,dehydrateOptions:{shouldDehydrateQuery:s=>s.cacheTime!==0&&s.queryKey[0].persist!==!1}}),Object.assign(i,{queryClient:t})}var RB=C.createContext(void 0),Eb=C.createContext(void 0);function v0e({children:t,config:e}){return C.createElement(RB.Provider,{children:C.createElement(hS,{children:t,client:e.queryClient,context:Eb}),value:e})}function xb(){const t=C.useContext(RB);if(!t)throw new Error(["`useConfig` must be used within `WagmiConfig`.\n","Read more: https://wagmi.sh/react/WagmiConfig"].join(` -`));return t}var m0e=dS.useSyncExternalStore;function y0e(t){return Array.isArray(t)}function g0e(t){if(!pT(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const r=e.prototype;return!(!pT(r)||!r.hasOwnProperty("isPrototypeOf"))}function pT(t){return Object.prototype.toString.call(t)==="[object Object]"}function b0e(t,e,r){return y0e(t)?typeof e=="function"?{...r,queryKey:t,queryFn:e}:{...e,queryKey:t}:t}function w0e(t){return JSON.stringify(t,(e,r)=>g0e(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):typeof r=="bigint"?r.toString():r)}function E0e(t,e){return typeof t=="function"?t(...e):!!t}function x0e(t,e){const r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(e.trackedProps.add(n),t[n])})}),r}function C0e(t,e){const r=rb({context:t.context}),n=mL(),i=yL(),s=r.defaultQueryOptions({...t,queryKeyHashFn:w0e});s._optimisticResults=n?"isRestoring":"optimistic",s.onError&&(s.onError=yt.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=yt.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=yt.batchCalls(s.onSettled)),s.suspense&&typeof s.staleTime!="number"&&(s.staleTime=1e3),(s.suspense||s.useErrorBoundary)&&(i.isReset()||(s.retryOnMount=!1));const[o]=C.useState(()=>new e(r,s)),a=o.getOptimisticResult(s);if(m0e(C.useCallback(f=>n?()=>{}:o.subscribe(yt.batchCalls(f)),[o,n]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),C.useEffect(()=>{i.clearReset()},[i]),C.useEffect(()=>{o.setOptions(s,{listeners:!1})},[s,o]),s.suspense&&a.isLoading&&a.isFetching&&!n)throw o.fetchOptimistic(s).then(({data:f})=>{var d,h;(d=s.onSuccess)==null||d.call(s,f),(h=s.onSettled)==null||h.call(s,f,null)}).catch(f=>{var d,h;i.clearReset(),(d=s.onError)==null||d.call(s,f),(h=s.onSettled)==null||h.call(s,void 0,f)});if(a.isError&&!i.isReset()&&!a.isFetching&&E0e(s.useErrorBoundary,[a.error,o.getCurrentQuery()]))throw a.error;const c=a.status==="loading"&&a.fetchStatus==="idle"?"idle":a.status,l=c==="idle",u=c==="loading"&&a.fetchStatus==="fetching";return{...a,defaultedOptions:s,isIdle:l,isLoading:u,observer:o,status:c}}function qS(t,e,r){const n=tL(t,e,r);return Qle({context:Eb,...n})}function S0e(t,e,r){const n=b0e(t,e,r),i=C0e({context:Eb,...n},uS),s={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?s:x0e(s,i.observer)}var k0e=()=>rb({context:Eb});function MB({chainId:t}={}){return OB.useSyncExternalStoreWithSelector(e=>e0e({chainId:t},e),()=>NC({chainId:t}),()=>NC({chainId:t}),e=>e,(e,r)=>e.uid===r.uid)}function U2({chainId:t}){return[{entity:"walletClient",chainId:t,persist:!1}]}function A0e({queryKey:[{chainId:t}]}){return AB({chainId:t})}function VS({chainId:t,suspense:e,onError:r,onSettled:n,onSuccess:i}={}){const{connector:s}=kn(),o=Cb({chainId:t}),a=S0e(U2({chainId:o}),A0e,{cacheTime:0,enabled:!!s,staleTime:1/0,suspense:e,onError:r,onSettled:n,onSuccess:i}),c=k0e();return C.useEffect(()=>t0e({chainId:o},u=>{u?c.invalidateQueries(U2({chainId:o})):c.removeQueries(U2({chainId:o}))}),[c,o]),a}function Cb({chainId:t}={}){return MB({chainId:t}).chain.id}function _0e(){const[,t]=C.useReducer(e=>e+1,0);return t}var z2=t=>typeof t=="object"&&!Array.isArray(t);function $B(t,e,r=e,n=OC){const i=C.useRef([]),s=OB.useSyncExternalStoreWithSelector(t,e,r,o=>o,(o,a)=>{if(z2(o)&&z2(a)&&i.current.length){for(const c of i.current)if(!n(o[c],a[c]))return!1;return!0}return n(o,a)});if(z2(s)){const o={...s};return Object.defineProperties(o,Object.entries(o).reduce((a,[c,l])=>({...a,[c]:{configurable:!1,enumerable:!0,get:()=>(i.current.includes(c)||i.current.push(c),l)}}),{})),o}return s}function kn({onConnect:t,onDisconnect:e}={}){const r=xb(),n=C.useCallback(a=>n0e(a),[r]),i=$B(n,_B),s=C.useRef(),o=s.current;return C.useEffect(()=>{(o==null?void 0:o.status)!=="connected"&&i.status==="connected"&&(t==null||t({address:i.address,connector:i.connector,isReconnected:(o==null?void 0:o.status)==="reconnecting"||(o==null?void 0:o.status)===void 0})),(o==null?void 0:o.status)==="connected"&&i.status==="disconnected"&&(e==null||e()),s.current=i},[t,e,o,i]),i}var P0e=t=>[{entity:"connect",...t}],T0e=t=>{const{connector:e,chainId:r}=t;if(!e)throw new Error("connector is required");return Xhe({connector:e,chainId:r})};function NB({chainId:t,connector:e,onError:r,onMutate:n,onSettled:i,onSuccess:s}={}){const o=xb(),{data:a,error:c,isError:l,isIdle:u,isLoading:f,isSuccess:d,mutate:h,mutateAsync:p,reset:v,status:b,variables:y}=qS(P0e({connector:e,chainId:t}),T0e,{onError:r,onMutate:n,onSettled:i,onSuccess:s}),m=C.useCallback(S=>h({chainId:(S==null?void 0:S.chainId)??t,connector:(S==null?void 0:S.connector)??e}),[t,e,h]),g=C.useCallback(S=>p({chainId:(S==null?void 0:S.chainId)??t,connector:(S==null?void 0:S.connector)??e}),[t,e,p]);return{connect:m,connectAsync:g,connectors:o.connectors,data:a,error:c,isError:l,isIdle:u,isLoading:f,isSuccess:d,pendingConnector:y==null?void 0:y.connector,reset:v,status:b,variables:y}}var I0e=[{entity:"disconnect"}],O0e=()=>Zhe();function DB({onError:t,onMutate:e,onSettled:r,onSuccess:n}={}){const{error:i,isError:s,isIdle:o,isLoading:a,isSuccess:c,mutate:l,mutateAsync:u,reset:f,status:d}=qS(I0e,O0e,{...t?{onError(h,p,v){t(h,v)}}:{},onMutate:e,...r?{onSettled(h,p,v,b){r(p,b)}}:{},...n?{onSuccess(h,p,v){n(v)}}:{}});return{disconnect:l,disconnectAsync:u,error:i,isError:s,isIdle:o,isLoading:a,isSuccess:c,reset:f,status:d}}function an(){const t=xb(),e=C.useCallback(r=>i0e(r),[t]);return $B(e,PB)}var R0e=t=>[{entity:"switchNetwork",...t}],M0e=t=>{const{chainId:e}=t;if(!e)throw new Error("chainId is required");return r0e({chainId:e})};function GS({chainId:t,throwForSwitchChainNotSupported:e,onError:r,onMutate:n,onSettled:i,onSuccess:s}={}){var I;const o=xb(),a=_0e(),{data:c,error:l,isError:u,isIdle:f,isLoading:d,isSuccess:h,mutate:p,mutateAsync:v,reset:b,status:y,variables:m}=qS(R0e({chainId:t}),M0e,{onError:r,onMutate:n,onSettled:i,onSuccess:s}),g=C.useCallback(B=>p({chainId:B??t}),[t,p]),S=C.useCallback(B=>v({chainId:B??t}),[t,v]);C.useEffect(()=>o.subscribe(({chains:j,connector:H})=>({chains:j,connector:H}),a),[o,a]);let P,T;const w=!!((I=o.connector)!=null&&I.switchChain);return(e||w)&&(P=g,T=S),{chains:o.chains??[],data:c,error:l,isError:u,isIdle:f,isLoading:d,isSuccess:h,pendingChainId:m==null?void 0:m.chainId,reset:b,status:y,switchNetwork:P,switchNetworkAsync:T,variables:m}}const $0e=[{inputs:[{internalType:"bytes32",type:"bytes32"}],name:"getAlternativeSignature",outputs:[{internalType:"string",type:"string"}],stateMutability:"view",type:"function"}];var N0e=Object.freeze({__proto__:null,abi:$0e});const D0e=[{type:"function",name:"isValidSignature",constant:!0,inputs:[{type:"bytes32"},{type:"bytes"}],outputs:[{type:"bytes4"}],payable:!1,stateMutability:"view"}],L0e={isValidSignatureBytes32:"0x1626ba7e"};var B0e=Object.freeze({__proto__:null,abi:D0e,returns:L0e});const F0e=[{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC1271Revert",type:"error"},{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC6492DeployFailed",type:"error"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSig",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"allowSideEffects",type:"bool"},{internalType:"bool",name:"deployAlreadyDeployed",type:"bool"}],name:"isValidSigImpl",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffects",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffectsNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];var j0e=Object.freeze({__proto__:null,abi:F0e});const U0e=[{type:"function",name:"deploy",constant:!1,inputs:[{type:"address"},{type:"bytes32"}],outputs:[],payable:!0,stateMutability:"payable"}];var z0e=Object.freeze({__proto__:null,abi:U0e});const W0e=[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"}];var H0e=Object.freeze({__proto__:null,abi:W0e});const q0e=[{type:"function",name:"updateImageHash",constant:!0,inputs:[{type:"bytes32"}],outputs:[],payable:!1,stateMutability:"view"},{type:"function",name:"imageHash",constant:!0,inputs:[],outputs:[{type:"bytes32"}],payable:!1,stateMutability:"view"}];var V0e=Object.freeze({__proto__:null,abi:q0e});const G0e=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"knownImageHashes",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"lastImageHashUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}];var K0e=Object.freeze({__proto__:null,abi:G0e});const Q0e=[{inputs:[{internalType:"address",name:"",type:"address"}],name:"requireFreshSigner",outputs:[],stateMutability:"nonpayable",type:"function"}];var Y0e=Object.freeze({__proto__:null,abi:Q0e});const rn={erc6492:j0e,erc5719:N0e,erc1271:B0e,factory:z0e,mainModule:H0e,mainModuleUpgradable:V0e,sequenceUtils:K0e,requireFreshSigner:Y0e},J0e=Object.freeze(Object.defineProperty({__proto__:null,walletContracts:rn},Symbol.toStringTag,{value:"Module"}));function py(){return py=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),me({},n)).then(i=>ye(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),me({},n)).then(i=>ye(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),me({},n)).then(i=>ye(i).then(s=>({status:s.status}))),this.getSequenceContext=n=>this.fetch(this.url("GetSequenceContext"),me({},n)).then(i=>ye(i).then(s=>({data:s.data}))),this.getAuthToken=(n,i)=>this.fetch(this.url("GetAuthToken"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status,jwtToken:o.jwtToken,address:o.address,user:o.user}))),this.sendPasswordlessLink=(n,i)=>this.fetch(this.url("SendPasswordlessLink"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status}))),this.friendList=(n,i)=>this.fetch(this.url("FriendList"),me(n,i)).then(s=>ye(s).then(o=>({page:o.page,friends:o.friends}))),this.getFriendByAddress=(n,i)=>this.fetch(this.url("GetFriendByAddress"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status,friend:o.friend}))),this.searchFriends=(n,i)=>this.fetch(this.url("SearchFriends"),me(n,i)).then(s=>ye(s).then(o=>({friends:o.friends}))),this.addFriend=(n,i)=>this.fetch(this.url("AddFriend"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status,friend:o.friend}))),this.updateFriendNickname=(n,i)=>this.fetch(this.url("UpdateFriendNickname"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status,friend:o.friend}))),this.removeFriend=(n,i)=>this.fetch(this.url("RemoveFriend"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status}))),this.contractCall=(n,i)=>this.fetch(this.url("ContractCall"),me(n,i)).then(s=>ye(s).then(o=>({returns:o.returns}))),this.decodeContractCall=(n,i)=>this.fetch(this.url("DecodeContractCall"),me(n,i)).then(s=>ye(s).then(o=>({call:o.call}))),this.lookupContractCallSelectors=(n,i)=>this.fetch(this.url("LookupContractCallSelectors"),me(n,i)).then(s=>ye(s).then(o=>({signatures:o.signatures}))),this.userStorageFetch=(n,i)=>this.fetch(this.url("UserStorageFetch"),me(n,i)).then(s=>ye(s).then(o=>({object:o.object}))),this.userStorageSave=(n,i)=>this.fetch(this.url("UserStorageSave"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok}))),this.userStorageDelete=(n,i)=>this.fetch(this.url("UserStorageDelete"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok}))),this.userStorageFetchAll=(n,i)=>this.fetch(this.url("UserStorageFetchAll"),me(n,i)).then(s=>ye(s).then(o=>({objects:o.objects}))),this.getMoonpayLink=(n,i)=>this.fetch(this.url("GetMoonpayLink"),me(n,i)).then(s=>ye(s).then(o=>({signedUrl:o.signedUrl}))),this.getSardineClientToken=n=>this.fetch(this.url("GetSardineClientToken"),me({},n)).then(i=>ye(i).then(s=>({token:s.token}))),this.isUsingGoogleMail=(n,i)=>this.fetch(this.url("IsUsingGoogleMail"),me(n,i)).then(s=>ye(s).then(o=>({yes:o.yes}))),this.resolveENSAddress=(n,i)=>this.fetch(this.url("ResolveENSAddress"),me(n,i)).then(s=>ye(s).then(o=>({address:o.address,ok:o.ok}))),this.isValidSignature=(n,i)=>this.fetch(this.url("IsValidSignature"),me(n,i)).then(s=>ye(s).then(o=>({isValid:o.isValid}))),this.isValidMessageSignature=(n,i)=>this.fetch(this.url("IsValidMessageSignature"),me(n,i)).then(s=>ye(s).then(o=>({isValid:o.isValid}))),this.isValidTypedDataSignature=(n,i)=>this.fetch(this.url("IsValidTypedDataSignature"),me(n,i)).then(s=>ye(s).then(o=>({isValid:o.isValid}))),this.isValidETHAuthProof=(n,i)=>this.fetch(this.url("IsValidETHAuthProof"),me(n,i)).then(s=>ye(s).then(o=>({isValid:o.isValid}))),this.getCoinPrices=(n,i)=>this.fetch(this.url("GetCoinPrices"),me(n,i)).then(s=>ye(s).then(o=>({tokenPrices:o.tokenPrices}))),this.getCollectiblePrices=(n,i)=>this.fetch(this.url("GetCollectiblePrices"),me(n,i)).then(s=>ye(s).then(o=>({tokenPrices:o.tokenPrices}))),this.getExchangeRate=(n,i)=>this.fetch(this.url("GetExchangeRate"),me(n,i)).then(s=>ye(s).then(o=>({exchangeRate:o.exchangeRate}))),this.memoryStore=(n,i)=>this.fetch(this.url("MemoryStore"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok}))),this.memoryLoad=(n,i)=>this.fetch(this.url("MemoryLoad"),me(n,i)).then(s=>ye(s).then(o=>({value:o.value}))),this.listPayCardsOnFile=n=>this.fetch(this.url("ListPayCardsOnFile"),me({},n)).then(i=>ye(i).then(s=>({payCards:s.payCards}))),this.savePayCard=(n,i)=>this.fetch(this.url("SavePayCard"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok,payCard:o.payCard}))),this.updatePayCardCVC=(n,i)=>this.fetch(this.url("UpdatePayCardCVC"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok}))),this.deletePayCard=(n,i)=>this.fetch(this.url("DeletePayCard"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok}))),this.smartRampQuote=(n,i)=>this.fetch(this.url("SmartRampQuote"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status,quoteDetails:o.quoteDetails}))),this.smartRampPurchase=(n,i)=>this.fetch(this.url("SmartRampPurchase"),me(n,i)).then(s=>ye(s).then(o=>({processing:o.processing,receipt:o.receipt}))),this.smartRampWaitOrderConfirmation=(n,i)=>this.fetch(this.url("SmartRampWaitOrderConfirmation"),me(n,i)).then(s=>ye(s).then(o=>({done:o.done,receipt:o.receipt}))),this.smartRampGetOrder=(n,i)=>this.fetch(this.url("SmartRampGetOrder"),me(n,i)).then(s=>ye(s).then(o=>({order:o.order}))),this.smartRampCheckCardAuthorization=(n,i)=>this.fetch(this.url("SmartRampCheckCardAuthorization"),me(n,i)).then(s=>ye(s).then(o=>({cardAuth:o.cardAuth}))),this.smartRampOrdersList=(n,i)=>this.fetch(this.url("SmartRampOrdersList"),me(n,i)).then(s=>ye(s).then(o=>({page:o.page,orders:o.orders}))),this.smartRampGetOrderTxnHash=(n,i)=>this.fetch(this.url("SmartRampGetOrderTxnHash"),me(n,i)).then(s=>ye(s).then(o=>({txnHash:o.txnHash,txnSuccessful:o.txnSuccessful}))),this.smartRampSubmitCardAuthorization=(n,i)=>this.fetch(this.url("SmartRampSubmitCardAuthorization"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status}))),this.adminSmartRampGetOrder=(n,i)=>this.fetch(this.url("AdminSmartRampGetOrder"),me(n,i)).then(s=>ye(s).then(o=>({order:o.order}))),this.adminSmartRampListCompletedOrders=(n,i)=>this.fetch(this.url("AdminSmartRampListCompletedOrders"),me(n,i)).then(s=>ye(s).then(o=>({orders:o.orders}))),this.adminSmartRampListPendingOrders=(n,i)=>this.fetch(this.url("AdminSmartRampListPendingOrders"),me(n,i)).then(s=>ye(s).then(o=>({pendingOrders:o.pendingOrders}))),this.getInviteInfo=n=>this.fetch(this.url("GetInviteInfo"),me({},n)).then(i=>ye(i).then(s=>({inviteInfo:s.inviteInfo}))),this.isValidAccessCode=(n,i)=>this.fetch(this.url("IsValidAccessCode"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status}))),this.internalClaimAccessCode=(n,i)=>this.fetch(this.url("InternalClaimAccessCode"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status}))),this.walletRecover=(n,i)=>this.fetch(this.url("WalletRecover"),me(n,i)).then(s=>ye(s).then(o=>({encryptedWallet:o.encryptedWallet}))),this.blockNumberAtTime=(n,i)=>this.fetch(this.url("BlockNumberAtTime"),me(n,i)).then(s=>ye(s).then(o=>({blocks:o.blocks}))),this.paperSessionSecret=(n,i)=>this.fetch(this.url("PaperSessionSecret"),me(n,i)).then(s=>ye(s).then(o=>({secret:o.secret}))),this.paperSessionSecret2=(n,i)=>this.fetch(this.url("PaperSessionSecret2"),me(n,i)).then(s=>ye(s).then(o=>({secret:o.secret}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const me=(t={},e={})=>({method:"POST",headers:py({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),ye=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),vT=typeof global=="object"?global.fetch:window.fetch;class Uh extends LB{constructor(e,r,n){super(e.endsWith("/")?e.slice(0,-1):e,vT),this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=py({},s.headers,o),vT(i,s)},this.projectAccessKey=r,this.jwtAuth=n,this.fetch=this._fetch}}const i1e=Object.freeze(Object.defineProperty({__proto__:null,API:LB,SequenceAPIClient:Uh,SmartRampOrderStatus:t1e,SmartRampTxnStatus:r1e,SortOrder:n1e,WebRPCSchemaHash:e1e,WebRPCSchemaVersion:Z0e,WebRPCVersion:X0e},Symbol.toStringTag,{value:"Module"})),BB="3.7.5",s1e=BB,o1e=typeof atob=="function",a1e=typeof btoa=="function",xd=typeof Buffer=="function",mT=typeof TextDecoder=="function"?new TextDecoder:void 0,yT=typeof TextEncoder=="function"?new TextEncoder:void 0,c1e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ph=Array.prototype.slice.call(c1e),Jp=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(ph),l1e=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Xr=String.fromCharCode.bind(String),gT=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),FB=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),jB=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),UB=t=>{let e,r,n,i,s="";const o=t.length%3;for(let a=0;a255||(n=t.charCodeAt(a++))>255||(i=t.charCodeAt(a++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|i,s+=ph[e>>18&63]+ph[e>>12&63]+ph[e>>6&63]+ph[e&63]}return o?s.slice(0,o-3)+"===".substring(o):s},KS=a1e?t=>btoa(t):xd?t=>Buffer.from(t,"binary").toString("base64"):UB,DC=xd?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,i=t.length;ne?FB(DC(t)):DC(t),u1e=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?Xr(192|e>>>6)+Xr(128|e&63):Xr(224|e>>>12&15)+Xr(128|e>>>6&63)+Xr(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return Xr(240|e>>>18&7)+Xr(128|e>>>12&63)+Xr(128|e>>>6&63)+Xr(128|e&63)}},f1e=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,zB=t=>t.replace(f1e,u1e),bT=xd?t=>Buffer.from(t,"utf8").toString("base64"):yT?t=>DC(yT.encode(t)):t=>KS(zB(t)),yf=(t,e=!1)=>e?FB(bT(t)):bT(t),wT=t=>yf(t,!0),d1e=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,h1e=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return Xr((r>>>10)+55296)+Xr((r&1023)+56320);case 3:return Xr((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return Xr((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},WB=t=>t.replace(d1e,h1e),HB=t=>{if(t=t.replace(/\s+/g,""),!l1e.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r="",n,i;for(let s=0;s>16&255):i===64?Xr(e>>16&255,e>>8&255):Xr(e>>16&255,e>>8&255,e&255);return r},QS=o1e?t=>atob(jB(t)):xd?t=>Buffer.from(t,"base64").toString("binary"):HB,qB=xd?t=>gT(Buffer.from(t,"base64")):t=>gT(QS(t).split("").map(e=>e.charCodeAt(0))),VB=t=>qB(GB(t)),p1e=xd?t=>Buffer.from(t,"base64").toString("utf8"):mT?t=>mT.decode(qB(t)):t=>WB(QS(t)),GB=t=>jB(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),LC=t=>p1e(GB(t)),v1e=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},KB=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),QB=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,KB(r));t("fromBase64",function(){return LC(this)}),t("toBase64",function(e){return yf(this,e)}),t("toBase64URI",function(){return yf(this,!0)}),t("toBase64URL",function(){return yf(this,!0)}),t("toUint8Array",function(){return VB(this)})},YB=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,KB(r));t("toBase64",function(e){return Fv(this,e)}),t("toBase64URI",function(){return Fv(this,!0)}),t("toBase64URL",function(){return Fv(this,!0)})},m1e=()=>{QB(),YB()},Wl={version:BB,VERSION:s1e,atob:QS,atobPolyfill:HB,btoa:KS,btoaPolyfill:UB,fromBase64:LC,toBase64:yf,encode:yf,encodeURI:wT,encodeURL:wT,utob:zB,btou:WB,decode:LC,isValid:v1e,fromUint8Array:Fv,toUint8Array:VB,extendString:QB,extendUint8Array:YB,extendBuiltins:m1e};var BC=function(){return BC=Object.assign||function(e){for(var r,n=1,i=arguments.length;n0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]0&&(i.types.Claims.push({name:"app",type:"string"}),i.message.app=this.claims.app),this.claims.iat&&this.claims.iat>0&&(i.types.Claims.push({name:"iat",type:"int64"}),i.message.iat=this.claims.iat),this.claims.exp&&this.claims.exp>0&&(i.types.Claims.push({name:"exp",type:"int64"}),i.message.exp=this.claims.exp),this.claims.n&&this.claims.n>0&&(i.types.Claims.push({name:"n",type:"uint64"}),i.message.n=this.claims.n),this.claims.typ&&this.claims.typ.length>0&&(i.types.Claims.push({name:"typ",type:"string"}),i.message.typ=this.claims.typ),this.claims.ogn&&this.claims.ogn.length>0&&(i.types.Claims.push({name:"ogn",type:"string"}),i.message.ogn=this.claims.ogn),this.claims.v&&this.claims.v.length>0&&(i.types.Claims.push({name:"v",type:"string"}),i.message.v=this.claims.v),i},t}(),g1e=function(t){if(t.app==="")return{ok:!1,err:new Error("claims: app is empty")};var e=Math.round(new Date().getTime()/1e3),r=5*60,n=60*60*24*365+r;return t.v===""?{ok:!1,err:new Error("claims: ethauth version is empty")}:t.iat&&t.iat!==0&&(t.iat>e+r||t.iate+n?{ok:!1,err:new Error("claims: token has expired")}:{ok:!0}},b1e=function(t,e,r){return sl(void 0,void 0,void 0,function(){var n,i;return ol(this,function(s){return n=r.messageDigest(),i=DM(n,r.signature),i.slice(0,2)==="0x"&&i.length===42&&i.toLowerCase()===r.address.toLowerCase()?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]})})},w1e=function(t,e,r){return sl(void 0,void 0,void 0,function(){var n,i,s,o,a;return ol(this,function(c){switch(c.label){case 0:return!t||t===void 0?[2,{isValid:!1}]:(n=r.messageDigest(),[4,t.getCode(r.address)]);case 1:if(i=c.sent(),i==="0x"||i.length<=2)throw new Error("ValidateContractAccountProof failed. unable to fetch wallet contract code");return s=["function isValidSignature(bytes32, bytes) public view returns (bytes4)"],o=new sd(r.address,s,t),[4,o.isValidSignature(n,re(r.signature))];case 2:return a=c.sent(),a===E1e?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]}})})},E1e="0x1626ba7e",JB="1",FC="eth",x1e={name:"ETHAuth",version:JB},t1=function(){function t(){for(var e=[],r=0;r0&&(c+="."+i.extra),[2,c]}})})},this.decodeProof=function(i,s){return s===void 0&&(s=!1),sl(n,void 0,void 0,function(){var o,a,c,l,u,f,d,h,p,v;return ol(this,function(b){switch(b.label){case 0:if(o=i.split("."),o.length<4||o.length>5)throw new Error("ethauth: invalid proof string");if(a=o[0],c=o[1],l=o[2],u=o[3],f=o[4],a!==FC)throw new Error("ethauth: not an ethauth proof");return d=Wl.decode(l),h=JSON.parse(d),p=new Sb({address:c,claims:h,signature:u,extra:f}),[4,this.validateProof(p,s)];case 1:if(v=b.sent(),!v)throw new Error("ethauth: proof is invalid");return[2,p]}})})},this.validateProof=function(i,s){return s===void 0&&(s=!1),sl(n,void 0,void 0,function(){var o,a;return ol(this,function(c){switch(c.label){case 0:if(o=this.validateProofClaims(i),o.err)throw new Error("ethauth: proof claims are invalid ".concat(o.err));return s===!0?[3,2]:[4,this.validateProofSignature(i)];case 1:if(a=c.sent(),a!==!0)throw new Error("ethauth: proof signature is invalid");c.label=2;case 2:return[2,!0]}})})},this.validateProofSignature=function(i){return sl(n,void 0,void 0,function(){var s,c,o,a,c;return ol(this,function(l){switch(l.label){case 0:s=[],c=0,l.label=1;case 1:if(!(cWl.encode(t,!0),YS=t=>Wl.encode(JSON.stringify(t),!0),S1e=t=>{if(t!=null)return Wl.decode(t)},JS=t=>{if(t!=null)return JSON.parse(Wl.decode(t))};function XB(t){return t!=null&&(J.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Fe(t)||typeof t=="bigint"||aa(t))}const XS=t=>re(Be(typeof t=="string"?wt(t):t)),ZB=(t,e,r)=>We(["string","uint256","address","bytes32"],["",e,t,r]),jC=(t,e,r)=>Be(ZB(t,e,r)),eF=()=>typeof window>"u"&&typeof process=="object",k1e=()=>!eF(),tF=t=>{const e=t.split(".");if(e.length!==3)throw new Error("invalid jwt");return JSON.parse(Wl.decode(e[1]))};function vy(){return vy=Object.assign?Object.assign.bind():function(t){for(var e=1;ege.configure(t),r1=(t,e,r)=>{const n={};return r&&r.length>0&&(n.Authorization=`BEARER ${r}`),e&&e.length>0&&(n["X-Access-Key"]=e),{url:t,headers:n,skipFetchSetup:!0,fetchOptions:{mode:"cors",cache:"force-cache",credentials:"same-origin",redirect:"follow",referrer:"client"}}};let _1e=class{constructor(){this.cache=new Map}do(e,r,n,...i){e=`${e}:${Be(wt(JSON.stringify(i,P1e)))}`;let s=this.cache.get(e);if(s&&s.expiration&&new Date>=s.expiration&&(s=void 0,this.cache.delete(e)),!s){const o={promise:n(...i)};r!==void 0&&(o.promise=o.promise.then(a=>(o.expiration=new Date(Date.now()+r),a))),s=o,this.cache.set(e,s)}return s.promise}};function P1e(t,e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).sort()):e}function ZS(t,e){return function(...r){const n=Array.prototype.slice.call(r);return new Promise(async(i,s)=>{try{n.push((o,a)=>o?s(o):i(a)),await t.apply(e,n)}catch(o){s(o)}})}}function T1e(t,e){const r=encodeURIComponent(t),n=encodeURIComponent(JSON.stringify(e));return`${r}=${n}`}function I1e(t){const e=t.split("&"),r={};for(const n of e){const i=n.split("=");r[decodeURIComponent(i[0])]=JSON.parse(decodeURIComponent(i[1]))}return r}const e8=(t=0,e=Number.MAX_SAFE_INTEGER)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),nF=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\d.]+/);return e&&e.length>0?e[0].trim():""},iF=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\w\s\d]+/);return e&&e.length>0?e[0].trim():""},sF=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\w\d.\-:\/]+/);return e&&e.length>0?e[0].trim():""},O1e=t=>new Promise(e=>{const r=setTimeout(()=>{clearTimeout(r),e()},t)}),oF=t=>{const e=vy({},t.types);return delete e.EIP712Domain,Wr.hash(t.domain,e,t.message)},H1=t=>re(oF(t)),{defineReadOnly:R1e,getStatic:M1e,resolveProperties:$1e,checkProperties:N1e,shallowCopy:D1e,deepCopy:L1e}=LJ,B1e=t=>t.replace(/([^:]\/)\/+/g,"$1"),F1e=Object.freeze(Object.defineProperty({__proto__:null,Logger:rF,PromiseCache:_1e,base64Decode:S1e,base64DecodeObject:JS,base64Encode:C1e,base64EncodeObject:YS,checkProperties:N1e,configureLogger:A1e,deepCopy:L1e,defineReadOnly:R1e,encodeMessageDigest:XS,encodeTypedDataDigest:H1,encodeTypedDataHash:oF,getEthersConnectionInfo:r1,getRandomInt:e8,getStatic:M1e,isBigNumberish:XB,isBrowser:k1e,isNode:eF,jwtDecodeClaims:tF,logger:ge,packMessageData:ZB,promisify:ZS,queryStringFromObject:T1e,queryStringToObject:I1e,resolveProperties:$1e,sanitizeAlphanumeric:iF,sanitizeHost:sF,sanitizeNumberString:nF,shallowCopy:D1e,sleep:O1e,subDigestOf:jC,urlClean:B1e},Symbol.toStringTag,{value:"Module"}));function Zt(){return Zt=Object.assign?Object.assign.bind():function(t){for(var e=1;etypeof t=="number"?t:t.chainId?t.chainId:J.from(t).toNumber(),U1e=t=>{if(t)return aF(t)},cF=(t,e=!1,r=!1)=>{if(!t)throw new Error("invalid network config: empty config");const n=[];if(Array.isArray(t)?n.push(...t):n.push(t),n.length===0){if(e)throw new Error("invalid network config: empty config");return!1}const i=n.map(l=>l.chainId).sort(),s=i.filter((l,u)=>i.indexOf(l)!==u);if(s.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${s}`);return!1}n.forEach(l=>l.name=l.name.toLowerCase());const o=n.map(l=>l.name).sort(),a=o.filter((l,u)=>o.indexOf(l)!==u);if(a.length>0){if(e)throw new Error(`invalid network config: duplicate network names ${a}`);return!1}let c=!1;for(let l=0;l(cF(t,!0,e),t),z1e=(t,e=!0)=>{const r=t.map(i=>i.chainId).sort(),n=r.filter((i,s)=>r.indexOf(i)!==s);if(n.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${n}`);return!1}return!0},W1e=(t,e)=>{if(!(!t||!e)){if(!t.chainId&&!t.name)throw new Error("failed to update network config: source config is missing chainId or name");if(t.chainId!==e.chainId&&t.name!==e.name)throw new Error("failed to update network config: one of chainId or name must match");t.rpcUrl&&(e.rpcUrl=t.rpcUrl,e.provider=void 0),t.provider&&(e.provider=t.provider),t.relayer&&(e.relayer=t.relayer)}},uF=t=>lF(fF(t)),bs=(t,e)=>{if(typeof e=="string")if(e.startsWith("0x")){const r=J.from(e).toNumber();return t.find(n=>n.chainId===r)}else return t.find(r=>r.name===e||`${r.chainId}`===e);else{if(typeof e=="number")return t.find(r=>r.chainId===e);if(e.chainId)return t.find(r=>r.chainId===e.chainId);if(J.isBigNumber(e)){const r=e.toNumber();return t.find(n=>n.chainId===r)}else return}},H1e=(t,e)=>t?t.name===e||t.chainId===e:!1,q1e=t=>{const e={};for(let r=0;r{if(!t)return[];const e=t.sort((n,i)=>n.chainId===i.chainId?0:n.chainIdn.isDefaultChain);return r>0&&e.splice(0,0,e.splice(r,1)[0]),e},kb=(t,e)=>typeof t=="string"?(e=e||{},t.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,function(r,n){let i=e[n];return typeof i=="function"?i=i():i==null?i="":typeof i=="object"||typeof i=="symbol"?i=i.toString():i=i.valueOf(),i})):"",t8=t=>kb("https://${network}-indexer.sequence.app",{network:t}),dF=t=>kb("https://${network}-relayer.sequence.app",{network:t}),hF=t=>kb("https://nodes.sequence.app/${network}",{network:t});function r8(t){return bs(Wf,t)}function pF(t){return J.isBigNumber(t)?t:XB(t)?J.from(t):J.from(t.chainId)}const Cr=t=>{const e=hF(t);return{rpcUrl:e,relayer:{url:dF(t),provider:{url:e}},indexerUrl:t8(t)}},Wf=uF([Zt({},Ut[ce.POLYGON],Cr("polygon"),{isDefaultChain:!0,isAuthChain:!0}),Zt({},Ut[ce.MAINNET],Cr("mainnet")),Zt({},Ut[ce.BSC],Cr("bsc")),Zt({},Ut[ce.AVALANCHE],Cr("avalanche")),Zt({},Ut[ce.ARBITRUM],Cr("arbitrum")),Zt({},Ut[ce.ARBITRUM_NOVA],Cr("arbitrum-nova")),Zt({},Ut[ce.OPTIMISM],Cr("optimism")),Zt({},Ut[ce.OPTIMISM_SEPOLIA],Cr("optimism-sepolia")),Zt({},Ut[ce.POLYGON_ZKEVM],Cr("polygon-zkevm")),Zt({},Ut[ce.GNOSIS],Cr("gnosis")),Zt({},Ut[ce.RINKEBY],Cr("rinkeby"),{disabled:!0}),Zt({},Ut[ce.GOERLI],Cr("goerli"),{disabled:!0}),Zt({},Ut[ce.SEPOLIA],Cr("sepolia")),Zt({},Ut[ce.POLYGON_MUMBAI],Cr("mumbai")),Zt({},Ut[ce.BSC_TESTNET],Cr("bsc-testnet")),Zt({},Ut[ce.ARBITRUM_SEPOLIA],Cr("arbitrum-sepolia")),Zt({},Ut[ce.BASE],Cr("base")),Zt({},Ut[ce.BASE_SEPOLIA],Cr("base-sepolia")),Zt({},Ut[ce.HOMEVERSE_TESTNET],Cr("homeverse-testnet")),Zt({},Ut[ce.AVALANCHE_TESTNET],Cr("avalanche-testnet")),Zt({},Ut[ce.HARDHAT],{rpcUrl:"http://localhost:8545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:8545"}}}),Zt({},Ut[ce.HARDHAT_2],{rpcUrl:"http://localhost:9545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:9545"}}})]),Hf="2.0";class n8{constructor(e,r){this.sender=r,e&&this.setMiddleware(e)}setMiddleware(e){this.handler=vF(e,this.sender.sendAsync)}sendAsync(e,r,n){try{this.handler(e,r,n)}catch(i){r(i,void 0)}}}const vF=(t,e)=>{if(t.length===0)return e;const r=i=>i.sendAsyncMiddleware?i.sendAsyncMiddleware:i;let n;n=r(t[t.length-1])(e);for(let i=t.length-2;i>=0;i--)n=r(t[i])(n);return n};function mF(t){return t!==void 0&&t.send!==void 0&&t.constructor.defaultUrl!==void 0&&t.detectNetwork!==void 0&&t.getSigner!==void 0&&t.perform!==void 0}function yF(t){return t!==void 0&&t.sendAsync!==void 0}let V1e=0;class my{constructor(e,r){this.sendAsync=(n,i,s)=>{this.send(n.method,n.params,s||this.defaultChainId).then(o=>{i(void 0,{jsonrpc:"2.0",id:n.id,result:o})}).catch(o=>{i(o,void 0)})},this.defaultChainId=r,mF(e)?this.send=e.send.bind(e):yF(e)?this.send=(n,i,s)=>new Promise((o,a)=>{e.sendAsync({jsonrpc:Hf,id:++V1e,method:n,params:i},(c,l)=>{c?a(c):o(l?l.result:void 0)},s||this.defaultChainId)}):this.send=e,this.request=(n,i)=>this.send(n.method,n.params,i)}}class G1e{constructor(e){this.sendAsync=(r,n)=>{this.provider.send(r.method,r.params).then(i=>{n(void 0,{jsonrpc:"2.0",id:r.id,result:i})}).catch(i=>{n(i,void 0)})},this.send=this.sendAsync,this.provider=e}}class K1e{constructor(e){e?this.isAllowedFunc=e:this.isAllowedFunc=r=>!0,this.sendAsyncMiddleware=UC(this.isAllowedFunc)}setIsAllowedFunc(e){this.isAllowedFunc=e,this.sendAsyncMiddleware=UC(this.isAllowedFunc)}}const UC=t=>e=>(r,n,i)=>{if(!t(r))throw new Error("allowProvider middleware precondition is unmet.");e(r,n,i)};class i8{constructor(e){this.cachableJsonRpcMethods=["net_version","eth_chainId","eth_accounts","sequence_getWalletContext","sequence_getNetworks"],this.cachableJsonRpcMethodsByBlock=["eth_call","eth_getCode"],this.cacheByBlockResetLock=!1,this.sendAsyncMiddleware=r=>(n,i,s)=>{if(this.cachableJsonRpcMethods.includes(n.method)||this.cachableJsonRpcMethodsByBlock.includes(n.method)){const o=this.cacheKey(n.method,n.params,s||this.defaultChainId),a=this.getCacheValue(o);if(a&&a!==""){i(void 0,{jsonrpc:"2.0",id:n.id,result:a});return}}r(n,(o,a,c)=>{if((this.cachableJsonRpcMethods.includes(n.method)||this.cachableJsonRpcMethodsByBlock.includes(n.method))&&a&&a.result&&this.shouldCacheResponse(n,a)){const l=this.cacheKey(n.method,n.params,c||this.defaultChainId);this.cachableJsonRpcMethods.includes(n.method)?this.setCacheValue(l,a.result):this.setCacheByBlockValue(l,a.result)}i(o,a)},s||this.defaultChainId)},this.cacheKey=(r,n,i)=>{let s="";return i?s=`${i}:${r}:`:s=`:${r}:`,!n||n.length===0?s+"[]":s+JSON.stringify(n)},this.getCache=()=>this.cache,this.setCache=r=>{this.cache=r,this.onUpdateCallback&&this.onUpdateCallback()},this.getCacheValue=r=>{if(this.cache[r])return this.cache[r];if(this.cacheByBlock[r])return this.cacheByBlock[r]},this.setCacheValue=(r,n)=>{this.cache[r]=n,this.onUpdateCallback&&this.onUpdateCallback(r,n)},this.setCacheByBlockValue=(r,n)=>{this.cacheByBlock[r]=n,this.cacheByBlockResetLock||(this.cacheByBlockResetLock=!0,setTimeout(()=>{this.cacheByBlockResetLock=!1,this.cacheByBlock={}},1500))},this.shouldCacheResponse=(r,n)=>!(!n||!n.result||r.method==="eth_getCode"&&n.result.length<=2),this.clearCache=()=>{this.cache={},this.cacheByBlock={}},this.cache={},this.cacheByBlock={},this.defaultChainId=e==null?void 0:e.defaultChainId,e!=null&&e.blockCache?(e==null?void 0:e.blockCache)!==!0&&(this.cachableJsonRpcMethodsByBlock=e==null?void 0:e.blockCache):this.cachableJsonRpcMethodsByBlock=[]}onUpdate(e){this.onUpdateCallback=e}}class gF{constructor(e){this.sendAsyncMiddleware=r=>(n,i,s)=>{const{id:o,method:a}=n;switch(a){case"net_version":if(this.options.chainId){i(void 0,{jsonrpc:"2.0",id:o,result:`${this.options.chainId}`});return}break;case"eth_chainId":if(this.options.chainId){i(void 0,{jsonrpc:"2.0",id:o,result:te(this.options.chainId)});return}break;case"eth_accounts":if(this.options.accountAddress){i(void 0,{jsonrpc:"2.0",id:o,result:[qe(this.options.accountAddress)]});return}break;case"sequence_getWalletContext":if(this.options.walletContext){i(void 0,{jsonrpc:"2.0",id:o,result:this.options.walletContext});return}break}r(n,i,s)},this.options=e}}const bF=t=>(e,r,n)=>{t(e,(i,s)=>{if(!i&&s&&s.error)throw typeof s.error=="string"?new Error(s.error):new Error(s.error.message);r(i,s)},n)},wF=t=>(e,r,n)=>{const i=n?` chainId:${n}`:"";ge.info(`[provider request]${i} id:${e.id} method:${e.method} params:`,e.params),t(e,(s,o)=>{s?ge.warn(`[provider response]${i} id:${e.id} method:${e.method} params:`,e.params,"error:",s):ge.info(`[provider response]${i} id:${e.id} method:${e.method} params:`,e.params,"response:",o),r(s,o)},n)},Q1e=t=>e=>(r,n,i)=>{const s=t(r),{id:o,method:a}=r;switch(a){case"net_version":n(void 0,{jsonrpc:"2.0",id:o,result:`${s}`});return;case"eth_chainId":n(void 0,{jsonrpc:"2.0",id:o,result:te(s)});return}e(r,n,i)},EF=["personal_sign","eth_sign","eth_signTypedData","eth_signTypedData_v4","eth_sendTransaction","eth_sendRawTransaction","sequence_sign","sequence_signTypedData_v4","sequence_getWalletContext","sequence_getWalletConfig","sequence_getWalletState","sequence_getNetworks","sequence_updateConfig","sequence_publishConfig","sequence_gasRefundOptions","sequence_getNonce","sequence_relay","eth_decrypt","eth_getEncryptionPublicKey","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];class Y1e{constructor(e){this.sendAsyncMiddleware=r=>(n,i,s)=>{if(EF.includes(n.method)){this.provider.sendAsync(n,i,s);return}r(n,i,s)},this.provider=e}}class J1e{constructor(e){this.privateJsonRpcMethods=["net_version","eth_chainId","eth_accounts",...EF],this.sendAsyncMiddleware=r=>(n,i)=>{if(this.provider&&!this.privateJsonRpcMethods.includes(n.method)){this.provider.send(n.method,n.params).then(s=>{i(void 0,{jsonrpc:"2.0",id:n.id,result:s})}).catch(s=>i(s));return}ge.debug("[public-provider] sending request to signer window",n.method),r(n,i)},e&&this.setRpcUrl(e)}getRpcUrl(){return this.rpcUrl}setRpcUrl(e){!e||e===""?(this.rpcUrl=void 0,this.provider=void 0):(this.rpcUrl=e,this.provider=new Ko(e))}}class xF{constructor(){this.singleflightJsonRpcMethods=["eth_chainId","net_version","eth_call","eth_getCode","eth_blockNumber","eth_getBalance","eth_getStorageAt","eth_getTransactionCount","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_getBlockByHash","eth_getBlockByNumber","eth_getTransactionByHash","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionReceipt","eth_getUncleByBlockHashAndIndex","eth_getUncleByBlockNumberAndIndex","eth_getLogs"],this.sendAsyncMiddleware=e=>(r,n,i)=>{if(!this.singleflightJsonRpcMethods.includes(r.method)){e(r,n,i);return}const s=this.requestKey(r.method,r.params||[],i);if(!this.inflight[s])this.inflight[s]=[];else{this.inflight[s].push({id:r.id,callback:n});return}e(r,(o,a,c)=>{n(o,a);for(let l=0;l{let i="";return n?i=`${n}:${e}:`:i=`:${e}:`,!r||r.length===0?i+"[]":i+JSON.stringify(r)},this.inflight={}}}class X1e extends Ko{constructor(e,r){super(e,r==null?void 0:r.chainId),this.send=(a,c)=>this._sender.send(a,c),this.fetch=(a,c)=>{const l={method:a,params:c,id:this._nextId++,jsonrpc:"2.0"};return _1(this.connection,JSON.stringify(l),Z1e).then(f=>f,f=>{throw f})};const n=r==null?void 0:r.chainId,i=r==null?void 0:r.middlewares,s=r==null?void 0:r.blockCache;this._chainId=n;const o=new n8(i??[new gF({chainId:n}),new xF,new i8({defaultChainId:n,blockCache:s})],new my(this.fetch,n));this._sender=new my(o,n)}async getNetwork(){const e=this._chainId;if(e){const r=Ut[e],n=(r==null?void 0:r.name)||"",i=r==null?void 0:r.ensAddress;return{name:n,chainId:e,ensAddress:i}}else{const r=await this.send("eth_chainId",[]);return this._chainId=J.from(r).toNumber(),this.getNetwork()}}}function Z1e(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}const epe=Object.freeze(Object.defineProperty({__proto__:null,AllowProvider:K1e,CachedProvider:i8,ChainId:ce,EagerProvider:gF,JsonRpcExternalProvider:G1e,JsonRpcProvider:X1e,JsonRpcRouter:n8,JsonRpcSender:my,JsonRpcVersion:Hf,NetworkType:ft,PublicProvider:J1e,SigningProvider:Y1e,SingleflightMiddleware:xF,allNetworks:Wf,allowProviderMiddleware:UC,checkNetworkConfig:H1e,createJsonRpcMiddlewareStack:vF,ensureUniqueNetworks:z1e,ensureValidNetworks:lF,exceptionProviderMiddleware:bF,findNetworkConfig:bs,findSupportedNetwork:r8,getChainId:aF,indexerURL:t8,isJsonRpcHandler:yF,isJsonRpcProvider:mF,isNetworkConfig:j1e,isValidNetworkConfig:cF,loggingProviderMiddleware:wF,maybeChainId:U1e,networkProviderMiddleware:Q1e,networks:Ut,networksIndex:q1e,nodesURL:hF,relayerURL:dF,sortNetworks:fF,stringTemplate:kb,toChainIdNumber:pF,updateNetworkConfig:W1e,validateAndSortNetworks:uF},Symbol.toStringTag,{value:"Module"}));function wn(){return wn=Object.assign?Object.assign.bind():function(t){for(var e=1;e{if(o8(i))return We(["uint8","uint8","address"],[El.Address,i.weight,i.address]);if(i.isDynamic){const s=re(i.signature);return We(["uint8","uint8","address","uint16","bytes"],[El.DynamicSignature,i.weight,i.address,s.length,s])}return We(["uint8","uint8","bytes"],[El.EOASignature,i.weight,i.signature])});return We(["uint16",...new Array(n.length).fill("bytes")],[r,...n])}async function PF(t,e,r){const n=q1(e),i=await Promise.all(t.signers.map(async s=>{if(o8(s))return s;if(s.isDynamic){if(!s.address)throw new Error("Dynamic signature part must have address");if(!s8(s.address,n,s.signature,r))throw new Error(`Invalid dynamic signature part ${s.address}`);return{address:s.address,weight:s.weight,signature:s.signature}}else return{address:V1(n,s.signature),weight:s.weight,signature:s.signature}}));return{version:1,payload:e,subdigest:n,config:{version:1,threshold:t.threshold,signers:i}}}function zh(t,e,r,n){if(r.length!==0)throw new Error("Explicit subdigests not supported on v1");let i=J.from(0);const s=t.signers.map(a=>{if(!e.has(a.address))return a;const c=e.get(a.address),l=re(c.signature);return i=i.add(a.weight),c.isDynamic||l.length!==66?wn({},a,{isDynamic:!0,signature:c.signature,address:a.address}):wn({},a,{isDynamic:!1,signature:c.signature})});return{encoded:a8({version:1,threshold:t.threshold,signers:s}),weight:i}}const c8={decode:t=>_F(t),encode:t=>a8(t),trim:async t=>t,supportsNoChainId:!0,recover:(t,e,r)=>PF(t,e,r),encodeSigners:(t,e,r,n)=>zh(t,e,r),hasEnoughSigningPower:(t,e)=>{const{weight:r}=c8.encodeSigners(t,e,[],0);return r.gte(t.threshold)},chainSignatures:(t,e)=>{throw new Error("Signature chaining not supported on v1")},hashSetImageHash:function(t){throw new Error("Image hash not supported on v1")},signaturesOf(t){return t.signers.filter(e=>e.signature!==void 0).map(e=>({address:e.address,signature:e.signature}))},signaturesOfDecoded:function(t){return t.signers.map(e=>e.signature).filter(e=>e!==void 0)}};var lpe=Object.freeze({__proto__:null,SignaturePartType:El,isAddressMember:o8,isUnrecoveredSignatureMember:kF,isUnrecoveredSignature:AF,decodeSignature:_F,encodeSignature:a8,recoverSignature:PF,encodeSigners:zh,SignatureCoder:c8});const l8={isWalletConfig:t=>t.version===1&&t.threshold!==void 0&&t.signers!==void 0,imageHashOf:t=>t.signers.reduce((e,r)=>Be(Bn.encode(["bytes32","uint8","address"],[e,r.weight,r.address])),We(["uint256"],[t.threshold])),hasSubdigest:(t,e)=>!1,isComplete:t=>!0,checkpointOf:t=>J.from(0),signersOf:t=>t.signers.map(e=>({address:e.address,weight:J.from(e.weight).toNumber()})),fromSimple:t=>{if(!tr.eq(t.checkpoint))throw new Error("v1 wallet config does not support checkpoint");return{version:1,threshold:t.threshold,signers:t.signers}},update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new Br([...rn.mainModule.abi,...rn.mainModuleUpgradable.abi]),s=[];return(!n||n==="first")&&s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImplementation"),[r.mainModuleUpgradable]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[l8.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),{entrypoint:t,transactions:s}},decodeTransaction:function(t){throw new Error("Function not implemented.")}},toJSON:function(t){const e=t.signers.map(r=>({weight:J.from(r.weight).toString(),address:r.address}));return JSON.stringify({version:t.version,threshold:J.from(t.threshold).toString(),signers:e})},fromJSON:function(t){const e=JSON.parse(t),r=e.signers.map(n=>({weight:J.from(n.weight),address:n.address}));return{version:e.version,threshold:J.from(e.threshold),signers:r}},editConfig:function(t,e){var r;const n=t.signers.slice();if(e.checkpoint&&!tr.eq(e.checkpoint))throw new Error("v1 wallet config does not support checkpoint");if(e.add)for(const i of e.add)n.find(s=>s.address===i.address)||n.push({weight:i.weight,address:i.address});if(e.remove)for(const i of e.remove){const s=n.findIndex(o=>o.address===i);s>=0&&n.splice(s,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,signers:n}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=zh(t,r,[]);if(a.gte(t.threshold))return o}const n=t.signers;for(const{address:i}of n.sort(({weight:s},{weight:o})=>J.from(s).sub(o).toNumber())){const s="0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02";r.set(i,{signature:s,isDynamic:!1});const{encoded:o,weight:a}=zh(t,r,[]);if(a.gte(t.threshold))return o}return zh(t,r,[]).encoded}};var upe=Object.freeze({__proto__:null,ConfigCoder:l8});const TF=1,IF={version:TF,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var Io=Object.freeze({__proto__:null,config:upe,signature:lpe,version:TF,DeployedWalletContext:IF});const u8="0x8713a7c4465f6fbee2b6e9d6646d1d9f83fec929edfc4baf661f3c865bdd04d1";function OF(t){return Be(RF(t))}function RF(t){return We(["bytes32","bytes32"],[u8,t])}function MF(t){const e=re(t);if(e.length===64&&te(e.slice(0,32))===u8)return te(e.slice(32,64))}function fpe(t){return MF(t)!==void 0}var dpe=Object.freeze({__proto__:null,SetImageHashPrefix:u8,hashSetImageHash:OF,messageSetImageHash:RF,decodeMessageSetImageHash:MF,isMessageSetImageHash:fpe});let qr=function(t){return t[t.Legacy=0]="Legacy",t[t.Dynamic=1]="Dynamic",t[t.NoChainIdDynamic=2]="NoChainIdDynamic",t[t.Chained=3]="Chained",t}({}),pr=function(t){return t[t.Signature=0]="Signature",t[t.Address=1]="Address",t[t.DynamicSignature=2]="DynamicSignature",t[t.Node=3]="Node",t[t.Branch=4]="Branch",t[t.Subdigest=5]="Subdigest",t[t.Nested=6]="Nested",t}({});const yy=66;function Hl(t){return t.left!==void 0&&t.right!==void 0}function Cd(t){return t.tree!==void 0}function G1(t){return t.unrecovered&&t.signature!==void 0&&t.isDynamic!==void 0}function gy(t){let e=re(t),r;const n=(i,s)=>i?i.right?{left:i,right:s}:{left:i.left,right:s}:{left:s};for(;e.length>0;){const i=e[0];switch(e=e.slice(1),i){case pr.Signature:{const s=e[0],o=te(e.slice(1,yy+1));r=n(r,{signature:o,weight:s,unrecovered:!0,isDynamic:!1}),e=e.slice(yy+1)}break;case pr.Address:{const s=e[0],o=qe(te(e.slice(1,21)));r=n(r,{address:o,weight:s}),e=e.slice(21)}break;case pr.DynamicSignature:{const s=e[0],o=qe(te(e.slice(1,21))),a=e[21]<<16|e[22]<<8|e[23],c=te(e.slice(24,24+a));r=n(r,{address:o,signature:c,weight:s,unrecovered:!0,isDynamic:!0}),e=e.slice(24+a)}break;case pr.Node:{const s=te(e.slice(0,32));r=n(r,{nodeHash:s}),e=e.slice(32)}break;case pr.Branch:{const s=e[0]<<16|e[1]<<8|e[2],o=gy(e.slice(3,3+s));r=n(r,o),e=e.slice(3+s)}break;case pr.Subdigest:{const s=te(e.slice(0,32));r=n(r,{subdigest:s}),e=e.slice(32)}break;case pr.Nested:{const s=e[0],o=e[1]<<8|e[2],a=e[3]<<16|e[4]<<8|e[5],c=gy(e.slice(6,6+a));r=n(r,{weight:s,threshold:o,tree:c}),e=e.slice(6+a)}break;default:throw new Error(`Unknown signature part type: ${i}: ${te(e)}`)}}if(!r)throw new Error("Empty signature tree");return r.right?r:r.left}class $F extends Error{constructor(e){super(`Invalid signature leaf: ${JSON.stringify(e)}`),this.leaf=e}}async function xl(t,e,r){if(Hl(t)){const[n,i]=await Promise.all([xl(t.left,e,r),xl(t.right,e,r)]);return{left:n,right:i}}if(Cd(t))return{weight:t.weight,threshold:t.threshold,tree:await xl(t.tree,e,r)};if(G1(t))if(t.isDynamic){if(!t.address)throw new Error("Dynamic signature leaf without address");if(!await s8(t.address,e,t.signature,r))throw new $F(t);return{weight:t.weight,address:t.address,signature:t.signature,subdigest:e}}else return{weight:t.weight,address:V1(e,t.signature),signature:t.signature,subdigest:e};return t}const hn={concat:(t,e)=>We(["bytes","bytes"],[t,e]),node:t=>We(["uint8","bytes32"],[pr.Node,t]),branch:t=>{const e=re(t);return We(["uint8","uint24","bytes"],[pr.Branch,e.length,e])},nested:(t,e,r)=>{const n=re(r);return We(["uint8","uint8","uint16","uint24","bytes"],[pr.Nested,t,e,n.length,n])},subdigest:t=>We(["uint8","bytes32"],[pr.Subdigest,t]),signature:(t,e)=>We(["uint8","uint8","bytes"],[pr.Signature,t,e]),dynamicSignature:(t,e,r)=>{const n=re(r);return We(["uint8","uint8","address","uint24","bytes"],[pr.DynamicSignature,t,e,n.length,n])},address:(t,e)=>We(["uint8","uint8","address"],[pr.Address,t,e])};function Wh(t,e,r,n,i={}){const s=Hh(t.tree,e,r,i);return J.from(n).isZero()?{encoded:We(["uint8","uint16","uint32","bytes"],[qr.NoChainIdDynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:J.from(t.threshold).gt(255)?{encoded:We(["uint8","uint16","uint32","bytes"],[qr.Dynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:{encoded:We(["uint8","uint8","uint32","bytes"],[qr.Legacy,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}}function Hh(t,e,r,n={}){const i=!n.disableTrim;if(Cs(t)){const s=Hh(t.left,e,r),o=Hh(t.right,e,r),a=Ln(t.left),c=Ln(t.right);return i&&s.weight.eq(0)&&o.weight.eq(0)&&!a&&!c?{encoded:hn.node(ui(t)),weight:tr}:i&&o.weight.eq(0)&&!c?{encoded:hn.concat(s.encoded,hn.node(ui(t.right))),weight:s.weight}:i&&s.weight.eq(0)&&!a?{encoded:hn.concat(hn.node(ui(t.left)),hn.branch(o.encoded)),weight:o.weight}:{encoded:hn.concat(s.encoded,hn.branch(o.encoded)),weight:s.weight.add(o.weight)}}if(ha(t)){const s=Hh(t.tree,e,r);return i&&s.weight.eq(0)?{encoded:hn.node(ui(t)),weight:tr}:{encoded:hn.nested(t.weight,t.threshold,s.encoded),weight:s.weight}}if(pa(t))return{encoded:hn.node(ui(t)),weight:tr};if(da(t)){const s=r.includes(t.subdigest);return{encoded:hn.node(ui(t)),weight:s?NR:tr}}if(Ln(t))if(e.has(t.address)){const o=e.get(t.address),a=o.signature;return n.forceDynamicEncoding||o.isDynamic?{encoded:hn.dynamicSignature(t.weight,t.address,a),weight:J.from(t.weight)}:{encoded:hn.signature(t.weight,a),weight:J.from(t.weight)}}else return{encoded:hn.address(t.weight,t.address),weight:tr};throw new Error(`Invalid topology - unknown error: ${JSON.stringify(t)}`)}function f8(t){return h8(t)?f8(t.suffix[t.suffix.length-1]):t.config}function d8(t){return t.type!==void 0&&t.decoded!==void 0&&t.version!==void 0&&t.version===2}function K1(t){return t.suffix!==void 0&&Array.isArray(t.suffix)&&t.suffix.every(d8)}function NF(t){return t.type!==void 0&&t.config!==void 0&&t.digest!==void 0&&t.version!==void 0&&t.version===2}function h8(t){return t.chain!==void 0&&Array.isArray(t.chain)&&t.chain.every(NF)}function Ab(t){const e=re(t),r=e[0];switch(r){case qr.Legacy:return{version:2,type:qr.Legacy,decoded:jv(e)};case qr.Dynamic:return{version:2,type:qr.Dynamic,decoded:jv(e.slice(1))};case qr.NoChainIdDynamic:return{version:2,type:qr.NoChainIdDynamic,decoded:jv(e.slice(1))};case qr.Chained:return DF(e);default:throw new Error(`Invalid signature type: ${r}`)}}function jv(t){const e=re(t),r=e[0]<<8|e[1],n=e[2]<<24|e[3]<<16|e[4]<<8|e[5],i=gy(e.slice(6));return{threshold:r,checkpoint:n,tree:i}}function DF(t){const e=re(t),r=e[0];if(r!==qr.Chained)throw new Error(`Expected chained signature type: ${r}`);const n=[];let i=1;for(;ire(ic(s))),i=We(n.map(()=>["uint24","bytes"]).flat(),n.map(s=>[s.length,s]).flat());return We(["uint8","bytes"],[qr.Chained,i])}function ic(t){if(Wo(t))return te(t);if(K1(t)||h8(t))return _b(ic(t),(t.suffix||[]).map(ic));const e=d8(t)?t.decoded:t.config;switch(t.type){case qr.Legacy:if(J.from(e.threshold).gt(255))throw new Error(`Legacy signature threshold is too large: ${e.threshold} (max 255)`);return zC(e);case qr.NoChainIdDynamic:case qr.Dynamic:return We(["uint8","bytes"],[t.type,zC(e)]);case qr.Chained:throw new Error("Unreachable code: Chained signature should be handled above");default:throw new Error(`Invalid signature type: ${t.type}`)}}function zC(t){return We(["uint16","uint32","bytes"],[t.threshold,t.checkpoint,qh(t.tree)])}function qh(t){if(Cs(t)||Hl(t)){const e=re(qh(t.right)),r=re(qh(t.left));return Cs(t.right)||Hl(t.right)?We(["bytes","uint8","uint24","bytes"],[r,pr.Branch,e.length,e]):We(["bytes","bytes"],[r,e])}if(ha(t)||Cd(t)){const e=re(qh(t.tree));return We(["uint8","uint8","uint16","uint24","bytes"],[pr.Nested,t.weight,t.threshold,e.length,e])}if(G1(t)||Ln(t)&&t.signature!==void 0){const e=re(t.signature);if(t.isDynamic||e.length!==yy){if(!t.address)throw new Error("Dynamic signature leaf must have address");return We(["uint8","uint8","address","uint24","bytes"],[pr.DynamicSignature,t.weight,t.address,e.length,e])}else return We(["uint8","uint8","bytes"],[pr.Signature,t.weight,e])}if(Ln(t))return We(["uint8","uint8","address"],[pr.Address,t.weight,t.address]);if(pa(t))return We(["uint8","bytes32"],[pr.Node,t.nodeHash]);if(da(t))return We(["uint8","bytes32"],[pr.Subdigest,t.subdigest]);throw new Error(`Unknown signature tree type: ${t}`)}function Vh(t){return Cs(t)?[...Vh(t.left),...Vh(t.right)]:ha(t)?Vh(t.tree):Ln(t)&&t.signature?[{address:t.address,signature:t.signature}]:[]}function Gh(t){return Hl(t)?[...Gh(t.left),...Gh(t.right)]:Cd(t)?Gh(t.tree):G1(t)?[t.signature]:[]}function Uv(t){return Hl(t)?[...Uv(t.left),...Uv(t.right)]:Cd(t)?Uv(t.tree):da(t)?[t.subdigest]:[]}async function by(t){const e=typeof t=="string"?Ab(t):t;if(K1(e)){const n=await Promise.all([by(wn({},e,{suffix:void 0})),...e.suffix.map(i=>by(i))]);return _b(n[0],n.slice(1))}const{trimmed:r}=await Kh(e.decoded.tree);return ic(wn({},e,{decoded:wn({},e.decoded,{tree:r})}))}async function Kh(t,e=!0){if(Hl(t)){const[r,n]=await Promise.all([Kh(t.left),Kh(t.right)]);if(r.weight===0&&n.weight===0)try{const i=await xl(t,Tm,void 0);return{weight:0,trimmed:{nodeHash:ui(i)}}}catch{}else return{weight:r.weight+n.weight,trimmed:{left:r.trimmed,right:n.trimmed}}}if(Cd(t)){const r=await Kh(t.tree);if(r.weight===0)try{const n=await xl(t,Tm,void 0);return{weight:0,trimmed:{nodeHash:ui(n)}}}catch{}return{weight:r.weight,trimmed:{weight:t.weight,threshold:t.threshold,tree:r.trimmed}}}return pa(t)&&jF(t.nodeHash)?{weight:0,trimmed:wn({},FF(t.nodeHash))}:G1(t)||Ln(t)&&t.signature!==void 0?{weight:J.from(t.weight).toNumber(),trimmed:t}:!e&&da(t)?{weight:1/0,trimmed:t}:{weight:0,trimmed:t}}const Pb={decode:t=>Ab(t),encode:t=>ic(t),trim:t=>by(t),supportsNoChainId:!0,recover:(t,e,r)=>p8(t,e,r),encodeSigners:(t,e,r,n)=>Wh(t,e,r,n),hasEnoughSigningPower:(t,e)=>{const{weight:r}=Pb.encodeSigners(t,e,[],0);return r.gte(t.threshold)},chainSignatures:(t,e)=>{const r=e.reverse(),n=Wo(t)?t:ic(t),i=r.map(s=>Wo(s)?s:ic(s));return _b(n,i)},hashSetImageHash:function(t){return OF(t)},signaturesOf(t){return Vh(t.tree)},signaturesOfDecoded:function(t){return Gh(t.decoded.tree)}};var hpe=Object.freeze({__proto__:null,SignatureType:qr,SignaturePartType:pr,SignaturePartTypeLength:yy,isUnrecoveredNode:Hl,isUnrecoveredNestedLeaf:Cd,isUnrecoveredSignatureLeaf:G1,decodeSignatureTree:gy,InvalidSignatureLeafError:$F,recoverTopology:xl,partEncoder:hn,encodeSigners:Wh,encodeTree:Hh,deepestConfigOfSignature:f8,isUnrecoveredSignature:d8,isUnrecoveredChainedSignature:K1,isSignature:NF,isChainedSignature:h8,decodeSignature:Ab,decodeSignatureBody:jv,decodeChainedSignature:DF,setImageHashStruct:LF,recoverSignature:p8,encodeChain:_b,encodeSignature:ic,encodeSignatureBody:zC,encodeSignatureTree:qh,signaturesOf:Vh,signaturesOfDecoded:Gh,subdigestsOfDecoded:Uv,trimSignature:by,trimUnrecoveredTree:Kh,SignatureCoder:Pb});function Ln(t){return t.address!==void 0&&t.weight!==void 0}function da(t){return t.subdigest!==void 0&&t.address===void 0}function Qh(t){return Cs(t)?JSON.stringify({left:Qh(t.left),right:Qh(t.right)}):ha(t)?JSON.stringify({weight:J.from(t.weight).toString(),threshold:J.from(t.threshold).toString(),tree:Qh(t.tree)}):Ln(t)?JSON.stringify({address:t.address,weight:J.from(t.weight).toString()}):JSON.stringify(t)}function Yh(t){const e=typeof t=="string"?JSON.parse(t):t;return e.left!==void 0&&e.right!==void 0?{left:Yh(e.left),right:Yh(e.right)}:e.weight!==void 0&&e.threshold!==void 0&&e.tree!==void 0?{weight:J.from(e.weight),threshold:J.from(e.threshold),tree:Yh(e.tree)}:e.address!==void 0&&e.weight!==void 0?{address:e.address,weight:J.from(e.weight)}:e}function ha(t){return t.tree!==void 0&&t.weight!==void 0&&t.threshold!==void 0}function pa(t){return t.nodeHash!==void 0}function v8(t){return Ln(t)||da(t)||ha(t)||pa(t)}function Cs(t){return t.left!==void 0&&t.right!==void 0}function ppe(t){return Cs(t)||v8(t)}function BF(t){return We(["uint96","address"],[t.weight,t.address])}function FF(t){const e=re(t);if(e.length!==32)throw new Error("Invalid encoded string length");const r=J.from(e.slice(0,12)),n=qe(te(e.slice(12)));return{weight:r,address:n}}function jF(t){const e=re(t);return e.length!==32?!1:e.slice(0,11).every(n=>n===0)}function ui(t){if(Ln(t))return BF(t);if(da(t))return ec(["string","bytes32"],[`Sequence static digest: -`,t.subdigest]);if(ha(t)){const e=ui(t.tree);return ec(["string","bytes32","uint256","uint256"],[`Sequence nested config: -`,e,t.threshold,t.weight])}return pa(t)?t.nodeHash:ec(["bytes32","bytes32"],[ui(t.left),ui(t.right)])}function vpe(t){const e=[];let r=t;for(;!v8(r);)e.unshift(r.right),r=r.left;return e.unshift(r),e}function mpe(t){return t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&t.version!==void 0&&t.version===2}function m8(t){return ec(["bytes32","uint256"],[ec(["bytes32","uint256"],[ui(t.tree),t.threshold]),t.checkpoint])}function UF(t){return t.threshold!==void 0&&t.weight!==void 0&&t.members!==void 0}function gf(t){return Ln(t)||da(t)?[t]:ha(t)?[{threshold:t.threshold,weight:t.weight,members:gf(t.tree)}]:pa(t)?[]:[...gf(t.left),...gf(t.right)]}function WC(t){return pa(t)?!0:Cs(t)?WC(t.left)||WC(t.right):!1}function ype(t){return{threshold:t.threshold,checkpoint:t.checkpoint,members:gf(t.tree)}}const zF=(t,e)=>t.map(r=>UF(r)?{tree:e(r.members),threshold:r.threshold,weight:r.weight}:r);function y8(t){if(t.length===0)throw new Error("Empty members array");return zF(t,y8).reduce((r,n)=>({left:r,right:n}))}function g8(t){if(t.length===0)throw new Error("Empty members array");const e=zF(t,g8);for(let r=e.length;r>1;r=r/2)for(let n=0;n=r?e[n]=e[i]:e[n]={left:e[i],right:e[s]}}return e[0]}function b8(t){return t.length>8?g8(t):y8(t)}function WF(t,e=b8){return{version:2,threshold:t.threshold,checkpoint:t.checkpoint,tree:e(t.members)}}function wy(t,e){return da(t)?t.subdigest===e:Cs(t)?wy(t.left,e)||wy(t.right,e):!1}function HC(t){const e=[t],r=new Set;for(;e.length>0;){const n=e.pop();ha(n)?e.push(n.tree):Cs(n)?(e.push(n.left),e.push(n.right)):Ln(n)&&r.add({address:n.address,weight:J.from(n.weight).toNumber()})}return Array.from(r)}function Ey(t){return Cs(t)?Ey(t.left)&&Ey(t.right):!pa(t)}const Tb={isWalletConfig:t=>t.version===2&&t.threshold!==void 0&&t.tree!==void 0,imageHashOf:t=>m8(t),hasSubdigest:(t,e)=>wy(t.tree,e),checkpointOf:t=>J.from(t.checkpoint),signersOf:t=>HC(t.tree),fromSimple:t=>WF({threshold:t.threshold,checkpoint:t.checkpoint,members:t.signers.map(e=>({address:e.address,weight:e.weight}))}),isComplete:t=>Ey(t.tree),update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new Br(rn.mainModuleUpgradable.abi);return{entrypoint:t,transactions:[{to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[Tb.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}]}},decodeTransaction:function(t){var e,r,n,i;const s=new Br(rn.mainModuleUpgradable.abi);if(t.transactions.length!==1)throw new Error("Invalid transaction bundle, expected 1 transaction");const o=t.transactions[0].data;if(!o)throw new Error("Invalid transaction bundle, expected data");const a=s.decodeFunctionData(s.getFunction("updateImageHash"),o);if(!a)throw new Error("Invalid transaction bundle, expected valid data");if(t.transactions[0].to!==t.entrypoint)throw new Error("Invalid transaction bundle, expected to be sent to entrypoint");if(t.transactions[0].delegateCall)throw new Error("Invalid transaction bundle, expected not to be a delegateCall");if(!t.transactions[0].revertOnError)throw new Error("Invalid transaction bundle, expected revertOnError");if(!tr.eq((e=(r=t.transactions[0])==null?void 0:r.value)!=null?e:0))throw new Error("Invalid transaction bundle, expected value to be 0");if(!tr.eq((n=(i=t.transactions[0])==null?void 0:i.gasLimit)!=null?n:0))throw new Error("Invalid transaction bundle, expected value to be 0");return{address:t.entrypoint,newImageHash:a[0],kind:void 0}}},toJSON:function(t){return JSON.stringify({version:t.version,threshold:J.from(t.threshold).toString(),checkpoint:J.from(t.checkpoint).toString(),tree:Qh(t.tree)})},fromJSON:function(t){const e=JSON.parse(t);return{version:e.version,threshold:J.from(e.threshold),checkpoint:J.from(e.checkpoint),tree:Yh(e.tree)}},editConfig:function(t,e){var r,n;const i=gf(t.tree);if(e.add)for(const s of e.add)i.find(o=>Ln(o)&&o.address===s.address)||i.push({address:s.address,weight:s.weight});if(e.remove)for(const s of e.remove){const o=i.findIndex(a=>Ln(a)&&a.address===s);o>=0&&i.splice(o,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,checkpoint:(n=e.checkpoint)!=null?n:t.checkpoint,tree:b8(i)}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=Wh(t,r,[],0);if(a.gte(t.threshold))return o}const n=HC(t.tree);for(const{address:i}of n.sort(({weight:s},{weight:o})=>s-o)){const s="0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02";r.set(i,{signature:s,isDynamic:!1});const{encoded:o,weight:a}=Wh(t,r,[],0);if(a.gte(t.threshold))return o}return Wh(t,r,[],0).encoded}};var gpe=Object.freeze({__proto__:null,isSignerLeaf:Ln,isSubdigestLeaf:da,topologyToJSON:Qh,topologyFromJSON:Yh,isNestedLeaf:ha,isNodeLeaf:pa,isLeaf:v8,isNode:Cs,isTopology:ppe,encodeSignerLeaf:BF,decodeSignerLeaf:FF,isEncodedSignerLeaf:jF,hashNode:ui,leftFace:vpe,isWalletConfig:mpe,imageHash:m8,isSimpleNestedMember:UF,topologyToMembers:gf,hasUnknownNodes:WC,toSimpleWalletConfig:ype,legacyTopologyBuilder:y8,merkleTopologyBuilder:g8,optimized2SignersTopologyBuilder:b8,toWalletConfig:WF,hasSubdigest:wy,signersOf:HC,isComplete:Ey,ConfigCoder:Tb}),bpe=Object.freeze({__proto__:null});const wpe={config:Tb,signature:Pb},HF=2,qF={version:HF,factory:"0xFaA5c0b14d1bED5C888Ca655B9a8A5911F78eF4A",guestModule:"0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE",mainModule:"0xfBf8f1A5E00034762D928f46d438B947f5d4065d",mainModuleUpgradable:"0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var Ve=Object.freeze({__proto__:null,config:gpe,signature:hpe,context:bpe,chained:dpe,coders:wpe,version:HF,DeployedWalletContext:qF});function qC(t,e){const r=Be(We(["bytes","bytes32"],[t.walletCreationCode,dt(t.mainModule,32)])),n=Be(We(["bytes1","address","bytes32","bytes32"],["0xff",t.factory,e,r]));return qe(br(n,12))}async function Epe(t,e,r,n,i,s){return(await Promise.all(nj.map(async a=>{try{const c=a.signature.SignatureCoder.decode(te(r)),l=await a.signature.SignatureCoder.recover(c,{address:t,digest:te(e),chainId:n},i),u=a.config.ConfigCoder.imageHashOf(l.config);if(qC(s[a.version],u).toLowerCase()===t.toLowerCase())return!0;const d=await a.signature.SignatureCoder.recover(c,{address:t,digest:te(e),chainId:n},i),h=a.config.ConfigCoder.imageHashOf(d.config);return qC(s[a.version],h).toLowerCase()===t.toLowerCase()}catch{}return!1}))).some(a=>a)}function xpe(t){const e=Object.keys(t).length;for(let r=1;r<=e;r++){const n=t[r];if(!n||n.version!==r)return!1}return!0}function Cpe(t){const e=Object.keys(t).length;return t[e]}const Spe={1:IF,2:qF};var kpe=Object.freeze({__proto__:null,addressOf:qC,isValidCounterfactual:Epe,isValidVersionedContext:xpe,latestContext:Cpe,defaultContexts:Spe});const Ib=`tuple( + */var _b=C,U0e=xS;function z0e(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var W0e=typeof Object.is=="function"?Object.is:z0e,H0e=U0e.useSyncExternalStore,q0e=_b.useRef,V0e=_b.useEffect,G0e=_b.useMemo,K0e=_b.useDebugValue;oB.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var s=q0e(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=G0e(function(){function c(h){if(!l){if(l=!0,u=h,h=n(h),i!==void 0&&o.hasValue){var p=o.value;if(i(p,h))return f=p}return f=h}if(p=f,W0e(u,h))return p;var v=n(h);return i!==void 0&&i(p,v)?p:(u=h,f=v)}var l=!1,u,f,d=r===void 0?null:r;return[function(){return c(e())},d===null?void 0:function(){return c(d())}]},[e,r,n,i]);var a=H0e(t,s[0],s[1]);return V0e(function(){o.hasValue=!0,o.value=a},[a]),K0e(a),a};sB.exports=oB;var aB=sB.exports;function Q0e({queryClient:t=new bS({defaultOptions:{queries:{cacheTime:1e3*60*60*24,networkMode:"offlineFirst",refetchOnWindowFocus:!1,retry:0},mutations:{networkMode:"offlineFirst"}}}),storage:e=eB({storage:typeof window<"u"&&window.localStorage?window.localStorage:ZF}),persister:r=typeof window<"u"?zle({key:"cache",storage:e,serialize:i=>i,deserialize:i=>i}):void 0,...n}){const i=R0e({...n,storage:e});return r&&Lue({queryClient:t,persister:r,dehydrateOptions:{shouldDehydrateQuery:s=>s.cacheTime!==0&&s.queryKey[0].persist!==!1}}),Object.assign(i,{queryClient:t})}var cB=C.createContext(void 0),Pb=C.createContext(void 0);function Y0e({children:t,config:e}){return C.createElement(cB.Provider,{children:C.createElement(CS,{children:t,client:e.queryClient,context:Pb}),value:e})}function Tb(){const t=C.useContext(cB);if(!t)throw new Error(["`useConfig` must be used within `WagmiConfig`.\n","Read more: https://wagmi.sh/react/WagmiConfig"].join(` +`));return t}var J0e=xS.useSyncExternalStore;function X0e(t){return Array.isArray(t)}function Z0e(t){if(!ST(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const r=e.prototype;return!(!ST(r)||!r.hasOwnProperty("isPrototypeOf"))}function ST(t){return Object.prototype.toString.call(t)==="[object Object]"}function e1e(t,e,r){return X0e(t)?typeof e=="function"?{...r,queryKey:t,queryFn:e}:{...e,queryKey:t}:t}function t1e(t){return JSON.stringify(t,(e,r)=>Z0e(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):typeof r=="bigint"?r.toString():r)}function r1e(t,e){return typeof t=="function"?t(...e):!!t}function n1e(t,e){const r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(e.trackedProps.add(n),t[n])})}),r}function i1e(t,e){const r=ub({context:t.context}),n=VL(),i=GL(),s=r.defaultQueryOptions({...t,queryKeyHashFn:t1e});s._optimisticResults=n?"isRestoring":"optimistic",s.onError&&(s.onError=yt.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=yt.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=yt.batchCalls(s.onSettled)),s.suspense&&typeof s.staleTime!="number"&&(s.staleTime=1e3),(s.suspense||s.useErrorBoundary)&&(i.isReset()||(s.retryOnMount=!1));const[o]=C.useState(()=>new e(r,s)),a=o.getOptimisticResult(s);if(J0e(C.useCallback(f=>n?()=>{}:o.subscribe(yt.batchCalls(f)),[o,n]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),C.useEffect(()=>{i.clearReset()},[i]),C.useEffect(()=>{o.setOptions(s,{listeners:!1})},[s,o]),s.suspense&&a.isLoading&&a.isFetching&&!n)throw o.fetchOptimistic(s).then(({data:f})=>{var d,h;(d=s.onSuccess)==null||d.call(s,f),(h=s.onSettled)==null||h.call(s,f,null)}).catch(f=>{var d,h;i.clearReset(),(d=s.onError)==null||d.call(s,f),(h=s.onSettled)==null||h.call(s,void 0,f)});if(a.isError&&!i.isReset()&&!a.isFetching&&r1e(s.useErrorBoundary,[a.error,o.getCurrentQuery()]))throw a.error;const c=a.status==="loading"&&a.fetchStatus==="idle"?"idle":a.status,l=c==="idle",u=c==="loading"&&a.fetchStatus==="fetching";return{...a,defaultedOptions:s,isIdle:l,isLoading:u,observer:o,status:c}}function t8(t,e,r){const n=OL(t,e,r);return Oue({context:Pb,...n})}function s1e(t,e,r){const n=e1e(t,e,r),i=i1e({context:Pb,...n},wS),s={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?s:n1e(s,i.observer)}var o1e=()=>ub({context:Pb});function lB({chainId:t}={}){return aB.useSyncExternalStoreWithSelector(e=>N0e({chainId:t},e),()=>WC({chainId:t}),()=>WC({chainId:t}),e=>e,(e,r)=>e.uid===r.uid)}function K2({chainId:t}){return[{entity:"walletClient",chainId:t,persist:!1}]}function a1e({queryKey:[{chainId:t}]}){return rB({chainId:t})}function r8({chainId:t,suspense:e,onError:r,onSettled:n,onSuccess:i}={}){const{connector:s}=kn(),o=Ib({chainId:t}),a=s1e(K2({chainId:o}),a1e,{cacheTime:0,enabled:!!s,staleTime:1/0,suspense:e,onError:r,onSettled:n,onSuccess:i}),c=o1e();return C.useEffect(()=>D0e({chainId:o},u=>{u?c.invalidateQueries(K2({chainId:o})):c.removeQueries(K2({chainId:o}))}),[c,o]),a}function Ib({chainId:t}={}){return lB({chainId:t}).chain.id}function c1e(){const[,t]=C.useReducer(e=>e+1,0);return t}var Q2=t=>typeof t=="object"&&!Array.isArray(t);function uB(t,e,r=e,n=BC){const i=C.useRef([]),s=aB.useSyncExternalStoreWithSelector(t,e,r,o=>o,(o,a)=>{if(Q2(o)&&Q2(a)&&i.current.length){for(const c of i.current)if(!n(o[c],a[c]))return!1;return!0}return n(o,a)});if(Q2(s)){const o={...s};return Object.defineProperties(o,Object.entries(o).reduce((a,[c,l])=>({...a,[c]:{configurable:!1,enumerable:!0,get:()=>(i.current.includes(c)||i.current.push(c),l)}}),{})),o}return s}function kn({onConnect:t,onDisconnect:e}={}){const r=Tb(),n=C.useCallback(a=>F0e(a),[r]),i=uB(n,nB),s=C.useRef(),o=s.current;return C.useEffect(()=>{(o==null?void 0:o.status)!=="connected"&&i.status==="connected"&&(t==null||t({address:i.address,connector:i.connector,isReconnected:(o==null?void 0:o.status)==="reconnecting"||(o==null?void 0:o.status)===void 0})),(o==null?void 0:o.status)==="connected"&&i.status==="disconnected"&&(e==null||e()),s.current=i},[t,e,o,i]),i}var l1e=t=>[{entity:"connect",...t}],u1e=t=>{const{connector:e,chainId:r}=t;if(!e)throw new Error("connector is required");return $0e({connector:e,chainId:r})};function fB({chainId:t,connector:e,onError:r,onMutate:n,onSettled:i,onSuccess:s}={}){const o=Tb(),{data:a,error:c,isError:l,isIdle:u,isLoading:f,isSuccess:d,mutate:h,mutateAsync:p,reset:v,status:b,variables:y}=t8(l1e({connector:e,chainId:t}),u1e,{onError:r,onMutate:n,onSettled:i,onSuccess:s}),m=C.useCallback(S=>h({chainId:(S==null?void 0:S.chainId)??t,connector:(S==null?void 0:S.connector)??e}),[t,e,h]),g=C.useCallback(S=>p({chainId:(S==null?void 0:S.chainId)??t,connector:(S==null?void 0:S.connector)??e}),[t,e,p]);return{connect:m,connectAsync:g,connectors:o.connectors,data:a,error:c,isError:l,isIdle:u,isLoading:f,isSuccess:d,pendingConnector:y==null?void 0:y.connector,reset:v,status:b,variables:y}}var f1e=[{entity:"disconnect"}],d1e=()=>M0e();function dB({onError:t,onMutate:e,onSettled:r,onSuccess:n}={}){const{error:i,isError:s,isIdle:o,isLoading:a,isSuccess:c,mutate:l,mutateAsync:u,reset:f,status:d}=t8(f1e,d1e,{...t?{onError(h,p,v){t(h,v)}}:{},onMutate:e,...r?{onSettled(h,p,v,b){r(p,b)}}:{},...n?{onSuccess(h,p,v){n(v)}}:{}});return{disconnect:l,disconnectAsync:u,error:i,isError:s,isIdle:o,isLoading:a,isSuccess:c,reset:f,status:d}}function an(){const t=Tb(),e=C.useCallback(r=>B0e(r),[t]);return uB(e,iB)}var h1e=t=>[{entity:"switchNetwork",...t}],p1e=t=>{const{chainId:e}=t;if(!e)throw new Error("chainId is required");return L0e({chainId:e})};function n8({chainId:t,throwForSwitchChainNotSupported:e,onError:r,onMutate:n,onSettled:i,onSuccess:s}={}){var I;const o=Tb(),a=c1e(),{data:c,error:l,isError:u,isIdle:f,isLoading:d,isSuccess:h,mutate:p,mutateAsync:v,reset:b,status:y,variables:m}=t8(h1e({chainId:t}),p1e,{onError:r,onMutate:n,onSettled:i,onSuccess:s}),g=C.useCallback(F=>p({chainId:F??t}),[t,p]),S=C.useCallback(F=>v({chainId:F??t}),[t,v]);C.useEffect(()=>o.subscribe(({chains:j,connector:H})=>({chains:j,connector:H}),a),[o,a]);let P,T;const w=!!((I=o.connector)!=null&&I.switchChain);return(e||w)&&(P=g,T=S),{chains:o.chains??[],data:c,error:l,isError:u,isIdle:f,isLoading:d,isSuccess:h,pendingChainId:m==null?void 0:m.chainId,reset:b,status:y,switchNetwork:P,switchNetworkAsync:T,variables:m}}const v1e=[{inputs:[{internalType:"bytes32",type:"bytes32"}],name:"getAlternativeSignature",outputs:[{internalType:"string",type:"string"}],stateMutability:"view",type:"function"}];var m1e=Object.freeze({__proto__:null,abi:v1e});const y1e=[{type:"function",name:"isValidSignature",constant:!0,inputs:[{type:"bytes32"},{type:"bytes"}],outputs:[{type:"bytes4"}],payable:!1,stateMutability:"view"}],g1e={isValidSignatureBytes32:"0x1626ba7e"};var b1e=Object.freeze({__proto__:null,abi:y1e,returns:g1e});const w1e=[{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC1271Revert",type:"error"},{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC6492DeployFailed",type:"error"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSig",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"allowSideEffects",type:"bool"},{internalType:"bool",name:"deployAlreadyDeployed",type:"bool"}],name:"isValidSigImpl",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffects",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffectsNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];var E1e=Object.freeze({__proto__:null,abi:w1e});const x1e=[{type:"function",name:"deploy",constant:!1,inputs:[{type:"address"},{type:"bytes32"}],outputs:[],payable:!0,stateMutability:"payable"}];var C1e=Object.freeze({__proto__:null,abi:x1e});const S1e=[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"}];var k1e=Object.freeze({__proto__:null,abi:S1e});const A1e=[{type:"function",name:"updateImageHash",constant:!0,inputs:[{type:"bytes32"}],outputs:[],payable:!1,stateMutability:"view"},{type:"function",name:"imageHash",constant:!0,inputs:[],outputs:[{type:"bytes32"}],payable:!1,stateMutability:"view"}];var _1e=Object.freeze({__proto__:null,abi:A1e});const P1e=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"knownImageHashes",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"lastImageHashUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}];var T1e=Object.freeze({__proto__:null,abi:P1e});const I1e=[{inputs:[{internalType:"address",name:"",type:"address"}],name:"requireFreshSigner",outputs:[],stateMutability:"nonpayable",type:"function"}];var O1e=Object.freeze({__proto__:null,abi:I1e});const rn={erc6492:E1e,erc5719:m1e,erc1271:b1e,factory:C1e,mainModule:k1e,mainModuleUpgradable:_1e,sequenceUtils:T1e,requireFreshSigner:O1e},R1e=Object.freeze(Object.defineProperty({__proto__:null,walletContracts:rn},Symbol.toStringTag,{value:"Module"}));function wy(){return wy=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),me({},n)).then(i=>ye(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),me({},n)).then(i=>ye(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),me({},n)).then(i=>ye(i).then(s=>({status:s.status}))),this.getSequenceContext=n=>this.fetch(this.url("GetSequenceContext"),me({},n)).then(i=>ye(i).then(s=>({data:s.data}))),this.getAuthToken=(n,i)=>this.fetch(this.url("GetAuthToken"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status,jwtToken:o.jwtToken,address:o.address,user:o.user}))),this.sendPasswordlessLink=(n,i)=>this.fetch(this.url("SendPasswordlessLink"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status}))),this.friendList=(n,i)=>this.fetch(this.url("FriendList"),me(n,i)).then(s=>ye(s).then(o=>({page:o.page,friends:o.friends}))),this.getFriendByAddress=(n,i)=>this.fetch(this.url("GetFriendByAddress"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status,friend:o.friend}))),this.searchFriends=(n,i)=>this.fetch(this.url("SearchFriends"),me(n,i)).then(s=>ye(s).then(o=>({friends:o.friends}))),this.addFriend=(n,i)=>this.fetch(this.url("AddFriend"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status,friend:o.friend}))),this.updateFriendNickname=(n,i)=>this.fetch(this.url("UpdateFriendNickname"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status,friend:o.friend}))),this.removeFriend=(n,i)=>this.fetch(this.url("RemoveFriend"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status}))),this.contractCall=(n,i)=>this.fetch(this.url("ContractCall"),me(n,i)).then(s=>ye(s).then(o=>({returns:o.returns}))),this.decodeContractCall=(n,i)=>this.fetch(this.url("DecodeContractCall"),me(n,i)).then(s=>ye(s).then(o=>({call:o.call}))),this.lookupContractCallSelectors=(n,i)=>this.fetch(this.url("LookupContractCallSelectors"),me(n,i)).then(s=>ye(s).then(o=>({signatures:o.signatures}))),this.userStorageFetch=(n,i)=>this.fetch(this.url("UserStorageFetch"),me(n,i)).then(s=>ye(s).then(o=>({object:o.object}))),this.userStorageSave=(n,i)=>this.fetch(this.url("UserStorageSave"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok}))),this.userStorageDelete=(n,i)=>this.fetch(this.url("UserStorageDelete"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok}))),this.userStorageFetchAll=(n,i)=>this.fetch(this.url("UserStorageFetchAll"),me(n,i)).then(s=>ye(s).then(o=>({objects:o.objects}))),this.getMoonpayLink=(n,i)=>this.fetch(this.url("GetMoonpayLink"),me(n,i)).then(s=>ye(s).then(o=>({signedUrl:o.signedUrl}))),this.getSardineClientToken=n=>this.fetch(this.url("GetSardineClientToken"),me({},n)).then(i=>ye(i).then(s=>({token:s.token}))),this.isUsingGoogleMail=(n,i)=>this.fetch(this.url("IsUsingGoogleMail"),me(n,i)).then(s=>ye(s).then(o=>({yes:o.yes}))),this.resolveENSAddress=(n,i)=>this.fetch(this.url("ResolveENSAddress"),me(n,i)).then(s=>ye(s).then(o=>({address:o.address,ok:o.ok}))),this.isValidSignature=(n,i)=>this.fetch(this.url("IsValidSignature"),me(n,i)).then(s=>ye(s).then(o=>({isValid:o.isValid}))),this.isValidMessageSignature=(n,i)=>this.fetch(this.url("IsValidMessageSignature"),me(n,i)).then(s=>ye(s).then(o=>({isValid:o.isValid}))),this.isValidTypedDataSignature=(n,i)=>this.fetch(this.url("IsValidTypedDataSignature"),me(n,i)).then(s=>ye(s).then(o=>({isValid:o.isValid}))),this.isValidETHAuthProof=(n,i)=>this.fetch(this.url("IsValidETHAuthProof"),me(n,i)).then(s=>ye(s).then(o=>({isValid:o.isValid}))),this.getCoinPrices=(n,i)=>this.fetch(this.url("GetCoinPrices"),me(n,i)).then(s=>ye(s).then(o=>({tokenPrices:o.tokenPrices}))),this.getCollectiblePrices=(n,i)=>this.fetch(this.url("GetCollectiblePrices"),me(n,i)).then(s=>ye(s).then(o=>({tokenPrices:o.tokenPrices}))),this.getExchangeRate=(n,i)=>this.fetch(this.url("GetExchangeRate"),me(n,i)).then(s=>ye(s).then(o=>({exchangeRate:o.exchangeRate}))),this.memoryStore=(n,i)=>this.fetch(this.url("MemoryStore"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok}))),this.memoryLoad=(n,i)=>this.fetch(this.url("MemoryLoad"),me(n,i)).then(s=>ye(s).then(o=>({value:o.value}))),this.listPayCardsOnFile=n=>this.fetch(this.url("ListPayCardsOnFile"),me({},n)).then(i=>ye(i).then(s=>({payCards:s.payCards}))),this.savePayCard=(n,i)=>this.fetch(this.url("SavePayCard"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok,payCard:o.payCard}))),this.updatePayCardCVC=(n,i)=>this.fetch(this.url("UpdatePayCardCVC"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok}))),this.deletePayCard=(n,i)=>this.fetch(this.url("DeletePayCard"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok}))),this.smartRampQuote=(n,i)=>this.fetch(this.url("SmartRampQuote"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status,quoteDetails:o.quoteDetails}))),this.smartRampPurchase=(n,i)=>this.fetch(this.url("SmartRampPurchase"),me(n,i)).then(s=>ye(s).then(o=>({processing:o.processing,receipt:o.receipt}))),this.smartRampWaitOrderConfirmation=(n,i)=>this.fetch(this.url("SmartRampWaitOrderConfirmation"),me(n,i)).then(s=>ye(s).then(o=>({done:o.done,receipt:o.receipt}))),this.smartRampGetOrder=(n,i)=>this.fetch(this.url("SmartRampGetOrder"),me(n,i)).then(s=>ye(s).then(o=>({order:o.order}))),this.smartRampCheckCardAuthorization=(n,i)=>this.fetch(this.url("SmartRampCheckCardAuthorization"),me(n,i)).then(s=>ye(s).then(o=>({cardAuth:o.cardAuth}))),this.smartRampOrdersList=(n,i)=>this.fetch(this.url("SmartRampOrdersList"),me(n,i)).then(s=>ye(s).then(o=>({page:o.page,orders:o.orders}))),this.smartRampGetOrderTxnHash=(n,i)=>this.fetch(this.url("SmartRampGetOrderTxnHash"),me(n,i)).then(s=>ye(s).then(o=>({txnHash:o.txnHash,txnSuccessful:o.txnSuccessful}))),this.smartRampSubmitCardAuthorization=(n,i)=>this.fetch(this.url("SmartRampSubmitCardAuthorization"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status}))),this.adminSmartRampGetOrder=(n,i)=>this.fetch(this.url("AdminSmartRampGetOrder"),me(n,i)).then(s=>ye(s).then(o=>({order:o.order}))),this.adminSmartRampListCompletedOrders=(n,i)=>this.fetch(this.url("AdminSmartRampListCompletedOrders"),me(n,i)).then(s=>ye(s).then(o=>({orders:o.orders}))),this.adminSmartRampListPendingOrders=(n,i)=>this.fetch(this.url("AdminSmartRampListPendingOrders"),me(n,i)).then(s=>ye(s).then(o=>({pendingOrders:o.pendingOrders}))),this.getInviteInfo=n=>this.fetch(this.url("GetInviteInfo"),me({},n)).then(i=>ye(i).then(s=>({inviteInfo:s.inviteInfo}))),this.isValidAccessCode=(n,i)=>this.fetch(this.url("IsValidAccessCode"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status}))),this.internalClaimAccessCode=(n,i)=>this.fetch(this.url("InternalClaimAccessCode"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status}))),this.walletRecover=(n,i)=>this.fetch(this.url("WalletRecover"),me(n,i)).then(s=>ye(s).then(o=>({encryptedWallet:o.encryptedWallet}))),this.blockNumberAtTime=(n,i)=>this.fetch(this.url("BlockNumberAtTime"),me(n,i)).then(s=>ye(s).then(o=>({blocks:o.blocks}))),this.paperSessionSecret=(n,i)=>this.fetch(this.url("PaperSessionSecret"),me(n,i)).then(s=>ye(s).then(o=>({secret:o.secret}))),this.paperSessionSecret2=(n,i)=>this.fetch(this.url("PaperSessionSecret2"),me(n,i)).then(s=>ye(s).then(o=>({secret:o.secret}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const me=(t={},e={})=>({method:"POST",headers:wy({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),ye=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),kT=typeof global=="object"?global.fetch:window.fetch;class Hh extends hB{constructor(e,r,n){super(e.endsWith("/")?e.slice(0,-1):e,kT),this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=wy({},s.headers,o),kT(i,s)},this.projectAccessKey=r,this.jwtAuth=n,this.fetch=this._fetch}}const B1e=Object.freeze(Object.defineProperty({__proto__:null,API:hB,SequenceAPIClient:Hh,SmartRampOrderStatus:D1e,SmartRampTxnStatus:L1e,SortOrder:F1e,WebRPCSchemaHash:N1e,WebRPCSchemaVersion:M1e,WebRPCVersion:$1e},Symbol.toStringTag,{value:"Module"})),pB="3.7.5",j1e=pB,U1e=typeof atob=="function",z1e=typeof btoa=="function",kd=typeof Buffer=="function",AT=typeof TextDecoder=="function"?new TextDecoder:void 0,_T=typeof TextEncoder=="function"?new TextEncoder:void 0,W1e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",yh=Array.prototype.slice.call(W1e),rv=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(yh),H1e=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Xr=String.fromCharCode.bind(String),PT=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),vB=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),mB=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),yB=t=>{let e,r,n,i,s="";const o=t.length%3;for(let a=0;a255||(n=t.charCodeAt(a++))>255||(i=t.charCodeAt(a++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|i,s+=yh[e>>18&63]+yh[e>>12&63]+yh[e>>6&63]+yh[e&63]}return o?s.slice(0,o-3)+"===".substring(o):s},i8=z1e?t=>btoa(t):kd?t=>Buffer.from(t,"binary").toString("base64"):yB,HC=kd?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,i=t.length;ne?vB(HC(t)):HC(t),q1e=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?Xr(192|e>>>6)+Xr(128|e&63):Xr(224|e>>>12&15)+Xr(128|e>>>6&63)+Xr(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return Xr(240|e>>>18&7)+Xr(128|e>>>12&63)+Xr(128|e>>>6&63)+Xr(128|e&63)}},V1e=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,gB=t=>t.replace(V1e,q1e),TT=kd?t=>Buffer.from(t,"utf8").toString("base64"):_T?t=>HC(_T.encode(t)):t=>i8(gB(t)),bf=(t,e=!1)=>e?vB(TT(t)):TT(t),IT=t=>bf(t,!0),G1e=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,K1e=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return Xr((r>>>10)+55296)+Xr((r&1023)+56320);case 3:return Xr((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return Xr((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},bB=t=>t.replace(G1e,K1e),wB=t=>{if(t=t.replace(/\s+/g,""),!H1e.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r="",n,i;for(let s=0;s>16&255):i===64?Xr(e>>16&255,e>>8&255):Xr(e>>16&255,e>>8&255,e&255);return r},s8=U1e?t=>atob(mB(t)):kd?t=>Buffer.from(t,"base64").toString("binary"):wB,EB=kd?t=>PT(Buffer.from(t,"base64")):t=>PT(s8(t).split("").map(e=>e.charCodeAt(0))),xB=t=>EB(CB(t)),Q1e=kd?t=>Buffer.from(t,"base64").toString("utf8"):AT?t=>AT.decode(EB(t)):t=>bB(s8(t)),CB=t=>mB(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),qC=t=>Q1e(CB(t)),Y1e=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},SB=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),kB=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,SB(r));t("fromBase64",function(){return qC(this)}),t("toBase64",function(e){return bf(this,e)}),t("toBase64URI",function(){return bf(this,!0)}),t("toBase64URL",function(){return bf(this,!0)}),t("toUint8Array",function(){return xB(this)})},AB=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,SB(r));t("toBase64",function(e){return Hv(this,e)}),t("toBase64URI",function(){return Hv(this,!0)}),t("toBase64URL",function(){return Hv(this,!0)})},J1e=()=>{kB(),AB()},Hl={version:pB,VERSION:j1e,atob:s8,atobPolyfill:wB,btoa:i8,btoaPolyfill:yB,fromBase64:qC,toBase64:bf,encode:bf,encodeURI:IT,encodeURL:IT,utob:gB,btou:bB,decode:qC,isValid:Y1e,fromUint8Array:Hv,toUint8Array:xB,extendString:kB,extendUint8Array:AB,extendBuiltins:J1e};var VC=function(){return VC=Object.assign||function(e){for(var r,n=1,i=arguments.length;n0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]0&&(i.types.Claims.push({name:"app",type:"string"}),i.message.app=this.claims.app),this.claims.iat&&this.claims.iat>0&&(i.types.Claims.push({name:"iat",type:"int64"}),i.message.iat=this.claims.iat),this.claims.exp&&this.claims.exp>0&&(i.types.Claims.push({name:"exp",type:"int64"}),i.message.exp=this.claims.exp),this.claims.n&&this.claims.n>0&&(i.types.Claims.push({name:"n",type:"uint64"}),i.message.n=this.claims.n),this.claims.typ&&this.claims.typ.length>0&&(i.types.Claims.push({name:"typ",type:"string"}),i.message.typ=this.claims.typ),this.claims.ogn&&this.claims.ogn.length>0&&(i.types.Claims.push({name:"ogn",type:"string"}),i.message.ogn=this.claims.ogn),this.claims.v&&this.claims.v.length>0&&(i.types.Claims.push({name:"v",type:"string"}),i.message.v=this.claims.v),i},t}(),Z1e=function(t){if(t.app==="")return{ok:!1,err:new Error("claims: app is empty")};var e=Math.round(new Date().getTime()/1e3),r=5*60,n=60*60*24*365+r;return t.v===""?{ok:!1,err:new Error("claims: ethauth version is empty")}:t.iat&&t.iat!==0&&(t.iat>e+r||t.iate+n?{ok:!1,err:new Error("claims: token has expired")}:{ok:!0}},epe=function(t,e,r){return sl(void 0,void 0,void 0,function(){var n,i;return ol(this,function(s){return n=r.messageDigest(),i=G$(n,r.signature),i.slice(0,2)==="0x"&&i.length===42&&i.toLowerCase()===r.address.toLowerCase()?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]})})},tpe=function(t,e,r){return sl(void 0,void 0,void 0,function(){var n,i,s,o,a;return ol(this,function(c){switch(c.label){case 0:return!t||t===void 0?[2,{isValid:!1}]:(n=r.messageDigest(),[4,t.getCode(r.address)]);case 1:if(i=c.sent(),i==="0x"||i.length<=2)throw new Error("ValidateContractAccountProof failed. unable to fetch wallet contract code");return s=["function isValidSignature(bytes32, bytes) public view returns (bytes4)"],o=new cd(r.address,s,t),[4,o.isValidSignature(n,re(r.signature))];case 2:return a=c.sent(),a===rpe?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]}})})},rpe="0x1626ba7e",_B="1",GC="eth",npe={name:"ETHAuth",version:_B},i1=function(){function t(){for(var e=[],r=0;r0&&(c+="."+i.extra),[2,c]}})})},this.decodeProof=function(i,s){return s===void 0&&(s=!1),sl(n,void 0,void 0,function(){var o,a,c,l,u,f,d,h,p,v;return ol(this,function(b){switch(b.label){case 0:if(o=i.split("."),o.length<4||o.length>5)throw new Error("ethauth: invalid proof string");if(a=o[0],c=o[1],l=o[2],u=o[3],f=o[4],a!==GC)throw new Error("ethauth: not an ethauth proof");return d=Hl.decode(l),h=JSON.parse(d),p=new Ob({address:c,claims:h,signature:u,extra:f}),[4,this.validateProof(p,s)];case 1:if(v=b.sent(),!v)throw new Error("ethauth: proof is invalid");return[2,p]}})})},this.validateProof=function(i,s){return s===void 0&&(s=!1),sl(n,void 0,void 0,function(){var o,a;return ol(this,function(c){switch(c.label){case 0:if(o=this.validateProofClaims(i),o.err)throw new Error("ethauth: proof claims are invalid ".concat(o.err));return s===!0?[3,2]:[4,this.validateProofSignature(i)];case 1:if(a=c.sent(),a!==!0)throw new Error("ethauth: proof signature is invalid");c.label=2;case 2:return[2,!0]}})})},this.validateProofSignature=function(i){return sl(n,void 0,void 0,function(){var s,c,o,a,c;return ol(this,function(l){switch(l.label){case 0:s=[],c=0,l.label=1;case 1:if(!(cHl.encode(t,!0),o8=t=>Hl.encode(JSON.stringify(t),!0),spe=t=>{if(t!=null)return Hl.decode(t)},a8=t=>{if(t!=null)return JSON.parse(Hl.decode(t))};function PB(t){return t!=null&&(J.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||je(t)||typeof t=="bigint"||ca(t))}const c8=t=>re(Be(typeof t=="string"?wt(t):t)),TB=(t,e,r)=>He(["string","uint256","address","bytes32"],["",e,t,r]),KC=(t,e,r)=>Be(TB(t,e,r)),IB=()=>typeof window>"u"&&typeof process=="object",ope=()=>!IB(),OB=t=>{const e=t.split(".");if(e.length!==3)throw new Error("invalid jwt");return JSON.parse(Hl.decode(e[1]))};function Ey(){return Ey=Object.assign?Object.assign.bind():function(t){for(var e=1;ege.configure(t),s1=(t,e,r)=>{const n={};return r&&r.length>0&&(n.Authorization=`BEARER ${r}`),e&&e.length>0&&(n["X-Access-Key"]=e),{url:t,headers:n,skipFetchSetup:!0,fetchOptions:{mode:"cors",cache:"force-cache",credentials:"same-origin",redirect:"follow",referrer:"client"}}};let cpe=class{constructor(){this.cache=new Map}do(e,r,n,...i){e=`${e}:${Be(wt(JSON.stringify(i,lpe)))}`;let s=this.cache.get(e);if(s&&s.expiration&&new Date>=s.expiration&&(s=void 0,this.cache.delete(e)),!s){const o={promise:n(...i)};r!==void 0&&(o.promise=o.promise.then(a=>(o.expiration=new Date(Date.now()+r),a))),s=o,this.cache.set(e,s)}return s.promise}};function lpe(t,e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).sort()):e}function l8(t,e){return function(...r){const n=Array.prototype.slice.call(r);return new Promise(async(i,s)=>{try{n.push((o,a)=>o?s(o):i(a)),await t.apply(e,n)}catch(o){s(o)}})}}function upe(t,e){const r=encodeURIComponent(t),n=encodeURIComponent(JSON.stringify(e));return`${r}=${n}`}function fpe(t){const e=t.split("&"),r={};for(const n of e){const i=n.split("=");r[decodeURIComponent(i[0])]=JSON.parse(decodeURIComponent(i[1]))}return r}const u8=(t=0,e=Number.MAX_SAFE_INTEGER)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),$B=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\d.]+/);return e&&e.length>0?e[0].trim():""},MB=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\w\s\d]+/);return e&&e.length>0?e[0].trim():""},NB=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\w\d.\-:\/]+/);return e&&e.length>0?e[0].trim():""},dpe=t=>new Promise(e=>{const r=setTimeout(()=>{clearTimeout(r),e()},t)}),DB=t=>{const e=Ey({},t.types);return delete e.EIP712Domain,qr.hash(t.domain,e,t.message)},Q1=t=>re(DB(t)),{defineReadOnly:hpe,getStatic:ppe,resolveProperties:vpe,checkProperties:mpe,shallowCopy:ype,deepCopy:gpe}=hX,bpe=t=>t.replace(/([^:]\/)\/+/g,"$1"),wpe=Object.freeze(Object.defineProperty({__proto__:null,Logger:RB,PromiseCache:cpe,base64Decode:spe,base64DecodeObject:a8,base64Encode:ipe,base64EncodeObject:o8,checkProperties:mpe,configureLogger:ape,deepCopy:gpe,defineReadOnly:hpe,encodeMessageDigest:c8,encodeTypedDataDigest:Q1,encodeTypedDataHash:DB,getEthersConnectionInfo:s1,getRandomInt:u8,getStatic:ppe,isBigNumberish:PB,isBrowser:ope,isNode:IB,jwtDecodeClaims:OB,logger:ge,packMessageData:TB,promisify:l8,queryStringFromObject:upe,queryStringToObject:fpe,resolveProperties:vpe,sanitizeAlphanumeric:MB,sanitizeHost:NB,sanitizeNumberString:$B,shallowCopy:ype,sleep:dpe,subDigestOf:KC,urlClean:bpe},Symbol.toStringTag,{value:"Module"}));function Zt(){return Zt=Object.assign?Object.assign.bind():function(t){for(var e=1;etypeof t=="number"?t:t.chainId?t.chainId:J.from(t).toNumber(),xpe=t=>{if(t)return LB(t)},FB=(t,e=!1,r=!1)=>{if(!t)throw new Error("invalid network config: empty config");const n=[];if(Array.isArray(t)?n.push(...t):n.push(t),n.length===0){if(e)throw new Error("invalid network config: empty config");return!1}const i=n.map(l=>l.chainId).sort(),s=i.filter((l,u)=>i.indexOf(l)!==u);if(s.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${s}`);return!1}n.forEach(l=>l.name=l.name.toLowerCase());const o=n.map(l=>l.name).sort(),a=o.filter((l,u)=>o.indexOf(l)!==u);if(a.length>0){if(e)throw new Error(`invalid network config: duplicate network names ${a}`);return!1}let c=!1;for(let l=0;l(FB(t,!0,e),t),Cpe=(t,e=!0)=>{const r=t.map(i=>i.chainId).sort(),n=r.filter((i,s)=>r.indexOf(i)!==s);if(n.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${n}`);return!1}return!0},Spe=(t,e)=>{if(!(!t||!e)){if(!t.chainId&&!t.name)throw new Error("failed to update network config: source config is missing chainId or name");if(t.chainId!==e.chainId&&t.name!==e.name)throw new Error("failed to update network config: one of chainId or name must match");t.rpcUrl&&(e.rpcUrl=t.rpcUrl,e.provider=void 0),t.provider&&(e.provider=t.provider),t.relayer&&(e.relayer=t.relayer)}},jB=t=>BB(UB(t)),xs=(t,e)=>{if(typeof e=="string")if(e.startsWith("0x")){const r=J.from(e).toNumber();return t.find(n=>n.chainId===r)}else return t.find(r=>r.name===e||`${r.chainId}`===e);else{if(typeof e=="number")return t.find(r=>r.chainId===e);if(e.chainId)return t.find(r=>r.chainId===e.chainId);if(J.isBigNumber(e)){const r=e.toNumber();return t.find(n=>n.chainId===r)}else return}},kpe=(t,e)=>t?t.name===e||t.chainId===e:!1,Ape=t=>{const e={};for(let r=0;r{if(!t)return[];const e=t.sort((n,i)=>n.chainId===i.chainId?0:n.chainIdn.isDefaultChain);return r>0&&e.splice(0,0,e.splice(r,1)[0]),e},Rb=(t,e)=>typeof t=="string"?(e=e||{},t.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,function(r,n){let i=e[n];return typeof i=="function"?i=i():i==null?i="":typeof i=="object"||typeof i=="symbol"?i=i.toString():i=i.valueOf(),i})):"",f8=t=>Rb("https://${network}-indexer.sequence.app",{network:t}),zB=t=>Rb("https://${network}-relayer.sequence.app",{network:t}),WB=t=>Rb("https://nodes.sequence.app/${network}",{network:t});function d8(t){return xs(Vf,t)}function HB(t){return J.isBigNumber(t)?t:PB(t)?J.from(t):J.from(t.chainId)}const Cr=t=>{const e=WB(t);return{rpcUrl:e,relayer:{url:zB(t),provider:{url:e}},indexerUrl:f8(t)}},Vf=jB([Zt({},Ut[ce.POLYGON],Cr("polygon"),{isDefaultChain:!0,isAuthChain:!0}),Zt({},Ut[ce.MAINNET],Cr("mainnet")),Zt({},Ut[ce.BSC],Cr("bsc")),Zt({},Ut[ce.AVALANCHE],Cr("avalanche")),Zt({},Ut[ce.ARBITRUM],Cr("arbitrum")),Zt({},Ut[ce.ARBITRUM_NOVA],Cr("arbitrum-nova")),Zt({},Ut[ce.OPTIMISM],Cr("optimism")),Zt({},Ut[ce.OPTIMISM_SEPOLIA],Cr("optimism-sepolia")),Zt({},Ut[ce.POLYGON_ZKEVM],Cr("polygon-zkevm")),Zt({},Ut[ce.GNOSIS],Cr("gnosis")),Zt({},Ut[ce.RINKEBY],Cr("rinkeby"),{disabled:!0}),Zt({},Ut[ce.GOERLI],Cr("goerli"),{disabled:!0}),Zt({},Ut[ce.SEPOLIA],Cr("sepolia")),Zt({},Ut[ce.POLYGON_MUMBAI],Cr("mumbai")),Zt({},Ut[ce.BSC_TESTNET],Cr("bsc-testnet")),Zt({},Ut[ce.ARBITRUM_SEPOLIA],Cr("arbitrum-sepolia")),Zt({},Ut[ce.BASE],Cr("base")),Zt({},Ut[ce.BASE_SEPOLIA],Cr("base-sepolia")),Zt({},Ut[ce.HOMEVERSE_TESTNET],Cr("homeverse-testnet")),Zt({},Ut[ce.AVALANCHE_TESTNET],Cr("avalanche-testnet")),Zt({},Ut[ce.HARDHAT],{rpcUrl:"http://localhost:8545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:8545"}}}),Zt({},Ut[ce.HARDHAT_2],{rpcUrl:"http://localhost:9545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:9545"}}})]),Gf="2.0";class h8{constructor(e,r){this.sender=r,e&&this.setMiddleware(e)}setMiddleware(e){this.handler=qB(e,this.sender.sendAsync)}sendAsync(e,r,n){try{this.handler(e,r,n)}catch(i){r(i,void 0)}}}const qB=(t,e)=>{if(t.length===0)return e;const r=i=>i.sendAsyncMiddleware?i.sendAsyncMiddleware:i;let n;n=r(t[t.length-1])(e);for(let i=t.length-2;i>=0;i--)n=r(t[i])(n);return n};function VB(t){return t!==void 0&&t.send!==void 0&&t.constructor.defaultUrl!==void 0&&t.detectNetwork!==void 0&&t.getSigner!==void 0&&t.perform!==void 0}function GB(t){return t!==void 0&&t.sendAsync!==void 0}let _pe=0;class xy{constructor(e,r){this.sendAsync=(n,i,s)=>{this.send(n.method,n.params,s||this.defaultChainId).then(o=>{i(void 0,{jsonrpc:"2.0",id:n.id,result:o})}).catch(o=>{i(o,void 0)})},this.defaultChainId=r,VB(e)?this.send=e.send.bind(e):GB(e)?this.send=(n,i,s)=>new Promise((o,a)=>{e.sendAsync({jsonrpc:Gf,id:++_pe,method:n,params:i},(c,l)=>{c?a(c):o(l?l.result:void 0)},s||this.defaultChainId)}):this.send=e,this.request=(n,i)=>this.send(n.method,n.params,i)}}class Ppe{constructor(e){this.sendAsync=(r,n)=>{this.provider.send(r.method,r.params).then(i=>{n(void 0,{jsonrpc:"2.0",id:r.id,result:i})}).catch(i=>{n(i,void 0)})},this.send=this.sendAsync,this.provider=e}}class Tpe{constructor(e){e?this.isAllowedFunc=e:this.isAllowedFunc=r=>!0,this.sendAsyncMiddleware=QC(this.isAllowedFunc)}setIsAllowedFunc(e){this.isAllowedFunc=e,this.sendAsyncMiddleware=QC(this.isAllowedFunc)}}const QC=t=>e=>(r,n,i)=>{if(!t(r))throw new Error("allowProvider middleware precondition is unmet.");e(r,n,i)};class p8{constructor(e){this.cachableJsonRpcMethods=["net_version","eth_chainId","eth_accounts","sequence_getWalletContext","sequence_getNetworks"],this.cachableJsonRpcMethodsByBlock=["eth_call","eth_getCode"],this.cacheByBlockResetLock=!1,this.sendAsyncMiddleware=r=>(n,i,s)=>{if(this.cachableJsonRpcMethods.includes(n.method)||this.cachableJsonRpcMethodsByBlock.includes(n.method)){const o=this.cacheKey(n.method,n.params,s||this.defaultChainId),a=this.getCacheValue(o);if(a&&a!==""){i(void 0,{jsonrpc:"2.0",id:n.id,result:a});return}}r(n,(o,a,c)=>{if((this.cachableJsonRpcMethods.includes(n.method)||this.cachableJsonRpcMethodsByBlock.includes(n.method))&&a&&a.result&&this.shouldCacheResponse(n,a)){const l=this.cacheKey(n.method,n.params,c||this.defaultChainId);this.cachableJsonRpcMethods.includes(n.method)?this.setCacheValue(l,a.result):this.setCacheByBlockValue(l,a.result)}i(o,a)},s||this.defaultChainId)},this.cacheKey=(r,n,i)=>{let s="";return i?s=`${i}:${r}:`:s=`:${r}:`,!n||n.length===0?s+"[]":s+JSON.stringify(n)},this.getCache=()=>this.cache,this.setCache=r=>{this.cache=r,this.onUpdateCallback&&this.onUpdateCallback()},this.getCacheValue=r=>{if(this.cache[r])return this.cache[r];if(this.cacheByBlock[r])return this.cacheByBlock[r]},this.setCacheValue=(r,n)=>{this.cache[r]=n,this.onUpdateCallback&&this.onUpdateCallback(r,n)},this.setCacheByBlockValue=(r,n)=>{this.cacheByBlock[r]=n,this.cacheByBlockResetLock||(this.cacheByBlockResetLock=!0,setTimeout(()=>{this.cacheByBlockResetLock=!1,this.cacheByBlock={}},1500))},this.shouldCacheResponse=(r,n)=>!(!n||!n.result||r.method==="eth_getCode"&&n.result.length<=2),this.clearCache=()=>{this.cache={},this.cacheByBlock={}},this.cache={},this.cacheByBlock={},this.defaultChainId=e==null?void 0:e.defaultChainId,e!=null&&e.blockCache?(e==null?void 0:e.blockCache)!==!0&&(this.cachableJsonRpcMethodsByBlock=e==null?void 0:e.blockCache):this.cachableJsonRpcMethodsByBlock=[]}onUpdate(e){this.onUpdateCallback=e}}class KB{constructor(e){this.sendAsyncMiddleware=r=>(n,i,s)=>{const{id:o,method:a}=n;switch(a){case"net_version":if(this.options.chainId){i(void 0,{jsonrpc:"2.0",id:o,result:`${this.options.chainId}`});return}break;case"eth_chainId":if(this.options.chainId){i(void 0,{jsonrpc:"2.0",id:o,result:te(this.options.chainId)});return}break;case"eth_accounts":if(this.options.accountAddress){i(void 0,{jsonrpc:"2.0",id:o,result:[Ve(this.options.accountAddress)]});return}break;case"sequence_getWalletContext":if(this.options.walletContext){i(void 0,{jsonrpc:"2.0",id:o,result:this.options.walletContext});return}break}r(n,i,s)},this.options=e}}const QB=t=>(e,r,n)=>{t(e,(i,s)=>{if(!i&&s&&s.error)throw typeof s.error=="string"?new Error(s.error):new Error(s.error.message);r(i,s)},n)},YB=t=>(e,r,n)=>{const i=n?` chainId:${n}`:"";ge.info(`[provider request]${i} id:${e.id} method:${e.method} params:`,e.params),t(e,(s,o)=>{s?ge.warn(`[provider response]${i} id:${e.id} method:${e.method} params:`,e.params,"error:",s):ge.info(`[provider response]${i} id:${e.id} method:${e.method} params:`,e.params,"response:",o),r(s,o)},n)},Ipe=t=>e=>(r,n,i)=>{const s=t(r),{id:o,method:a}=r;switch(a){case"net_version":n(void 0,{jsonrpc:"2.0",id:o,result:`${s}`});return;case"eth_chainId":n(void 0,{jsonrpc:"2.0",id:o,result:te(s)});return}e(r,n,i)},JB=["personal_sign","eth_sign","eth_signTypedData","eth_signTypedData_v4","eth_sendTransaction","eth_sendRawTransaction","sequence_sign","sequence_signTypedData_v4","sequence_getWalletContext","sequence_getWalletConfig","sequence_getWalletState","sequence_getNetworks","sequence_updateConfig","sequence_publishConfig","sequence_gasRefundOptions","sequence_getNonce","sequence_relay","eth_decrypt","eth_getEncryptionPublicKey","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];class Ope{constructor(e){this.sendAsyncMiddleware=r=>(n,i,s)=>{if(JB.includes(n.method)){this.provider.sendAsync(n,i,s);return}r(n,i,s)},this.provider=e}}class Rpe{constructor(e){this.privateJsonRpcMethods=["net_version","eth_chainId","eth_accounts",...JB],this.sendAsyncMiddleware=r=>(n,i)=>{if(this.provider&&!this.privateJsonRpcMethods.includes(n.method)){this.provider.send(n.method,n.params).then(s=>{i(void 0,{jsonrpc:"2.0",id:n.id,result:s})}).catch(s=>i(s));return}ge.debug("[public-provider] sending request to signer window",n.method),r(n,i)},e&&this.setRpcUrl(e)}getRpcUrl(){return this.rpcUrl}setRpcUrl(e){!e||e===""?(this.rpcUrl=void 0,this.provider=void 0):(this.rpcUrl=e,this.provider=new Ko(e))}}class XB{constructor(){this.singleflightJsonRpcMethods=["eth_chainId","net_version","eth_call","eth_getCode","eth_blockNumber","eth_getBalance","eth_getStorageAt","eth_getTransactionCount","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_getBlockByHash","eth_getBlockByNumber","eth_getTransactionByHash","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionReceipt","eth_getUncleByBlockHashAndIndex","eth_getUncleByBlockNumberAndIndex","eth_getLogs"],this.sendAsyncMiddleware=e=>(r,n,i)=>{if(!this.singleflightJsonRpcMethods.includes(r.method)){e(r,n,i);return}const s=this.requestKey(r.method,r.params||[],i);if(!this.inflight[s])this.inflight[s]=[];else{this.inflight[s].push({id:r.id,callback:n});return}e(r,(o,a,c)=>{n(o,a);for(let l=0;l{let i="";return n?i=`${n}:${e}:`:i=`:${e}:`,!r||r.length===0?i+"[]":i+JSON.stringify(r)},this.inflight={}}}class $pe extends Ko{constructor(e,r){super(e,r==null?void 0:r.chainId),this.send=(a,c)=>this._sender.send(a,c),this.fetch=(a,c)=>{const l={method:a,params:c,id:this._nextId++,jsonrpc:"2.0"};return I1(this.connection,JSON.stringify(l),Mpe).then(f=>f,f=>{throw f})};const n=r==null?void 0:r.chainId,i=r==null?void 0:r.middlewares,s=r==null?void 0:r.blockCache;this._chainId=n;const o=new h8(i??[new KB({chainId:n}),new XB,new p8({defaultChainId:n,blockCache:s})],new xy(this.fetch,n));this._sender=new xy(o,n)}async getNetwork(){const e=this._chainId;if(e){const r=Ut[e],n=(r==null?void 0:r.name)||"",i=r==null?void 0:r.ensAddress;return{name:n,chainId:e,ensAddress:i}}else{const r=await this.send("eth_chainId",[]);return this._chainId=J.from(r).toNumber(),this.getNetwork()}}}function Mpe(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}const Npe=Object.freeze(Object.defineProperty({__proto__:null,AllowProvider:Tpe,CachedProvider:p8,ChainId:ce,EagerProvider:KB,JsonRpcExternalProvider:Ppe,JsonRpcProvider:$pe,JsonRpcRouter:h8,JsonRpcSender:xy,JsonRpcVersion:Gf,NetworkType:ft,PublicProvider:Rpe,SigningProvider:Ope,SingleflightMiddleware:XB,allNetworks:Vf,allowProviderMiddleware:QC,checkNetworkConfig:kpe,createJsonRpcMiddlewareStack:qB,ensureUniqueNetworks:Cpe,ensureValidNetworks:BB,exceptionProviderMiddleware:QB,findNetworkConfig:xs,findSupportedNetwork:d8,getChainId:LB,indexerURL:f8,isJsonRpcHandler:GB,isJsonRpcProvider:VB,isNetworkConfig:Epe,isValidNetworkConfig:FB,loggingProviderMiddleware:YB,maybeChainId:xpe,networkProviderMiddleware:Ipe,networks:Ut,networksIndex:Ape,nodesURL:WB,relayerURL:zB,sortNetworks:UB,stringTemplate:Rb,toChainIdNumber:HB,updateNetworkConfig:Spe,validateAndSortNetworks:jB},Symbol.toStringTag,{value:"Module"}));function wn(){return wn=Object.assign?Object.assign.bind():function(t){for(var e=1;e{if(m8(i))return He(["uint8","uint8","address"],[xl.Address,i.weight,i.address]);if(i.isDynamic){const s=re(i.signature);return He(["uint8","uint8","address","uint16","bytes"],[xl.DynamicSignature,i.weight,i.address,s.length,s])}return He(["uint8","uint8","bytes"],[xl.EOASignature,i.weight,i.signature])});return He(["uint16",...new Array(n.length).fill("bytes")],[r,...n])}async function ij(t,e,r){const n=Y1(e),i=await Promise.all(t.signers.map(async s=>{if(m8(s))return s;if(s.isDynamic){if(!s.address)throw new Error("Dynamic signature part must have address");if(!v8(s.address,n,s.signature,r))throw new Error(`Invalid dynamic signature part ${s.address}`);return{address:s.address,weight:s.weight,signature:s.signature}}else return{address:J1(n,s.signature),weight:s.weight,signature:s.signature}}));return{version:1,payload:e,subdigest:n,config:{version:1,threshold:t.threshold,signers:i}}}function qh(t,e,r,n){if(r.length!==0)throw new Error("Explicit subdigests not supported on v1");let i=J.from(0);const s=t.signers.map(a=>{if(!e.has(a.address))return a;const c=e.get(a.address),l=re(c.signature);return i=i.add(a.weight),c.isDynamic||l.length!==66?wn({},a,{isDynamic:!0,signature:c.signature,address:a.address}):wn({},a,{isDynamic:!1,signature:c.signature})});return{encoded:y8({version:1,threshold:t.threshold,signers:s}),weight:i}}const g8={decode:t=>nj(t),encode:t=>y8(t),trim:async t=>t,supportsNoChainId:!0,recover:(t,e,r)=>ij(t,e,r),encodeSigners:(t,e,r,n)=>qh(t,e,r),hasEnoughSigningPower:(t,e)=>{const{weight:r}=g8.encodeSigners(t,e,[],0);return r.gte(t.threshold)},chainSignatures:(t,e)=>{throw new Error("Signature chaining not supported on v1")},hashSetImageHash:function(t){throw new Error("Image hash not supported on v1")},signaturesOf(t){return t.signers.filter(e=>e.signature!==void 0).map(e=>({address:e.address,signature:e.signature}))},signaturesOfDecoded:function(t){return t.signers.map(e=>e.signature).filter(e=>e!==void 0)}};var Hpe=Object.freeze({__proto__:null,SignaturePartType:xl,isAddressMember:m8,isUnrecoveredSignatureMember:tj,isUnrecoveredSignature:rj,decodeSignature:nj,encodeSignature:y8,recoverSignature:ij,encodeSigners:qh,SignatureCoder:g8});const b8={isWalletConfig:t=>t.version===1&&t.threshold!==void 0&&t.signers!==void 0,imageHashOf:t=>t.signers.reduce((e,r)=>Be(Bn.encode(["bytes32","uint8","address"],[e,r.weight,r.address])),He(["uint256"],[t.threshold])),hasSubdigest:(t,e)=>!1,isComplete:t=>!0,checkpointOf:t=>J.from(0),signersOf:t=>t.signers.map(e=>({address:e.address,weight:J.from(e.weight).toNumber()})),fromSimple:t=>{if(!tr.eq(t.checkpoint))throw new Error("v1 wallet config does not support checkpoint");return{version:1,threshold:t.threshold,signers:t.signers}},update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new jr([...rn.mainModule.abi,...rn.mainModuleUpgradable.abi]),s=[];return(!n||n==="first")&&s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImplementation"),[r.mainModuleUpgradable]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[b8.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),{entrypoint:t,transactions:s}},decodeTransaction:function(t){throw new Error("Function not implemented.")}},toJSON:function(t){const e=t.signers.map(r=>({weight:J.from(r.weight).toString(),address:r.address}));return JSON.stringify({version:t.version,threshold:J.from(t.threshold).toString(),signers:e})},fromJSON:function(t){const e=JSON.parse(t),r=e.signers.map(n=>({weight:J.from(n.weight),address:n.address}));return{version:e.version,threshold:J.from(e.threshold),signers:r}},editConfig:function(t,e){var r;const n=t.signers.slice();if(e.checkpoint&&!tr.eq(e.checkpoint))throw new Error("v1 wallet config does not support checkpoint");if(e.add)for(const i of e.add)n.find(s=>s.address===i.address)||n.push({weight:i.weight,address:i.address});if(e.remove)for(const i of e.remove){const s=n.findIndex(o=>o.address===i);s>=0&&n.splice(s,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,signers:n}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=qh(t,r,[]);if(a.gte(t.threshold))return o}const n=t.signers;for(const{address:i}of n.sort(({weight:s},{weight:o})=>J.from(s).sub(o).toNumber())){const s="0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02";r.set(i,{signature:s,isDynamic:!1});const{encoded:o,weight:a}=qh(t,r,[]);if(a.gte(t.threshold))return o}return qh(t,r,[]).encoded}};var qpe=Object.freeze({__proto__:null,ConfigCoder:b8});const sj=1,oj={version:sj,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var Oo=Object.freeze({__proto__:null,config:qpe,signature:Hpe,version:sj,DeployedWalletContext:oj});const w8="0x8713a7c4465f6fbee2b6e9d6646d1d9f83fec929edfc4baf661f3c865bdd04d1";function aj(t){return Be(cj(t))}function cj(t){return He(["bytes32","bytes32"],[w8,t])}function lj(t){const e=re(t);if(e.length===64&&te(e.slice(0,32))===w8)return te(e.slice(32,64))}function Vpe(t){return lj(t)!==void 0}var Gpe=Object.freeze({__proto__:null,SetImageHashPrefix:w8,hashSetImageHash:aj,messageSetImageHash:cj,decodeMessageSetImageHash:lj,isMessageSetImageHash:Vpe});let Gr=function(t){return t[t.Legacy=0]="Legacy",t[t.Dynamic=1]="Dynamic",t[t.NoChainIdDynamic=2]="NoChainIdDynamic",t[t.Chained=3]="Chained",t}({}),pr=function(t){return t[t.Signature=0]="Signature",t[t.Address=1]="Address",t[t.DynamicSignature=2]="DynamicSignature",t[t.Node=3]="Node",t[t.Branch=4]="Branch",t[t.Subdigest=5]="Subdigest",t[t.Nested=6]="Nested",t}({});const Cy=66;function ql(t){return t.left!==void 0&&t.right!==void 0}function Ad(t){return t.tree!==void 0}function X1(t){return t.unrecovered&&t.signature!==void 0&&t.isDynamic!==void 0}function Sy(t){let e=re(t),r;const n=(i,s)=>i?i.right?{left:i,right:s}:{left:i.left,right:s}:{left:s};for(;e.length>0;){const i=e[0];switch(e=e.slice(1),i){case pr.Signature:{const s=e[0],o=te(e.slice(1,Cy+1));r=n(r,{signature:o,weight:s,unrecovered:!0,isDynamic:!1}),e=e.slice(Cy+1)}break;case pr.Address:{const s=e[0],o=Ve(te(e.slice(1,21)));r=n(r,{address:o,weight:s}),e=e.slice(21)}break;case pr.DynamicSignature:{const s=e[0],o=Ve(te(e.slice(1,21))),a=e[21]<<16|e[22]<<8|e[23],c=te(e.slice(24,24+a));r=n(r,{address:o,signature:c,weight:s,unrecovered:!0,isDynamic:!0}),e=e.slice(24+a)}break;case pr.Node:{const s=te(e.slice(0,32));r=n(r,{nodeHash:s}),e=e.slice(32)}break;case pr.Branch:{const s=e[0]<<16|e[1]<<8|e[2],o=Sy(e.slice(3,3+s));r=n(r,o),e=e.slice(3+s)}break;case pr.Subdigest:{const s=te(e.slice(0,32));r=n(r,{subdigest:s}),e=e.slice(32)}break;case pr.Nested:{const s=e[0],o=e[1]<<8|e[2],a=e[3]<<16|e[4]<<8|e[5],c=Sy(e.slice(6,6+a));r=n(r,{weight:s,threshold:o,tree:c}),e=e.slice(6+a)}break;default:throw new Error(`Unknown signature part type: ${i}: ${te(e)}`)}}if(!r)throw new Error("Empty signature tree");return r.right?r:r.left}class uj extends Error{constructor(e){super(`Invalid signature leaf: ${JSON.stringify(e)}`),this.leaf=e}}async function Cl(t,e,r){if(ql(t)){const[n,i]=await Promise.all([Cl(t.left,e,r),Cl(t.right,e,r)]);return{left:n,right:i}}if(Ad(t))return{weight:t.weight,threshold:t.threshold,tree:await Cl(t.tree,e,r)};if(X1(t))if(t.isDynamic){if(!t.address)throw new Error("Dynamic signature leaf without address");if(!await v8(t.address,e,t.signature,r))throw new uj(t);return{weight:t.weight,address:t.address,signature:t.signature,subdigest:e}}else return{weight:t.weight,address:J1(e,t.signature),signature:t.signature,subdigest:e};return t}const hn={concat:(t,e)=>He(["bytes","bytes"],[t,e]),node:t=>He(["uint8","bytes32"],[pr.Node,t]),branch:t=>{const e=re(t);return He(["uint8","uint24","bytes"],[pr.Branch,e.length,e])},nested:(t,e,r)=>{const n=re(r);return He(["uint8","uint8","uint16","uint24","bytes"],[pr.Nested,t,e,n.length,n])},subdigest:t=>He(["uint8","bytes32"],[pr.Subdigest,t]),signature:(t,e)=>He(["uint8","uint8","bytes"],[pr.Signature,t,e]),dynamicSignature:(t,e,r)=>{const n=re(r);return He(["uint8","uint8","address","uint24","bytes"],[pr.DynamicSignature,t,e,n.length,n])},address:(t,e)=>He(["uint8","uint8","address"],[pr.Address,t,e])};function Vh(t,e,r,n,i={}){const s=Gh(t.tree,e,r,i);return J.from(n).isZero()?{encoded:He(["uint8","uint16","uint32","bytes"],[Gr.NoChainIdDynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:J.from(t.threshold).gt(255)?{encoded:He(["uint8","uint16","uint32","bytes"],[Gr.Dynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:{encoded:He(["uint8","uint8","uint32","bytes"],[Gr.Legacy,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}}function Gh(t,e,r,n={}){const i=!n.disableTrim;if(As(t)){const s=Gh(t.left,e,r),o=Gh(t.right,e,r),a=Fn(t.left),c=Fn(t.right);return i&&s.weight.eq(0)&&o.weight.eq(0)&&!a&&!c?{encoded:hn.node(fi(t)),weight:tr}:i&&o.weight.eq(0)&&!c?{encoded:hn.concat(s.encoded,hn.node(fi(t.right))),weight:s.weight}:i&&s.weight.eq(0)&&!a?{encoded:hn.concat(hn.node(fi(t.left)),hn.branch(o.encoded)),weight:o.weight}:{encoded:hn.concat(s.encoded,hn.branch(o.encoded)),weight:s.weight.add(o.weight)}}if(pa(t)){const s=Gh(t.tree,e,r);return i&&s.weight.eq(0)?{encoded:hn.node(fi(t)),weight:tr}:{encoded:hn.nested(t.weight,t.threshold,s.encoded),weight:s.weight}}if(va(t))return{encoded:hn.node(fi(t)),weight:tr};if(ha(t)){const s=r.includes(t.subdigest);return{encoded:hn.node(fi(t)),weight:s?VR:tr}}if(Fn(t))if(e.has(t.address)){const o=e.get(t.address),a=o.signature;return n.forceDynamicEncoding||o.isDynamic?{encoded:hn.dynamicSignature(t.weight,t.address,a),weight:J.from(t.weight)}:{encoded:hn.signature(t.weight,a),weight:J.from(t.weight)}}else return{encoded:hn.address(t.weight,t.address),weight:tr};throw new Error(`Invalid topology - unknown error: ${JSON.stringify(t)}`)}function E8(t){return C8(t)?E8(t.suffix[t.suffix.length-1]):t.config}function x8(t){return t.type!==void 0&&t.decoded!==void 0&&t.version!==void 0&&t.version===2}function Z1(t){return t.suffix!==void 0&&Array.isArray(t.suffix)&&t.suffix.every(x8)}function fj(t){return t.type!==void 0&&t.config!==void 0&&t.digest!==void 0&&t.version!==void 0&&t.version===2}function C8(t){return t.chain!==void 0&&Array.isArray(t.chain)&&t.chain.every(fj)}function $b(t){const e=re(t),r=e[0];switch(r){case Gr.Legacy:return{version:2,type:Gr.Legacy,decoded:qv(e)};case Gr.Dynamic:return{version:2,type:Gr.Dynamic,decoded:qv(e.slice(1))};case Gr.NoChainIdDynamic:return{version:2,type:Gr.NoChainIdDynamic,decoded:qv(e.slice(1))};case Gr.Chained:return dj(e);default:throw new Error(`Invalid signature type: ${r}`)}}function qv(t){const e=re(t),r=e[0]<<8|e[1],n=e[2]<<24|e[3]<<16|e[4]<<8|e[5],i=Sy(e.slice(6));return{threshold:r,checkpoint:n,tree:i}}function dj(t){const e=re(t),r=e[0];if(r!==Gr.Chained)throw new Error(`Expected chained signature type: ${r}`);const n=[];let i=1;for(;ire(sc(s))),i=He(n.map(()=>["uint24","bytes"]).flat(),n.map(s=>[s.length,s]).flat());return He(["uint8","bytes"],[Gr.Chained,i])}function sc(t){if(Wo(t))return te(t);if(Z1(t)||C8(t))return Mb(sc(t),(t.suffix||[]).map(sc));const e=x8(t)?t.decoded:t.config;switch(t.type){case Gr.Legacy:if(J.from(e.threshold).gt(255))throw new Error(`Legacy signature threshold is too large: ${e.threshold} (max 255)`);return YC(e);case Gr.NoChainIdDynamic:case Gr.Dynamic:return He(["uint8","bytes"],[t.type,YC(e)]);case Gr.Chained:throw new Error("Unreachable code: Chained signature should be handled above");default:throw new Error(`Invalid signature type: ${t.type}`)}}function YC(t){return He(["uint16","uint32","bytes"],[t.threshold,t.checkpoint,Kh(t.tree)])}function Kh(t){if(As(t)||ql(t)){const e=re(Kh(t.right)),r=re(Kh(t.left));return As(t.right)||ql(t.right)?He(["bytes","uint8","uint24","bytes"],[r,pr.Branch,e.length,e]):He(["bytes","bytes"],[r,e])}if(pa(t)||Ad(t)){const e=re(Kh(t.tree));return He(["uint8","uint8","uint16","uint24","bytes"],[pr.Nested,t.weight,t.threshold,e.length,e])}if(X1(t)||Fn(t)&&t.signature!==void 0){const e=re(t.signature);if(t.isDynamic||e.length!==Cy){if(!t.address)throw new Error("Dynamic signature leaf must have address");return He(["uint8","uint8","address","uint24","bytes"],[pr.DynamicSignature,t.weight,t.address,e.length,e])}else return He(["uint8","uint8","bytes"],[pr.Signature,t.weight,e])}if(Fn(t))return He(["uint8","uint8","address"],[pr.Address,t.weight,t.address]);if(va(t))return He(["uint8","bytes32"],[pr.Node,t.nodeHash]);if(ha(t))return He(["uint8","bytes32"],[pr.Subdigest,t.subdigest]);throw new Error(`Unknown signature tree type: ${t}`)}function Qh(t){return As(t)?[...Qh(t.left),...Qh(t.right)]:pa(t)?Qh(t.tree):Fn(t)&&t.signature?[{address:t.address,signature:t.signature}]:[]}function Yh(t){return ql(t)?[...Yh(t.left),...Yh(t.right)]:Ad(t)?Yh(t.tree):X1(t)?[t.signature]:[]}function Vv(t){return ql(t)?[...Vv(t.left),...Vv(t.right)]:Ad(t)?Vv(t.tree):ha(t)?[t.subdigest]:[]}async function ky(t){const e=typeof t=="string"?$b(t):t;if(Z1(e)){const n=await Promise.all([ky(wn({},e,{suffix:void 0})),...e.suffix.map(i=>ky(i))]);return Mb(n[0],n.slice(1))}const{trimmed:r}=await Jh(e.decoded.tree);return sc(wn({},e,{decoded:wn({},e.decoded,{tree:r})}))}async function Jh(t,e=!0){if(ql(t)){const[r,n]=await Promise.all([Jh(t.left),Jh(t.right)]);if(r.weight===0&&n.weight===0)try{const i=await Cl(t,Mm,void 0);return{weight:0,trimmed:{nodeHash:fi(i)}}}catch{}else return{weight:r.weight+n.weight,trimmed:{left:r.trimmed,right:n.trimmed}}}if(Ad(t)){const r=await Jh(t.tree);if(r.weight===0)try{const n=await Cl(t,Mm,void 0);return{weight:0,trimmed:{nodeHash:fi(n)}}}catch{}return{weight:r.weight,trimmed:{weight:t.weight,threshold:t.threshold,tree:r.trimmed}}}return va(t)&&mj(t.nodeHash)?{weight:0,trimmed:wn({},vj(t.nodeHash))}:X1(t)||Fn(t)&&t.signature!==void 0?{weight:J.from(t.weight).toNumber(),trimmed:t}:!e&&ha(t)?{weight:1/0,trimmed:t}:{weight:0,trimmed:t}}const Nb={decode:t=>$b(t),encode:t=>sc(t),trim:t=>ky(t),supportsNoChainId:!0,recover:(t,e,r)=>S8(t,e,r),encodeSigners:(t,e,r,n)=>Vh(t,e,r,n),hasEnoughSigningPower:(t,e)=>{const{weight:r}=Nb.encodeSigners(t,e,[],0);return r.gte(t.threshold)},chainSignatures:(t,e)=>{const r=e.reverse(),n=Wo(t)?t:sc(t),i=r.map(s=>Wo(s)?s:sc(s));return Mb(n,i)},hashSetImageHash:function(t){return aj(t)},signaturesOf(t){return Qh(t.tree)},signaturesOfDecoded:function(t){return Yh(t.decoded.tree)}};var Kpe=Object.freeze({__proto__:null,SignatureType:Gr,SignaturePartType:pr,SignaturePartTypeLength:Cy,isUnrecoveredNode:ql,isUnrecoveredNestedLeaf:Ad,isUnrecoveredSignatureLeaf:X1,decodeSignatureTree:Sy,InvalidSignatureLeafError:uj,recoverTopology:Cl,partEncoder:hn,encodeSigners:Vh,encodeTree:Gh,deepestConfigOfSignature:E8,isUnrecoveredSignature:x8,isUnrecoveredChainedSignature:Z1,isSignature:fj,isChainedSignature:C8,decodeSignature:$b,decodeSignatureBody:qv,decodeChainedSignature:dj,setImageHashStruct:hj,recoverSignature:S8,encodeChain:Mb,encodeSignature:sc,encodeSignatureBody:YC,encodeSignatureTree:Kh,signaturesOf:Qh,signaturesOfDecoded:Yh,subdigestsOfDecoded:Vv,trimSignature:ky,trimUnrecoveredTree:Jh,SignatureCoder:Nb});function Fn(t){return t.address!==void 0&&t.weight!==void 0}function ha(t){return t.subdigest!==void 0&&t.address===void 0}function Xh(t){return As(t)?JSON.stringify({left:Xh(t.left),right:Xh(t.right)}):pa(t)?JSON.stringify({weight:J.from(t.weight).toString(),threshold:J.from(t.threshold).toString(),tree:Xh(t.tree)}):Fn(t)?JSON.stringify({address:t.address,weight:J.from(t.weight).toString()}):JSON.stringify(t)}function Zh(t){const e=typeof t=="string"?JSON.parse(t):t;return e.left!==void 0&&e.right!==void 0?{left:Zh(e.left),right:Zh(e.right)}:e.weight!==void 0&&e.threshold!==void 0&&e.tree!==void 0?{weight:J.from(e.weight),threshold:J.from(e.threshold),tree:Zh(e.tree)}:e.address!==void 0&&e.weight!==void 0?{address:e.address,weight:J.from(e.weight)}:e}function pa(t){return t.tree!==void 0&&t.weight!==void 0&&t.threshold!==void 0}function va(t){return t.nodeHash!==void 0}function k8(t){return Fn(t)||ha(t)||pa(t)||va(t)}function As(t){return t.left!==void 0&&t.right!==void 0}function Qpe(t){return As(t)||k8(t)}function pj(t){return He(["uint96","address"],[t.weight,t.address])}function vj(t){const e=re(t);if(e.length!==32)throw new Error("Invalid encoded string length");const r=J.from(e.slice(0,12)),n=Ve(te(e.slice(12)));return{weight:r,address:n}}function mj(t){const e=re(t);return e.length!==32?!1:e.slice(0,11).every(n=>n===0)}function fi(t){if(Fn(t))return pj(t);if(ha(t))return tc(["string","bytes32"],[`Sequence static digest: +`,t.subdigest]);if(pa(t)){const e=fi(t.tree);return tc(["string","bytes32","uint256","uint256"],[`Sequence nested config: +`,e,t.threshold,t.weight])}return va(t)?t.nodeHash:tc(["bytes32","bytes32"],[fi(t.left),fi(t.right)])}function Ype(t){const e=[];let r=t;for(;!k8(r);)e.unshift(r.right),r=r.left;return e.unshift(r),e}function Jpe(t){return t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&t.version!==void 0&&t.version===2}function A8(t){return tc(["bytes32","uint256"],[tc(["bytes32","uint256"],[fi(t.tree),t.threshold]),t.checkpoint])}function yj(t){return t.threshold!==void 0&&t.weight!==void 0&&t.members!==void 0}function wf(t){return Fn(t)||ha(t)?[t]:pa(t)?[{threshold:t.threshold,weight:t.weight,members:wf(t.tree)}]:va(t)?[]:[...wf(t.left),...wf(t.right)]}function JC(t){return va(t)?!0:As(t)?JC(t.left)||JC(t.right):!1}function Xpe(t){return{threshold:t.threshold,checkpoint:t.checkpoint,members:wf(t.tree)}}const gj=(t,e)=>t.map(r=>yj(r)?{tree:e(r.members),threshold:r.threshold,weight:r.weight}:r);function _8(t){if(t.length===0)throw new Error("Empty members array");return gj(t,_8).reduce((r,n)=>({left:r,right:n}))}function P8(t){if(t.length===0)throw new Error("Empty members array");const e=gj(t,P8);for(let r=e.length;r>1;r=r/2)for(let n=0;n=r?e[n]=e[i]:e[n]={left:e[i],right:e[s]}}return e[0]}function T8(t){return t.length>8?P8(t):_8(t)}function bj(t,e=T8){return{version:2,threshold:t.threshold,checkpoint:t.checkpoint,tree:e(t.members)}}function Ay(t,e){return ha(t)?t.subdigest===e:As(t)?Ay(t.left,e)||Ay(t.right,e):!1}function XC(t){const e=[t],r=new Set;for(;e.length>0;){const n=e.pop();pa(n)?e.push(n.tree):As(n)?(e.push(n.left),e.push(n.right)):Fn(n)&&r.add({address:n.address,weight:J.from(n.weight).toNumber()})}return Array.from(r)}function _y(t){return As(t)?_y(t.left)&&_y(t.right):!va(t)}const Db={isWalletConfig:t=>t.version===2&&t.threshold!==void 0&&t.tree!==void 0,imageHashOf:t=>A8(t),hasSubdigest:(t,e)=>Ay(t.tree,e),checkpointOf:t=>J.from(t.checkpoint),signersOf:t=>XC(t.tree),fromSimple:t=>bj({threshold:t.threshold,checkpoint:t.checkpoint,members:t.signers.map(e=>({address:e.address,weight:e.weight}))}),isComplete:t=>_y(t.tree),update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new jr(rn.mainModuleUpgradable.abi);return{entrypoint:t,transactions:[{to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[Db.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}]}},decodeTransaction:function(t){var e,r,n,i;const s=new jr(rn.mainModuleUpgradable.abi);if(t.transactions.length!==1)throw new Error("Invalid transaction bundle, expected 1 transaction");const o=t.transactions[0].data;if(!o)throw new Error("Invalid transaction bundle, expected data");const a=s.decodeFunctionData(s.getFunction("updateImageHash"),o);if(!a)throw new Error("Invalid transaction bundle, expected valid data");if(t.transactions[0].to!==t.entrypoint)throw new Error("Invalid transaction bundle, expected to be sent to entrypoint");if(t.transactions[0].delegateCall)throw new Error("Invalid transaction bundle, expected not to be a delegateCall");if(!t.transactions[0].revertOnError)throw new Error("Invalid transaction bundle, expected revertOnError");if(!tr.eq((e=(r=t.transactions[0])==null?void 0:r.value)!=null?e:0))throw new Error("Invalid transaction bundle, expected value to be 0");if(!tr.eq((n=(i=t.transactions[0])==null?void 0:i.gasLimit)!=null?n:0))throw new Error("Invalid transaction bundle, expected value to be 0");return{address:t.entrypoint,newImageHash:a[0],kind:void 0}}},toJSON:function(t){return JSON.stringify({version:t.version,threshold:J.from(t.threshold).toString(),checkpoint:J.from(t.checkpoint).toString(),tree:Xh(t.tree)})},fromJSON:function(t){const e=JSON.parse(t);return{version:e.version,threshold:J.from(e.threshold),checkpoint:J.from(e.checkpoint),tree:Zh(e.tree)}},editConfig:function(t,e){var r,n;const i=wf(t.tree);if(e.add)for(const s of e.add)i.find(o=>Fn(o)&&o.address===s.address)||i.push({address:s.address,weight:s.weight});if(e.remove)for(const s of e.remove){const o=i.findIndex(a=>Fn(a)&&a.address===s);o>=0&&i.splice(o,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,checkpoint:(n=e.checkpoint)!=null?n:t.checkpoint,tree:T8(i)}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=Vh(t,r,[],0);if(a.gte(t.threshold))return o}const n=XC(t.tree);for(const{address:i}of n.sort(({weight:s},{weight:o})=>s-o)){const s="0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02";r.set(i,{signature:s,isDynamic:!1});const{encoded:o,weight:a}=Vh(t,r,[],0);if(a.gte(t.threshold))return o}return Vh(t,r,[],0).encoded}};var Zpe=Object.freeze({__proto__:null,isSignerLeaf:Fn,isSubdigestLeaf:ha,topologyToJSON:Xh,topologyFromJSON:Zh,isNestedLeaf:pa,isNodeLeaf:va,isLeaf:k8,isNode:As,isTopology:Qpe,encodeSignerLeaf:pj,decodeSignerLeaf:vj,isEncodedSignerLeaf:mj,hashNode:fi,leftFace:Ype,isWalletConfig:Jpe,imageHash:A8,isSimpleNestedMember:yj,topologyToMembers:wf,hasUnknownNodes:JC,toSimpleWalletConfig:Xpe,legacyTopologyBuilder:_8,merkleTopologyBuilder:P8,optimized2SignersTopologyBuilder:T8,toWalletConfig:bj,hasSubdigest:Ay,signersOf:XC,isComplete:_y,ConfigCoder:Db}),eve=Object.freeze({__proto__:null});const tve={config:Db,signature:Nb},wj=2,Ej={version:wj,factory:"0xFaA5c0b14d1bED5C888Ca655B9a8A5911F78eF4A",guestModule:"0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE",mainModule:"0xfBf8f1A5E00034762D928f46d438B947f5d4065d",mainModuleUpgradable:"0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var Ge=Object.freeze({__proto__:null,config:Zpe,signature:Kpe,context:eve,chained:Gpe,coders:tve,version:wj,DeployedWalletContext:Ej});function ZC(t,e){const r=Be(He(["bytes","bytes32"],[t.walletCreationCode,dt(t.mainModule,32)])),n=Be(He(["bytes1","address","bytes32","bytes32"],["0xff",t.factory,e,r]));return Ve(br(n,12))}async function rve(t,e,r,n,i,s){return(await Promise.all($j.map(async a=>{try{const c=a.signature.SignatureCoder.decode(te(r)),l=await a.signature.SignatureCoder.recover(c,{address:t,digest:te(e),chainId:n},i),u=a.config.ConfigCoder.imageHashOf(l.config);if(ZC(s[a.version],u).toLowerCase()===t.toLowerCase())return!0;const d=await a.signature.SignatureCoder.recover(c,{address:t,digest:te(e),chainId:n},i),h=a.config.ConfigCoder.imageHashOf(d.config);return ZC(s[a.version],h).toLowerCase()===t.toLowerCase()}catch{}return!1}))).some(a=>a)}function nve(t){const e=Object.keys(t).length;for(let r=1;r<=e;r++){const n=t[r];if(!n||n.version!==r)return!1}return!0}function ive(t){const e=Object.keys(t).length;return t[e]}const sve={1:oj,2:Ej};var ove=Object.freeze({__proto__:null,addressOf:ZC,isValidCounterfactual:rve,isValidVersionedContext:nve,latestContext:ive,defaultContexts:sve});const Lb=`tuple( bool delegateCall, bool revertOnError, uint256 gasLimit, address target, uint256 value, bytes data -)[]`;function Ape(t,e,r,n){return wn({},t,{chainId:r,intent:{id:n,wallet:e}})}function _pe(t){return Be(Bn.encode(["address","uint256","bytes32"],[t.intent.wallet,t.chainId,t.intent.id]))}function Ppe(t){const e=Bn.decode(["uint256",Ib],t);if(e.length!==2||!e[0]||!e[1])throw new Error("Invalid meta transaction data");return[e[0],e[1]]}function VF(t,e){return Bn.encode(["uint256",Ib],[t,n1(e)])}function GF(t,e){return Be(VF(t,e))}function Tpe(t,e,r,n){return q1({address:t,chainId:e,digest:GF(r,n)})}function Ipe(t,e,r){return q1({address:t,chainId:e,digest:Be(Bn.encode(["string",Ib],["guest:",n1(r)]))})}function KF(t,e){return e.map(r=>w8(t,r))}function w8(t,e){if(e.to&&e.to!==lr)return{nonce:e.nonce,transaction:{delegateCall:!1,revertOnError:!1,gasLimit:e.gasLimit||0,to:e.to,value:e.value||0,data:e.data||"0x"}};{const r=new Br(rn.mainModule.abi),n=r.encodeFunctionData(r.getFunction("createContract"),[e.data]);return{nonce:e.nonce,transaction:{delegateCall:!1,revertOnError:!1,gasLimit:e.gasLimit,to:t,value:e.value||0,data:n}}}}function Ob(t){return t.delegateCall!==void 0||t.revertOnError!==void 0}function QF(t){return t.every(Ob)}function n1(t){return t.map(e=>{var r;return{delegateCall:e.delegateCall===!0,revertOnError:e.revertOnError===!0,gasLimit:e.gasLimit!==void 0?e.gasLimit:tr,target:(r=e.to)!=null?r:lr,value:e.value!==void 0?e.value:tr,data:e.data!==void 0?e.data:[]}})}function Ope(t){return t.map(e=>({delegateCall:e.delegateCall,revertOnError:e.revertOnError,gasLimit:e.gasLimit,to:e.target,value:e.value,data:e.data}))}function Rpe(t,e){const r=J.from(t),n=J.from(e),i=$R.pow(J.from(96));if(!n.div(i).eq(tr))throw new Error("Space already encoded");return n.add(r.mul(i))}function Mpe(t){const e=J.from(t),r=$R.pow(J.from(96));return[e.div(r),e.mod(r)]}function $pe(t,e){return Array.isArray(e)?QF(e)?e:KF(t,e).map(n=>n.transaction):Ob(e)?[e]:[w8(t,e).transaction]}function YF(t){return t!==void 0&&t.entrypoint!==void 0&&t.chainId!==void 0&&t.transactions!==void 0&&t.nonce!==void 0&&t.intent!==void 0&&t.intent.id!==void 0&&t.intent.wallet!==void 0&&Array.isArray(t.transactions)&&t.transactions.reduce((e,r)=>e&&Ob(r),!0)}function JF(t){return t!==void 0&&t.signature!==void 0&&t.signature!==""&&YF(t)}function Npe(t){const e=new Br(rn.mainModule.abi);return e.encodeFunctionData(e.getFunction("execute"),JF(t)?[n1(t.transactions),t.nonce,t.signature]:[n1(t.transactions),0,[]])}const XF="0x61c2926c",ZF=`tuple( +)[]`;function ave(t,e,r,n){return wn({},t,{chainId:r,intent:{id:n,wallet:e}})}function cve(t){return Be(Bn.encode(["address","uint256","bytes32"],[t.intent.wallet,t.chainId,t.intent.id]))}function lve(t){const e=Bn.decode(["uint256",Lb],t);if(e.length!==2||!e[0]||!e[1])throw new Error("Invalid meta transaction data");return[e[0],e[1]]}function xj(t,e){return Bn.encode(["uint256",Lb],[t,o1(e)])}function Cj(t,e){return Be(xj(t,e))}function uve(t,e,r,n){return Y1({address:t,chainId:e,digest:Cj(r,n)})}function fve(t,e,r){return Y1({address:t,chainId:e,digest:Be(Bn.encode(["string",Lb],["guest:",o1(r)]))})}function Sj(t,e){return e.map(r=>I8(t,r))}function I8(t,e){if(e.to&&e.to!==lr)return{nonce:e.nonce,transaction:{delegateCall:!1,revertOnError:!1,gasLimit:e.gasLimit||0,to:e.to,value:e.value||0,data:e.data||"0x"}};{const r=new jr(rn.mainModule.abi),n=r.encodeFunctionData(r.getFunction("createContract"),[e.data]);return{nonce:e.nonce,transaction:{delegateCall:!1,revertOnError:!1,gasLimit:e.gasLimit,to:t,value:e.value||0,data:n}}}}function Fb(t){return t.delegateCall!==void 0||t.revertOnError!==void 0}function kj(t){return t.every(Fb)}function o1(t){return t.map(e=>{var r;return{delegateCall:e.delegateCall===!0,revertOnError:e.revertOnError===!0,gasLimit:e.gasLimit!==void 0?e.gasLimit:tr,target:(r=e.to)!=null?r:lr,value:e.value!==void 0?e.value:tr,data:e.data!==void 0?e.data:[]}})}function dve(t){return t.map(e=>({delegateCall:e.delegateCall,revertOnError:e.revertOnError,gasLimit:e.gasLimit,to:e.target,value:e.value,data:e.data}))}function hve(t,e){const r=J.from(t),n=J.from(e),i=qR.pow(J.from(96));if(!n.div(i).eq(tr))throw new Error("Space already encoded");return n.add(r.mul(i))}function pve(t){const e=J.from(t),r=qR.pow(J.from(96));return[e.div(r),e.mod(r)]}function vve(t,e){return Array.isArray(e)?kj(e)?e:Sj(t,e).map(n=>n.transaction):Fb(e)?[e]:[I8(t,e).transaction]}function Aj(t){return t!==void 0&&t.entrypoint!==void 0&&t.chainId!==void 0&&t.transactions!==void 0&&t.nonce!==void 0&&t.intent!==void 0&&t.intent.id!==void 0&&t.intent.wallet!==void 0&&Array.isArray(t.transactions)&&t.transactions.reduce((e,r)=>e&&Fb(r),!0)}function _j(t){return t!==void 0&&t.signature!==void 0&&t.signature!==""&&Aj(t)}function mve(t){const e=new jr(rn.mainModule.abi);return e.encodeFunctionData(e.getFunction("execute"),_j(t)?[o1(t.transactions),t.nonce,t.signature]:[o1(t.transactions),0,[]])}const Pj="0x61c2926c",Tj=`tuple( bool delegateCall, bool revertOnError, uint256 gasLimit, address target, uint256 value, bytes data -)[]`,VC=(t,e)=>{const r=[],n=new Br(rn.mainModule.abi);for(const i of e){const s=re(i.data||"0x");if(i.to===t&&te(s.slice(0,4))===XF){const o=s.slice(4),a=Bn.decode([ZF],o)[0];r.push(...VC(i.to,a.map(c=>wn({},c,{to:c.target}))))}else try{const o=n.decodeFunctionData("execute",s)[0],a=VC(t,o.map(c=>wn({},c,{to:c.target})));r.push(...a)}catch{r.push(i)}}return r};var Dpe=Object.freeze({__proto__:null,MetaTransactionsType:Ib,intendTransactionBundle:Ape,intendedTransactionID:_pe,unpackMetaTransactionsData:Ppe,packMetaTransactionsData:VF,digestOfTransactions:GF,subdigestOfTransactions:Tpe,subdigestOfGuestModuleTransactions:Ipe,toSequenceTransactions:KF,toSequenceTransaction:w8,isSequenceTransaction:Ob,hasSequenceTransactions:QF,sequenceTxAbiEncode:n1,fromTxAbiEncode:Ope,encodeNonce:Rpe,decodeNonce:Mpe,fromTransactionish:$pe,isTransactionBundle:YF,isSignedTransactionBundle:JF,encodeBundleExecData:Npe,selfExecuteSelector:XF,selfExecuteAbi:ZF,unwind:VC});const ej="0x608060405234801561001057600080fd5b5060405161124a38038061124a83398101604081905261002f91610124565b600060405161003d906100dd565b604051809103906000f080158015610059573d6000803e3d6000fd5b5090506000816001600160a01b0316638f0684308686866040518463ffffffff1660e01b815260040161008e939291906101fb565b6020604051808303816000875af11580156100ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d19190610244565b9050806000526001601ff35b610fdc8061026e83390190565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561011b578181015183820152602001610103565b50506000910152565b60008060006060848603121561013957600080fd5b83516001600160a01b038116811461015057600080fd5b6020850151604086015191945092506001600160401b038082111561017457600080fd5b818601915086601f83011261018857600080fd5b81518181111561019a5761019a6100ea565b604051601f8201601f19908116603f011681019083821181831017156101c2576101c26100ea565b816040528281528960208487010111156101db57600080fd5b6101ec836020830160208801610100565b80955050505050509250925092565b60018060a01b0384168152826020820152606060408201526000825180606084015261022e816080850160208701610100565b601f01601f191691909101608001949350505050565b60006020828403121561025657600080fd5b8151801515811461026657600080fd5b939250505056fe608060405234801561001057600080fd5b50610fbc806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806376be4cea1161005057806376be4cea146100a65780638f068430146100b957806398ef1ed8146100cc57600080fd5b80631c6453271461006c5780633d787b6314610093575b600080fd5b61007f61007a366004610ad4565b6100df565b604051901515815260200160405180910390f35b61007f6100a1366004610ad4565b61023d565b61007f6100b4366004610b3e565b61031e565b61007f6100c7366004610ad4565b6108e1565b61007f6100da366004610ad4565b61096e565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061012890889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610181575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261017e91810190610c45565b60015b610232573d8080156101af576040519150601f19603f3d011682016040523d82523d6000602084013e6101b4565b606091505b508051600181900361022757816000815181106101d3576101d3610c69565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0100000000000000000000000000000000000000000000000000000000000000149250610235915050565b600092505050610235565b90505b949350505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906102879088908890889088906001908990600401610bc3565b6020604051808303816000875af19250505080156102e0575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102dd91810190610c45565b60015b610232573d80801561030e576040519150601f19603f3d011682016040523d82523d6000602084013e610313565b606091505b506000915050610235565b600073ffffffffffffffffffffffffffffffffffffffff87163b6060827f64926492649264926492649264926492649264926492649264926492649264928888610369602082610c98565b610375928b9290610cd8565b61037e91610d02565b1490508015610484576000606089828a610399602082610c98565b926103a693929190610cd8565b8101906103b39190610e18565b955090925090508415806103c45750865b1561047d576000808373ffffffffffffffffffffffffffffffffffffffff16836040516103f19190610eb2565b6000604051808303816000865af19150503d806000811461042e576040519150601f19603f3d011682016040523d82523d6000602084013e610433565b606091505b50915091508161047a57806040517f9d0d6e2d0000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b60405180910390fd5b50505b50506104be565b87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294505050505b80806104ca5750600083115b156106bb576040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b1690631626ba7e90610523908c908690600401610f2b565b602060405180830381865afa92505050801561057a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261057791810190610f44565b60015b61060f573d8080156105a8576040519150601f19603f3d011682016040523d82523d6000602084013e6105ad565b606091505b50851580156105bc5750600084115b156105db576105d08b8b8b8b8b600161031e565b9450505050506108d7565b806040517f6f2a95990000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f1626ba7e000000000000000000000000000000000000000000000000000000001480158161065f575086155b801561066b5750600085115b1561068b5761067f8c8c8c8c8c600161031e565b955050505050506108d7565b841580156106965750825b80156106a0575087155b156106af57806000526001601ffd5b94506108d79350505050565b6041871461074b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f5369676e617475726556616c696461746f72237265636f7665725369676e657260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610471565b600061075a6020828a8c610cd8565b61076391610d02565b90506000610775604060208b8d610cd8565b61077e91610d02565b905060008a8a604081811061079557610795610c69565b919091013560f81c915050601b81148015906107b557508060ff16601c14155b15610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f5369676e617475726556616c696461746f723a20696e76616c6964207369676e60448201527f617475726520762076616c7565000000000000000000000000000000000000006064820152608401610471565b6040805160008152602081018083528e905260ff831691810191909152606081018490526080810183905273ffffffffffffffffffffffffffffffffffffffff8e169060019060a0016020604051602081039080840390855afa1580156108ad573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff161496505050505050505b9695505050505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061092b9088908890889088906001908990600401610bc3565b6020604051808303816000875af115801561094a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102329190610c45565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906109b790889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610a10575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610a0d91810190610c45565b60015b610232573d808015610a3e576040519150601f19603f3d011682016040523d82523d6000602084013e610a43565b606091505b5080516001819003610a6257816000815181106101d3576101d3610c69565b8082fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610a8857600080fd5b50565b60008083601f840112610a9d57600080fd5b50813567ffffffffffffffff811115610ab557600080fd5b602083019150836020828501011115610acd57600080fd5b9250929050565b60008060008060608587031215610aea57600080fd5b8435610af581610a66565b935060208501359250604085013567ffffffffffffffff811115610b1857600080fd5b610b2487828801610a8b565b95989497509550505050565b8015158114610a8857600080fd5b60008060008060008060a08789031215610b5757600080fd5b8635610b6281610a66565b955060208701359450604087013567ffffffffffffffff811115610b8557600080fd5b610b9189828a01610a8b565b9095509350506060870135610ba581610b30565b91506080870135610bb581610b30565b809150509295509295509295565b73ffffffffffffffffffffffffffffffffffffffff8716815285602082015260a060408201528360a0820152838560c0830137600060c085830181019190915292151560608201529015156080820152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909101019392505050565b600060208284031215610c5757600080fd5b8151610c6281610b30565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115610cd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b60008085851115610ce857600080fd5b83861115610cf557600080fd5b5050820193919092039150565b80356020831015610cd2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610d7e57600080fd5b813567ffffffffffffffff80821115610d9957610d99610d3e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610ddf57610ddf610d3e565b81604052838152866020858801011115610df857600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610e2d57600080fd5b8335610e3881610a66565b9250602084013567ffffffffffffffff80821115610e5557600080fd5b610e6187838801610d6d565b93506040860135915080821115610e7757600080fd5b50610e8486828701610d6d565b9150509250925092565b60005b83811015610ea9578181015183820152602001610e91565b50506000910152565b60008251610ec4818460208701610e8e565b9190910192915050565b60008151808452610ee6816020860160208601610e8e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610c626020830184610ece565b8281526040602082015260006102356040830184610ece565b600060208284031215610f5657600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610c6257600080fdfea26469706673582212201a72aed4b15ffb05b6502997a9bb655992e06590bd26b336dfbb153d7ff6f34b64736f6c63430008120033",Lpe="0x6492649264926492649264926492649264926492649264926492649264926492";async function tj(t,e,r,n){return await t.call({data:qt([ej,new Z6().encode(["address","bytes32","bytes"],[e,r,n])])})==="0x01"}var Bpe=Object.freeze({__proto__:null,EIP_6492_OFFCHAIN_DEPLOY_CODE:ej,EIP_6492_SUFFIX:Lpe,validateEIP6492Offchain:tj});class Fpe{constructor(e){this.isDeployedCache=new Set,this.provider=e}module(e){return new sd(e,[...rn.mainModuleUpgradable.abi,...rn.mainModule.abi,...rn.erc1271.abi],this.provider)}async isDeployed(e){if(this.isDeployedCache.has(e))return!0;const n=(await this.provider.getCode(e).then(i=>re(i))).length!==0;return n&&this.isDeployedCache.add(e),n}async implementation(e){const r=Bn.encode(["address"],[e]),n=await this.provider.getStorageAt(e,r).then(i=>re(i));if(n.length===20)return qe(te(n));if(n.length===32)return Bn.decode(["address"],n)[0]}async imageHash(e){try{return await this.module(e).imageHash()}catch{}}async nonce(e,r=0){try{return await this.module(e).readNonce(r)}catch(n){if(!await this.isDeployed(e))return 0;throw n}}async isValidSignature(e,r,n){return tj(this.provider,e,r,n)}}var jpe=Object.freeze({__proto__:null,OnChainReader:Fpe});function Upe(t){return t&&t.address&&t.digest&&t.chainId!==void 0&&t.config}var he=Object.freeze({__proto__:null,config:tpe,signature:rpe,context:kpe,signer:cpe,EIP1271:spe,transaction:Dpe,reader:jpe,EIP6492:Bpe,isWalletSignRequestMetadata:Upe});const GC=[{config:l8,signature:c8},{config:Tb,signature:Pb}];function rj(t){const e=t-1;if(e<0||e>=GC.length)throw new Error(`No coder for version: ${t}`);return GC[e]}function zpe(t){return rj(t)}var Zr=Object.freeze({__proto__:null,ALL_CODERS:GC,coderFor:rj,genericCoderFor:zpe});const nj=[Io,Ve],Wpe=Object.freeze(Object.defineProperty({__proto__:null,allVersions:nj,commons:he,universal:Zr,v1:Io,v2:Ve},Symbol.toStringTag,{value:"Module"}));function Hpe(t,e,r){for(let n=0;ne.version)&&(e=r);if(e===void 0)throw new Error("No migrations");return e}async getAllMigratePresignedTransaction(e){const{address:r,fromImageHash:n,fromVersion:i,chainId:s}=e;let o=n,a=i;const c=Object.values(this.contexts),l=[];for(let u=1;ure(s).length===0))return ET;if(!n.provider)throw new Error("signer.provider is not set, but is required");return n.provider.estimateGas({from:e,to:i.to,data:i.data,value:i.value})}))).map(i=>({executed:!0,succeeded:!0,gasUsed:J.from(i).toNumber(),gasLimit:J.from(i).toNumber()}))}async getNonce(e,r,n){if(!this.provider)throw new Error("provider is not set");if(await this.provider.getCode(e)==="0x")return 0;r===void 0&&(r=0);const s=await new sd(e,rn.mainModule.abi,this.provider).readNonce(r,{blockTag:n});return he.transaction.encodeNonce(r,s)}async wait(e,r,n=this.waitPollRate,i=5){var s=this;typeof e!="string"&&(e=he.transaction.intendedTransactionID(e));let o=!1;const a=async function(u,f){let d=0;for(;!o;){try{return await u()}catch(h){if(d++,i!==void 0&&d>=i)throw ge.error(`giving up after ${d} failed attempts${f?`: ${f}`:""}`,h),h;ge.warn(`attempt #${d} failed${f?`: ${f}`:""}`,h)}n>0&&await new Promise(h=>setTimeout(h,n))}throw new Error(`timed out after ${d} failed attempts${f?`: ${f}`:""}`)},c=async function(){let u=s.fromBlockLog;if(u<0&&(u=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number")+u),typeof e!="string")throw new Error("impossible");const f=e.replace("0x","");for(;!o;){const d=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number"),h=await a(()=>s.provider.getLogs({fromBlock:Math.max(0,u-s.deltaBlocksLog),toBlock:d,topics:["0x1f180c27086c7a39ea2a7b25239d1ab92348f07ca7bb59d1438fcf527568f881"]}),`unable to get NonceChange logs for blocks ${Math.max(0,u-s.deltaBlocksLog)} to ${d}`);u=d;const v=(await Promise.all(h.map(b=>a(()=>s.provider.getTransactionReceipt(b.transactionHash),`unable to get receipt for transaction ${b.transactionHash}`)))).find(b=>b.logs.find(y=>y.topics.length===0&&y.data.replace("0x","")===f||y.topics.length===1&&y.topics[0]==="0x3dbd1590ea96dd3253a91f24e64e3a502e1225d602a5731357bc12643070ccd7"&&y.data.length>=64&&y.data.replace("0x","").startsWith(f)));if(v)return bc({receipt:v},await a(()=>s.provider.getTransaction(v.transactionHash),`unable to get transaction ${v.transactionHash}`));o||await new Promise(b=>setTimeout(b,n))}throw new Error(`Timeout waiting for transaction receipt ${e}`)};return r!==void 0?Promise.race([c(),new Promise((l,u)=>setTimeout(()=>{o=!0,u(`Timeout waiting for transaction receipt ${e}`)},r))]):c()}}function Jpe(t){return t.signer!==void 0&&Nl.isSigner(t.signer)}class Xpe extends cj{constructor(e){if(super(Nl.isSigner(e)?{provider:e.provider}:bc({},e,{provider:e.signer.provider})),this.signer=Nl.isSigner(e)?e:e.signer,!this.signer.provider)throw new Error("Signer must have a provider")}async getFeeOptions(e,...r){return{options:[]}}async getFeeOptionsRaw(e,r,n){return{options:[]}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}setTransactionOptions(e){this.txnOptions=e}async relay(e,r,n=!0){r!==void 0&&ge.warn("LocalRelayer doesn't accept fee quotes");const i=he.transaction.encodeBundleExecData(e),s=this.signer.sendTransaction(bc({to:e.entrypoint,data:i},this.txnOptions,{gasLimit:9e6}));if(n){const o=await s;return o.receipt=await o.wait(),o}else return s}}const Zpe="v1",eve="v0.4.0",tve="950b00c821b56110c64d947312b9dea3e197e207";let Ha=function(t){return t.UNKNOWN="UNKNOWN",t.DROPPED="DROPPED",t.QUEUED="QUEUED",t.SENT="SENT",t.SUCCEEDED="SUCCEEDED",t.PARTIALLY_FAILED="PARTIALLY_FAILED",t.FAILED="FAILED",t}({}),rve=function(t){return t.SEND="SEND",t.RECEIVE="RECEIVE",t.BRIDGE_DEPOSIT="BRIDGE_DEPOSIT",t.BRIDGE_WITHDRAW="BRIDGE_WITHDRAW",t.BURN="BURN",t.UNKNOWN="UNKNOWN",t}({}),nve=function(t){return t.UNKNOWN="UNKNOWN",t.ERC20_TOKEN="ERC20_TOKEN",t.ERC1155_TOKEN="ERC1155_TOKEN",t}({}),ive=function(t){return t.DESC="DESC",t.ASC="ASC",t}({});class lj{constructor(e,r){this.path="/rpc/Relayer/",this.ping=n=>this.fetch(this.url("Ping"),lt({},n)).then(i=>ut(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),lt({},n)).then(i=>ut(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),lt({},n)).then(i=>ut(i).then(s=>({status:s.status}))),this.getSequenceContext=n=>this.fetch(this.url("GetSequenceContext"),lt({},n)).then(i=>ut(i).then(s=>({data:s.data}))),this.getChainID=n=>this.fetch(this.url("GetChainID"),lt({},n)).then(i=>ut(i).then(s=>({chainID:s.chainID}))),this.sendMetaTxn=(n,i)=>this.fetch(this.url("SendMetaTxn"),lt(n,i)).then(s=>ut(s).then(o=>({status:o.status,txnHash:o.txnHash}))),this.getMetaTxnNonce=(n,i)=>this.fetch(this.url("GetMetaTxnNonce"),lt(n,i)).then(s=>ut(s).then(o=>({nonce:o.nonce}))),this.getMetaTxnReceipt=(n,i)=>this.fetch(this.url("GetMetaTxnReceipt"),lt(n,i)).then(s=>ut(s).then(o=>({receipt:o.receipt}))),this.simulate=(n,i)=>this.fetch(this.url("Simulate"),lt(n,i)).then(s=>ut(s).then(o=>({results:o.results}))),this.updateMetaTxnGasLimits=(n,i)=>this.fetch(this.url("UpdateMetaTxnGasLimits"),lt(n,i)).then(s=>ut(s).then(o=>({payload:o.payload}))),this.feeTokens=n=>this.fetch(this.url("FeeTokens"),lt({},n)).then(i=>ut(i).then(s=>({isFeeRequired:s.isFeeRequired,tokens:s.tokens}))),this.feeOptions=(n,i)=>this.fetch(this.url("FeeOptions"),lt(n,i)).then(s=>ut(s).then(o=>({options:o.options,quote:o.quote}))),this.getMetaTxnNetworkFeeOptions=(n,i)=>this.fetch(this.url("GetMetaTxnNetworkFeeOptions"),lt(n,i)).then(s=>ut(s).then(o=>({options:o.options}))),this.sentTransactions=(n,i)=>this.fetch(this.url("SentTransactions"),lt(n,i)).then(s=>ut(s).then(o=>({page:o.page,transactions:o.transactions}))),this.pendingTransactions=(n,i)=>this.fetch(this.url("PendingTransactions"),lt(n,i)).then(s=>ut(s).then(o=>({page:o.page,transactions:o.transactions}))),this.getGasTank=(n,i)=>this.fetch(this.url("GetGasTank"),lt(n,i)).then(s=>ut(s).then(o=>({gasTank:o.gasTank}))),this.addGasTank=(n,i)=>this.fetch(this.url("AddGasTank"),lt(n,i)).then(s=>ut(s).then(o=>({status:o.status,gasTank:o.gasTank}))),this.updateGasTank=(n,i)=>this.fetch(this.url("UpdateGasTank"),lt(n,i)).then(s=>ut(s).then(o=>({status:o.status,gasTank:o.gasTank}))),this.getGasSponsor=(n,i)=>this.fetch(this.url("GetGasSponsor"),lt(n,i)).then(s=>ut(s).then(o=>({gasSponsor:o.gasSponsor}))),this.listGasSponsors=(n,i)=>this.fetch(this.url("ListGasSponsors"),lt(n,i)).then(s=>ut(s).then(o=>({page:o.page,gasSponsors:o.gasSponsors}))),this.addGasSponsor=(n,i)=>this.fetch(this.url("AddGasSponsor"),lt(n,i)).then(s=>ut(s).then(o=>({status:o.status,gasSponsor:o.gasSponsor}))),this.updateGasSponsor=(n,i)=>this.fetch(this.url("UpdateGasSponsor"),lt(n,i)).then(s=>ut(s).then(o=>({status:o.status,gasSponsor:o.gasSponsor}))),this.removeGasSponsor=(n,i)=>this.fetch(this.url("RemoveGasSponsor"),lt(n,i)).then(s=>ut(s).then(o=>({status:o.status}))),this.reportGasSponsorUsage=(n,i)=>this.fetch(this.url("ReportGasSponsorUsage"),lt(n,i)).then(s=>ut(s).then(o=>({gasSponsorUsage:o.gasSponsorUsage}))),this.nextGasTankBalanceAdjustmentNonce=(n,i)=>this.fetch(this.url("NextGasTankBalanceAdjustmentNonce"),lt(n,i)).then(s=>ut(s).then(o=>({nonce:o.nonce}))),this.adjustGasTankBalance=(n,i)=>this.fetch(this.url("AdjustGasTankBalance"),lt(n,i)).then(s=>ut(s).then(o=>({status:o.status,adjustment:o.adjustment}))),this.getGasTankBalanceAdjustment=(n,i)=>this.fetch(this.url("GetGasTankBalanceAdjustment"),lt(n,i)).then(s=>ut(s).then(o=>({adjustment:o.adjustment}))),this.listGasTankBalanceAdjustments=(n,i)=>this.fetch(this.url("ListGasTankBalanceAdjustments"),lt(n,i)).then(s=>ut(s).then(o=>({page:o.page,adjustments:o.adjustments}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const lt=(t={},e={})=>({method:"POST",headers:bc({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),ut=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r});var qf=Object.freeze({__proto__:null,WebRPCVersion:Zpe,WebRPCSchemaVersion:eve,WebRPCSchemaHash:tve,ETHTxnStatus:Ha,TransferType:rve,FeeTokenType:nve,SortOrder:ive,Relayer:lj});const sve=[Ha.DROPPED,Ha.SUCCEEDED,Ha.PARTIALLY_FAILED,Ha.FAILED],ove=[Ha.DROPPED,Ha.PARTIALLY_FAILED,Ha.FAILED];function ave(t){return t.url!==void 0&&typeof t.url=="string"&&t.provider!==void 0&&Tc.isProvider(t.provider)}const cve=typeof global=="object"?global.fetch:window.fetch;class uj{constructor(e){if(this._fetch=(r,n)=>{const i={},{jwtAuth:s,projectAccessKey:o}=this.options;return s&&s.length>0&&(i.Authorization=`BEARER ${s}`),o&&o.length>0&&(i["X-Access-Key"]=o),n.headers=bc({},n.headers,i),cve(r,n)},this.options=e,this.service=new lj(e.url,this._fetch),Tc.isProvider(e.provider))this.provider=e.provider;else{const{jwtAuth:r,projectAccessKey:n}=this.options,i=r1(e.provider.url,n,r);this.provider=new Fm(i)}}async waitReceipt(e,r=1e3,n=5,i){typeof e!="string"&&(e=he.transaction.intendedTransactionID(e)),ge.info(`[rpc-relayer/waitReceipt] waiting for ${e}`);let s=0;for(;i===void 0||!i();){try{const{receipt:o}=await this.service.getMetaTxnReceipt({metaTxID:e});if(o&&o.txnReceipt&&o.txnReceipt!=="null"&&sve.includes(o.status))return{receipt:o}}catch(o){if(s++,s===n)throw o}(i===void 0||!i())&&await new Promise(o=>setTimeout(o,r))}throw new Error(`Cancelled waiting for transaction receipt ${e}`)}async simulate(e,...r){const i=Bn.encode([he.transaction.MetaTransactionsType],[he.transaction.sequenceTxAbiEncode(r)]);return(await this.service.simulate({wallet:e,transactions:i})).results}async getFeeOptions(e,...r){const n=await this.service.feeTokens();if(n.isFeeRequired){const i=n.tokens.map(c=>c.symbol).join(", ");ge.info(`[rpc-relayer/getFeeOptions] relayer fees are required, accepted tokens are ${i}`);const s=await this.getNonce(e);if(!this.provider)throw ge.warn("[rpc-relayer/getFeeOptions] provider not set, needed for stub signature"),new Error("provider is not set");const{options:o,quote:a}=await this.service.feeOptions({wallet:e,to:e,data:he.transaction.encodeBundleExecData({entrypoint:e,transactions:r,nonce:s})});return ge.info(`[rpc-relayer/getFeeOptions] got refund options ${JSON.stringify(o)}`),{options:o,quote:{_tag:"FeeQuote",_quote:a}}}else return ge.info("[rpc-relayer/getFeeOptions] relayer fees are not required"),{options:[]}}async getFeeOptionsRaw(e,r,n){const{options:i,quote:s}=await this.service.feeOptions({wallet:e,to:e,data:te(r),simulate:n==null?void 0:n.simulate});return{options:i,quote:{_tag:"FeeQuote",_quote:s}}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}async getNonce(e,r){ge.info(`[rpc-relayer/getNonce] get nonce for wallet ${e} space: ${r}`);const n=r!==void 0?J.from(r).toHexString():void 0,i=await this.service.getMetaTxnNonce({walletContractAddress:e,space:n}),s=J.from(i.nonce),[o,a]=he.transaction.decodeNonce(s);return ge.info(`[rpc-relayer/getNonce] got next nonce for wallet ${e} ${a} space: ${o}`),s}async relay(e,r,n=!0){var i=this;ge.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(e)} with quote ${JSON.stringify(r)}`);let s;if(r!==void 0&&(typeof r._quote=="string"?s=r._quote:ge.warn("[rpc-relayer/relay] ignoring invalid fee quote")),!this.provider)throw ge.warn("[rpc-relayer/relay] provider not set, failed relay"),new Error("provider is not set");const o=he.transaction.encodeBundleExecData(e),a=await this.service.sendMetaTxn({call:{walletAddress:e.intent.wallet,contract:e.entrypoint,input:o},quote:s});if(ge.info(`[rpc-relayer/relay] got relay result ${JSON.stringify(a)}`),n)return this.wait(e.intent.id);{const c={hash:e.intent.id,confirmations:0,from:e.intent.wallet,wait:u=>Promise.reject(new Error("impossible"))},l=async function(f){var d;if(!i.provider)throw new Error("cannot wait for receipt, relayer has no provider set");const h=await i.wait(e.intent.id),p=(d=h.receipt)==null?void 0:d.transactionHash;if(!p)throw new Error("cannot wait for receipt, unknown native transaction hash");return Object.assign(c,h),i.provider.waitForTransaction(p,f)};return c.wait=l,c}}async wait(e,r,n=1e3,i=5){var s=this;let o=!1;const{receipt:a}=await(r!==void 0?Promise.race([this.waitReceipt(e,n,i,()=>o),new Promise((l,u)=>setTimeout(()=>{o=!0,u(`Timeout waiting for transaction receipt ${e}`)},r))]):this.waitReceipt(e,n,i));if(!a.txnReceipt||ove.includes(a.status))throw new lve(a);const c=JSON.parse(a.txnReceipt);return{blockHash:c.blockHash,blockNumber:J.from(c.blockNumber).toNumber(),confirmations:1,from:typeof e=="string"?void 0:e.intent.wallet,hash:c.transactionHash,raw:a.txnReceipt,receipt:c,wait:async function(l){return s.provider.waitForTransaction(c.transactionHash,l)}}}}class lve{constructor(e){this.receipt=e}}function fj(t){return typeof t=="object"&&typeof t.simulate=="function"&&typeof t.getFeeOptions=="function"&&typeof t.gasRefundOptions=="function"&&typeof t.getNonce=="function"&&typeof t.relay=="function"&&typeof t.wait=="function"}const uve=Object.freeze(Object.defineProperty({__proto__:null,LocalRelayer:Xpe,ProviderRelayer:cj,ProviderRelayerDefaults:aj,RpcRelayer:uj,RpcRelayerProto:qf,isLocalRelayerOptions:Jpe,isProviderRelayerOptions:Ype,isRelayer:fj,isRpcRelayerOptions:ave,proto:qf},Symbol.toStringTag,{value:"Module"}));function dj(t){return t.getAddress!==void 0&&t.buildDeployTransaction!==void 0&&t.predecorateSignedTransactions!==void 0&&t.decorateTransactions!==void 0&&t.requestSignature!==void 0&&t.notifyStatusChange!==void 0}class hj{constructor(e,r=!0){this.signer=e,this.eoa=r}getAddress(){return this.signer.getAddress()}async buildDeployTransaction(e){}async predecorateSignedTransactions(e){return[]}async decorateTransactions(e,r){return e}async requestSignature(e,r,n,i){return i.onSignature(await this.signer.signMessage(r)),!0}notifyStatusChange(e,r,n){}suffix(){return[2]}}var XC=Object.freeze({__proto__:null,isSapientSigner:dj,SignerWrapper:hj});function pj(t){return t.rejected}function E8(t){return t.signature!==void 0}function vj(t){return!pj(t)&&!E8(t)}const mj="Initial";class Rb{constructor(e,r=Rb.randomTag()){this.observers=[],this.signers=[],this.count=0,this.tag=r,this.setSigners(e)}static randomTag(){return`default-${te(A1(8)).slice(2)}`}pullId(){return`${this.tag}-${this.count++}`}setSigners(e){this.signers=e.map(r=>dj(r)?r:new hj(r))}async getSigners(){return Promise.all(this.signers.map(async function(e){return e.getAddress()}))}subscribe(e){return this.observers.push(e),()=>{this.observers=this.observers.filter(r=>r!==e)}}async notifyObservers(e,r,n){await Promise.all([...this.signers.map(async function(i){return i.notifyStatusChange(e,r,n)}),...this.observers.map(async function(i){return i(r,n)})])}async buildDeployTransaction(e){let r;for(const n of this.signers){const i=await n.buildDeployTransaction(e);r===void 0?r=i:i!=null&&i.transactions&&(r.transactions=i.transactions.concat(r.transactions))}return r}async predecorateSignedTransactions(e){const r=[];for(const n of this.signers)r.push(...await n.predecorateSignedTransactions(e??{}));return r}async decorateTransactions(e,r){for(const n of this.signers)e=await n.decorateTransactions(e,r??{});return e}signMessage(e){var r=this;const n=this.pullId();return new Promise(async function(i){const{message:s,metadata:o,callback:a,candidates:c}=e,l={ended:!1,message:s,signers:{}};let u=o??{};const f=v=>{u=v,r.notifyObservers(n,l,u)},d=()=>{try{r.notifyObservers(n,l,u);const v=Object.entries(l.signers).filter(([b,y])=>vj(y));if(a&&a(l,f)||v.length===0){l.ended=!0,i(l),r.notifyObservers(n,l,u);return}}catch(v){console.error("Error while notifying observers",v)}};let h=r.signers;if(c){const v=await Promise.all(r.signers.map(async function(b){return b.getAddress()}));h=r.signers.filter((b,y)=>c.includes(v[y]))}const p=await Promise.allSettled(h.map(async function(v){const b=await v.getAddress();return l.signers[b]={situation:mj},v.requestSignature(n,s,o??{},{onSignature:y=>{const m=v.suffix();l.signers[b]={signature:y,suffix:m},d()},onRejection:y=>{l.signers[b]={rejected:!0,error:y},d()},onStatus:y=>{l.signers[b]={situation:y},d()}})}));for(let v=0;vvt(e))):vt(t)}const CT=t=>{const e=new Map;for(const r of Object.keys(t.signers)){const n=t.signers[r];if(E8(n)){const i=re(n.suffix),s=We(["bytes","bytes"],[n.signature,i]);e.set(r,{signature:s,isDynamic:i.length!==1||i[0]!==2})}}return e};class i1 extends Nl{constructor(e){if(tr.eq(e.chainId)&&!e.coders.signature.supportsNoChainId)throw new Error(`Sequence version ${e.config.version} doesn't support chainId 0`);super(),this.context=e.context,this.config=e.config,this.orchestrator=e.orchestrator,this.coders=e.coders,this.address=e.address,this.chainId=e.chainId,this.provider=e.provider,this.relayer=e.relayer,this._reader=e.reader}static newWallet(e){const r=he.context.addressOf(e.context,e.coders.config.imageHashOf(e.config));return new i1($a({},e,{address:r}))}reader(){if(this._reader)return this._reader;if(!this.provider)throw new Error("Wallet status provider requires a provider");return new he.reader.OnChainReader(this.provider)}setConfig(e){this.config=e}setOrchestrator(e){this.orchestrator=e}setAddress(e){this.address=e}getSigners(){return this.orchestrator.getSigners()}async getAddress(){return this.address}async decorateTransactions(e){const r=await this.orchestrator.decorateTransactions(e);if(await this.reader().isDeployed(this.address))return r;const n=[{to:r.entrypoint,data:he.transaction.encodeBundleExecData(r),revertOnError:!0}],i=await this.buildDeployTransaction();return i&&n.unshift(...i.transactions),{entrypoint:this.context.guestModule,chainId:this.chainId,intent:r.intent,transactions:n}}async buildDeployTransaction(e){if(e!=null&&e.ignoreDeployed&&await this.reader().isDeployed(this.address))return;const r=this.coders.config.imageHashOf(this.config);if(he.context.addressOf(this.context,r)!==this.address)throw new Error(`First address of config ${r} doesn't match wallet address ${this.address}`);const n=i1.buildDeployTransaction(this.context,r);if(e!=null&&e.includeChildren){const i=await this.orchestrator.buildDeployTransaction(e);i&&(n.transactions=i.transactions.concat(n.transactions))}return n}async deploy(e){const r=await this.buildDeployTransaction(e);if(r!==void 0){if(!this.relayer)throw new Error("Wallet deploy requires a relayer");return this.relayer.relay($a({},r,{chainId:this.chainId,intent:{id:te(A1(32)),wallet:this.address}}))}}static buildDeployTransaction(e,r){const n=new Br(rn.factory.abi);return{entrypoint:e.guestModule,transactions:[{to:e.factory,data:n.encodeFunctionData(n.getFunction("deploy"),[e.mainModule,r]),gasLimit:1e5,delegateCall:!1,revertOnError:!0,value:0}]}}async buildUpdateConfigurationTransaction(e){if(this.coders.config.update.isKindUsed){const r=await this.reader().implementation(this.address),n=r&&r===this.context.mainModuleUpgradable;return this.coders.config.update.buildTransaction(this.address,e,this.context,n?"later":"first")}return this.coders.config.update.buildTransaction(this.address,e,this.context)}async getNonce(e=0){const r=await this.reader().nonce(this.address,e);if(r===void 0)throw new Error("Unable to determine nonce");return r}async signDigest(e,r){const n=jC(this.address,this.chainId,e);if(this.coders.config.hasSubdigest(this.config,n))return this.coders.signature.encodeSigners(this.config,new Map,[n],this.chainId).encoded;const i=$a({},r,{digest:e,chainId:this.chainId,address:this.address,config:this.config}),s=re(n),o=await this.orchestrator.signMessage({candidates:this.coders.config.signersOf(this.config).map(c=>c.address),message:s,metadata:i,callback:(c,l)=>{const u=CT(c),f=$a({},i,{parts:u});return l(f),this.coders.signature.hasEnoughSigningPower(this.config,u)}}),a=CT(o);return this.coders.signature.encodeSigners(this.config,a,[],this.chainId).encoded}signMessage(e){return this.signDigest(Be(e),{message:e})}signTransactionBundle(e){if(e.entrypoint!==this.address)throw new Error(`Invalid entrypoint: ${e.entrypoint} !== ${this.address}`);return this.signTransactions(e.transactions,e.nonce)}async fetchNonceOrSpace(e){let r;if(e&&e.space)r=J.from(e.space);else if(e===void 0)r=0;else return e;const n=await this.reader().nonce(this.address,r);if(n===void 0)throw new Error("Unable to determine nonce");return he.transaction.encodeNonce(r,n)}async signTransactions(e,r,n){const i=await xT(e),s=he.transaction.fromTransactionish(this.address,i);s.length===0&&s.push({to:this.address,data:"0x",value:0,gasLimit:0,delegateCall:!1,revertOnError:!0});const o=await this.fetchNonceOrSpace(r),a=he.transaction.digestOfTransactions(o,s),c=$a({digest:a,transactions:s},n),l=await this.signDigest(a,c);return{intent:{id:jC(this.address,this.chainId,a),wallet:this.address},chainId:this.chainId,transactions:s,entrypoint:this.address,nonce:o,signature:l}}async sendSignedTransaction(e,r){if(!this.relayer)throw new Error("Wallet sendTransaction requires a relayer");return this.relayer.relay(e,r)}async sendTransaction(e,r,n){const i=await this.signTransactions(e,r),s=await this.decorateTransactions(i);return this.sendSignedTransaction(s,n)}async fillGasLimits(e){const r=await xT(e),n=he.transaction.fromTransactionish(this.address,r),i=this.relayer;if(!i)throw new Error("Wallet fillGasLimits requires a relayer");const s=await i.simulate(this.address,...n);return n.map((o,a)=>{const c=o.gasLimit?J.from(o.gasLimit).toNumber():s[a].gasLimit;return $a({},o,s[a],{gasLimit:c})})}connect(e,r){return this.provider=e,this.relayer=r,this}signTransaction(e){throw new Error("Method not implemented.")}}function ko(){return ko=Object.assign?Object.assign.bind():function(t){for(var e=1;edve(t[e])):!1}function pve(t){if(!t)return[];const e=J.from(t.value);switch(t.token.type){case qf.FeeTokenType.UNKNOWN:return[{delegateCall:!1,revertOnError:!0,gasLimit:t.gasLimit,to:t.to,value:e.toHexString(),data:[]}];case qf.FeeTokenType.ERC20_TOKEN:if(!t.token.contractAddress)throw new Error("No contract address for ERC-20 fee option");return[{delegateCall:!1,revertOnError:!0,gasLimit:t.gasLimit,to:t.token.contractAddress,value:0,data:new Br([{constant:!1,inputs:[{type:"address"},{type:"uint256"}],name:"transfer",outputs:[],type:"function"}]).encodeFunctionData("transfer",[t.to,e.toHexString()])}];default:throw new Error(`Unhandled fee token type ${t.token.type}`)}}class vve{constructor(e,r,n){this._isSigner=!0,this.account=e,this.chainId=r,this.options=n}get provider(){return this.account.providerFor(this.chainId)}async getAddress(){return this.account.address}signMessage(e){var r,n;return this.account.signMessage(e,this.chainId,(r=(n=this.options)==null?void 0:n.cantValidateBehavior)!=null?r:"throw")}async defaultSelectFee(e,r){if(r.length===0)return;const n=[{constant:!0,inputs:[{type:"address"}],name:"balanceOf",outputs:[{type:"uint256"}],type:"function"}];for(const i of r)if(i.token.type===qf.FeeTokenType.UNKNOWN){if((await this.getBalance()).gte(J.from(i.value)))return i}else if(i.token.contractAddress&&i.token.type===qf.FeeTokenType.ERC20_TOKEN&&(await new sd(i.token.contractAddress,n,this.provider).balanceOf(this.account.address)).gte(J.from(i.value)))return i;throw new Error("No fee option available - not enough balance")}async sendTransaction(e,r){var n,i,s,o,a;const c=hve(e)?await vt(e):e,l=await this.account.prepareTransactions({txs:c,chainId:this.chainId,stubSignatureOverrides:(n=(i=this.options)==null?void 0:i.stubSignatureOverrides)!=null?n:new Map,simulateForFeeOptions:r==null?void 0:r.simulateForFeeOptions}),f=await((s=(o=this.options)==null?void 0:o.selectFee)!=null?s:this.defaultSelectFee.bind(this))(c,l.feeOptions),d=[...l.transactions,...pve(f)];return this.account.sendTransaction(d,this.chainId,l.feeQuote,void 0,void 0,(a=this.options)!=null&&a.nonceSpace?{nonceSpace:this.options.nonceSpace}:void 0)}getBalance(e){return this.provider.getBalance(this.account.address,e)}call(e,r){return this.provider.call(e,r)}async resolveName(e){const r=await this.provider.resolveName(e);if(!r)throw new Error(`Could not resolve name ${e}`);return r}connect(e){throw new Error("Method not implemented.")}signTransaction(e){throw new Error("Method not implemented.")}getTransactionCount(e){throw new Error("Method not implemented.")}estimateGas(e){throw new Error("Method not implemented.")}getChainId(){return Promise.resolve(J.from(this.chainId).toNumber())}getGasPrice(){throw new Error("Method not implemented.")}getFeeData(){throw new Error("Method not implemented.")}checkTransaction(e){throw new Error("Method not implemented.")}populateTransaction(e){throw new Error("Method not implemented.")}_checkProvider(e){throw new Error("Method not implemented.")}}class mve{async isDeployed(e){return!1}async implementation(e){}async imageHash(e){}async nonce(e,r){return tr}async isValidSignature(e,r,n){throw new Error("Method not supported.")}}class $o{constructor(e){this.address=qe(e.address),this.contexts=e.contexts,this.tracker=e.tracker,this.networks=e.networks,this.orchestrator=e.orchestrator,this.jwt=e.jwt,this.migrations=e.migrations||JC.DefaultMigrations,this.migrator=new YC.Migrator(e.tracker,this.migrations,this.contexts)}getSigner(e,r){return new vve(this,e,r)}static async new(e){var r;const i=new YC.Migrator(e.tracker,(r=e.migrations)!=null?r:JC.DefaultMigrations,e.contexts).lastMigration(),s=i.configCoder,o=s.fromSimple(e.config),a=s.imageHashOf(o),c=e.contexts[i.version],l=he.context.addressOf(c,a);return await e.tracker.saveCounterfactualWallet({config:o,context:Object.values(e.contexts)}),new $o({address:l,tracker:e.tracker,contexts:e.contexts,networks:e.networks,orchestrator:e.orchestrator,migrations:e.migrations})}getAddress(){return Promise.resolve(this.address)}get version(){return this.migrator.lastMigration().version}get coders(){const e=this.migrator.lastMigration();return{signature:e.signatureCoder,config:e.configCoder}}network(e){const r=J.from(e),n=this.networks.find(i=>r.eq(i.chainId));if(!n)throw new Error(`Network not found for chainId ${e}`);return n}providerFor(e){const r=this.network(e);if(!r.provider&&!r.rpcUrl)throw new Error(`Provider not found for chainId ${e}`);return r.provider||new Fm(r1(r.rpcUrl,void 0,this.jwt),{name:"",chainId:J.from(e).toNumber()})}reader(e){return tr.eq(e)?new mve:new he.reader.OnChainReader(this.providerFor(e))}relayer(e){const r=this.network(e);if(!r.relayer)throw new Error(`Relayer not found for chainId ${e}`);return fj(r.relayer)?r.relayer:new uj(ko({},r.relayer,{jwtAuth:this.jwt}))}setOrchestrator(e){this.orchestrator=e}setJwt(e){this.jwt=e}contextFor(e){const r=this.contexts[e];if(!r)throw new Error(`Context not found for version ${e}`);return r}walletForStatus(e,r){const n=Zr.coderFor(r.version);return this.walletFor(e,this.contextFor(r.version),r.config,n)}walletFor(e,r,n,i){const s=tr.eq(e);return new i1({config:n,context:r,chainId:e,coders:i,relayer:s?void 0:this.relayer(e),address:this.address,orchestrator:this.orchestrator,reader:this.reader(e)})}async status(e,r=!1){var n=this;const i=this.reader(e).isDeployed(this.address),s=this.tracker.imageHashOfCounterfactualWallet({wallet:this.address}).then(P=>{if(!P)throw new Error(`Counterfactual imageHash not found for wallet ${this.address}`);return P}),o=s.then(P=>ij.counterfactualVersion(this.address,P.imageHash,Object.values(this.contexts))),a=async function(){if(!await i)return o;const T=await n.reader(e).implementation(n.address);if(!T)throw new Error(`Implementation not found for wallet ${n.address}`);const w=Object.values(n.contexts);for(let I=0;I0?v[v.length-1].nextImageHash:d,y=await this.tracker.configOfImageHash({imageHash:b});if(!y)throw new Error(`Config not found for imageHash ${b}`);const m=await i,g=await s,S=Zr.coderFor(h).config.checkpointOf(y);return{original:ko({},g,{version:await o}),onChain:{imageHash:f,config:await l,version:u,deployed:m},fullyMigrated:h===this.version,signedMigrations:p,version:h,presignedConfigurations:v,imageHash:b,config:y,checkpoint:S,canOnchainValidate:u===this.version&&m}}mustBeFullyMigrated(e){if(!e.fullyMigrated)throw new Error(`Wallet ${this.address} is not fully migrated`)}async predecorateSignedTransactions(e,r){const n=await this.orchestrator.predecorateSignedTransactions({chainId:r}),i=await this.predecorateTransactions([],e,r);return he.transaction.fromTransactionish(this.address,i).length>0&&n.push(await this.signTransactions(i,r)),n}async predecorateTransactions(e,r,n){if(r.onChain.imageHash!==r.imageHash){const s=await this.walletForStatus(n,r).buildUpdateConfigurationTransaction(r.config);return[Array.isArray(e)?e:[e],s.transactions].flat()}return e}async decorateTransactions(e,r,n){var i;if(!Array.isArray(e))return this.decorateTransactions([e],r,n);n=(i=n)!=null?i:e[0].chainId;const s=await this.buildBootstrapTransactions(r,n),o=s.transactions.length>0;if(!o&&e.length===1)return e[0];const{entrypoint:a}=o?s:e[0],c={entrypoint:a,chainId:n,intent:e[0].intent,transactions:[...s.transactions,...e.map(l=>({to:l.entrypoint,data:he.transaction.encodeBundleExecData(l),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}))]};return r.onChain.deployed||(c.intent.id=he.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,n,c.transactions)),c}async decorateSignature(e,r){if(!r.presignedConfigurations||r.presignedConfigurations.length===0)return e;const n=this.coders.signature,i=r.presignedConfigurations.map(o=>o.signature),s=n.chainSignatures(e,i);return n.trim(s)}async publishWitness(){const e=Be(wt(`This is a Sequence account woo! ${Date.now()}`)),r=await this.signDigest(e,0,!1),n=this.coders.signature.decode(r),i=this.coders.signature.signaturesOfDecoded(n);return this.tracker.saveWitnesses({wallet:this.address,digest:e,chainId:0,signatures:i})}async signDigest(e,r,n=!0,i="ignore",s){const o=tr.eq(r)?this.networks[0].chainId:r,a=await this.status(o);if(this.mustBeFullyMigrated(a),!a.canOnchainValidate&&i==="throw")throw new Error("Wallet cannot validate onchain");const l=await this.walletForStatus(r,a).signDigest(e,s),u=n?this.decorateSignature(l,a):l;if(!a.canOnchainValidate)switch(i){case"ignore":return u;case"eip6492":return this.buildEIP6492Signature(await u,a,r)}return u}async buildEIP6492Signature(e,r,n){const i=await this.buildBootstrapTransactions(r,n);if(i.transactions.length===0)throw new Error("Cannot build EIP-6492 signature without bootstrap transactions");const s=Bn.encode(["address","bytes","bytes"],[i.entrypoint,he.transaction.encodeBundleExecData(i),e]);return We(["bytes","bytes32"],[s,he.EIP6492.EIP_6492_SUFFIX])}async editConfig(e){const r=await this.status(0).then(i=>i.config),n=this.coders.config.editConfig(r,ko({},e,{checkpoint:this.coders.config.checkpointOf(r).add(1)}));return this.updateConfig(n)}async updateConfig(e){if(!this.coders.config.isWalletConfig(e))throw new Error(`Invalid config for wallet ${this.address}`);const r=this.coders.config.imageHashOf(e),n=this.coders.signature.hashSetImageHash(r),i=await this.signDigest(n,0,!1);await this.tracker.savePresignedConfiguration({wallet:this.address,nextConfig:e,signature:i});const s=await this.tracker.configOfImageHash({imageHash:r,noCache:!0});if(!s||this.coders.config.imageHashOf(s)!==r)throw Error(`Reverse lookup failed for imageHash ${r}`)}async buildBootstrapTransactions(e,r){var n;const i=await this.orchestrator.buildDeployTransaction({chainId:r}),s=(n=i==null?void 0:i.transactions)!=null?n:[];if(!e.onChain.deployed){const c=i1.buildDeployTransaction(e.original.context,e.original.imageHash);s.push(...c.transactions)}s.length,s.push(...e.signedMigrations.map(c=>({to:c.tx.entrypoint,data:he.transaction.encodeBundleExecData(c.tx),value:0,gasLimit:0,revertOnError:!0,delegateCall:!1})));const o=e.signedMigrations.length>0?e.signedMigrations[0].tx.intent.id:he.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,r,s),{guestModule:a}=this.contextFor(e.version);return{entrypoint:a,transactions:s,chainId:r,intent:{id:o,wallet:this.address}}}async bootstrapTransactions(e,r){const n=r||await this.status(e);return this.buildBootstrapTransactions(n,e)}async doBootstrap(e,r,n){const i=await this.bootstrapTransactions(e,n);return this.relayer(e).relay(ko({},i,{chainId:e}),r)}signMessage(e,r,n="ignore"){return this.signDigest(Be(e),r,!0,n)}async signTransactions(e,r,n,i){const s=n||await this.status(r);this.mustBeFullyMigrated(s);const o=this.walletForStatus(r,s),a={address:this.address,digest:"",chainId:r,config:{version:this.version},decorate:!0,cantValidateBehavior:"ignore"},c=await o.signTransactions(e,(i==null?void 0:i.nonceSpace)&&{space:i==null?void 0:i.nonceSpace},a);return ko({},c,{signature:await this.decorateSignature(c.signature,s)})}async signMigrations(e,r){const n=await this.status(e);if(n.fullyMigrated)return!1;const i=this.walletForStatus(e,n),s=r(i.config),o=await this.migrator.signNextMigration(this.address,n.version,i,s);if(!o)return!1;await this.tracker.saveWalletConfig({config:s});const a=Zr.coderFor(s.version).config,c=a.imageHashOf(s),l=await this.tracker.configOfImageHash({imageHash:c,noCache:!0});if(!l||a.imageHashOf(l)!==c)throw Error(`Reverse lookup failed for imageHash ${c}`);return await this.tracker.saveMigration(this.address,o,this.contexts),!0}async signAllMigrations(e){var r=this;const n=[];return{signedMigrations:(await Promise.all(this.networks.map(async function(o){try{return await r.signMigrations(o.chainId,e)}catch(a){return console.warn(`Failed to sign migrations for chain ${o.chainId}`,a),n.push(o.chainId),null}}))).filter(o=>o!==null),failedChains:n}}async isMigratedAllChains(){var e=this;const r=[];return{migratedAllChains:(await Promise.all(this.networks.map(async function(s){try{return await e.status(s.chainId)}catch(o){return r.push(s.chainId),console.warn(`Failed to get status for chain ${s.chainId}`,o),{fullyMigrated:!0}}}))).every(s=>s.fullyMigrated),failedChains:r}}async sendSignedTransactions(e,r,n,i,s){if(!Array.isArray(e))return this.sendSignedTransactions([e],r,n,i,s);const o=i||await this.status(e[0].chainId);this.mustBeFullyMigrated(o);const a=await this.decorateTransactions(e,o);return s==null||s(a),this.relayer(r).relay(a,n)}async fillGasLimits(e,r,n){return this.walletForStatus(r,n||await this.status(r)).fillGasLimits(e)}async gasRefundQuotes(e,r,n,i,s){const o=i||await this.status(r),a=this.walletForStatus(r,o),c=await this.predecorateTransactions(e,o,r),l=he.transaction.fromTransactionish(this.address,c),u=a.coders.config.buildStubSignature(a.config,n),f=te(A1(32)),d={chainId:r,intent:{id:f,wallet:this.address},signature:u,transactions:l,entrypoint:this.address,nonce:0},h=await this.decorateTransactions(d,o),p=he.transaction.encodeBundleExecData(h),v=await this.relayer(r).getFeeOptionsRaw(h.entrypoint,p,s);return ko({},v,{decorated:h})}async prepareTransactions(e){const r=await this.status(e.chainId),n=await this.fillGasLimits(e.txs,e.chainId,r),i=await this.gasRefundQuotes(n,e.chainId,e.stubSignatureOverrides,r,{simulate:e.simulateForFeeOptions}),s=he.transaction.unwind(this.address,i.decorated.transactions);return{transactions:n,flatDecorated:s,feeOptions:i.options,feeQuote:i.quote}}async sendTransaction(e,r,n,i=!1,s,o){const a=await this.status(r),c=i?e:await this.predecorateTransactions(e,a,r),u=he.transaction.fromTransactionish(this.address,c).length>0?await this.signTransactions(c,r,void 0,o):void 0,f=await this.orchestrator.predecorateSignedTransactions({chainId:r}),d=[];if(u!==void 0&&u.transactions.length>0&&d.push(u),d.push(...f.filter(h=>h.transactions.length>0)),d.length!==0)return this.sendSignedTransactions(d,r,n,void 0,s)}async signTypedData(e,r,n,i,s="ignore"){const o=H1({domain:e,types:r,message:n});return this.signDigest(o,i,!0,s)}async getSigners(){var e=this;const r=n=>n.length?n[n.length-1]:void 0;return(await Promise.all(this.networks.map(async function({chainId:n,name:i}){try{var s;const o=await e.status(n);let a=(s=r(o.presignedConfigurations))==null?void 0:s.nextImageHash;if(!a&&o.onChain.version!==o.version){const f=r(o.signedMigrations);if(f){const{toVersion:d,toConfig:h}=f;a=Zr.genericCoderFor(d).config.imageHashOf(h)}}a||(a=o.onChain.imageHash);const c=await e.tracker.configOfImageHash({imageHash:a});if(!c)throw new Error(`unable to find config for image hash ${a}`);return Zr.genericCoderFor(c.version).config.signersOf(c).map(f=>ko({},f,{network:n}))}catch(o){return console.warn(`unable to get signers on network ${n} ${i}`,o),[]}}))).flat()}async getAllSigners(){var e=this;const r=[];return await Promise.all(this.networks.map(async function(n){const i=n.chainId,s=await e.status(i,!0),o=[s.onChain.imageHash,...s.onChain.version!==s.version?s.signedMigrations.map(a=>Zr.coderFor(a.toVersion).config.imageHashOf(a.toConfig)):[],...s.presignedConfigurations.map(a=>a.nextImageHash)];return Promise.all(o.map(async function(a,c){const l=c===o.length-1,u=await e.tracker.configOfImageHash({imageHash:a});if(!u){console.warn(`AllSigners may be incomplete, config not found for imageHash ${a}`);return}Zr.genericCoderFor(u.version).config.signersOf(u).forEach(h=>{const p=r.find(v=>v.address===h.address&&v.network===i);if(p&&l&&p.flaggedForRemoval){p.flaggedForRemoval=!1;return}p||r.push({address:h.address,weight:h.weight,network:i,flaggedForRemoval:!l})})}))})),r}}function yve(t){return t instanceof $o}const gve=Object.freeze(Object.defineProperty({__proto__:null,Account:$o,isAccount:yve},Symbol.toStringTag,{value:"Module"}));function xy(){return xy=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),Fr({},n)).then(i=>jr(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),Fr({},n)).then(i=>jr(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),Fr({},n)).then(i=>jr(i).then(s=>({status:s.status}))),this.getChainID=n=>this.fetch(this.url("GetChainID"),Fr({},n)).then(i=>jr(i).then(s=>({chainID:s.chainID}))),this.getEtherBalance=(n,i)=>this.fetch(this.url("GetEtherBalance"),Fr(n,i)).then(s=>jr(s).then(o=>({balance:o.balance}))),this.getTokenBalances=(n,i)=>this.fetch(this.url("GetTokenBalances"),Fr(n,i)).then(s=>jr(s).then(o=>({page:o.page,balances:o.balances}))),this.getTokenSupplies=(n,i)=>this.fetch(this.url("GetTokenSupplies"),Fr(n,i)).then(s=>jr(s).then(o=>({page:o.page,contractType:o.contractType,tokenIDs:o.tokenIDs}))),this.getTokenSuppliesMap=(n,i)=>this.fetch(this.url("GetTokenSuppliesMap"),Fr(n,i)).then(s=>jr(s).then(o=>({supplies:o.supplies}))),this.getBalanceUpdates=(n,i)=>this.fetch(this.url("GetBalanceUpdates"),Fr(n,i)).then(s=>jr(s).then(o=>({page:o.page,balances:o.balances}))),this.getTransactionHistory=(n,i)=>this.fetch(this.url("GetTransactionHistory"),Fr(n,i)).then(s=>jr(s).then(o=>({page:o.page,transactions:o.transactions}))),this.syncBalance=(n,i)=>this.fetch(this.url("SyncBalance"),Fr(n,i)).then(s=>jr(s).then(o=>({}))),this.fetchTransactionReceipt=(n,i)=>this.fetch(this.url("FetchTransactionReceipt"),Fr(n,i)).then(s=>jr(s).then(o=>({receipt:o.receipt}))),this.fetchTransactionReceiptWithFilter=(n,i)=>this.fetch(this.url("FetchTransactionReceiptWithFilter"),Fr(n,i)).then(s=>jr(s).then(o=>({receipt:o.receipt}))),this.getAllWebhookListeners=(n,i)=>this.fetch(this.url("GetAllWebhookListeners"),Fr(n,i)).then(s=>jr(s).then(o=>({listeners:o.listeners}))),this.getWebhookListener=(n,i)=>this.fetch(this.url("GetWebhookListener"),Fr(n,i)).then(s=>jr(s).then(o=>({listener:o.listener}))),this.addWebhookListener=(n,i)=>this.fetch(this.url("AddWebhookListener"),Fr(n,i)).then(s=>jr(s).then(o=>({status:o.status,listener:o.listener}))),this.updateWebhookListener=(n,i)=>this.fetch(this.url("UpdateWebhookListener"),Fr(n,i)).then(s=>jr(s).then(o=>({status:o.status}))),this.removeWebhookListener=(n,i)=>this.fetch(this.url("RemoveWebhookListener"),Fr(n,i)).then(s=>jr(s).then(o=>({status:o.status}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Fr=(t={},e={})=>({method:"POST",headers:xy({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),jr=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),ST=typeof global=="object"?global.fetch:window.fetch;class C8 extends yj{constructor(e,r,n){super(e.endsWith("/")?e.slice(0,-1):e,ST),this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=xy({},s.headers,o),ST(i,s)},this.projectAccessKey=r,this.jwtAuth=n,this.fetch=this._fetch}}const _ve=Object.freeze(Object.defineProperty({__proto__:null,ContractType:x8,EventLogDataType:Cve,EventLogType:xve,Indexer:yj,SequenceIndexer:C8,SortOrder:Ave,TransactionStatus:Sve,TransactionType:kve,TxnTransferType:os,WebRPCSchemaHash:Eve,WebRPCSchemaVersion:wve,WebRPCVersion:bve},Symbol.toStringTag,{value:"Module"}));function Cy(){return Cy=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),Ur({},n)).then(i=>zr(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),Ur({},n)).then(i=>zr(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),Ur({},n)).then(i=>zr(i).then(s=>({status:s.status}))),this.getTokenMetadata=(n,i)=>this.fetch(this.url("GetTokenMetadata"),Ur(n,i)).then(s=>zr(s).then(o=>({tokenMetadata:o.tokenMetadata}))),this.refreshTokenMetadata=(n,i)=>this.fetch(this.url("RefreshTokenMetadata"),Ur(n,i)).then(s=>zr(s).then(o=>({status:o.status}))),this.getTokenMetadataBatch=(n,i)=>this.fetch(this.url("GetTokenMetadataBatch"),Ur(n,i)).then(s=>zr(s).then(o=>({contractTokenMetadata:o.contractTokenMetadata}))),this.searchTokenMetadata=(n,i)=>this.fetch(this.url("SearchTokenMetadata"),Ur(n,i)).then(s=>zr(s).then(o=>({page:o.page,tokenMetadata:o.tokenMetadata}))),this.searchTokenIDs=(n,i)=>this.fetch(this.url("SearchTokenIDs"),Ur(n,i)).then(s=>zr(s).then(o=>({page:o.page,tokenIds:o.tokenIds}))),this.tokenCollectionFilters=(n,i)=>this.fetch(this.url("TokenCollectionFilters"),Ur(n,i)).then(s=>zr(s).then(o=>({filters:o.filters}))),this.getContractInfo=(n,i)=>this.fetch(this.url("GetContractInfo"),Ur(n,i)).then(s=>zr(s).then(o=>({contractInfo:o.contractInfo}))),this.getContractInfoBatch=(n,i)=>this.fetch(this.url("GetContractInfoBatch"),Ur(n,i)).then(s=>zr(s).then(o=>({contractInfoMap:o.contractInfoMap}))),this.searchContractInfo=(n,i)=>this.fetch(this.url("SearchContractInfo"),Ur(n,i)).then(s=>zr(s).then(o=>({contractInfoList:o.contractInfoList}))),this.searchContractInfoBatch=(n,i)=>this.fetch(this.url("SearchContractInfoBatch"),Ur(n,i)).then(s=>zr(s).then(o=>({contractInfoByChain:o.contractInfoByChain}))),this.searchMetadata=(n,i)=>this.fetch(this.url("SearchMetadata"),Ur(n,i)).then(s=>zr(s).then(o=>({tokenMetadata:o.tokenMetadata,contractInfo:o.contractInfo}))),this.projectSetTokenMetadata=(n,i)=>this.fetch(this.url("ProjectSetTokenMetadata"),Ur(n,i)).then(s=>zr(s).then(o=>({ok:o.ok}))),this.getNiftyswapTokenQuantity=(n,i)=>this.fetch(this.url("GetNiftyswapTokenQuantity"),Ur(n,i)).then(s=>zr(s).then(o=>({quantity:o.quantity}))),this.getNiftyswapUnitPrices=(n,i)=>this.fetch(this.url("GetNiftyswapUnitPrices"),Ur(n,i)).then(s=>zr(s).then(o=>({prices:o.prices}))),this.getNiftyswapUnitPricesWithQuantities=(n,i)=>this.fetch(this.url("GetNiftyswapUnitPricesWithQuantities"),Ur(n,i)).then(s=>zr(s).then(o=>({prices:o.prices}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Ur=(t={},e={})=>({method:"POST",headers:Cy({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),zr=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),kT=typeof global=="object"?global.fetch:window.fetch;class S8 extends gj{constructor(e="https://metadata.sequence.app",r,n){super(e.endsWith("/")?e.slice(0,-1):e,kT),this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=Cy({},s.headers,o),kT(i,s)},this.projectAccessKey=r,this.jwtAuth=n,this.fetch=this._fetch}}const Nve=Object.freeze(Object.defineProperty({__proto__:null,ContractType:Ove,Metadata:gj,PropertyType:Rve,SequenceMetadata:S8,SortOrder:$ve,SwapType:Mve,WebRPCSchemaHash:Ive,WebRPCSchemaVersion:Tve,WebRPCVersion:Pve},Symbol.toStringTag,{value:"Module"}));function Dve(t,e){const r=t.replace("ipfs://ipfs/","").replace("ipfs://","");return t.startsWith("ipfs://")?`${e}${r}`:t}function Lve(t){return t.startsWith("ipfs://")}class Bve{constructor(e,r,n=1e3){this.pending=new Map,this.provider=e,this.solver=r,this.window=n}async runByEIP5719(e,r,n){const i=`${e}-${r}-${n}`,s=Date.now();if(this.pending.has(i)&&s-this.pending.get(i).timestamp10)throw new Error("EIP5719 - Too many tries");if(he.signer.canRecover(n)){const c=he.signer.recoverSigner(r,n);if(c&&c.toLowerCase()===t.toLowerCase())return n}try{if(await he.signer.isValidSignature(t,r,n,e))return n}catch{}const o=await jve(Fve(t,e).getAlternativeSignature(r));if(!o||o==="")throw new Error("EIP5719 - Invalid signature and no alternative signature");const a=te(await(i||new Uve).resolve(o));if(!a||a==="")throw new Error("EIP5719 - Empty alternative signature");if(a===te(n))throw new Error("EIP5719 - Alternative signature is invalid or the same");return bj(t,e,r,a,i,s+1)}class Uve{constructor(e="https://cloudflare-ipfs.com/ipfs/"){var r=this;this.uri=n=>Lve(n)?Dve(n,this.gateway):n,this.resolve=async function(n){const i=r.uri(n),s=await fetch(i);if(!s.ok)throw new Error(`URISolverIPFS - Failed to fetch ${i}`);return await s.text()},this.gateway=e}}const zve=(t,e)=>e.some(r=>t instanceof r);let AT,_T;function Wve(){return AT||(AT=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Hve(){return _T||(_T=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const wj=new WeakMap,ZC=new WeakMap,Ej=new WeakMap,W2=new WeakMap,k8=new WeakMap;function qve(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(sc(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(r=>{r instanceof IDBCursor&&wj.set(r,t)}).catch(()=>{}),k8.set(e,t),e}function Vve(t){if(ZC.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});ZC.set(t,e)}let e5={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return ZC.get(t);if(e==="objectStoreNames")return t.objectStoreNames||Ej.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return sc(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function Gve(t){e5=t(e5)}function Kve(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(H2(this),e,...r);return Ej.set(n,e.sort?e.sort():[e]),sc(n)}:Hve().includes(t)?function(...e){return t.apply(H2(this),e),sc(wj.get(this))}:function(...e){return sc(t.apply(H2(this),e))}}function Qve(t){return typeof t=="function"?Kve(t):(t instanceof IDBTransaction&&Vve(t),zve(t,Wve())?new Proxy(t,e5):t)}function sc(t){if(t instanceof IDBRequest)return qve(t);if(W2.has(t))return W2.get(t);const e=Qve(t);return e!==t&&(W2.set(t,e),k8.set(e,t)),e}const H2=t=>k8.get(t);function Yve(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=sc(o);return n&&o.addEventListener("upgradeneeded",c=>{n(sc(o.result),c.oldVersion,c.newVersion,sc(o.transaction),c)}),r&&o.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const Jve=["get","getKey","getAll","getAllKeys","count"],Xve=["put","add","delete","clear"],q2=new Map;function PT(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(q2.get(e))return q2.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=Xve.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||Jve.includes(r)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return n&&(l=l.index(a.shift())),(await Promise.all([l[r](...a),i&&c.done]))[0]};return q2.set(e,s),s}Gve(t=>({...t,get:(e,r,n)=>PT(e,r)||t.get(e,r,n),has:(e,r)=>!!PT(e,r)||t.has(e,r)}));class Zve{}var eme=Object.freeze({__proto__:null,ConfigTracker:Zve});class tme{constructor(e){this.tracker=e}async loadPresignedConfiguration(e){return console.debug("? loadPresignedConfiguration"),_n(e,"? "),_n(await this.tracker.loadPresignedConfiguration(e),"! ")}savePresignedConfiguration(e){return console.debug("? savePresignedConfiguration"),_n(e,"? "),this.tracker.savePresignedConfiguration(e)}saveWitnesses(e){return console.debug("? saveWitnesses"),_n(e,"? "),this.tracker.saveWitnesses(e)}async configOfImageHash(e){return console.debug("? configOfImageHash"),_n(e,"? "),_n(await this.tracker.configOfImageHash(e),"! ")}saveWalletConfig(e){return console.debug("? saveWalletConfig"),_n(e,"? "),this.tracker.saveWalletConfig(e)}async imageHashOfCounterfactualWallet(e){return console.debug("? imageHashOfCounterfactualWallet"),_n(e,"? "),_n(await this.tracker.imageHashOfCounterfactualWallet(e),"! ")}saveCounterfactualWallet(e){return console.debug("? saveCounterfactualWallet"),_n(e,"? "),this.tracker.saveCounterfactualWallet(e)}async walletsOfSigner(e){return console.debug("? walletsOfSigner"),_n(e,"? "),_n(await this.tracker.walletsOfSigner(e),"! ")}async getMigration(e,r,n,i){return console.debug("? getMigration"),_n({address:e,fromImageHash:r,fromVersion:n,chainId:i},"? "),_n(await this.tracker.getMigration(e,r,n,i),"! ")}saveMigration(e,r,n){return console.debug("? saveMigration"),_n({address:e,signed:r,contexts:n},"? "),this.tracker.saveMigration(e,r,n)}}function _n(t,e=""){switch(t){case void 0:console.debug(e+"undefined");break;default:JSON.stringify(t,void 0,2).split(` -`).map(r=>e+r).forEach(r=>console.debug(r));break}return t}var rme=Object.freeze({__proto__:null,DebugConfigTracker:tme});function wc(){return wc=Object.assign?Object.assign.bind():function(t){for(var e=1;ePromise.resolve(this.configs[e]),this.saveConfig=(e,r)=>(this.configs[e]=r,Promise.resolve()),this.loadV2Node=e=>Promise.resolve(this.v2Nodes[e]),this.saveV2Node=(e,r)=>(this.v2Nodes[e]=r,Promise.resolve()),this.loadCounterfactualWallet=e=>Promise.resolve(this.counterfactualWallets[e]),this.saveCounterfactualWallet=(e,r,n)=>(this.counterfactualWallets[e]={imageHash:r,context:n},Promise.resolve()),this.loadPayloadOfSubdigest=e=>Promise.resolve(this.payloads[e]),this.savePayloadOfSubdigest=(e,r)=>(this.payloads[e]=r,Promise.resolve()),this.loadSubdigestsOfSigner=e=>Promise.resolve(Object.keys(this.signatures[e]||{})),this.loadSignatureOfSubdigest=(e,r)=>{var n;return Promise.resolve((n=this.signatures[e])==null?void 0:n[r])},this.saveSignatureOfSubdigest=(e,r,n)=>(this.signatures[e]||(this.signatures[e]={}),this.signatures[e][r]=n,Promise.resolve()),this.loadMigrationsSubdigest=(e,r,n)=>{var i,s;return Promise.resolve(((i=this.migrations[e])==null||(s=i[r])==null?void 0:s[n])||[])},this.saveMigrationsSubdigest=(e,r,n,i,s)=>(this.migrations[e]||(this.migrations[e]={}),this.migrations[e][r]||(this.migrations[e][r]={}),this.migrations[e][r][n]||(this.migrations[e][r][n]=[]),this.migrations[e][r][n].push({subdigest:i,toImageHash:s}),Promise.resolve())}}function bf(t){if(t===void 0)return;const e={};for(const r of Object.keys(t)){const n=t[r];n._isBigNumber===!0&&n._hex!==void 0&&typeof n._hex=="string"&&n._hex.length!==""?e[r]=J.from(n):Array.isArray(n)?e[r]=n.map(i=>bf(i)):typeof n=="object"&&n!==null?e[r]=bf(n):e[r]=n}return e}class nme{constructor(e){var r=this;this.loadConfig=async function(n){return(await r.getDb()).get("configs",n).then(s=>bf(s))},this.saveConfig=async function(n,i){await(await r.getDb()).put("configs",i,n)},this.loadV2Node=async function(n){return(await r.getDb()).get("v2Nodes",n).then(s=>bf(s))},this.saveV2Node=async function(n,i){await(await r.getDb()).put("v2Nodes",i,n)},this.loadCounterfactualWallet=async function(n){return(await r.getDb()).get("counterfactualWallets",n)},this.saveCounterfactualWallet=async function(n,i,s){await(await r.getDb()).put("counterfactualWallets",{imageHash:i,context:s},n)},this.loadPayloadOfSubdigest=async function(n){return(await r.getDb()).get("payloads",n).then(s=>bf(s))},this.savePayloadOfSubdigest=async function(n,i){await(await r.getDb()).put("payloads",i,n)},this.loadSubdigestsOfSigner=async function(n){return(await(await r.getDb()).getAllKeysFromIndex("signatures","signer",IDBKeyRange.only(n))).map(o=>o.split("-")[0])},this.loadSignatureOfSubdigest=async function(n,i){const o=await(await r.getDb()).get("signatures",[i,n].join("-"));return o==null?void 0:o.signature},this.saveSignatureOfSubdigest=async function(n,i,s){await(await r.getDb()).put("signatures",{signature:s,signer:n},[i,n].join("-"))},this.loadMigrationsSubdigest=async function(n,i,s){return(await(await r.getDb()).getAllFromIndex("migrations","jump",IDBKeyRange.only([n,i,s]))).map(c=>({subdigest:c.subdigest,toImageHash:c.toImageHash}))},this.saveMigrationsSubdigest=async function(n,i,s,o,a){await(await r.getDb()).put("migrations",{wallet:n,fromVersion:i,toVersion:s,subdigest:o,toImageHash:a},o)},this.dbName=e}async getDb(){if(this._lazyDb)return this._lazyDb;const e=this.dbName;return this._lazyDb=await Yve(e,1,{upgrade(r,n,i,s){console.log(`upgrading ${e} from ${n} to ${i} - ${s}`),n===0&&(r.createObjectStore("configs"),r.createObjectStore("v2Nodes"),r.createObjectStore("counterfactualWallets"),r.createObjectStore("payloads"),r.createObjectStore("signatures").createIndex("signer","signer",{unique:!1}),r.createObjectStore("migrations").createIndex("jump",["wallet","fromVersion","toVersion"]))}}),this._lazyDb}}function Cj(t){return t.left!==void 0&&t.right!==void 0}function Sj(t){return t.weight!==void 0&&t.threshold!==void 0&&t.tree!==void 0}function t5(t){return t.version===2&&t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&typeof t.tree=="string"}var ime=Object.freeze({__proto__:null,isPlainNode:Cj,isPlainNested:Sj,isPlainV2Config:t5,MemoryTrackerStore:xj,recreateBigNumbers:bf,IndexedDBStore:nme});class A8{constructor(e,r=new xj,n=!1){var i=this;this.loadTopology=async function(s){const o=await i.store.loadV2Node(s);if(!o)return{nodeHash:s};if(Cj(o)){const[a,c]=await Promise.all([i.loadTopology(o.left),i.loadTopology(o.right)]);return{left:a,right:c}}return Sj(o)?{weight:J.from(o.weight),threshold:J.from(o.threshold),tree:await i.loadTopology(o.tree)}:o},this.saveTopology=async function(s){if(Ve.config.isNodeLeaf(s))return;const o=Ve.config.hashNode(s);if(Ve.config.isNode(s)){const a=i.saveTopology(s.left),c=i.saveTopology(s.right),l=i.store.saveV2Node(o,{left:Ve.config.hashNode(s.left),right:Ve.config.hashNode(s.right)});await Promise.all([a,c,l]);return}if(Ve.config.isNestedLeaf(s)){const a=i.saveTopology(s.tree),c=i.store.saveV2Node(o,{weight:J.from(s.weight).toString(),threshold:J.from(s.threshold).toString(),tree:Ve.config.hashNode(s.tree)});await Promise.all([a,c]);return}if(Ve.config.isSignerLeaf(s))return i.store.saveV2Node(o,{address:s.address,weight:s.weight});if(Ve.config.isSubdigestLeaf(s))return i.store.saveV2Node(o,{subdigest:s.subdigest});throw new Error(`Unknown topology type: ${s}`)},this.saveWalletConfig=async function(s){const{config:o}=s;if(Io.config.ConfigCoder.isWalletConfig(o)){const a=Io.config.ConfigCoder.imageHashOf(o);return i.store.saveConfig(a,o)}if(Ve.config.ConfigCoder.isWalletConfig(o)){const a=Ve.config.ConfigCoder.imageHashOf(o);if(Ve.config.isComplete(o.tree))return i.store.saveConfig(a,o)}},this.configOfImageHashCache={},this.configOfImageHash=async function(s){const{imageHash:o}=s;if(i.configOfImageHashCache[s.imageHash])return i.configOfImageHashCache[s.imageHash];const a=await i.store.loadConfig(o);if(a){if(a.version===1||a.version===2&&!t5(a))return i.configOfImageHashCache[s.imageHash]=a,a;if(t5(a)){const c={version:2,threshold:J.from(a.threshold),checkpoint:J.from(a.checkpoint),tree:await i.loadTopology(a.tree)};return i.configOfImageHashCache[s.imageHash]=c,c}throw new Error(`Unknown config type: ${a}`)}},this.saveCounterfactualWallet=async function(s){const{config:o,context:a}=s,c=Zr.genericCoderFor(o.version).config.imageHashOf(o);await Promise.all([i.saveWalletConfig({config:o}),...a.map(l=>{const u=he.context.addressOf(l,c);return i.store.saveCounterfactualWallet(u,c,l)})])},this.imageHashOfCounterfactualWallet=async function(s){const{wallet:o}=s,a=await i.store.loadCounterfactualWallet(o);if(a)return{imageHash:a.imageHash,context:a.context}},this.savePayload=async function(s){const{payload:o}=s,a=he.signature.subdigestOf(o);await i.store.savePayloadOfSubdigest(a,o)},this.payloadOfSubdigestCache={},this.payloadOfSubdigest=async function(s){if(i.payloadOfSubdigestCache[s.subdigest])return i.payloadOfSubdigestCache[s.subdigest];const{subdigest:o}=s,a=await i.store.loadPayloadOfSubdigest(o);return a&&(i.payloadOfSubdigestCache[o]=a),a},this.savePresignedConfiguration=async function(s){const o=Ve.signature.SignatureCoder.decode(s.signature),a=Zr.genericCoderFor(s.nextConfig.version).config.imageHashOf(s.nextConfig),c=Ve.chained.messageSetImageHash(a),l=Be(c),u={message:c,address:s.wallet,chainId:0,digest:l},f=i.savePayload({payload:u}),d=i.saveWalletConfig({config:s.nextConfig}),h=await Ve.signature.SignatureCoder.recover(o,u,i.provider),p=Ve.signature.signaturesOf(h.config.tree);await Promise.all([f,d,i.saveWalletConfig({config:h.config}),...p.map(v=>i.store.saveSignatureOfSubdigest(v.address,h.subdigest,v.signature))])},this.loadPresignedConfiguration=async function(s){const{wallet:o,fromImageHash:a,longestPath:c}=s,l=await i.configOfImageHash({imageHash:a});if(!l||!Ve.config.ConfigCoder.isWalletConfig(l))return[];const u=Ve.config.signersOf(l.tree).map(g=>g.address),f=await Promise.all(u.map(g=>i.store.loadSubdigestsOfSigner(g))),d=[...new Set(f.flat())],p=(await Promise.all([...new Set(d)].map(async function(g){return wc({},await i.payloadOfSubdigest({subdigest:g}),{subdigest:g})}))).filter(g=>(g==null?void 0:g.message)&&(g==null?void 0:g.address)&&g.address===o).map(g=>({payload:g,nextImageHash:Ve.chained.decodeMessageSetImageHash(g.message)})).filter(g=>g==null?void 0:g.nextImageHash);let v;const y=(await Promise.all(p.map(async function({nextImageHash:g,payload:S}){const P=await i.configOfImageHash({imageHash:g});if(!P||!Ve.config.isWalletConfig(P))return;const T=J.from(P.checkpoint);return{nextConfig:P,nextCheckpoint:T,nextImageHash:g,payload:S}}))).filter(g=>g!==void 0).filter(g=>g.nextCheckpoint.gt(l.checkpoint)).sort((g,S)=>g.nextCheckpoint.gt(S.nextCheckpoint)?c?1:-1:c?-1:1);for(const g of y){const{nextConfig:S,nextCheckpoint:P,nextImageHash:T,payload:w}=g;if(v){const j=v.checkpoint;if(c){if(P.gte(j))continue}else if(P.lte(j))continue}const I=new Map((await Promise.all(u.map(async function(j){const H=await i.store.loadSignatureOfSubdigest(j,w.subdigest);if(!H)return[j,void 0];const K=te(i.useEIP5719?await i.cachedEIP5719.runByEIP5719(j,w.subdigest,H):H),F=he.signer.tryRecoverSigner(w.subdigest,K)!==j;return[j,{isDynamic:F,signature:K}]}))).filter(j=>!!j[1]));if(I.size===0)continue;const B=Ve.signature.SignatureCoder.encodeSigners(l,I,[],0);B.weight.lt(l.threshold)||(v={nextImageHash:T,checkpoint:J.from(S.checkpoint),signature:B.encoded})}if(!v)return[];const m=await i.loadPresignedConfiguration({wallet:o,fromImageHash:v.nextImageHash,longestPath:c});return[{wallet:o,nextImageHash:v.nextImageHash,signature:v.signature},...m]},this.saveWitnesses=async function(s){const o={digest:s.digest,address:s.wallet,chainId:s.chainId},a=he.signature.subdigestOf(o);await Promise.all([i.savePayload({payload:o}),...s.signatures.filter(c=>he.signer.canRecover(c)).map(c=>{const l=he.signer.recoverSigner(a,c);return i.store.saveSignatureOfSubdigest(l,a,c)})])},this.walletsOfSigner=async function(s){const o=await i.store.loadSubdigestsOfSigner(s.signer),a=await Promise.all(o.map(l=>i.payloadOfSubdigest({subdigest:l}))).then(l=>l.filter(u=>u!==void 0)),c=[];for(const l of a){const u=l.address;if(c.find(h=>h.wallet===u))continue;const f=he.signature.subdigestOf(l),d=await i.store.loadSignatureOfSubdigest(s.signer,f);d&&c.push({wallet:u,proof:{digest:l.digest,chainId:J.from(l.chainId),signature:te(d)}})}return c},this.provider=e,this.store=r,this.useEIP5719=n,this.cachedEIP5719=new Bve(e)}async saveMigration(e,r,n){const i=r.fromVersion;if(i!==1)throw new Error("Migration not supported");if(!Ve.config.isWalletConfig(r.toConfig))throw new Error("Invalid to config");const{newImageHash:s,address:o}=oj.v1v2.decodeTransaction(r.tx,n);if(o!==e)throw new Error("Invalid migration transaction - address");if(Ve.config.ConfigCoder.imageHashOf(r.toConfig)!=s)throw new Error("Invalid migration transaction - config");const a=he.transaction.packMetaTransactionsData(r.tx.nonce,r.tx.transactions),c=Be(a),l={chainId:r.tx.chainId,message:a,address:e,digest:c},u=he.signature.subdigestOf(l),f=this.savePayload({payload:l}),d=this.saveWalletConfig({config:r.toConfig}),h=Io.signature.SignatureCoder.decode(r.tx.signature),p=await Io.signature.SignatureCoder.recover(h,l,this.provider),v=Io.signature.SignatureCoder.signaturesOf(p.config);await Promise.all([f,d,this.saveWalletConfig({config:p.config}),this.store.saveMigrationsSubdigest(e,i,i+1,u,s),...v.map(b=>this.store.saveSignatureOfSubdigest(b.address,p.subdigest,b.signature))])}async getMigration(e,r,n,i){var s=this;const[o,a]=await Promise.all([this.configOfImageHash({imageHash:r}),this.store.loadMigrationsSubdigest(e,n,n+1)]),c=Zr.coderFor(n);return!o||!c.config.isWalletConfig(o)?void 0:(await Promise.all(a.map(async function(u){const{subdigest:f,toImageHash:d}=u,h=await s.payloadOfSubdigest({subdigest:f});if(!h||!h.message||!J.from(i).eq(h.chainId))return;const p=c.config.signersOf(o).map(g=>g.address),v=new Map((await Promise.all(p.map(async function(g){const S=await s.store.loadSignatureOfSubdigest(g,f);if(!S)return[g,void 0];const P=te(s.useEIP5719?await s.cachedEIP5719.runByEIP5719(g,f,S):S),T=he.signer.tryRecoverSigner(f,P)!==g;return[g,{isDynamic:T,signature:P}]}))).filter(g=>!!g[1])),b=c.signature.encodeSigners(o,v,[],i);if(!b||b.weightu.filter(f=>f!==void 0)))[0]}updateProvider(e){this.provider=e}}var sme=Object.freeze({__proto__:null,LocalConfigTracker:A8});let V2=function(t){return t.EIP712="EIP712",t.EthSign="EthSign",t.EIP1271="EIP1271",t}({});class ome{constructor(e,r){this.path="/rpc/Sessions/",this.ping=n=>this.fetch(this.url("Ping"),rs({},n)).then(i=>ns(i).then(s=>({}))),this.config=(n,i)=>this.fetch(this.url("Config"),rs(n,i)).then(s=>ns(s).then(o=>({version:o.version,config:o.config}))),this.wallets=(n,i)=>this.fetch(this.url("Wallets"),rs(n,i)).then(s=>ns(s).then(o=>({wallets:o.wallets}))),this.deployHash=(n,i)=>this.fetch(this.url("DeployHash"),rs(n,i)).then(s=>ns(s).then(o=>({deployHash:o.deployHash,context:o.context}))),this.configUpdates=(n,i)=>this.fetch(this.url("ConfigUpdates"),rs(n,i)).then(s=>ns(s).then(o=>({updates:o.updates}))),this.migrations=(n,i)=>this.fetch(this.url("Migrations"),rs(n,i)).then(s=>ns(s).then(o=>({migrations:o.migrations}))),this.saveConfig=(n,i)=>this.fetch(this.url("SaveConfig"),rs(n,i)).then(s=>ns(s).then(o=>({}))),this.saveWallet=(n,i)=>this.fetch(this.url("SaveWallet"),rs(n,i)).then(s=>ns(s).then(o=>({}))),this.saveSignature=(n,i)=>this.fetch(this.url("SaveSignature"),rs(n,i)).then(s=>ns(s).then(o=>({}))),this.saveSignerSignatures=(n,i)=>this.fetch(this.url("SaveSignerSignatures"),rs(n,i)).then(s=>ns(s).then(o=>({}))),this.saveMigration=(n,i)=>this.fetch(this.url("SaveMigration"),rs(n,i)).then(s=>ns(s).then(o=>({}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const rs=(t={},e={})=>({method:"POST",headers:wc({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),ns=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r});class ame{constructor(e,r=!0){this.onlyRecoverable=r,this.sessions=new ome(e,fetch)}async loadPresignedConfiguration(e){try{const{updates:r}=await this.sessions.configUpdates({wallet:e.wallet,fromImageHash:e.fromImageHash,allUpdates:e.longestPath});return r.map(({toImageHash:n,signature:i})=>({wallet:e.wallet,nextImageHash:n,signature:i}))}catch(r){if(G2(r))return[];throw r}}async savePresignedConfiguration(e){const r=e.nextConfig,n=Zr.genericCoderFor(r.version).config.imageHashOf(r),i=Ve.signature.setImageHashStruct(n),s=Be(i);await this.sessions.saveSignature({wallet:e.wallet,digest:s,chainID:"0",signature:e.signature,toConfig:Xp(r)})}async saveWitnesses(e){let r=e.signatures;this.onlyRecoverable&&(r=r.filter(n=>he.signer.canRecover(n))),await this.sessions.saveSignerSignatures({wallet:e.wallet,digest:e.digest,chainID:Xu(e.chainId),signatures:r})}async configOfImageHash(e){try{const{version:r,config:n}=await this.sessions.config(e);return cme(r,n)}catch(r){if(G2(r))return;throw r}}async saveWalletConfig(e){const r=Xp(e.config);await this.sessions.saveConfig({version:e.config.version,config:r})}async imageHashOfCounterfactualWallet(e){try{const{deployHash:r,context:n}=await this.sessions.deployHash(e);return{imageHash:r,context:n}}catch(r){if(G2(r))return;throw r}}async saveCounterfactualWallet(e){const r=Xp(e.config);await this.sessions.saveWallet({version:e.config.version,deployConfig:r})}async walletsOfSigner(e){const{wallets:r}=await this.sessions.wallets(e);return Object.entries(r).map(([n,{digest:i,chainID:s,type:o,signature:a}])=>{switch(o){case V2.EIP712:a+=te(he.signer.SigType.EIP712).slice(2);break;case V2.EthSign:a+=te(he.signer.SigType.ETH_SIGN).slice(2);break;case V2.EIP1271:a+=te(he.signer.SigType.WALLET_BYTES32).slice(2);break}return{wallet:n,proof:{digest:i,signature:a,chainId:J.from(s)}}})}async getMigration(e,r,n,i){var s=this;const o=Xu(i),{migrations:a}=await this.sessions.migrations({wallet:e,fromVersion:n,fromImageHash:r,chainID:o}),c=async function(f){const d=a[f];if(d){const h=Object.keys(d).map(Number).sort((p,v)=>v-p);for(const p of h)for(const[v,b]of Object.entries(d[p]))try{const y=await s.configOfImageHash({imageHash:v});if(y)return{fromVersion:n,toVersion:p,toConfig:y,tx:{entrypoint:b.executor,transactions:b.transactions,nonce:b.nonce,signature:b.signature,chainId:f,intent:{id:he.transaction.subdigestOfTransactions(e,f,b.nonce,b.transactions),wallet:e}}}}catch(y){console.error(y)}}},l=await c(o);if(l)return l;for(const u in a)if(u!==o){const f=await c(u);if(f)return f}}async saveMigration(e,r,n){await this.sessions.saveMigration({wallet:e,fromVersion:r.fromVersion,toVersion:r.toVersion,toConfig:Xp(r.toConfig),executor:r.tx.entrypoint,transactions:r.tx.transactions.map(lme),nonce:Xu(r.tx.nonce),signature:r.tx.signature,chainID:Xu(r.tx.chainId)})}}function Xp(t){switch(t.version){case 1:if(Io.config.ConfigCoder.isWalletConfig(t))return{threshold:ml(t.threshold),signers:t.signers.map(({weight:e,address:r})=>({weight:ml(e),address:r}))};throw new Error(`not a v${t.version} config: ${t}`);case 2:if(Ve.config.ConfigCoder.isWalletConfig(t))return{threshold:ml(t.threshold),checkpoint:ml(t.checkpoint),tree:zv(t.tree)};throw new Error(`not a v${t.version} config: ${t}`);default:throw new Error(`unknown version ${t.version}`)}}function zv(t){return Ve.config.isNode(t)?{left:zv(t.left),right:zv(t.right)}:Ve.config.isSignerLeaf(t)?{weight:ml(t.weight),address:t.address}:Ve.config.isNestedLeaf(t)?{weight:ml(t.weight),threshold:ml(t.threshold),tree:zv(t.tree)}:Ve.config.isNodeLeaf(t)?{node:t.nodeHash}:wc({},t)}function cme(t,e){switch(t){case 1:return wc({},e,{version:t});case 2:return wc({},e,{version:t,tree:Wv(e.tree)});default:throw new Error(`unknown version ${t}`)}}function Wv(t){switch(typeof t){case"object":const e=wc({},t);return e.left!==void 0&&(e.left=Wv(e.left)),e.right!==void 0&&(e.right=Wv(e.right)),e.tree!==void 0&&(e.tree=Wv(e.tree)),e.node!==void 0&&(e.nodeHash=e.node,delete e.node),e;default:throw new Error(`v2 config tree ${t} is not an object`)}}function lme(t){return{to:t.to,value:t.value!==void 0?Xu(t.value):void 0,data:t.data!==void 0?te(t.data):void 0,gasLimit:t.gasLimit!==void 0?Xu(t.gasLimit):void 0,delegateCall:t.delegateCall,revertOnError:t.revertOnError}}function ml(t){return J.from(t).toNumber()}function Xu(t){return J.from(t).toString()}function G2(t){return typeof t=="object"&&t.status===404}var ume=Object.freeze({__proto__:null,RemoteConfigTracker:ame});function r5(t,e,r){return new Promise(n=>{let i=0;t.forEach(s=>s.then(o=>{r(o)?n(o):(i++,i===t.length&&n(e))}).catch(()=>{i++,i===t.length&&n(e)}))})}async function vh(t,e){return Promise.all(t.map(r=>r.catch(()=>e)))}class fme{constructor(e){this.trackers=e}async configOfImageHash(e){const r=this.trackers.map(async function(a,c){return{res:await a.configOfImageHash(e),i:c}}),n=await r5(r,void 0,a=>(a==null?void 0:a.res)===void 0?!1:Zr.genericCoderFor(a.res.version).config.isComplete(a.res));if(n!=null&&n.res)return this.saveWalletConfig({config:n.res,skipTracker:n.i}),n.res;const i=new A8(void 0),s=await vh(r,void 0);for(const a of s)a!=null&&a.res&&await i.saveWalletConfig({config:a.res});const o=await i.configOfImageHash(e);return o&&this.saveWalletConfig({config:o}),o}async saveWalletConfig(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveWalletConfig(e)}))}async imageHashOfCounterfactualWallet(e){const r=await r5(this.trackers.map(n=>n.imageHashOfCounterfactualWallet(e)),void 0,n=>!!n);return r&&this.configOfImageHash({imageHash:r.imageHash}).then(n=>{n&&this.saveCounterfactualWallet({config:n,context:[r.context]})}),r}async saveCounterfactualWallet(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveCounterfactualWallet(e)}))}async walletsOfSigner(e){const r=await vh(this.trackers.map(o=>o.walletsOfSigner(e)),[]).then(o=>o.flat()),n={};for(const o of r)n[o.wallet]=o.proof;const i=Object.keys(n).map(o=>({wallet:o,proof:n[o]})),s=new Map;return i.forEach(({wallet:o,proof:{digest:a,chainId:c,signature:l}})=>{const u=`${o}-${a}-${c}`;let f=s.get(u);f||(f={wallet:o,digest:a,chainId:c,signatures:[]},s.set(u,f)),f.signatures.push(l)}),s.forEach(o=>this.saveWitnesses(o)),i}async saveWitnesses(e){await Promise.all(this.trackers.map(r=>r.saveWitnesses(e)))}async loadPresignedConfiguration(e){var r=this;const n=await vh(this.trackers.map(c=>c.loadPresignedConfiguration(e)),[]),s=(await vh(n.map(async function(c){const l=c[c.length-1],u=await r.configOfImageHash({imageHash:l.nextImageHash});if(u)return{checkpoint:Zr.genericCoderFor(u.version).config.checkpointOf(u),result:c}}),void 0)).reduce((c,l)=>l&&(!c||l.checkpoint.gt(c.checkpoint))?l:c);if(!s)return[];const o=new Map,a=c=>(o.has(c)||o.set(c,this.configOfImageHash({imageHash:c})),o.get(c));return s.result.forEach(async function(c){const l=await a(c.nextImageHash);l&&r.savePresignedConfiguration({wallet:e.wallet,nextConfig:l,signature:c.signature})}),s.result}async savePresignedConfiguration(e){await Promise.all(this.trackers.map(r=>r.savePresignedConfiguration(e)))}async getMigration(e,r,n,i){return(await Promise.all(this.trackers.map(o=>o.getMigration(e,r,n,i)))).find(o=>!!o)}async saveMigration(e,r,n){await Promise.all(this.trackers.map(i=>i.saveMigration(e,r,n)))}}class dme{constructor(e,r,n){this.tracker=e,this.cache=r,this.contexts=n}async loadPresignedConfiguration(e){var r=this;const n=[this.tracker.loadPresignedConfiguration(e),this.cache.loadPresignedConfiguration(e)];let i;const[s,o]=await Promise.all(n);if(s.length>0&&o.length>0&&s[s.length-1].nextImageHash===o[o.length-1].nextImageHash)i=e.longestPath===!0?s.length>o.length?s:o:s.lengthf&&(!u||f.checkpoint.gt(u.checkpoint))?f:u))==null?void 0:c.result)!=null?a:[]}return i||[]}async savePresignedConfiguration(e){await Promise.all([this.tracker.savePresignedConfiguration(e),this.cache.savePresignedConfiguration(e)])}async configOfImageHash(e){if(e.noCache!==!0){const n=await this.cache.configOfImageHash(e);if(n)return n}const r=await this.tracker.configOfImageHash(e);return r&&await this.cache.saveWalletConfig({config:r}),r}async saveWalletConfig(e){await Promise.all([this.tracker.saveWalletConfig(e),this.cache.saveWalletConfig(e)])}async imageHashOfCounterfactualWallet(e){if(e.noCache!==!0){const n=await this.cache.imageHashOfCounterfactualWallet(e);if(n)return n}const r=await this.tracker.imageHashOfCounterfactualWallet(e);if(r){const n=await this.configOfImageHash({imageHash:r.imageHash});n&&await this.cache.saveCounterfactualWallet({config:n,context:[r.context]})}return r}async saveCounterfactualWallet(e){await Promise.all([this.tracker.saveCounterfactualWallet(e),this.cache.saveCounterfactualWallet(e)])}async walletsOfSigner(e){if(e.noCache)return this.tracker.walletsOfSigner(e);const r=await Promise.all([this.tracker.walletsOfSigner(e),this.cache.walletsOfSigner(e)]),n=new Map;for(const i of r)for(const s of i)n.set(s.wallet,s);return Array.from(n.values())}async saveWitnesses(e){await Promise.all([this.tracker.saveWitnesses(e),this.cache.saveWitnesses(e)])}async getMigration(e,r,n,i){const s=await this.cache.getMigration(e,r,n,i);if(s)return s;const o=await this.tracker.getMigration(e,r,n,i);return o&&await this.cache.saveMigration(e,o,this.contexts),o}async saveMigration(e,r,n){await Promise.all([this.tracker.saveMigration(e,r,n),this.cache.saveMigration(e,r,n)])}}class TT{constructor(){this.cache=new Map}do(e,r,n,...i){e=`${e}:${Be(wt(JSON.stringify(i,hme)))}`;let s=this.cache.get(e);if(s&&s.expiration&&new Date>=s.expiration&&(s=void 0,this.cache.delete(e)),!s){const o={promise:n(...i)};r!==void 0&&(o.promise=o.promise.then(a=>(o.expiration=new Date(Date.now()+r),a))),s=o,this.cache.set(e,s)}return s.promise}}function hme(t,e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).sort()):e}function pme(t){return t instanceof kj}class kj{constructor(e,r=50,n=!1){this.cache=new TT,this.tracker=e,this.window=r,this.verbose=n}invalidateCache(){this.cache=new TT}configOfImageHash(e){return this.cache.do("configOfImageHash",this.window,r=>this.tracker.configOfImageHash(r),e)}getMigration(e,r,n,i){return this.cache.do("getMigration",this.window,(...s)=>this.tracker.getMigration(...s),e,r,n,i)}saveMigration(e,r,n){return this.cache.do("saveMigration",void 0,(...i)=>this.tracker.saveMigration(...i),e,r,n)}loadPresignedConfiguration(e){return this.cache.do("loadPresignedConfiguration",this.window,r=>this.tracker.loadPresignedConfiguration(r),e)}savePresignedConfiguration(e){return this.cache.do("savePresignedConfiguration",void 0,r=>this.tracker.savePresignedConfiguration(r),e)}saveWitnesses(e){return this.cache.do("saveWitnesses",void 0,r=>this.tracker.saveWitnesses(r),e)}saveWalletConfig(e){return this.cache.do("saveWalletConfig",void 0,r=>this.tracker.saveWalletConfig(r),e)}imageHashOfCounterfactualWallet(e){return this.cache.do("imageHashOfCounterfactualWallet",void 0,r=>this.tracker.imageHashOfCounterfactualWallet(r),e)}saveCounterfactualWallet(e){return this.cache.do("saveCounterfactualWallet",void 0,r=>this.tracker.saveCounterfactualWallet(r),e)}walletsOfSigner(e){return this.cache.do("walletsOfSigner",this.window,r=>this.tracker.walletsOfSigner(r),e)}updateProvider(e){this.tracker instanceof A8&&this.tracker.updateProvider(e)}}var _8=Object.freeze({__proto__:null,debug:rme,local:sme,remote:ume,stores:ime,raceUntil:r5,allSafe:vh,MultipleTracker:fme,CachedTracker:dme,isDedupedTracker:pme,DedupedTracker:kj});const vme=Object.freeze(Object.defineProperty({__proto__:null,tracker:eme,trackers:_8},Symbol.toStringTag,{value:"Module"})),Aj=60*60*24*7,mme=60;class IT{constructor(e,r,n={}){this.proofStrings=new Map,this.onAuthCallbacks=[],this.indexerClients=new Map,this.account=e,this.settings=r,this.status=n}now(){return Math.floor(Date.now()/1e3)}get expiration(){var e;return Math.max((e=this.settings.metadata.expiration)!=null?e:Aj,120)}onAuth(e){return this.onAuthCallbacks.push(e),()=>this.onAuthCallbacks=this.onAuthCallbacks.filter(r=>r!==e)}async dump(){return this.status.jwt?{jwt:{token:await this.status.jwt.token,expiration:this.status.jwt.expiration},metadata:this.status.metadata}:{metadata:this.settings.metadata}}auth(e=5){var r=this;return this._initialAuthRequest?this._initialAuthRequest:(this._initialAuthRequest=async function(){const n=r.settings.sequenceApiUrl;if(!n)throw Error("No sequence api url");let i;for(let s=1;;s++)try{i=(await r.getJWT(!0)).token;break}catch(o){if(s===e)throw console.error(`couldn't authenticate after ${e} attempts`,o),o}return new Uh(n,void 0,i)}(),this._initialAuthRequest)}async getJWT(e){var r=this;const n=this.settings.sequenceApiUrl;if(!n)throw Error("No sequence api url");if(this.status.jwt){const l=this.status.jwt,u=await l.token;if(this.now(){throw this.status.jwt=void 0,l}),expiration:o};return this.status.jwt=a,a.token.then(l=>{this.onAuthCallbacks.forEach(u=>{try{u({status:"fulfilled",value:l})}catch{}})}).catch(l=>{this.onAuthCallbacks.forEach(u=>{try{u({status:"rejected",reason:l})}catch{}})}),{token:await a.token,expiration:o}}getProofStringKey(){return`${this.account.address} - ${this.settings.metadata.name}`}async isProofStringValid(e){try{const r=new t1,n=J.from(this.settings.sequenceApiChainId),i=bs(this.account.networks,n);if(!i)throw Error("No network found");return r.chainId=n.toNumber(),r.provider=new Fm(r1(i.rpcUrl),{name:"",chainId:n.toNumber()}),await r.decodeProof(e),!0}catch{return!1}}async getAPIClient(e=!0){if(!this.apiClient){const r=this.settings.sequenceApiUrl;if(!r)throw Error("No sequence api url");const n=(await this.getJWT(e)).token;this.apiClient=new Uh(r,void 0,n)}return this.apiClient}async getMetadataClient(e=!0){if(!this.metadataClient){const r=(await this.getJWT(e)).token;this.metadataClient=new S8(this.settings.sequenceMetadataUrl,void 0,r)}return this.metadataClient}async getIndexerClient(e,r=!0){const n=bs(this.account.networks,e);if(!n)throw Error(`No network for chain ${e}`);if(!this.indexerClients.has(n.chainId))if(n.indexer)this.indexerClients.set(n.chainId,n.indexer);else if(n.indexerUrl){const i=(await this.getJWT(r)).token;this.indexerClients.set(n.chainId,new C8(n.indexerUrl,void 0,i))}else throw Error(`No indexer url for chain ${e}`);return this.indexerClients.get(n.chainId)}getProofString(e){if(this.proofStrings.has(e)){const c=this.proofStrings.get(e);if(this.now()(r.signature=c,n.encodeProof(r,!0))).catch(c=>{throw this.proofStrings.delete(e),c}),expiration:o};return this.proofStrings.set(e,a),a}}const _j=async(t,e,r)=>{const n=qe(await t.getAddress());if(!n||n===""||n==="0x")throw Pj;const i=new Sb;if(i.address=n,!r||!r.app||r.app==="")throw new P8("authorization options requires app to be set");i.claims.app=r.app,i.claims.ogn=r.origin,i.claims.n=r.nonce,i.setExpiryIn(r.expiry?Math.max(r.expiry,200):Aj);const s=i.messageTypedData(),o=pF(e);i.signature=await(t instanceof $o?t.signTypedData(s.domain,s.types,s.message,o,"eip6492"):t.signTypedData(s.domain,s.types,s.message,o));const c=await new t1().encodeProof(i,!0);return{typedData:s,proofString:c}};class P8 extends Error{constructor(e){super(e),this.name="AuthError"}}const Pj=new P8("auth error: account address is empty");function al(){return al=Object.assign?Object.assign.bind():function(t){for(var e=1;eI.wallet)));let T;if(P){if(T=new $o({address:P,tracker:y,networks:b,contexts:v,orchestrator:p}),l&&l.length>0){let I=await T.status(g);if(I.original.version!==I.version||T.version!==I.version){const{migratedAllChains:H,failedChains:K}=await T.isMigratedAllChains();if(K.some(F=>n5.includes(F)))throw Error(`Failed to fetch account status on ${K.join(", ")}`);if(!H){if(h&&!await h(T))throw Error("Migration cancelled, cannot open session");const{failedChains:F}=await T.signAllMigrations(d||(_=>_));if(F.some(_=>n5.includes(_)))throw Error(`Failed to sign migrations on ${F.join(", ")}`);_8.isDedupedTracker(y)&&y.invalidateCache();let E;if([E,I]=await Promise.all([T.isMigratedAllChains().then(_=>_.migratedAllChains),T.status(g)]),!E)throw Error("Failed to migrate account")}}I.onChain.version!==I.version&&await T.doBootstrap(g,void 0,I);const B=I.config,j=T.coders.config.editConfig(B,{add:l,threshold:c});if(T.coders.config.imageHashOf(B)!==T.coders.config.imageHashOf(j)){const H=T.coders.config.editConfig(j,{checkpoint:T.coders.config.checkpointOf(B).add(1)});await T.updateConfig(H)}}}else{if(!l||l.length===0)throw Error("Cannot create new account without signers");if(!c)throw Error("Cannot create new account without threshold");if(T=await $o.new({config:{threshold:c,checkpoint:0,signers:l},tracker:y,contexts:v,orchestrator:p,networks:b}),P=await u([T.address]),await T.publishWitness(),!(await y.walletsOfSigner({signer:a,noCache:!0})).some(B=>B.wallet===T.address))throw Error("Account not found on tracker")}let w;return m&&(w=new IT(T,m),w.auth(),w.onAuth(I=>{I.status==="fulfilled"&&T.setJwt(I.value)})),new Jh(b,v,T,w)}static async load(e){const{dump:r,settings:n,editConfigOnMigration:i,onMigration:s,orchestrator:o}=e,{contexts:a,networks:c,tracker:l,services:u}=al({},Hv,n);let f;if(Tj(r)){var d,h,p;const S=r.config.address||he.context.addressOf(a[1],Io.config.ConfigCoder.imageHashOf(al({},r.config,{version:1}))),P=((d=(h=r.jwt)==null?void 0:h.expiration)!=null?d:0)T.migratedAllChains)){if(s&&!await s(f))throw Error("Migration cancelled, cannot open session");if(console.log("Migrating account..."),await f.signAllMigrations(i),!await f.isMigratedAllChains().then(T=>T.migratedAllChains))throw Error("Failed to migrate account")}}else if(Ij(r)){var v,b,y;const S=((v=(b=r.jwt)==null?void 0:b.expiration)!=null?v:0)async(n,i,s)=>{const o=s.messageDigest();return{isValid:await t(i).isValidSignature(s.address,o,s.signature)}},gme=Object.freeze(Object.defineProperty({__proto__:null,AuthError:P8,CRITICAL_CHAINS:n5,ErrAccountIsRequired:Pj,Session:Jh,SessionSettingsDefault:Hv,ValidateSequenceWalletProof:yme,isSessionDumpV1:Tj,isSessionDumpV2:Ij,signAuthorization:_j},Symbol.toStringTag,{value:"Module"}));function Sy(){return Sy=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),Pn({},n)).then(i=>Tn(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),Pn({},n)).then(i=>Tn(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),Pn({},n)).then(i=>Tn(i).then(s=>({status:s.status}))),this.getSignerConfig=(n,i)=>this.fetch(this.url("GetSignerConfig"),Pn(n,i)).then(s=>Tn(s).then(o=>({signerConfig:o.signerConfig}))),this.sign=(n,i)=>this.fetch(this.url("Sign"),Pn(n,i)).then(s=>Tn(s).then(o=>({sig:o.sig}))),this.signWith=(n,i)=>this.fetch(this.url("SignWith"),Pn(n,i)).then(s=>Tn(s).then(o=>({sig:o.sig}))),this.authMethods=(n,i)=>this.fetch(this.url("AuthMethods"),Pn(n,i)).then(s=>Tn(s).then(o=>({methods:o.methods,active:o.active}))),this.setPIN=(n,i)=>this.fetch(this.url("SetPIN"),Pn(n,i)).then(s=>Tn(s).then(o=>({}))),this.resetPIN=(n,i)=>this.fetch(this.url("ResetPIN"),Pn(n,i)).then(s=>Tn(s).then(o=>({}))),this.createTOTP=(n,i)=>this.fetch(this.url("CreateTOTP"),Pn(n,i)).then(s=>Tn(s).then(o=>({uri:o.uri}))),this.commitTOTP=(n,i)=>this.fetch(this.url("CommitTOTP"),Pn(n,i)).then(s=>Tn(s).then(o=>({codes:o.codes}))),this.resetTOTP=(n,i)=>this.fetch(this.url("ResetTOTP"),Pn(n,i)).then(s=>Tn(s).then(o=>({}))),this.reset2FA=(n,i)=>this.fetch(this.url("Reset2FA"),Pn(n,i)).then(s=>Tn(s).then(o=>({}))),this.recoveryCodes=(n,i)=>this.fetch(this.url("RecoveryCodes"),Pn(n,i)).then(s=>Tn(s).then(o=>({codes:o.codes}))),this.resetRecoveryCodes=(n,i)=>this.fetch(this.url("ResetRecoveryCodes"),Pn(n,i)).then(s=>Tn(s).then(o=>({codes:o.codes}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Pn=(t={},e={})=>({method:"POST",headers:Sy({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),Tn=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),wme=typeof global=="object"?global.fetch:window.fetch;class Eme{constructor(e,r,n=!1){this.address=e,this.url=r,this.appendSuffix=n,this.guard=new bme(r,wme)}async getAddress(){return this.address}async buildDeployTransaction(e){}async predecorateSignedTransactions(e){return[]}async decorateTransactions(e,r){return e}async requestSignature(e,r,n,i){var s;const{onSignature:o,onRejection:a}=i;if(!he.isWalletSignRequestMetadata(n))return a("expected sequence signature request metadata"),!1;const c=n.guardTotpCode,l=Zr.genericCoderFor(n.config.version),{encoded:u}=l.signature.encodeSigners(n.config,(s=n.parts)!=null?s:new Map,[],n.chainId);try{const{sig:h}=await this.guard.signWith({signer:this.address,request:{msg:te(r),auxData:this.packMsgAndSig(n.address,n.digest,u,n.chainId),chainId:J.from(n.chainId).toNumber()},token:c?{id:ky.TOTP,token:c}:void 0});if(re(h).length===0)throw new Error("guard response contained no signature data");return o(h),!0}catch(h){var f,d;return a(`unable to request guard signature: ${(f=(d=h.message)!=null?d:h.msg)!=null?f:h}`),!1}}notifyStatusChange(e,r,n){}async getAuthMethods(e){let r;if("jwt"in e)r=await this.guard.authMethods({},{Authorization:`BEARER ${e.jwt}`});else{const n=await OT(e);r=await this.guard.authMethods({proof:{wallet:n.walletAddress,timestamp:n.timestamp.getTime(),signer:n.signerAddress,signature:n.signature}})}return Sy({},r,{methods:r.methods.map(xme)})}async setPin(e,r){const n=await eh(r);e===void 0?await this.guard.resetPIN({timestamp:n.timestamp.getTime(),signature:n.signature},{Authorization:`BEARER ${r.jwt}`}):await this.guard.setPIN({pin:e,timestamp:n.timestamp.getTime(),signature:n.signature},{Authorization:`BEARER ${r.jwt}`})}resetPin(e){return this.setPin(void 0,e)}async createTotp(e){const r=await eh(e),{uri:n}=await this.guard.createTOTP({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return new URL(n)}async commitTotp(e,r){const{codes:n}=await this.guard.commitTOTP({token:e},{Authorization:`BEARER ${r}`});return n}async resetTotp(e){const r=await eh(e);await this.guard.resetTOTP({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`})}async reset2fa(e,r){if("jwt"in r)await this.guard.reset2FA({code:e},{Authorization:`BEARER ${r.jwt}`});else{const n=await OT(r);await this.guard.reset2FA({code:e,proof:{wallet:n.walletAddress,timestamp:n.timestamp.getTime(),signer:n.signerAddress,signature:n.signature}})}}async getRecoveryCodes(e){const r=await eh(e),{codes:n}=await this.guard.recoveryCodes({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return n}async resetRecoveryCodes(e){const r=await eh(e),{codes:n}=await this.guard.resetRecoveryCodes({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return n}packMsgAndSig(e,r,n,i){return Bn.encode(["address","uint256","bytes","bytes"],[e,i,r,n])}suffix(){return this.appendSuffix?[3]:[]}}let ky=function(t){return t.PIN="PIN",t.TOTP="TOTP",t}({});function xme(t){switch(t){case ky.PIN:case ky.TOTP:return t;default:throw new Error(`unknown auth method '${t}'`)}}function Cme(t){return"signerAddress"in t&&typeof t.signerAddress=="string"}async function OT(t){if(Cme(t))return t;{const e=XC.isSapientSigner(t.signer)?t.signer:new XC.SignerWrapper(t.signer),r=await e.getAddress(),n=new Date,i=Oj(t.walletAddress,n),s=H1(i),o=te(A1(32));return new Promise((a,c)=>e.requestSignature(o,s,{},{onSignature(l){a({walletAddress:t.walletAddress,timestamp:n,signerAddress:r,signature:te(l)})},onRejection:c,onStatus(l){}}))}}async function eh(t){if("wallet"in t){var e;const r=new Date,n=Rj(r),i=await t.wallet.signTypedData(n.domain,n.types,n.message,(e=n.domain.chainId)!=null?e:1,"eip6492");return{jwt:t.jwt,timestamp:r,signature:i}}else return t}function Oj(t,e){return{domain:Mj,types:{AuthMethods:[{name:"wallet",type:"address"},{name:"timestamp",type:"string"}]},message:{wallet:qe(t),timestamp:$j(e)}}}function Rj(t){return{domain:Mj,types:{AuthUpdate:[{name:"timestamp",type:"string"}]},message:{timestamp:$j(t)}}}const Mj={name:"Sequence Guard",version:"1",chainId:1};function $j(t){return t.toUTCString().replace("GMT","UTC")}const Sme=Object.freeze(Object.defineProperty({__proto__:null,AuthMethod:ky,GuardSigner:Eme,getAuthUpdateProofTypedData:Rj,getOwnershipProofTypedData:Oj},Symbol.toStringTag,{value:"Module"}));function Ay(){return Ay=Object.assign?Object.assign.bind():function(t){for(var e=1;e{this.queue.length>0&&(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.run,this.options.timeWindow))},this.handle=(n,i,s)=>{if(this.batchableJsonRpcMethods.find(o=>o===i.method)){this.queue.push({request:i,callback:s,next:n}),this.options.verbose&&console.log("Scheduling call",i.method),this.scheduleExecution();return}return this.options.verbose&&console.log("Forwarded call",i.method),n(i,s)},this.run=async function(){r.options.verbose&&console.log("Processing multicall");const n=Math.min(r.options.batchSize,r.queue.length);if(n===0){r.options.verbose&&console.log("Skip multicall, empty queue");return}if(n===1){r.forward(r.queue[0]),r.queue=[],r.options.verbose&&console.log("Skip multicall, single item");return}r.options.verbose&&console.log("Resolving",n);var a=r.queue.slice(0,n);r.queue=n===r.queue.length?[]:r.queue.slice(n),r.options.verbose&&console.log("Updated queue",r.queue.length),r.queue.length!==0&&(r.options.verbose&&console.log("Scheduling next batch"),r.scheduleExecution());const i=a[0].next;let s;var[a,c]=RT(a,h=>{try{if(h.next!==i)return!1;switch(h.request.method){case Rr.ethCall:if(h.request.params[0].from||h.request.params[0].gasPrice||h.request.params[0].value)return!1;case Rr.ethGetBalance:case Rr.ethGetCode:const p=Ame(h.request.params[1]);if(s===void 0&&(s=p),!_me(p,s))return!1}return!0}catch{return!1}});if(c.length!==0&&(r.options.verbose&&console.log("Forwarding incompatible calls",c.length),r.forward(c),a.length===0)){r.options.verbose&&console.log("Skip multicall, all calls are incompatible");return}let o=a.map(h=>{try{switch(h.request.method){case Rr.ethCall:return{delegateCall:!1,revertOnError:!1,target:h.request.params[0].to,data:h.request.params[0].data,gasLimit:h.request.params[0].gas?h.request.params[0].gas:0,value:0};case Rr.ethGetCode:return{delegateCall:!1,revertOnError:!1,target:r.options.contract,gasLimit:0,value:0,data:r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("callCode"),[h.request.params[0]])};case Rr.ethGetBalance:return{delegateCall:!1,revertOnError:!1,target:r.options.contract,gasLimit:0,value:0,data:r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("callBalanceOf"),[h.request.params[0]])};default:return null}}catch{return null}});var[a,c]=RT(a,(h,p)=>o[p]!==void 0);if(o=o.filter(h=>h),c.length!==0&&(r.options.verbose&&console.log("Forwarding calls on error",c.length),r.forward(c),a.length===0)){r.options.verbose&&console.log("Skip multicall, all calls had encoding errors");return}let l;try{r.options.verbose&&console.log("Encoding multicall"),l=r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("multiCall"),[o])}catch(h){r.options.verbose&&console.warn("Error encoding multicall, forwarding one by one",h),r.forward(a);return}const u=e8(),f=await kme(ZS(i)({id:u,jsonrpc:Hf,method:Rr.ethCall,params:[{to:r.options.contract,value:0,data:l},J.isBigNumber(s)?s.toNumber():s]}),h=>({jsonrpc:Hf,id:u,result:void 0,error:h}));if(f.error)return r.options.verbose&&console.warn("Error calling multicall, forwarding one by one",f.error),r.forward(a);let d;try{d=r.multicallInterface.decodeFunctionResult(r.multicallInterface.getFunction("multiCall"),f.result)}catch(h){r.options.verbose&&console.warn("Error decoding multicall result, forwarding one by one",h),r.forward(a);return}r.options.verbose&&console.log("Got response for",a.length),a.forEach((h,p)=>{if(!d[0][p])r.options.verbose&&console.warn(`Multicall error for ${h.request.method} not found`),r.forward(h);else switch(h.request.method){case Rr.ethCall:h.callback(void 0,{jsonrpc:h.request.jsonrpc,id:h.request.id,result:d[1][p]});break;case Rr.ethGetCode:h.callback(void 0,{jsonrpc:h.request.jsonrpc,id:h.request.id,result:Bn.decode(["bytes"],d[1][p])[0]});break;case Rr.ethGetBalance:h.callback(void 0,{jsonrpc:h.request.jsonrpc,id:h.request.id,result:Bn.decode(["uint256"],d[1][p])[0]});break}})},this.options=e?Ay({},Bi.DefaultOptions,e):Bi.DefaultOptions,this.options.batchSize<=0)throw new Error(`Invalid batch size of ${this.options.batchSize}`)}forward(e){Array.isArray(e)?e.forEach(r=>r.next(r.request,r.callback)):e.next(e.request,e.callback)}static isMulticall(e){return e&&e.handle!==void 0&&e.conf!==void 0&&Bi.isMulticallOptions(e.options)}static isMulticallOptions(e){return e!==void 0&&e.batchSize!==void 0&&e.timeWindow!==void 0&&e.contract!==void 0}}Bi.DefaultOptions=Ay({},Pme);const Nj=["getNetwork","getBlockNumber","getGasPrice","getTransactionCount","getStorageAt","sendTransaction","estimateGas","getBlock","getTransaction","getTransactionReceipt","getLogs","emit","litenerCount","addListener","removeListener","waitForTransaction","detectNetwork","getBlockWithTransactions"];class Tme extends kg{constructor(e,r){var n;super(e.getNetwork()),n=this,this.getResolver=async function(i){const s=n.provider;if(s.getResolver){const o=await s.getResolver(await i);return o?new _x(n,o.address,o.name):null}return s.getResolver(await i)},this.next=async function(i,s){try{switch(i.method){case Rr.ethCall:n.callback(i,s,await n.provider.call(i.params[0],i.params[1]));break;case Rr.ethGetCode:n.callback(i,s,await n.provider.getCode(i.params[0],i.params[1]));break;case Rr.ethGetBalance:n.callback(i,s,await n.provider.getBalance(i.params[0],i.params[1]));break}}catch(o){n.callback(i,s,void 0,o)}},this.provider=e,this.listenerCount=e.listenerCount.bind(e),this.multicall=Bi.isMulticall(r)?r:new Bi(r),Nj.forEach(i=>{e[i]!==void 0&&(this[i]=(...s)=>e[i](...s))})}callback(e,r,n,i){r(i,{jsonrpc:Hf,id:e.id,result:n,error:i})}async call(e,r){return this.rpcCall(Rr.ethCall,e,r)}async getCode(e,r){return this.rpcCall(Rr.ethGetCode,e,r)}async getBalance(e,r){return this.rpcCall(Rr.ethGetBalance,e,r)}async rpcCall(e,...r){const n=e8();return(await ZS(this.multicall.handle)(this.next,{jsonrpc:Hf,id:n,method:e,params:r})).result}}class Ime{constructor(e,r){if(this.provider=e,this.multicall=Bi.isMulticall(r)?r:new Bi(r),e.send){const n=async function(s,o){e.send(s,o)};this.send=(i,s)=>{this.multicall.handle(n,i,s)}}if(e.sendAsync){const n=async function(s,o){e.sendAsync(s,o)};this.sendAsync=(i,s)=>{this.multicall.handle(n,i,s)}}}get isMetaMask(){return this.provider.isMetaMask}get isStatus(){return this.provider.isStatus}}const Ome=t=>e=>{const r=Bi.isMulticall(t)?t:new Bi(t);return(n,i)=>r.handle(e,n,i)};var Rme=Object.freeze({__proto__:null,ProxyMethods:Nj,MulticallProvider:Tme,MulticallExternalProvider:Ime,multicallMiddleware:Ome});const Mme=Object.freeze(Object.defineProperty({__proto__:null,Multicall:Bi,providers:Rme},Symbol.toStringTag,{value:"Module"}));var Dj={exports:{}};/*! +)[]`,e5=(t,e)=>{const r=[],n=new jr(rn.mainModule.abi);for(const i of e){const s=re(i.data||"0x");if(i.to===t&&te(s.slice(0,4))===Pj){const o=s.slice(4),a=Bn.decode([Tj],o)[0];r.push(...e5(i.to,a.map(c=>wn({},c,{to:c.target}))))}else try{const o=n.decodeFunctionData("execute",s)[0],a=e5(t,o.map(c=>wn({},c,{to:c.target})));r.push(...a)}catch{r.push(i)}}return r};var yve=Object.freeze({__proto__:null,MetaTransactionsType:Lb,intendTransactionBundle:ave,intendedTransactionID:cve,unpackMetaTransactionsData:lve,packMetaTransactionsData:xj,digestOfTransactions:Cj,subdigestOfTransactions:uve,subdigestOfGuestModuleTransactions:fve,toSequenceTransactions:Sj,toSequenceTransaction:I8,isSequenceTransaction:Fb,hasSequenceTransactions:kj,sequenceTxAbiEncode:o1,fromTxAbiEncode:dve,encodeNonce:hve,decodeNonce:pve,fromTransactionish:vve,isTransactionBundle:Aj,isSignedTransactionBundle:_j,encodeBundleExecData:mve,selfExecuteSelector:Pj,selfExecuteAbi:Tj,unwind:e5});const Ij="0x608060405234801561001057600080fd5b5060405161124a38038061124a83398101604081905261002f91610124565b600060405161003d906100dd565b604051809103906000f080158015610059573d6000803e3d6000fd5b5090506000816001600160a01b0316638f0684308686866040518463ffffffff1660e01b815260040161008e939291906101fb565b6020604051808303816000875af11580156100ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d19190610244565b9050806000526001601ff35b610fdc8061026e83390190565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561011b578181015183820152602001610103565b50506000910152565b60008060006060848603121561013957600080fd5b83516001600160a01b038116811461015057600080fd5b6020850151604086015191945092506001600160401b038082111561017457600080fd5b818601915086601f83011261018857600080fd5b81518181111561019a5761019a6100ea565b604051601f8201601f19908116603f011681019083821181831017156101c2576101c26100ea565b816040528281528960208487010111156101db57600080fd5b6101ec836020830160208801610100565b80955050505050509250925092565b60018060a01b0384168152826020820152606060408201526000825180606084015261022e816080850160208701610100565b601f01601f191691909101608001949350505050565b60006020828403121561025657600080fd5b8151801515811461026657600080fd5b939250505056fe608060405234801561001057600080fd5b50610fbc806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806376be4cea1161005057806376be4cea146100a65780638f068430146100b957806398ef1ed8146100cc57600080fd5b80631c6453271461006c5780633d787b6314610093575b600080fd5b61007f61007a366004610ad4565b6100df565b604051901515815260200160405180910390f35b61007f6100a1366004610ad4565b61023d565b61007f6100b4366004610b3e565b61031e565b61007f6100c7366004610ad4565b6108e1565b61007f6100da366004610ad4565b61096e565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061012890889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610181575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261017e91810190610c45565b60015b610232573d8080156101af576040519150601f19603f3d011682016040523d82523d6000602084013e6101b4565b606091505b508051600181900361022757816000815181106101d3576101d3610c69565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0100000000000000000000000000000000000000000000000000000000000000149250610235915050565b600092505050610235565b90505b949350505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906102879088908890889088906001908990600401610bc3565b6020604051808303816000875af19250505080156102e0575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102dd91810190610c45565b60015b610232573d80801561030e576040519150601f19603f3d011682016040523d82523d6000602084013e610313565b606091505b506000915050610235565b600073ffffffffffffffffffffffffffffffffffffffff87163b6060827f64926492649264926492649264926492649264926492649264926492649264928888610369602082610c98565b610375928b9290610cd8565b61037e91610d02565b1490508015610484576000606089828a610399602082610c98565b926103a693929190610cd8565b8101906103b39190610e18565b955090925090508415806103c45750865b1561047d576000808373ffffffffffffffffffffffffffffffffffffffff16836040516103f19190610eb2565b6000604051808303816000865af19150503d806000811461042e576040519150601f19603f3d011682016040523d82523d6000602084013e610433565b606091505b50915091508161047a57806040517f9d0d6e2d0000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b60405180910390fd5b50505b50506104be565b87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294505050505b80806104ca5750600083115b156106bb576040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b1690631626ba7e90610523908c908690600401610f2b565b602060405180830381865afa92505050801561057a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261057791810190610f44565b60015b61060f573d8080156105a8576040519150601f19603f3d011682016040523d82523d6000602084013e6105ad565b606091505b50851580156105bc5750600084115b156105db576105d08b8b8b8b8b600161031e565b9450505050506108d7565b806040517f6f2a95990000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f1626ba7e000000000000000000000000000000000000000000000000000000001480158161065f575086155b801561066b5750600085115b1561068b5761067f8c8c8c8c8c600161031e565b955050505050506108d7565b841580156106965750825b80156106a0575087155b156106af57806000526001601ffd5b94506108d79350505050565b6041871461074b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f5369676e617475726556616c696461746f72237265636f7665725369676e657260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610471565b600061075a6020828a8c610cd8565b61076391610d02565b90506000610775604060208b8d610cd8565b61077e91610d02565b905060008a8a604081811061079557610795610c69565b919091013560f81c915050601b81148015906107b557508060ff16601c14155b15610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f5369676e617475726556616c696461746f723a20696e76616c6964207369676e60448201527f617475726520762076616c7565000000000000000000000000000000000000006064820152608401610471565b6040805160008152602081018083528e905260ff831691810191909152606081018490526080810183905273ffffffffffffffffffffffffffffffffffffffff8e169060019060a0016020604051602081039080840390855afa1580156108ad573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff161496505050505050505b9695505050505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061092b9088908890889088906001908990600401610bc3565b6020604051808303816000875af115801561094a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102329190610c45565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906109b790889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610a10575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610a0d91810190610c45565b60015b610232573d808015610a3e576040519150601f19603f3d011682016040523d82523d6000602084013e610a43565b606091505b5080516001819003610a6257816000815181106101d3576101d3610c69565b8082fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610a8857600080fd5b50565b60008083601f840112610a9d57600080fd5b50813567ffffffffffffffff811115610ab557600080fd5b602083019150836020828501011115610acd57600080fd5b9250929050565b60008060008060608587031215610aea57600080fd5b8435610af581610a66565b935060208501359250604085013567ffffffffffffffff811115610b1857600080fd5b610b2487828801610a8b565b95989497509550505050565b8015158114610a8857600080fd5b60008060008060008060a08789031215610b5757600080fd5b8635610b6281610a66565b955060208701359450604087013567ffffffffffffffff811115610b8557600080fd5b610b9189828a01610a8b565b9095509350506060870135610ba581610b30565b91506080870135610bb581610b30565b809150509295509295509295565b73ffffffffffffffffffffffffffffffffffffffff8716815285602082015260a060408201528360a0820152838560c0830137600060c085830181019190915292151560608201529015156080820152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909101019392505050565b600060208284031215610c5757600080fd5b8151610c6281610b30565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115610cd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b60008085851115610ce857600080fd5b83861115610cf557600080fd5b5050820193919092039150565b80356020831015610cd2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610d7e57600080fd5b813567ffffffffffffffff80821115610d9957610d99610d3e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610ddf57610ddf610d3e565b81604052838152866020858801011115610df857600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610e2d57600080fd5b8335610e3881610a66565b9250602084013567ffffffffffffffff80821115610e5557600080fd5b610e6187838801610d6d565b93506040860135915080821115610e7757600080fd5b50610e8486828701610d6d565b9150509250925092565b60005b83811015610ea9578181015183820152602001610e91565b50506000910152565b60008251610ec4818460208701610e8e565b9190910192915050565b60008151808452610ee6816020860160208601610e8e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610c626020830184610ece565b8281526040602082015260006102356040830184610ece565b600060208284031215610f5657600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610c6257600080fdfea26469706673582212201a72aed4b15ffb05b6502997a9bb655992e06590bd26b336dfbb153d7ff6f34b64736f6c63430008120033",gve="0x6492649264926492649264926492649264926492649264926492649264926492";async function Oj(t,e,r,n){return await t.call({data:qt([Ij,new a3().encode(["address","bytes32","bytes"],[e,r,n])])})==="0x01"}var bve=Object.freeze({__proto__:null,EIP_6492_OFFCHAIN_DEPLOY_CODE:Ij,EIP_6492_SUFFIX:gve,validateEIP6492Offchain:Oj});class wve{constructor(e){this.isDeployedCache=new Set,this.provider=e}module(e){return new cd(e,[...rn.mainModuleUpgradable.abi,...rn.mainModule.abi,...rn.erc1271.abi],this.provider)}async isDeployed(e){if(this.isDeployedCache.has(e))return!0;const n=(await this.provider.getCode(e).then(i=>re(i))).length!==0;return n&&this.isDeployedCache.add(e),n}async implementation(e){const r=Bn.encode(["address"],[e]),n=await this.provider.getStorageAt(e,r).then(i=>re(i));if(n.length===20)return Ve(te(n));if(n.length===32)return Bn.decode(["address"],n)[0]}async imageHash(e){try{return await this.module(e).imageHash()}catch{}}async nonce(e,r=0){try{return await this.module(e).readNonce(r)}catch(n){if(!await this.isDeployed(e))return 0;throw n}}async isValidSignature(e,r,n){return Oj(this.provider,e,r,n)}}var Eve=Object.freeze({__proto__:null,OnChainReader:wve});function xve(t){return t&&t.address&&t.digest&&t.chainId!==void 0&&t.config}var he=Object.freeze({__proto__:null,config:Dpe,signature:Lpe,context:ove,signer:Wpe,EIP1271:jpe,transaction:yve,reader:Eve,EIP6492:bve,isWalletSignRequestMetadata:xve});const t5=[{config:b8,signature:g8},{config:Db,signature:Nb}];function Rj(t){const e=t-1;if(e<0||e>=t5.length)throw new Error(`No coder for version: ${t}`);return t5[e]}function Cve(t){return Rj(t)}var Zr=Object.freeze({__proto__:null,ALL_CODERS:t5,coderFor:Rj,genericCoderFor:Cve});const $j=[Oo,Ge],Sve=Object.freeze(Object.defineProperty({__proto__:null,allVersions:$j,commons:he,universal:Zr,v1:Oo,v2:Ge},Symbol.toStringTag,{value:"Module"}));function kve(t,e,r){for(let n=0;ne.version)&&(e=r);if(e===void 0)throw new Error("No migrations");return e}async getAllMigratePresignedTransaction(e){const{address:r,fromImageHash:n,fromVersion:i,chainId:s}=e;let o=n,a=i;const c=Object.values(this.contexts),l=[];for(let u=1;ure(s).length===0))return OT;if(!n.provider)throw new Error("signer.provider is not set, but is required");return n.provider.estimateGas({from:e,to:i.to,data:i.data,value:i.value})}))).map(i=>({executed:!0,succeeded:!0,gasUsed:J.from(i).toNumber(),gasLimit:J.from(i).toNumber()}))}async getNonce(e,r,n){if(!this.provider)throw new Error("provider is not set");if(await this.provider.getCode(e)==="0x")return 0;r===void 0&&(r=0);const s=await new cd(e,rn.mainModule.abi,this.provider).readNonce(r,{blockTag:n});return he.transaction.encodeNonce(r,s)}async wait(e,r,n=this.waitPollRate,i=5){var s=this;typeof e!="string"&&(e=he.transaction.intendedTransactionID(e));let o=!1;const a=async function(u,f){let d=0;for(;!o;){try{return await u()}catch(h){if(d++,i!==void 0&&d>=i)throw ge.error(`giving up after ${d} failed attempts${f?`: ${f}`:""}`,h),h;ge.warn(`attempt #${d} failed${f?`: ${f}`:""}`,h)}n>0&&await new Promise(h=>setTimeout(h,n))}throw new Error(`timed out after ${d} failed attempts${f?`: ${f}`:""}`)},c=async function(){let u=s.fromBlockLog;if(u<0&&(u=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number")+u),typeof e!="string")throw new Error("impossible");const f=e.replace("0x","");for(;!o;){const d=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number"),h=await a(()=>s.provider.getLogs({fromBlock:Math.max(0,u-s.deltaBlocksLog),toBlock:d,topics:["0x1f180c27086c7a39ea2a7b25239d1ab92348f07ca7bb59d1438fcf527568f881"]}),`unable to get NonceChange logs for blocks ${Math.max(0,u-s.deltaBlocksLog)} to ${d}`);u=d;const v=(await Promise.all(h.map(b=>a(()=>s.provider.getTransactionReceipt(b.transactionHash),`unable to get receipt for transaction ${b.transactionHash}`)))).find(b=>b.logs.find(y=>y.topics.length===0&&y.data.replace("0x","")===f||y.topics.length===1&&y.topics[0]==="0x3dbd1590ea96dd3253a91f24e64e3a502e1225d602a5731357bc12643070ccd7"&&y.data.length>=64&&y.data.replace("0x","").startsWith(f)));if(v)return bc({receipt:v},await a(()=>s.provider.getTransaction(v.transactionHash),`unable to get transaction ${v.transactionHash}`));o||await new Promise(b=>setTimeout(b,n))}throw new Error(`Timeout waiting for transaction receipt ${e}`)};return r!==void 0?Promise.race([c(),new Promise((l,u)=>setTimeout(()=>{o=!0,u(`Timeout waiting for transaction receipt ${e}`)},r))]):c()}}function Rve(t){return t.signer!==void 0&&Dl.isSigner(t.signer)}class $ve extends Fj{constructor(e){if(super(Dl.isSigner(e)?{provider:e.provider}:bc({},e,{provider:e.signer.provider})),this.signer=Dl.isSigner(e)?e:e.signer,!this.signer.provider)throw new Error("Signer must have a provider")}async getFeeOptions(e,...r){return{options:[]}}async getFeeOptionsRaw(e,r,n){return{options:[]}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}setTransactionOptions(e){this.txnOptions=e}async relay(e,r,n=!0){r!==void 0&&ge.warn("LocalRelayer doesn't accept fee quotes");const i=he.transaction.encodeBundleExecData(e),s=this.signer.sendTransaction(bc({to:e.entrypoint,data:i},this.txnOptions,{gasLimit:9e6}));if(n){const o=await s;return o.receipt=await o.wait(),o}else return s}}const Mve="v1",Nve="v0.4.0",Dve="950b00c821b56110c64d947312b9dea3e197e207";let qa=function(t){return t.UNKNOWN="UNKNOWN",t.DROPPED="DROPPED",t.QUEUED="QUEUED",t.SENT="SENT",t.SUCCEEDED="SUCCEEDED",t.PARTIALLY_FAILED="PARTIALLY_FAILED",t.FAILED="FAILED",t}({}),Lve=function(t){return t.SEND="SEND",t.RECEIVE="RECEIVE",t.BRIDGE_DEPOSIT="BRIDGE_DEPOSIT",t.BRIDGE_WITHDRAW="BRIDGE_WITHDRAW",t.BURN="BURN",t.UNKNOWN="UNKNOWN",t}({}),Fve=function(t){return t.UNKNOWN="UNKNOWN",t.ERC20_TOKEN="ERC20_TOKEN",t.ERC1155_TOKEN="ERC1155_TOKEN",t}({}),Bve=function(t){return t.DESC="DESC",t.ASC="ASC",t}({});class Bj{constructor(e,r){this.path="/rpc/Relayer/",this.ping=n=>this.fetch(this.url("Ping"),lt({},n)).then(i=>ut(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),lt({},n)).then(i=>ut(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),lt({},n)).then(i=>ut(i).then(s=>({status:s.status}))),this.getSequenceContext=n=>this.fetch(this.url("GetSequenceContext"),lt({},n)).then(i=>ut(i).then(s=>({data:s.data}))),this.getChainID=n=>this.fetch(this.url("GetChainID"),lt({},n)).then(i=>ut(i).then(s=>({chainID:s.chainID}))),this.sendMetaTxn=(n,i)=>this.fetch(this.url("SendMetaTxn"),lt(n,i)).then(s=>ut(s).then(o=>({status:o.status,txnHash:o.txnHash}))),this.getMetaTxnNonce=(n,i)=>this.fetch(this.url("GetMetaTxnNonce"),lt(n,i)).then(s=>ut(s).then(o=>({nonce:o.nonce}))),this.getMetaTxnReceipt=(n,i)=>this.fetch(this.url("GetMetaTxnReceipt"),lt(n,i)).then(s=>ut(s).then(o=>({receipt:o.receipt}))),this.simulate=(n,i)=>this.fetch(this.url("Simulate"),lt(n,i)).then(s=>ut(s).then(o=>({results:o.results}))),this.updateMetaTxnGasLimits=(n,i)=>this.fetch(this.url("UpdateMetaTxnGasLimits"),lt(n,i)).then(s=>ut(s).then(o=>({payload:o.payload}))),this.feeTokens=n=>this.fetch(this.url("FeeTokens"),lt({},n)).then(i=>ut(i).then(s=>({isFeeRequired:s.isFeeRequired,tokens:s.tokens}))),this.feeOptions=(n,i)=>this.fetch(this.url("FeeOptions"),lt(n,i)).then(s=>ut(s).then(o=>({options:o.options,quote:o.quote}))),this.getMetaTxnNetworkFeeOptions=(n,i)=>this.fetch(this.url("GetMetaTxnNetworkFeeOptions"),lt(n,i)).then(s=>ut(s).then(o=>({options:o.options}))),this.sentTransactions=(n,i)=>this.fetch(this.url("SentTransactions"),lt(n,i)).then(s=>ut(s).then(o=>({page:o.page,transactions:o.transactions}))),this.pendingTransactions=(n,i)=>this.fetch(this.url("PendingTransactions"),lt(n,i)).then(s=>ut(s).then(o=>({page:o.page,transactions:o.transactions}))),this.getGasTank=(n,i)=>this.fetch(this.url("GetGasTank"),lt(n,i)).then(s=>ut(s).then(o=>({gasTank:o.gasTank}))),this.addGasTank=(n,i)=>this.fetch(this.url("AddGasTank"),lt(n,i)).then(s=>ut(s).then(o=>({status:o.status,gasTank:o.gasTank}))),this.updateGasTank=(n,i)=>this.fetch(this.url("UpdateGasTank"),lt(n,i)).then(s=>ut(s).then(o=>({status:o.status,gasTank:o.gasTank}))),this.getGasSponsor=(n,i)=>this.fetch(this.url("GetGasSponsor"),lt(n,i)).then(s=>ut(s).then(o=>({gasSponsor:o.gasSponsor}))),this.listGasSponsors=(n,i)=>this.fetch(this.url("ListGasSponsors"),lt(n,i)).then(s=>ut(s).then(o=>({page:o.page,gasSponsors:o.gasSponsors}))),this.addGasSponsor=(n,i)=>this.fetch(this.url("AddGasSponsor"),lt(n,i)).then(s=>ut(s).then(o=>({status:o.status,gasSponsor:o.gasSponsor}))),this.updateGasSponsor=(n,i)=>this.fetch(this.url("UpdateGasSponsor"),lt(n,i)).then(s=>ut(s).then(o=>({status:o.status,gasSponsor:o.gasSponsor}))),this.removeGasSponsor=(n,i)=>this.fetch(this.url("RemoveGasSponsor"),lt(n,i)).then(s=>ut(s).then(o=>({status:o.status}))),this.reportGasSponsorUsage=(n,i)=>this.fetch(this.url("ReportGasSponsorUsage"),lt(n,i)).then(s=>ut(s).then(o=>({gasSponsorUsage:o.gasSponsorUsage}))),this.nextGasTankBalanceAdjustmentNonce=(n,i)=>this.fetch(this.url("NextGasTankBalanceAdjustmentNonce"),lt(n,i)).then(s=>ut(s).then(o=>({nonce:o.nonce}))),this.adjustGasTankBalance=(n,i)=>this.fetch(this.url("AdjustGasTankBalance"),lt(n,i)).then(s=>ut(s).then(o=>({status:o.status,adjustment:o.adjustment}))),this.getGasTankBalanceAdjustment=(n,i)=>this.fetch(this.url("GetGasTankBalanceAdjustment"),lt(n,i)).then(s=>ut(s).then(o=>({adjustment:o.adjustment}))),this.listGasTankBalanceAdjustments=(n,i)=>this.fetch(this.url("ListGasTankBalanceAdjustments"),lt(n,i)).then(s=>ut(s).then(o=>({page:o.page,adjustments:o.adjustments}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const lt=(t={},e={})=>({method:"POST",headers:bc({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),ut=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r});var Kf=Object.freeze({__proto__:null,WebRPCVersion:Mve,WebRPCSchemaVersion:Nve,WebRPCSchemaHash:Dve,ETHTxnStatus:qa,TransferType:Lve,FeeTokenType:Fve,SortOrder:Bve,Relayer:Bj});const jve=[qa.DROPPED,qa.SUCCEEDED,qa.PARTIALLY_FAILED,qa.FAILED],Uve=[qa.DROPPED,qa.PARTIALLY_FAILED,qa.FAILED];function zve(t){return t.url!==void 0&&typeof t.url=="string"&&t.provider!==void 0&&Tc.isProvider(t.provider)}const Wve=typeof global=="object"?global.fetch:window.fetch;class jj{constructor(e){if(this._fetch=(r,n)=>{const i={},{jwtAuth:s,projectAccessKey:o}=this.options;return s&&s.length>0&&(i.Authorization=`BEARER ${s}`),o&&o.length>0&&(i["X-Access-Key"]=o),n.headers=bc({},n.headers,i),Wve(r,n)},this.options=e,this.service=new Bj(e.url,this._fetch),Tc.isProvider(e.provider))this.provider=e.provider;else{const{jwtAuth:r,projectAccessKey:n}=this.options,i=s1(e.provider.url,n,r);this.provider=new Hm(i)}}async waitReceipt(e,r=1e3,n=5,i){typeof e!="string"&&(e=he.transaction.intendedTransactionID(e)),ge.info(`[rpc-relayer/waitReceipt] waiting for ${e}`);let s=0;for(;i===void 0||!i();){try{const{receipt:o}=await this.service.getMetaTxnReceipt({metaTxID:e});if(o&&o.txnReceipt&&o.txnReceipt!=="null"&&jve.includes(o.status))return{receipt:o}}catch(o){if(s++,s===n)throw o}(i===void 0||!i())&&await new Promise(o=>setTimeout(o,r))}throw new Error(`Cancelled waiting for transaction receipt ${e}`)}async simulate(e,...r){const i=Bn.encode([he.transaction.MetaTransactionsType],[he.transaction.sequenceTxAbiEncode(r)]);return(await this.service.simulate({wallet:e,transactions:i})).results}async getFeeOptions(e,...r){const n=await this.service.feeTokens();if(n.isFeeRequired){const i=n.tokens.map(c=>c.symbol).join(", ");ge.info(`[rpc-relayer/getFeeOptions] relayer fees are required, accepted tokens are ${i}`);const s=await this.getNonce(e);if(!this.provider)throw ge.warn("[rpc-relayer/getFeeOptions] provider not set, needed for stub signature"),new Error("provider is not set");const{options:o,quote:a}=await this.service.feeOptions({wallet:e,to:e,data:he.transaction.encodeBundleExecData({entrypoint:e,transactions:r,nonce:s})});return ge.info(`[rpc-relayer/getFeeOptions] got refund options ${JSON.stringify(o)}`),{options:o,quote:{_tag:"FeeQuote",_quote:a}}}else return ge.info("[rpc-relayer/getFeeOptions] relayer fees are not required"),{options:[]}}async getFeeOptionsRaw(e,r,n){const{options:i,quote:s}=await this.service.feeOptions({wallet:e,to:e,data:te(r),simulate:n==null?void 0:n.simulate});return{options:i,quote:{_tag:"FeeQuote",_quote:s}}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}async getNonce(e,r){ge.info(`[rpc-relayer/getNonce] get nonce for wallet ${e} space: ${r}`);const n=r!==void 0?J.from(r).toHexString():void 0,i=await this.service.getMetaTxnNonce({walletContractAddress:e,space:n}),s=J.from(i.nonce),[o,a]=he.transaction.decodeNonce(s);return ge.info(`[rpc-relayer/getNonce] got next nonce for wallet ${e} ${a} space: ${o}`),s}async relay(e,r,n=!0){var i=this;ge.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(e)} with quote ${JSON.stringify(r)}`);let s;if(r!==void 0&&(typeof r._quote=="string"?s=r._quote:ge.warn("[rpc-relayer/relay] ignoring invalid fee quote")),!this.provider)throw ge.warn("[rpc-relayer/relay] provider not set, failed relay"),new Error("provider is not set");const o=he.transaction.encodeBundleExecData(e),a=await this.service.sendMetaTxn({call:{walletAddress:e.intent.wallet,contract:e.entrypoint,input:o},quote:s});if(ge.info(`[rpc-relayer/relay] got relay result ${JSON.stringify(a)}`),n)return this.wait(e.intent.id);{const c={hash:e.intent.id,confirmations:0,from:e.intent.wallet,wait:u=>Promise.reject(new Error("impossible"))},l=async function(f){var d;if(!i.provider)throw new Error("cannot wait for receipt, relayer has no provider set");const h=await i.wait(e.intent.id),p=(d=h.receipt)==null?void 0:d.transactionHash;if(!p)throw new Error("cannot wait for receipt, unknown native transaction hash");return Object.assign(c,h),i.provider.waitForTransaction(p,f)};return c.wait=l,c}}async wait(e,r,n=1e3,i=5){var s=this;let o=!1;const{receipt:a}=await(r!==void 0?Promise.race([this.waitReceipt(e,n,i,()=>o),new Promise((l,u)=>setTimeout(()=>{o=!0,u(`Timeout waiting for transaction receipt ${e}`)},r))]):this.waitReceipt(e,n,i));if(!a.txnReceipt||Uve.includes(a.status))throw new Hve(a);const c=JSON.parse(a.txnReceipt);return{blockHash:c.blockHash,blockNumber:J.from(c.blockNumber).toNumber(),confirmations:1,from:typeof e=="string"?void 0:e.intent.wallet,hash:c.transactionHash,raw:a.txnReceipt,receipt:c,wait:async function(l){return s.provider.waitForTransaction(c.transactionHash,l)}}}}class Hve{constructor(e){this.receipt=e}}function Uj(t){return typeof t=="object"&&typeof t.simulate=="function"&&typeof t.getFeeOptions=="function"&&typeof t.gasRefundOptions=="function"&&typeof t.getNonce=="function"&&typeof t.relay=="function"&&typeof t.wait=="function"}const qve=Object.freeze(Object.defineProperty({__proto__:null,LocalRelayer:$ve,ProviderRelayer:Fj,ProviderRelayerDefaults:Lj,RpcRelayer:jj,RpcRelayerProto:Kf,isLocalRelayerOptions:Rve,isProviderRelayerOptions:Ove,isRelayer:Uj,isRpcRelayerOptions:zve,proto:Kf},Symbol.toStringTag,{value:"Module"}));function zj(t){return t.getAddress!==void 0&&t.buildDeployTransaction!==void 0&&t.predecorateSignedTransactions!==void 0&&t.decorateTransactions!==void 0&&t.requestSignature!==void 0&&t.notifyStatusChange!==void 0}class Wj{constructor(e,r=!0){this.signer=e,this.eoa=r}getAddress(){return this.signer.getAddress()}async buildDeployTransaction(e){}async predecorateSignedTransactions(e){return[]}async decorateTransactions(e,r){return e}async requestSignature(e,r,n,i){return i.onSignature(await this.signer.signMessage(r)),!0}notifyStatusChange(e,r,n){}suffix(){return[2]}}var o5=Object.freeze({__proto__:null,isSapientSigner:zj,SignerWrapper:Wj});function Hj(t){return t.rejected}function O8(t){return t.signature!==void 0}function qj(t){return!Hj(t)&&!O8(t)}const Vj="Initial";class Bb{constructor(e,r=Bb.randomTag()){this.observers=[],this.signers=[],this.count=0,this.tag=r,this.setSigners(e)}static randomTag(){return`default-${te(T1(8)).slice(2)}`}pullId(){return`${this.tag}-${this.count++}`}setSigners(e){this.signers=e.map(r=>zj(r)?r:new Wj(r))}async getSigners(){return Promise.all(this.signers.map(async function(e){return e.getAddress()}))}subscribe(e){return this.observers.push(e),()=>{this.observers=this.observers.filter(r=>r!==e)}}async notifyObservers(e,r,n){await Promise.all([...this.signers.map(async function(i){return i.notifyStatusChange(e,r,n)}),...this.observers.map(async function(i){return i(r,n)})])}async buildDeployTransaction(e){let r;for(const n of this.signers){const i=await n.buildDeployTransaction(e);r===void 0?r=i:i!=null&&i.transactions&&(r.transactions=i.transactions.concat(r.transactions))}return r}async predecorateSignedTransactions(e){const r=[];for(const n of this.signers)r.push(...await n.predecorateSignedTransactions(e??{}));return r}async decorateTransactions(e,r){for(const n of this.signers)e=await n.decorateTransactions(e,r??{});return e}signMessage(e){var r=this;const n=this.pullId();return new Promise(async function(i){const{message:s,metadata:o,callback:a,candidates:c}=e,l={ended:!1,message:s,signers:{}};let u=o??{};const f=v=>{u=v,r.notifyObservers(n,l,u)},d=()=>{try{r.notifyObservers(n,l,u);const v=Object.entries(l.signers).filter(([b,y])=>qj(y));if(a&&a(l,f)||v.length===0){l.ended=!0,i(l),r.notifyObservers(n,l,u);return}}catch(v){console.error("Error while notifying observers",v)}};let h=r.signers;if(c){const v=await Promise.all(r.signers.map(async function(b){return b.getAddress()}));h=r.signers.filter((b,y)=>c.includes(v[y]))}const p=await Promise.allSettled(h.map(async function(v){const b=await v.getAddress();return l.signers[b]={situation:Vj},v.requestSignature(n,s,o??{},{onSignature:y=>{const m=v.suffix();l.signers[b]={signature:y,suffix:m},d()},onRejection:y=>{l.signers[b]={rejected:!0,error:y},d()},onStatus:y=>{l.signers[b]={situation:y},d()}})}));for(let v=0;vvt(e))):vt(t)}const $T=t=>{const e=new Map;for(const r of Object.keys(t.signers)){const n=t.signers[r];if(O8(n)){const i=re(n.suffix),s=He(["bytes","bytes"],[n.signature,i]);e.set(r,{signature:s,isDynamic:i.length!==1||i[0]!==2})}}return e};class a1 extends Dl{constructor(e){if(tr.eq(e.chainId)&&!e.coders.signature.supportsNoChainId)throw new Error(`Sequence version ${e.config.version} doesn't support chainId 0`);super(),this.context=e.context,this.config=e.config,this.orchestrator=e.orchestrator,this.coders=e.coders,this.address=e.address,this.chainId=e.chainId,this.provider=e.provider,this.relayer=e.relayer,this._reader=e.reader}static newWallet(e){const r=he.context.addressOf(e.context,e.coders.config.imageHashOf(e.config));return new a1(Na({},e,{address:r}))}reader(){if(this._reader)return this._reader;if(!this.provider)throw new Error("Wallet status provider requires a provider");return new he.reader.OnChainReader(this.provider)}setConfig(e){this.config=e}setOrchestrator(e){this.orchestrator=e}setAddress(e){this.address=e}getSigners(){return this.orchestrator.getSigners()}async getAddress(){return this.address}async decorateTransactions(e){const r=await this.orchestrator.decorateTransactions(e);if(await this.reader().isDeployed(this.address))return r;const n=[{to:r.entrypoint,data:he.transaction.encodeBundleExecData(r),revertOnError:!0}],i=await this.buildDeployTransaction();return i&&n.unshift(...i.transactions),{entrypoint:this.context.guestModule,chainId:this.chainId,intent:r.intent,transactions:n}}async buildDeployTransaction(e){if(e!=null&&e.ignoreDeployed&&await this.reader().isDeployed(this.address))return;const r=this.coders.config.imageHashOf(this.config);if(he.context.addressOf(this.context,r)!==this.address)throw new Error(`First address of config ${r} doesn't match wallet address ${this.address}`);const n=a1.buildDeployTransaction(this.context,r);if(e!=null&&e.includeChildren){const i=await this.orchestrator.buildDeployTransaction(e);i&&(n.transactions=i.transactions.concat(n.transactions))}return n}async deploy(e){const r=await this.buildDeployTransaction(e);if(r!==void 0){if(!this.relayer)throw new Error("Wallet deploy requires a relayer");return this.relayer.relay(Na({},r,{chainId:this.chainId,intent:{id:te(T1(32)),wallet:this.address}}))}}static buildDeployTransaction(e,r){const n=new jr(rn.factory.abi);return{entrypoint:e.guestModule,transactions:[{to:e.factory,data:n.encodeFunctionData(n.getFunction("deploy"),[e.mainModule,r]),gasLimit:1e5,delegateCall:!1,revertOnError:!0,value:0}]}}async buildUpdateConfigurationTransaction(e){if(this.coders.config.update.isKindUsed){const r=await this.reader().implementation(this.address),n=r&&r===this.context.mainModuleUpgradable;return this.coders.config.update.buildTransaction(this.address,e,this.context,n?"later":"first")}return this.coders.config.update.buildTransaction(this.address,e,this.context)}async getNonce(e=0){const r=await this.reader().nonce(this.address,e);if(r===void 0)throw new Error("Unable to determine nonce");return r}async signDigest(e,r){const n=KC(this.address,this.chainId,e);if(this.coders.config.hasSubdigest(this.config,n))return this.coders.signature.encodeSigners(this.config,new Map,[n],this.chainId).encoded;const i=Na({},r,{digest:e,chainId:this.chainId,address:this.address,config:this.config}),s=re(n),o=await this.orchestrator.signMessage({candidates:this.coders.config.signersOf(this.config).map(c=>c.address),message:s,metadata:i,callback:(c,l)=>{const u=$T(c),f=Na({},i,{parts:u});return l(f),this.coders.signature.hasEnoughSigningPower(this.config,u)}}),a=$T(o);return this.coders.signature.encodeSigners(this.config,a,[],this.chainId).encoded}signMessage(e){return this.signDigest(Be(e),{message:e})}signTransactionBundle(e){if(e.entrypoint!==this.address)throw new Error(`Invalid entrypoint: ${e.entrypoint} !== ${this.address}`);return this.signTransactions(e.transactions,e.nonce)}async fetchNonceOrSpace(e){let r;if(e&&e.space)r=J.from(e.space);else if(e===void 0)r=0;else return e;const n=await this.reader().nonce(this.address,r);if(n===void 0)throw new Error("Unable to determine nonce");return he.transaction.encodeNonce(r,n)}async signTransactions(e,r,n){const i=await RT(e),s=he.transaction.fromTransactionish(this.address,i);s.length===0&&s.push({to:this.address,data:"0x",value:0,gasLimit:0,delegateCall:!1,revertOnError:!0});const o=await this.fetchNonceOrSpace(r),a=he.transaction.digestOfTransactions(o,s),c=Na({digest:a,transactions:s},n),l=await this.signDigest(a,c);return{intent:{id:KC(this.address,this.chainId,a),wallet:this.address},chainId:this.chainId,transactions:s,entrypoint:this.address,nonce:o,signature:l}}async sendSignedTransaction(e,r){if(!this.relayer)throw new Error("Wallet sendTransaction requires a relayer");return this.relayer.relay(e,r)}async sendTransaction(e,r,n){const i=await this.signTransactions(e,r),s=await this.decorateTransactions(i);return this.sendSignedTransaction(s,n)}async fillGasLimits(e){const r=await RT(e),n=he.transaction.fromTransactionish(this.address,r),i=this.relayer;if(!i)throw new Error("Wallet fillGasLimits requires a relayer");const s=await i.simulate(this.address,...n);return n.map((o,a)=>{const c=o.gasLimit?J.from(o.gasLimit).toNumber():s[a].gasLimit;return Na({},o,s[a],{gasLimit:c})})}connect(e,r){return this.provider=e,this.relayer=r,this}signTransaction(e){throw new Error("Method not implemented.")}}function Ao(){return Ao=Object.assign?Object.assign.bind():function(t){for(var e=1;eGve(t[e])):!1}function Qve(t){if(!t)return[];const e=J.from(t.value);switch(t.token.type){case Kf.FeeTokenType.UNKNOWN:return[{delegateCall:!1,revertOnError:!0,gasLimit:t.gasLimit,to:t.to,value:e.toHexString(),data:[]}];case Kf.FeeTokenType.ERC20_TOKEN:if(!t.token.contractAddress)throw new Error("No contract address for ERC-20 fee option");return[{delegateCall:!1,revertOnError:!0,gasLimit:t.gasLimit,to:t.token.contractAddress,value:0,data:new jr([{constant:!1,inputs:[{type:"address"},{type:"uint256"}],name:"transfer",outputs:[],type:"function"}]).encodeFunctionData("transfer",[t.to,e.toHexString()])}];default:throw new Error(`Unhandled fee token type ${t.token.type}`)}}class Yve{constructor(e,r,n){this._isSigner=!0,this.account=e,this.chainId=r,this.options=n}get provider(){return this.account.providerFor(this.chainId)}async getAddress(){return this.account.address}signMessage(e){var r,n;return this.account.signMessage(e,this.chainId,(r=(n=this.options)==null?void 0:n.cantValidateBehavior)!=null?r:"throw")}async defaultSelectFee(e,r){if(r.length===0)return;const n=[{constant:!0,inputs:[{type:"address"}],name:"balanceOf",outputs:[{type:"uint256"}],type:"function"}];for(const i of r)if(i.token.type===Kf.FeeTokenType.UNKNOWN){if((await this.getBalance()).gte(J.from(i.value)))return i}else if(i.token.contractAddress&&i.token.type===Kf.FeeTokenType.ERC20_TOKEN&&(await new cd(i.token.contractAddress,n,this.provider).balanceOf(this.account.address)).gte(J.from(i.value)))return i;throw new Error("No fee option available - not enough balance")}async sendTransaction(e,r){var n,i,s,o,a;const c=Kve(e)?await vt(e):e,l=await this.account.prepareTransactions({txs:c,chainId:this.chainId,stubSignatureOverrides:(n=(i=this.options)==null?void 0:i.stubSignatureOverrides)!=null?n:new Map,simulateForFeeOptions:r==null?void 0:r.simulateForFeeOptions}),f=await((s=(o=this.options)==null?void 0:o.selectFee)!=null?s:this.defaultSelectFee.bind(this))(c,l.feeOptions),d=[...l.transactions,...Qve(f)];return this.account.sendTransaction(d,this.chainId,l.feeQuote,void 0,void 0,(a=this.options)!=null&&a.nonceSpace?{nonceSpace:this.options.nonceSpace}:void 0)}getBalance(e){return this.provider.getBalance(this.account.address,e)}call(e,r){return this.provider.call(e,r)}async resolveName(e){const r=await this.provider.resolveName(e);if(!r)throw new Error(`Could not resolve name ${e}`);return r}connect(e){throw new Error("Method not implemented.")}signTransaction(e){throw new Error("Method not implemented.")}getTransactionCount(e){throw new Error("Method not implemented.")}estimateGas(e){throw new Error("Method not implemented.")}getChainId(){return Promise.resolve(J.from(this.chainId).toNumber())}getGasPrice(){throw new Error("Method not implemented.")}getFeeData(){throw new Error("Method not implemented.")}checkTransaction(e){throw new Error("Method not implemented.")}populateTransaction(e){throw new Error("Method not implemented.")}_checkProvider(e){throw new Error("Method not implemented.")}}class Jve{async isDeployed(e){return!1}async implementation(e){}async imageHash(e){}async nonce(e,r){return tr}async isValidSignature(e,r,n){throw new Error("Method not supported.")}}class Mo{constructor(e){this.address=Ve(e.address),this.contexts=e.contexts,this.tracker=e.tracker,this.networks=e.networks,this.orchestrator=e.orchestrator,this.jwt=e.jwt,this.migrations=e.migrations||s5.DefaultMigrations,this.migrator=new i5.Migrator(e.tracker,this.migrations,this.contexts)}getSigner(e,r){return new Yve(this,e,r)}static async new(e){var r;const i=new i5.Migrator(e.tracker,(r=e.migrations)!=null?r:s5.DefaultMigrations,e.contexts).lastMigration(),s=i.configCoder,o=s.fromSimple(e.config),a=s.imageHashOf(o),c=e.contexts[i.version],l=he.context.addressOf(c,a);return await e.tracker.saveCounterfactualWallet({config:o,context:Object.values(e.contexts)}),new Mo({address:l,tracker:e.tracker,contexts:e.contexts,networks:e.networks,orchestrator:e.orchestrator,migrations:e.migrations})}getAddress(){return Promise.resolve(this.address)}get version(){return this.migrator.lastMigration().version}get coders(){const e=this.migrator.lastMigration();return{signature:e.signatureCoder,config:e.configCoder}}network(e){const r=J.from(e),n=this.networks.find(i=>r.eq(i.chainId));if(!n)throw new Error(`Network not found for chainId ${e}`);return n}providerFor(e){const r=this.network(e);if(!r.provider&&!r.rpcUrl)throw new Error(`Provider not found for chainId ${e}`);return r.provider||new Hm(s1(r.rpcUrl,void 0,this.jwt),{name:"",chainId:J.from(e).toNumber()})}reader(e){return tr.eq(e)?new Jve:new he.reader.OnChainReader(this.providerFor(e))}relayer(e){const r=this.network(e);if(!r.relayer)throw new Error(`Relayer not found for chainId ${e}`);return Uj(r.relayer)?r.relayer:new jj(Ao({},r.relayer,{jwtAuth:this.jwt}))}setOrchestrator(e){this.orchestrator=e}setJwt(e){this.jwt=e}contextFor(e){const r=this.contexts[e];if(!r)throw new Error(`Context not found for version ${e}`);return r}walletForStatus(e,r){const n=Zr.coderFor(r.version);return this.walletFor(e,this.contextFor(r.version),r.config,n)}walletFor(e,r,n,i){const s=tr.eq(e);return new a1({config:n,context:r,chainId:e,coders:i,relayer:s?void 0:this.relayer(e),address:this.address,orchestrator:this.orchestrator,reader:this.reader(e)})}async status(e,r=!1){var n=this;const i=this.reader(e).isDeployed(this.address),s=this.tracker.imageHashOfCounterfactualWallet({wallet:this.address}).then(P=>{if(!P)throw new Error(`Counterfactual imageHash not found for wallet ${this.address}`);return P}),o=s.then(P=>Mj.counterfactualVersion(this.address,P.imageHash,Object.values(this.contexts))),a=async function(){if(!await i)return o;const T=await n.reader(e).implementation(n.address);if(!T)throw new Error(`Implementation not found for wallet ${n.address}`);const w=Object.values(n.contexts);for(let I=0;I0?v[v.length-1].nextImageHash:d,y=await this.tracker.configOfImageHash({imageHash:b});if(!y)throw new Error(`Config not found for imageHash ${b}`);const m=await i,g=await s,S=Zr.coderFor(h).config.checkpointOf(y);return{original:Ao({},g,{version:await o}),onChain:{imageHash:f,config:await l,version:u,deployed:m},fullyMigrated:h===this.version,signedMigrations:p,version:h,presignedConfigurations:v,imageHash:b,config:y,checkpoint:S,canOnchainValidate:u===this.version&&m}}mustBeFullyMigrated(e){if(!e.fullyMigrated)throw new Error(`Wallet ${this.address} is not fully migrated`)}async predecorateSignedTransactions(e,r){const n=await this.orchestrator.predecorateSignedTransactions({chainId:r}),i=await this.predecorateTransactions([],e,r);return he.transaction.fromTransactionish(this.address,i).length>0&&n.push(await this.signTransactions(i,r)),n}async predecorateTransactions(e,r,n){if(r.onChain.imageHash!==r.imageHash){const s=await this.walletForStatus(n,r).buildUpdateConfigurationTransaction(r.config);return[Array.isArray(e)?e:[e],s.transactions].flat()}return e}async decorateTransactions(e,r,n){var i;if(!Array.isArray(e))return this.decorateTransactions([e],r,n);n=(i=n)!=null?i:e[0].chainId;const s=await this.buildBootstrapTransactions(r,n),o=s.transactions.length>0;if(!o&&e.length===1)return e[0];const{entrypoint:a}=o?s:e[0],c={entrypoint:a,chainId:n,intent:e[0].intent,transactions:[...s.transactions,...e.map(l=>({to:l.entrypoint,data:he.transaction.encodeBundleExecData(l),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}))]};return r.onChain.deployed||(c.intent.id=he.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,n,c.transactions)),c}async decorateSignature(e,r){if(!r.presignedConfigurations||r.presignedConfigurations.length===0)return e;const n=this.coders.signature,i=r.presignedConfigurations.map(o=>o.signature),s=n.chainSignatures(e,i);return n.trim(s)}async publishWitness(){const e=Be(wt(`This is a Sequence account woo! ${Date.now()}`)),r=await this.signDigest(e,0,!1),n=this.coders.signature.decode(r),i=this.coders.signature.signaturesOfDecoded(n);return this.tracker.saveWitnesses({wallet:this.address,digest:e,chainId:0,signatures:i})}async signDigest(e,r,n=!0,i="ignore",s){const o=tr.eq(r)?this.networks[0].chainId:r,a=await this.status(o);if(this.mustBeFullyMigrated(a),!a.canOnchainValidate&&i==="throw")throw new Error("Wallet cannot validate onchain");const l=await this.walletForStatus(r,a).signDigest(e,s),u=n?this.decorateSignature(l,a):l;if(!a.canOnchainValidate)switch(i){case"ignore":return u;case"eip6492":return this.buildEIP6492Signature(await u,a,r)}return u}async buildEIP6492Signature(e,r,n){const i=await this.buildBootstrapTransactions(r,n);if(i.transactions.length===0)throw new Error("Cannot build EIP-6492 signature without bootstrap transactions");const s=Bn.encode(["address","bytes","bytes"],[i.entrypoint,he.transaction.encodeBundleExecData(i),e]);return He(["bytes","bytes32"],[s,he.EIP6492.EIP_6492_SUFFIX])}async editConfig(e){const r=await this.status(0).then(i=>i.config),n=this.coders.config.editConfig(r,Ao({},e,{checkpoint:this.coders.config.checkpointOf(r).add(1)}));return this.updateConfig(n)}async updateConfig(e){if(!this.coders.config.isWalletConfig(e))throw new Error(`Invalid config for wallet ${this.address}`);const r=this.coders.config.imageHashOf(e),n=this.coders.signature.hashSetImageHash(r),i=await this.signDigest(n,0,!1);await this.tracker.savePresignedConfiguration({wallet:this.address,nextConfig:e,signature:i});const s=await this.tracker.configOfImageHash({imageHash:r,noCache:!0});if(!s||this.coders.config.imageHashOf(s)!==r)throw Error(`Reverse lookup failed for imageHash ${r}`)}async buildBootstrapTransactions(e,r){var n;const i=await this.orchestrator.buildDeployTransaction({chainId:r}),s=(n=i==null?void 0:i.transactions)!=null?n:[];if(!e.onChain.deployed){const c=a1.buildDeployTransaction(e.original.context,e.original.imageHash);s.push(...c.transactions)}s.length,s.push(...e.signedMigrations.map(c=>({to:c.tx.entrypoint,data:he.transaction.encodeBundleExecData(c.tx),value:0,gasLimit:0,revertOnError:!0,delegateCall:!1})));const o=e.signedMigrations.length>0?e.signedMigrations[0].tx.intent.id:he.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,r,s),{guestModule:a}=this.contextFor(e.version);return{entrypoint:a,transactions:s,chainId:r,intent:{id:o,wallet:this.address}}}async bootstrapTransactions(e,r){const n=r||await this.status(e);return this.buildBootstrapTransactions(n,e)}async doBootstrap(e,r,n){const i=await this.bootstrapTransactions(e,n);return this.relayer(e).relay(Ao({},i,{chainId:e}),r)}signMessage(e,r,n="ignore"){return this.signDigest(Be(e),r,!0,n)}async signTransactions(e,r,n,i){const s=n||await this.status(r);this.mustBeFullyMigrated(s);const o=this.walletForStatus(r,s),a={address:this.address,digest:"",chainId:r,config:{version:this.version},decorate:!0,cantValidateBehavior:"ignore"},c=await o.signTransactions(e,(i==null?void 0:i.nonceSpace)&&{space:i==null?void 0:i.nonceSpace},a);return Ao({},c,{signature:await this.decorateSignature(c.signature,s)})}async signMigrations(e,r){const n=await this.status(e);if(n.fullyMigrated)return!1;const i=this.walletForStatus(e,n),s=r(i.config),o=await this.migrator.signNextMigration(this.address,n.version,i,s);if(!o)return!1;await this.tracker.saveWalletConfig({config:s});const a=Zr.coderFor(s.version).config,c=a.imageHashOf(s),l=await this.tracker.configOfImageHash({imageHash:c,noCache:!0});if(!l||a.imageHashOf(l)!==c)throw Error(`Reverse lookup failed for imageHash ${c}`);return await this.tracker.saveMigration(this.address,o,this.contexts),!0}async signAllMigrations(e){var r=this;const n=[];return{signedMigrations:(await Promise.all(this.networks.map(async function(o){try{return await r.signMigrations(o.chainId,e)}catch(a){return console.warn(`Failed to sign migrations for chain ${o.chainId}`,a),n.push(o.chainId),null}}))).filter(o=>o!==null),failedChains:n}}async isMigratedAllChains(){var e=this;const r=[];return{migratedAllChains:(await Promise.all(this.networks.map(async function(s){try{return await e.status(s.chainId)}catch(o){return r.push(s.chainId),console.warn(`Failed to get status for chain ${s.chainId}`,o),{fullyMigrated:!0}}}))).every(s=>s.fullyMigrated),failedChains:r}}async sendSignedTransactions(e,r,n,i,s){if(!Array.isArray(e))return this.sendSignedTransactions([e],r,n,i,s);const o=i||await this.status(e[0].chainId);this.mustBeFullyMigrated(o);const a=await this.decorateTransactions(e,o);return s==null||s(a),this.relayer(r).relay(a,n)}async fillGasLimits(e,r,n){return this.walletForStatus(r,n||await this.status(r)).fillGasLimits(e)}async gasRefundQuotes(e,r,n,i,s){const o=i||await this.status(r),a=this.walletForStatus(r,o),c=await this.predecorateTransactions(e,o,r),l=he.transaction.fromTransactionish(this.address,c),u=a.coders.config.buildStubSignature(a.config,n),f=te(T1(32)),d={chainId:r,intent:{id:f,wallet:this.address},signature:u,transactions:l,entrypoint:this.address,nonce:0},h=await this.decorateTransactions(d,o),p=he.transaction.encodeBundleExecData(h),v=await this.relayer(r).getFeeOptionsRaw(h.entrypoint,p,s);return Ao({},v,{decorated:h})}async prepareTransactions(e){const r=await this.status(e.chainId),n=await this.fillGasLimits(e.txs,e.chainId,r),i=await this.gasRefundQuotes(n,e.chainId,e.stubSignatureOverrides,r,{simulate:e.simulateForFeeOptions}),s=he.transaction.unwind(this.address,i.decorated.transactions);return{transactions:n,flatDecorated:s,feeOptions:i.options,feeQuote:i.quote}}async sendTransaction(e,r,n,i=!1,s,o){const a=await this.status(r),c=i?e:await this.predecorateTransactions(e,a,r),u=he.transaction.fromTransactionish(this.address,c).length>0?await this.signTransactions(c,r,void 0,o):void 0,f=await this.orchestrator.predecorateSignedTransactions({chainId:r}),d=[];if(u!==void 0&&u.transactions.length>0&&d.push(u),d.push(...f.filter(h=>h.transactions.length>0)),d.length!==0)return this.sendSignedTransactions(d,r,n,void 0,s)}async signTypedData(e,r,n,i,s="ignore"){const o=Q1({domain:e,types:r,message:n});return this.signDigest(o,i,!0,s)}async getSigners(){var e=this;const r=n=>n.length?n[n.length-1]:void 0;return(await Promise.all(this.networks.map(async function({chainId:n,name:i}){try{var s;const o=await e.status(n);let a=(s=r(o.presignedConfigurations))==null?void 0:s.nextImageHash;if(!a&&o.onChain.version!==o.version){const f=r(o.signedMigrations);if(f){const{toVersion:d,toConfig:h}=f;a=Zr.genericCoderFor(d).config.imageHashOf(h)}}a||(a=o.onChain.imageHash);const c=await e.tracker.configOfImageHash({imageHash:a});if(!c)throw new Error(`unable to find config for image hash ${a}`);return Zr.genericCoderFor(c.version).config.signersOf(c).map(f=>Ao({},f,{network:n}))}catch(o){return console.warn(`unable to get signers on network ${n} ${i}`,o),[]}}))).flat()}async getAllSigners(){var e=this;const r=[];return await Promise.all(this.networks.map(async function(n){const i=n.chainId,s=await e.status(i,!0),o=[s.onChain.imageHash,...s.onChain.version!==s.version?s.signedMigrations.map(a=>Zr.coderFor(a.toVersion).config.imageHashOf(a.toConfig)):[],...s.presignedConfigurations.map(a=>a.nextImageHash)];return Promise.all(o.map(async function(a,c){const l=c===o.length-1,u=await e.tracker.configOfImageHash({imageHash:a});if(!u){console.warn(`AllSigners may be incomplete, config not found for imageHash ${a}`);return}Zr.genericCoderFor(u.version).config.signersOf(u).forEach(h=>{const p=r.find(v=>v.address===h.address&&v.network===i);if(p&&l&&p.flaggedForRemoval){p.flaggedForRemoval=!1;return}p||r.push({address:h.address,weight:h.weight,network:i,flaggedForRemoval:!l})})}))})),r}}function Xve(t){return t instanceof Mo}const Zve=Object.freeze(Object.defineProperty({__proto__:null,Account:Mo,isAccount:Xve},Symbol.toStringTag,{value:"Module"}));function Py(){return Py=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),Ur({},n)).then(i=>zr(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),Ur({},n)).then(i=>zr(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),Ur({},n)).then(i=>zr(i).then(s=>({status:s.status}))),this.getChainID=n=>this.fetch(this.url("GetChainID"),Ur({},n)).then(i=>zr(i).then(s=>({chainID:s.chainID}))),this.getEtherBalance=(n,i)=>this.fetch(this.url("GetEtherBalance"),Ur(n,i)).then(s=>zr(s).then(o=>({balance:o.balance}))),this.getTokenBalances=(n,i)=>this.fetch(this.url("GetTokenBalances"),Ur(n,i)).then(s=>zr(s).then(o=>({page:o.page,balances:o.balances}))),this.getTokenSupplies=(n,i)=>this.fetch(this.url("GetTokenSupplies"),Ur(n,i)).then(s=>zr(s).then(o=>({page:o.page,contractType:o.contractType,tokenIDs:o.tokenIDs}))),this.getTokenSuppliesMap=(n,i)=>this.fetch(this.url("GetTokenSuppliesMap"),Ur(n,i)).then(s=>zr(s).then(o=>({supplies:o.supplies}))),this.getBalanceUpdates=(n,i)=>this.fetch(this.url("GetBalanceUpdates"),Ur(n,i)).then(s=>zr(s).then(o=>({page:o.page,balances:o.balances}))),this.getTransactionHistory=(n,i)=>this.fetch(this.url("GetTransactionHistory"),Ur(n,i)).then(s=>zr(s).then(o=>({page:o.page,transactions:o.transactions}))),this.syncBalance=(n,i)=>this.fetch(this.url("SyncBalance"),Ur(n,i)).then(s=>zr(s).then(o=>({}))),this.fetchTransactionReceipt=(n,i)=>this.fetch(this.url("FetchTransactionReceipt"),Ur(n,i)).then(s=>zr(s).then(o=>({receipt:o.receipt}))),this.fetchTransactionReceiptWithFilter=(n,i)=>this.fetch(this.url("FetchTransactionReceiptWithFilter"),Ur(n,i)).then(s=>zr(s).then(o=>({receipt:o.receipt}))),this.getAllWebhookListeners=(n,i)=>this.fetch(this.url("GetAllWebhookListeners"),Ur(n,i)).then(s=>zr(s).then(o=>({listeners:o.listeners}))),this.getWebhookListener=(n,i)=>this.fetch(this.url("GetWebhookListener"),Ur(n,i)).then(s=>zr(s).then(o=>({listener:o.listener}))),this.addWebhookListener=(n,i)=>this.fetch(this.url("AddWebhookListener"),Ur(n,i)).then(s=>zr(s).then(o=>({status:o.status,listener:o.listener}))),this.updateWebhookListener=(n,i)=>this.fetch(this.url("UpdateWebhookListener"),Ur(n,i)).then(s=>zr(s).then(o=>({status:o.status}))),this.removeWebhookListener=(n,i)=>this.fetch(this.url("RemoveWebhookListener"),Ur(n,i)).then(s=>zr(s).then(o=>({status:o.status}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Ur=(t={},e={})=>({method:"POST",headers:Py({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),zr=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),MT=typeof global=="object"?global.fetch:window.fetch;class $8 extends Gj{constructor(e,r,n){super(e.endsWith("/")?e.slice(0,-1):e,MT),this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=Py({},s.headers,o),MT(i,s)},this.projectAccessKey=r,this.jwtAuth=n,this.fetch=this._fetch}}const cme=Object.freeze(Object.defineProperty({__proto__:null,ContractType:R8,EventLogDataType:ime,EventLogType:nme,Indexer:Gj,SequenceIndexer:$8,SortOrder:ame,TransactionStatus:sme,TransactionType:ome,TxnTransferType:cs,WebRPCSchemaHash:rme,WebRPCSchemaVersion:tme,WebRPCVersion:eme},Symbol.toStringTag,{value:"Module"}));function Ty(){return Ty=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),Wr({},n)).then(i=>Hr(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),Wr({},n)).then(i=>Hr(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),Wr({},n)).then(i=>Hr(i).then(s=>({status:s.status}))),this.getTokenMetadata=(n,i)=>this.fetch(this.url("GetTokenMetadata"),Wr(n,i)).then(s=>Hr(s).then(o=>({tokenMetadata:o.tokenMetadata}))),this.refreshTokenMetadata=(n,i)=>this.fetch(this.url("RefreshTokenMetadata"),Wr(n,i)).then(s=>Hr(s).then(o=>({status:o.status}))),this.getTokenMetadataBatch=(n,i)=>this.fetch(this.url("GetTokenMetadataBatch"),Wr(n,i)).then(s=>Hr(s).then(o=>({contractTokenMetadata:o.contractTokenMetadata}))),this.searchTokenMetadata=(n,i)=>this.fetch(this.url("SearchTokenMetadata"),Wr(n,i)).then(s=>Hr(s).then(o=>({page:o.page,tokenMetadata:o.tokenMetadata}))),this.searchTokenIDs=(n,i)=>this.fetch(this.url("SearchTokenIDs"),Wr(n,i)).then(s=>Hr(s).then(o=>({page:o.page,tokenIds:o.tokenIds}))),this.tokenCollectionFilters=(n,i)=>this.fetch(this.url("TokenCollectionFilters"),Wr(n,i)).then(s=>Hr(s).then(o=>({filters:o.filters}))),this.getContractInfo=(n,i)=>this.fetch(this.url("GetContractInfo"),Wr(n,i)).then(s=>Hr(s).then(o=>({contractInfo:o.contractInfo}))),this.getContractInfoBatch=(n,i)=>this.fetch(this.url("GetContractInfoBatch"),Wr(n,i)).then(s=>Hr(s).then(o=>({contractInfoMap:o.contractInfoMap}))),this.searchContractInfo=(n,i)=>this.fetch(this.url("SearchContractInfo"),Wr(n,i)).then(s=>Hr(s).then(o=>({contractInfoList:o.contractInfoList}))),this.searchContractInfoBatch=(n,i)=>this.fetch(this.url("SearchContractInfoBatch"),Wr(n,i)).then(s=>Hr(s).then(o=>({contractInfoByChain:o.contractInfoByChain}))),this.searchMetadata=(n,i)=>this.fetch(this.url("SearchMetadata"),Wr(n,i)).then(s=>Hr(s).then(o=>({tokenMetadata:o.tokenMetadata,contractInfo:o.contractInfo}))),this.projectSetTokenMetadata=(n,i)=>this.fetch(this.url("ProjectSetTokenMetadata"),Wr(n,i)).then(s=>Hr(s).then(o=>({ok:o.ok}))),this.getNiftyswapTokenQuantity=(n,i)=>this.fetch(this.url("GetNiftyswapTokenQuantity"),Wr(n,i)).then(s=>Hr(s).then(o=>({quantity:o.quantity}))),this.getNiftyswapUnitPrices=(n,i)=>this.fetch(this.url("GetNiftyswapUnitPrices"),Wr(n,i)).then(s=>Hr(s).then(o=>({prices:o.prices}))),this.getNiftyswapUnitPricesWithQuantities=(n,i)=>this.fetch(this.url("GetNiftyswapUnitPricesWithQuantities"),Wr(n,i)).then(s=>Hr(s).then(o=>({prices:o.prices}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Wr=(t={},e={})=>({method:"POST",headers:Ty({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),Hr=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),NT=typeof global=="object"?global.fetch:window.fetch;class M8 extends Kj{constructor(e="https://metadata.sequence.app",r,n){super(e.endsWith("/")?e.slice(0,-1):e,NT),this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=Ty({},s.headers,o),NT(i,s)},this.projectAccessKey=r,this.jwtAuth=n,this.fetch=this._fetch}}const mme=Object.freeze(Object.defineProperty({__proto__:null,ContractType:dme,Metadata:Kj,PropertyType:hme,SequenceMetadata:M8,SortOrder:vme,SwapType:pme,WebRPCSchemaHash:fme,WebRPCSchemaVersion:ume,WebRPCVersion:lme},Symbol.toStringTag,{value:"Module"}));function yme(t,e){const r=t.replace("ipfs://ipfs/","").replace("ipfs://","");return t.startsWith("ipfs://")?`${e}${r}`:t}function gme(t){return t.startsWith("ipfs://")}class bme{constructor(e,r,n=1e3){this.pending=new Map,this.provider=e,this.solver=r,this.window=n}async runByEIP5719(e,r,n){const i=`${e}-${r}-${n}`,s=Date.now();if(this.pending.has(i)&&s-this.pending.get(i).timestamp10)throw new Error("EIP5719 - Too many tries");if(he.signer.canRecover(n)){const c=he.signer.recoverSigner(r,n);if(c&&c.toLowerCase()===t.toLowerCase())return n}try{if(await he.signer.isValidSignature(t,r,n,e))return n}catch{}const o=await Eme(wme(t,e).getAlternativeSignature(r));if(!o||o==="")throw new Error("EIP5719 - Invalid signature and no alternative signature");const a=te(await(i||new xme).resolve(o));if(!a||a==="")throw new Error("EIP5719 - Empty alternative signature");if(a===te(n))throw new Error("EIP5719 - Alternative signature is invalid or the same");return Qj(t,e,r,a,i,s+1)}class xme{constructor(e="https://cloudflare-ipfs.com/ipfs/"){var r=this;this.uri=n=>gme(n)?yme(n,this.gateway):n,this.resolve=async function(n){const i=r.uri(n),s=await fetch(i);if(!s.ok)throw new Error(`URISolverIPFS - Failed to fetch ${i}`);return await s.text()},this.gateway=e}}const Cme=(t,e)=>e.some(r=>t instanceof r);let DT,LT;function Sme(){return DT||(DT=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function kme(){return LT||(LT=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Yj=new WeakMap,a5=new WeakMap,Jj=new WeakMap,Y2=new WeakMap,N8=new WeakMap;function Ame(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(oc(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(r=>{r instanceof IDBCursor&&Yj.set(r,t)}).catch(()=>{}),N8.set(e,t),e}function _me(t){if(a5.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});a5.set(t,e)}let c5={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return a5.get(t);if(e==="objectStoreNames")return t.objectStoreNames||Jj.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return oc(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function Pme(t){c5=t(c5)}function Tme(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(J2(this),e,...r);return Jj.set(n,e.sort?e.sort():[e]),oc(n)}:kme().includes(t)?function(...e){return t.apply(J2(this),e),oc(Yj.get(this))}:function(...e){return oc(t.apply(J2(this),e))}}function Ime(t){return typeof t=="function"?Tme(t):(t instanceof IDBTransaction&&_me(t),Cme(t,Sme())?new Proxy(t,c5):t)}function oc(t){if(t instanceof IDBRequest)return Ame(t);if(Y2.has(t))return Y2.get(t);const e=Ime(t);return e!==t&&(Y2.set(t,e),N8.set(e,t)),e}const J2=t=>N8.get(t);function Ome(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=oc(o);return n&&o.addEventListener("upgradeneeded",c=>{n(oc(o.result),c.oldVersion,c.newVersion,oc(o.transaction),c)}),r&&o.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const Rme=["get","getKey","getAll","getAllKeys","count"],$me=["put","add","delete","clear"],X2=new Map;function FT(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(X2.get(e))return X2.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=$me.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||Rme.includes(r)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return n&&(l=l.index(a.shift())),(await Promise.all([l[r](...a),i&&c.done]))[0]};return X2.set(e,s),s}Pme(t=>({...t,get:(e,r,n)=>FT(e,r)||t.get(e,r,n),has:(e,r)=>!!FT(e,r)||t.has(e,r)}));class Mme{}var Nme=Object.freeze({__proto__:null,ConfigTracker:Mme});class Dme{constructor(e){this.tracker=e}async loadPresignedConfiguration(e){return console.debug("? loadPresignedConfiguration"),_n(e,"? "),_n(await this.tracker.loadPresignedConfiguration(e),"! ")}savePresignedConfiguration(e){return console.debug("? savePresignedConfiguration"),_n(e,"? "),this.tracker.savePresignedConfiguration(e)}saveWitnesses(e){return console.debug("? saveWitnesses"),_n(e,"? "),this.tracker.saveWitnesses(e)}async configOfImageHash(e){return console.debug("? configOfImageHash"),_n(e,"? "),_n(await this.tracker.configOfImageHash(e),"! ")}saveWalletConfig(e){return console.debug("? saveWalletConfig"),_n(e,"? "),this.tracker.saveWalletConfig(e)}async imageHashOfCounterfactualWallet(e){return console.debug("? imageHashOfCounterfactualWallet"),_n(e,"? "),_n(await this.tracker.imageHashOfCounterfactualWallet(e),"! ")}saveCounterfactualWallet(e){return console.debug("? saveCounterfactualWallet"),_n(e,"? "),this.tracker.saveCounterfactualWallet(e)}async walletsOfSigner(e){return console.debug("? walletsOfSigner"),_n(e,"? "),_n(await this.tracker.walletsOfSigner(e),"! ")}async getMigration(e,r,n,i){return console.debug("? getMigration"),_n({address:e,fromImageHash:r,fromVersion:n,chainId:i},"? "),_n(await this.tracker.getMigration(e,r,n,i),"! ")}saveMigration(e,r,n){return console.debug("? saveMigration"),_n({address:e,signed:r,contexts:n},"? "),this.tracker.saveMigration(e,r,n)}}function _n(t,e=""){switch(t){case void 0:console.debug(e+"undefined");break;default:JSON.stringify(t,void 0,2).split(` +`).map(r=>e+r).forEach(r=>console.debug(r));break}return t}var Lme=Object.freeze({__proto__:null,DebugConfigTracker:Dme});function wc(){return wc=Object.assign?Object.assign.bind():function(t){for(var e=1;ePromise.resolve(this.configs[e]),this.saveConfig=(e,r)=>(this.configs[e]=r,Promise.resolve()),this.loadV2Node=e=>Promise.resolve(this.v2Nodes[e]),this.saveV2Node=(e,r)=>(this.v2Nodes[e]=r,Promise.resolve()),this.loadCounterfactualWallet=e=>Promise.resolve(this.counterfactualWallets[e]),this.saveCounterfactualWallet=(e,r,n)=>(this.counterfactualWallets[e]={imageHash:r,context:n},Promise.resolve()),this.loadPayloadOfSubdigest=e=>Promise.resolve(this.payloads[e]),this.savePayloadOfSubdigest=(e,r)=>(this.payloads[e]=r,Promise.resolve()),this.loadSubdigestsOfSigner=e=>Promise.resolve(Object.keys(this.signatures[e]||{})),this.loadSignatureOfSubdigest=(e,r)=>{var n;return Promise.resolve((n=this.signatures[e])==null?void 0:n[r])},this.saveSignatureOfSubdigest=(e,r,n)=>(this.signatures[e]||(this.signatures[e]={}),this.signatures[e][r]=n,Promise.resolve()),this.loadMigrationsSubdigest=(e,r,n)=>{var i,s;return Promise.resolve(((i=this.migrations[e])==null||(s=i[r])==null?void 0:s[n])||[])},this.saveMigrationsSubdigest=(e,r,n,i,s)=>(this.migrations[e]||(this.migrations[e]={}),this.migrations[e][r]||(this.migrations[e][r]={}),this.migrations[e][r][n]||(this.migrations[e][r][n]=[]),this.migrations[e][r][n].push({subdigest:i,toImageHash:s}),Promise.resolve())}}function Ef(t){if(t===void 0)return;const e={};for(const r of Object.keys(t)){const n=t[r];n._isBigNumber===!0&&n._hex!==void 0&&typeof n._hex=="string"&&n._hex.length!==""?e[r]=J.from(n):Array.isArray(n)?e[r]=n.map(i=>Ef(i)):typeof n=="object"&&n!==null?e[r]=Ef(n):e[r]=n}return e}class Fme{constructor(e){var r=this;this.loadConfig=async function(n){return(await r.getDb()).get("configs",n).then(s=>Ef(s))},this.saveConfig=async function(n,i){await(await r.getDb()).put("configs",i,n)},this.loadV2Node=async function(n){return(await r.getDb()).get("v2Nodes",n).then(s=>Ef(s))},this.saveV2Node=async function(n,i){await(await r.getDb()).put("v2Nodes",i,n)},this.loadCounterfactualWallet=async function(n){return(await r.getDb()).get("counterfactualWallets",n)},this.saveCounterfactualWallet=async function(n,i,s){await(await r.getDb()).put("counterfactualWallets",{imageHash:i,context:s},n)},this.loadPayloadOfSubdigest=async function(n){return(await r.getDb()).get("payloads",n).then(s=>Ef(s))},this.savePayloadOfSubdigest=async function(n,i){await(await r.getDb()).put("payloads",i,n)},this.loadSubdigestsOfSigner=async function(n){return(await(await r.getDb()).getAllKeysFromIndex("signatures","signer",IDBKeyRange.only(n))).map(o=>o.split("-")[0])},this.loadSignatureOfSubdigest=async function(n,i){const o=await(await r.getDb()).get("signatures",[i,n].join("-"));return o==null?void 0:o.signature},this.saveSignatureOfSubdigest=async function(n,i,s){await(await r.getDb()).put("signatures",{signature:s,signer:n},[i,n].join("-"))},this.loadMigrationsSubdigest=async function(n,i,s){return(await(await r.getDb()).getAllFromIndex("migrations","jump",IDBKeyRange.only([n,i,s]))).map(c=>({subdigest:c.subdigest,toImageHash:c.toImageHash}))},this.saveMigrationsSubdigest=async function(n,i,s,o,a){await(await r.getDb()).put("migrations",{wallet:n,fromVersion:i,toVersion:s,subdigest:o,toImageHash:a},o)},this.dbName=e}async getDb(){if(this._lazyDb)return this._lazyDb;const e=this.dbName;return this._lazyDb=await Ome(e,1,{upgrade(r,n,i,s){console.log(`upgrading ${e} from ${n} to ${i} - ${s}`),n===0&&(r.createObjectStore("configs"),r.createObjectStore("v2Nodes"),r.createObjectStore("counterfactualWallets"),r.createObjectStore("payloads"),r.createObjectStore("signatures").createIndex("signer","signer",{unique:!1}),r.createObjectStore("migrations").createIndex("jump",["wallet","fromVersion","toVersion"]))}}),this._lazyDb}}function Zj(t){return t.left!==void 0&&t.right!==void 0}function eU(t){return t.weight!==void 0&&t.threshold!==void 0&&t.tree!==void 0}function l5(t){return t.version===2&&t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&typeof t.tree=="string"}var Bme=Object.freeze({__proto__:null,isPlainNode:Zj,isPlainNested:eU,isPlainV2Config:l5,MemoryTrackerStore:Xj,recreateBigNumbers:Ef,IndexedDBStore:Fme});class D8{constructor(e,r=new Xj,n=!1){var i=this;this.loadTopology=async function(s){const o=await i.store.loadV2Node(s);if(!o)return{nodeHash:s};if(Zj(o)){const[a,c]=await Promise.all([i.loadTopology(o.left),i.loadTopology(o.right)]);return{left:a,right:c}}return eU(o)?{weight:J.from(o.weight),threshold:J.from(o.threshold),tree:await i.loadTopology(o.tree)}:o},this.saveTopology=async function(s){if(Ge.config.isNodeLeaf(s))return;const o=Ge.config.hashNode(s);if(Ge.config.isNode(s)){const a=i.saveTopology(s.left),c=i.saveTopology(s.right),l=i.store.saveV2Node(o,{left:Ge.config.hashNode(s.left),right:Ge.config.hashNode(s.right)});await Promise.all([a,c,l]);return}if(Ge.config.isNestedLeaf(s)){const a=i.saveTopology(s.tree),c=i.store.saveV2Node(o,{weight:J.from(s.weight).toString(),threshold:J.from(s.threshold).toString(),tree:Ge.config.hashNode(s.tree)});await Promise.all([a,c]);return}if(Ge.config.isSignerLeaf(s))return i.store.saveV2Node(o,{address:s.address,weight:s.weight});if(Ge.config.isSubdigestLeaf(s))return i.store.saveV2Node(o,{subdigest:s.subdigest});throw new Error(`Unknown topology type: ${s}`)},this.saveWalletConfig=async function(s){const{config:o}=s;if(Oo.config.ConfigCoder.isWalletConfig(o)){const a=Oo.config.ConfigCoder.imageHashOf(o);return i.store.saveConfig(a,o)}if(Ge.config.ConfigCoder.isWalletConfig(o)){const a=Ge.config.ConfigCoder.imageHashOf(o);if(Ge.config.isComplete(o.tree))return i.store.saveConfig(a,o)}},this.configOfImageHashCache={},this.configOfImageHash=async function(s){const{imageHash:o}=s;if(i.configOfImageHashCache[s.imageHash])return i.configOfImageHashCache[s.imageHash];const a=await i.store.loadConfig(o);if(a){if(a.version===1||a.version===2&&!l5(a))return i.configOfImageHashCache[s.imageHash]=a,a;if(l5(a)){const c={version:2,threshold:J.from(a.threshold),checkpoint:J.from(a.checkpoint),tree:await i.loadTopology(a.tree)};return i.configOfImageHashCache[s.imageHash]=c,c}throw new Error(`Unknown config type: ${a}`)}},this.saveCounterfactualWallet=async function(s){const{config:o,context:a}=s,c=Zr.genericCoderFor(o.version).config.imageHashOf(o);await Promise.all([i.saveWalletConfig({config:o}),...a.map(l=>{const u=he.context.addressOf(l,c);return i.store.saveCounterfactualWallet(u,c,l)})])},this.imageHashOfCounterfactualWallet=async function(s){const{wallet:o}=s,a=await i.store.loadCounterfactualWallet(o);if(a)return{imageHash:a.imageHash,context:a.context}},this.savePayload=async function(s){const{payload:o}=s,a=he.signature.subdigestOf(o);await i.store.savePayloadOfSubdigest(a,o)},this.payloadOfSubdigestCache={},this.payloadOfSubdigest=async function(s){if(i.payloadOfSubdigestCache[s.subdigest])return i.payloadOfSubdigestCache[s.subdigest];const{subdigest:o}=s,a=await i.store.loadPayloadOfSubdigest(o);return a&&(i.payloadOfSubdigestCache[o]=a),a},this.savePresignedConfiguration=async function(s){const o=Ge.signature.SignatureCoder.decode(s.signature),a=Zr.genericCoderFor(s.nextConfig.version).config.imageHashOf(s.nextConfig),c=Ge.chained.messageSetImageHash(a),l=Be(c),u={message:c,address:s.wallet,chainId:0,digest:l},f=i.savePayload({payload:u}),d=i.saveWalletConfig({config:s.nextConfig}),h=await Ge.signature.SignatureCoder.recover(o,u,i.provider),p=Ge.signature.signaturesOf(h.config.tree);await Promise.all([f,d,i.saveWalletConfig({config:h.config}),...p.map(v=>i.store.saveSignatureOfSubdigest(v.address,h.subdigest,v.signature))])},this.loadPresignedConfiguration=async function(s){const{wallet:o,fromImageHash:a,longestPath:c}=s,l=await i.configOfImageHash({imageHash:a});if(!l||!Ge.config.ConfigCoder.isWalletConfig(l))return[];const u=Ge.config.signersOf(l.tree).map(g=>g.address),f=await Promise.all(u.map(g=>i.store.loadSubdigestsOfSigner(g))),d=[...new Set(f.flat())],p=(await Promise.all([...new Set(d)].map(async function(g){return wc({},await i.payloadOfSubdigest({subdigest:g}),{subdigest:g})}))).filter(g=>(g==null?void 0:g.message)&&(g==null?void 0:g.address)&&g.address===o).map(g=>({payload:g,nextImageHash:Ge.chained.decodeMessageSetImageHash(g.message)})).filter(g=>g==null?void 0:g.nextImageHash);let v;const y=(await Promise.all(p.map(async function({nextImageHash:g,payload:S}){const P=await i.configOfImageHash({imageHash:g});if(!P||!Ge.config.isWalletConfig(P))return;const T=J.from(P.checkpoint);return{nextConfig:P,nextCheckpoint:T,nextImageHash:g,payload:S}}))).filter(g=>g!==void 0).filter(g=>g.nextCheckpoint.gt(l.checkpoint)).sort((g,S)=>g.nextCheckpoint.gt(S.nextCheckpoint)?c?1:-1:c?-1:1);for(const g of y){const{nextConfig:S,nextCheckpoint:P,nextImageHash:T,payload:w}=g;if(v){const j=v.checkpoint;if(c){if(P.gte(j))continue}else if(P.lte(j))continue}const I=new Map((await Promise.all(u.map(async function(j){const H=await i.store.loadSignatureOfSubdigest(j,w.subdigest);if(!H)return[j,void 0];const K=te(i.useEIP5719?await i.cachedEIP5719.runByEIP5719(j,w.subdigest,H):H),B=he.signer.tryRecoverSigner(w.subdigest,K)!==j;return[j,{isDynamic:B,signature:K}]}))).filter(j=>!!j[1]));if(I.size===0)continue;const F=Ge.signature.SignatureCoder.encodeSigners(l,I,[],0);F.weight.lt(l.threshold)||(v={nextImageHash:T,checkpoint:J.from(S.checkpoint),signature:F.encoded})}if(!v)return[];const m=await i.loadPresignedConfiguration({wallet:o,fromImageHash:v.nextImageHash,longestPath:c});return[{wallet:o,nextImageHash:v.nextImageHash,signature:v.signature},...m]},this.saveWitnesses=async function(s){const o={digest:s.digest,address:s.wallet,chainId:s.chainId},a=he.signature.subdigestOf(o);await Promise.all([i.savePayload({payload:o}),...s.signatures.filter(c=>he.signer.canRecover(c)).map(c=>{const l=he.signer.recoverSigner(a,c);return i.store.saveSignatureOfSubdigest(l,a,c)})])},this.walletsOfSigner=async function(s){const o=await i.store.loadSubdigestsOfSigner(s.signer),a=await Promise.all(o.map(l=>i.payloadOfSubdigest({subdigest:l}))).then(l=>l.filter(u=>u!==void 0)),c=[];for(const l of a){const u=l.address;if(c.find(h=>h.wallet===u))continue;const f=he.signature.subdigestOf(l),d=await i.store.loadSignatureOfSubdigest(s.signer,f);d&&c.push({wallet:u,proof:{digest:l.digest,chainId:J.from(l.chainId),signature:te(d)}})}return c},this.provider=e,this.store=r,this.useEIP5719=n,this.cachedEIP5719=new bme(e)}async saveMigration(e,r,n){const i=r.fromVersion;if(i!==1)throw new Error("Migration not supported");if(!Ge.config.isWalletConfig(r.toConfig))throw new Error("Invalid to config");const{newImageHash:s,address:o}=Dj.v1v2.decodeTransaction(r.tx,n);if(o!==e)throw new Error("Invalid migration transaction - address");if(Ge.config.ConfigCoder.imageHashOf(r.toConfig)!=s)throw new Error("Invalid migration transaction - config");const a=he.transaction.packMetaTransactionsData(r.tx.nonce,r.tx.transactions),c=Be(a),l={chainId:r.tx.chainId,message:a,address:e,digest:c},u=he.signature.subdigestOf(l),f=this.savePayload({payload:l}),d=this.saveWalletConfig({config:r.toConfig}),h=Oo.signature.SignatureCoder.decode(r.tx.signature),p=await Oo.signature.SignatureCoder.recover(h,l,this.provider),v=Oo.signature.SignatureCoder.signaturesOf(p.config);await Promise.all([f,d,this.saveWalletConfig({config:p.config}),this.store.saveMigrationsSubdigest(e,i,i+1,u,s),...v.map(b=>this.store.saveSignatureOfSubdigest(b.address,p.subdigest,b.signature))])}async getMigration(e,r,n,i){var s=this;const[o,a]=await Promise.all([this.configOfImageHash({imageHash:r}),this.store.loadMigrationsSubdigest(e,n,n+1)]),c=Zr.coderFor(n);return!o||!c.config.isWalletConfig(o)?void 0:(await Promise.all(a.map(async function(u){const{subdigest:f,toImageHash:d}=u,h=await s.payloadOfSubdigest({subdigest:f});if(!h||!h.message||!J.from(i).eq(h.chainId))return;const p=c.config.signersOf(o).map(g=>g.address),v=new Map((await Promise.all(p.map(async function(g){const S=await s.store.loadSignatureOfSubdigest(g,f);if(!S)return[g,void 0];const P=te(s.useEIP5719?await s.cachedEIP5719.runByEIP5719(g,f,S):S),T=he.signer.tryRecoverSigner(f,P)!==g;return[g,{isDynamic:T,signature:P}]}))).filter(g=>!!g[1])),b=c.signature.encodeSigners(o,v,[],i);if(!b||b.weightu.filter(f=>f!==void 0)))[0]}updateProvider(e){this.provider=e}}var jme=Object.freeze({__proto__:null,LocalConfigTracker:D8});let Z2=function(t){return t.EIP712="EIP712",t.EthSign="EthSign",t.EIP1271="EIP1271",t}({});class Ume{constructor(e,r){this.path="/rpc/Sessions/",this.ping=n=>this.fetch(this.url("Ping"),is({},n)).then(i=>ss(i).then(s=>({}))),this.config=(n,i)=>this.fetch(this.url("Config"),is(n,i)).then(s=>ss(s).then(o=>({version:o.version,config:o.config}))),this.wallets=(n,i)=>this.fetch(this.url("Wallets"),is(n,i)).then(s=>ss(s).then(o=>({wallets:o.wallets}))),this.deployHash=(n,i)=>this.fetch(this.url("DeployHash"),is(n,i)).then(s=>ss(s).then(o=>({deployHash:o.deployHash,context:o.context}))),this.configUpdates=(n,i)=>this.fetch(this.url("ConfigUpdates"),is(n,i)).then(s=>ss(s).then(o=>({updates:o.updates}))),this.migrations=(n,i)=>this.fetch(this.url("Migrations"),is(n,i)).then(s=>ss(s).then(o=>({migrations:o.migrations}))),this.saveConfig=(n,i)=>this.fetch(this.url("SaveConfig"),is(n,i)).then(s=>ss(s).then(o=>({}))),this.saveWallet=(n,i)=>this.fetch(this.url("SaveWallet"),is(n,i)).then(s=>ss(s).then(o=>({}))),this.saveSignature=(n,i)=>this.fetch(this.url("SaveSignature"),is(n,i)).then(s=>ss(s).then(o=>({}))),this.saveSignerSignatures=(n,i)=>this.fetch(this.url("SaveSignerSignatures"),is(n,i)).then(s=>ss(s).then(o=>({}))),this.saveMigration=(n,i)=>this.fetch(this.url("SaveMigration"),is(n,i)).then(s=>ss(s).then(o=>({}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const is=(t={},e={})=>({method:"POST",headers:wc({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),ss=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r});class zme{constructor(e,r=!0){this.onlyRecoverable=r,this.sessions=new Ume(e,fetch)}async loadPresignedConfiguration(e){try{const{updates:r}=await this.sessions.configUpdates({wallet:e.wallet,fromImageHash:e.fromImageHash,allUpdates:e.longestPath});return r.map(({toImageHash:n,signature:i})=>({wallet:e.wallet,nextImageHash:n,signature:i}))}catch(r){if(eE(r))return[];throw r}}async savePresignedConfiguration(e){const r=e.nextConfig,n=Zr.genericCoderFor(r.version).config.imageHashOf(r),i=Ge.signature.setImageHashStruct(n),s=Be(i);await this.sessions.saveSignature({wallet:e.wallet,digest:s,chainID:"0",signature:e.signature,toConfig:nv(r)})}async saveWitnesses(e){let r=e.signatures;this.onlyRecoverable&&(r=r.filter(n=>he.signer.canRecover(n))),await this.sessions.saveSignerSignatures({wallet:e.wallet,digest:e.digest,chainID:ef(e.chainId),signatures:r})}async configOfImageHash(e){try{const{version:r,config:n}=await this.sessions.config(e);return Wme(r,n)}catch(r){if(eE(r))return;throw r}}async saveWalletConfig(e){const r=nv(e.config);await this.sessions.saveConfig({version:e.config.version,config:r})}async imageHashOfCounterfactualWallet(e){try{const{deployHash:r,context:n}=await this.sessions.deployHash(e);return{imageHash:r,context:n}}catch(r){if(eE(r))return;throw r}}async saveCounterfactualWallet(e){const r=nv(e.config);await this.sessions.saveWallet({version:e.config.version,deployConfig:r})}async walletsOfSigner(e){const{wallets:r}=await this.sessions.wallets(e);return Object.entries(r).map(([n,{digest:i,chainID:s,type:o,signature:a}])=>{switch(o){case Z2.EIP712:a+=te(he.signer.SigType.EIP712).slice(2);break;case Z2.EthSign:a+=te(he.signer.SigType.ETH_SIGN).slice(2);break;case Z2.EIP1271:a+=te(he.signer.SigType.WALLET_BYTES32).slice(2);break}return{wallet:n,proof:{digest:i,signature:a,chainId:J.from(s)}}})}async getMigration(e,r,n,i){var s=this;const o=ef(i),{migrations:a}=await this.sessions.migrations({wallet:e,fromVersion:n,fromImageHash:r,chainID:o}),c=async function(f){const d=a[f];if(d){const h=Object.keys(d).map(Number).sort((p,v)=>v-p);for(const p of h)for(const[v,b]of Object.entries(d[p]))try{const y=await s.configOfImageHash({imageHash:v});if(y)return{fromVersion:n,toVersion:p,toConfig:y,tx:{entrypoint:b.executor,transactions:b.transactions,nonce:b.nonce,signature:b.signature,chainId:f,intent:{id:he.transaction.subdigestOfTransactions(e,f,b.nonce,b.transactions),wallet:e}}}}catch(y){console.error(y)}}},l=await c(o);if(l)return l;for(const u in a)if(u!==o){const f=await c(u);if(f)return f}}async saveMigration(e,r,n){await this.sessions.saveMigration({wallet:e,fromVersion:r.fromVersion,toVersion:r.toVersion,toConfig:nv(r.toConfig),executor:r.tx.entrypoint,transactions:r.tx.transactions.map(Hme),nonce:ef(r.tx.nonce),signature:r.tx.signature,chainID:ef(r.tx.chainId)})}}function nv(t){switch(t.version){case 1:if(Oo.config.ConfigCoder.isWalletConfig(t))return{threshold:ml(t.threshold),signers:t.signers.map(({weight:e,address:r})=>({weight:ml(e),address:r}))};throw new Error(`not a v${t.version} config: ${t}`);case 2:if(Ge.config.ConfigCoder.isWalletConfig(t))return{threshold:ml(t.threshold),checkpoint:ml(t.checkpoint),tree:Gv(t.tree)};throw new Error(`not a v${t.version} config: ${t}`);default:throw new Error(`unknown version ${t.version}`)}}function Gv(t){return Ge.config.isNode(t)?{left:Gv(t.left),right:Gv(t.right)}:Ge.config.isSignerLeaf(t)?{weight:ml(t.weight),address:t.address}:Ge.config.isNestedLeaf(t)?{weight:ml(t.weight),threshold:ml(t.threshold),tree:Gv(t.tree)}:Ge.config.isNodeLeaf(t)?{node:t.nodeHash}:wc({},t)}function Wme(t,e){switch(t){case 1:return wc({},e,{version:t});case 2:return wc({},e,{version:t,tree:Kv(e.tree)});default:throw new Error(`unknown version ${t}`)}}function Kv(t){switch(typeof t){case"object":const e=wc({},t);return e.left!==void 0&&(e.left=Kv(e.left)),e.right!==void 0&&(e.right=Kv(e.right)),e.tree!==void 0&&(e.tree=Kv(e.tree)),e.node!==void 0&&(e.nodeHash=e.node,delete e.node),e;default:throw new Error(`v2 config tree ${t} is not an object`)}}function Hme(t){return{to:t.to,value:t.value!==void 0?ef(t.value):void 0,data:t.data!==void 0?te(t.data):void 0,gasLimit:t.gasLimit!==void 0?ef(t.gasLimit):void 0,delegateCall:t.delegateCall,revertOnError:t.revertOnError}}function ml(t){return J.from(t).toNumber()}function ef(t){return J.from(t).toString()}function eE(t){return typeof t=="object"&&t.status===404}var qme=Object.freeze({__proto__:null,RemoteConfigTracker:zme});function u5(t,e,r){return new Promise(n=>{let i=0;t.forEach(s=>s.then(o=>{r(o)?n(o):(i++,i===t.length&&n(e))}).catch(()=>{i++,i===t.length&&n(e)}))})}async function gh(t,e){return Promise.all(t.map(r=>r.catch(()=>e)))}class Vme{constructor(e){this.trackers=e}async configOfImageHash(e){const r=this.trackers.map(async function(a,c){return{res:await a.configOfImageHash(e),i:c}}),n=await u5(r,void 0,a=>(a==null?void 0:a.res)===void 0?!1:Zr.genericCoderFor(a.res.version).config.isComplete(a.res));if(n!=null&&n.res)return this.saveWalletConfig({config:n.res,skipTracker:n.i}),n.res;const i=new D8(void 0),s=await gh(r,void 0);for(const a of s)a!=null&&a.res&&await i.saveWalletConfig({config:a.res});const o=await i.configOfImageHash(e);return o&&this.saveWalletConfig({config:o}),o}async saveWalletConfig(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveWalletConfig(e)}))}async imageHashOfCounterfactualWallet(e){const r=await u5(this.trackers.map(n=>n.imageHashOfCounterfactualWallet(e)),void 0,n=>!!n);return r&&this.configOfImageHash({imageHash:r.imageHash}).then(n=>{n&&this.saveCounterfactualWallet({config:n,context:[r.context]})}),r}async saveCounterfactualWallet(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveCounterfactualWallet(e)}))}async walletsOfSigner(e){const r=await gh(this.trackers.map(o=>o.walletsOfSigner(e)),[]).then(o=>o.flat()),n={};for(const o of r)n[o.wallet]=o.proof;const i=Object.keys(n).map(o=>({wallet:o,proof:n[o]})),s=new Map;return i.forEach(({wallet:o,proof:{digest:a,chainId:c,signature:l}})=>{const u=`${o}-${a}-${c}`;let f=s.get(u);f||(f={wallet:o,digest:a,chainId:c,signatures:[]},s.set(u,f)),f.signatures.push(l)}),s.forEach(o=>this.saveWitnesses(o)),i}async saveWitnesses(e){await Promise.all(this.trackers.map(r=>r.saveWitnesses(e)))}async loadPresignedConfiguration(e){var r=this;const n=await gh(this.trackers.map(c=>c.loadPresignedConfiguration(e)),[]),s=(await gh(n.map(async function(c){const l=c[c.length-1],u=await r.configOfImageHash({imageHash:l.nextImageHash});if(u)return{checkpoint:Zr.genericCoderFor(u.version).config.checkpointOf(u),result:c}}),void 0)).reduce((c,l)=>l&&(!c||l.checkpoint.gt(c.checkpoint))?l:c);if(!s)return[];const o=new Map,a=c=>(o.has(c)||o.set(c,this.configOfImageHash({imageHash:c})),o.get(c));return s.result.forEach(async function(c){const l=await a(c.nextImageHash);l&&r.savePresignedConfiguration({wallet:e.wallet,nextConfig:l,signature:c.signature})}),s.result}async savePresignedConfiguration(e){await Promise.all(this.trackers.map(r=>r.savePresignedConfiguration(e)))}async getMigration(e,r,n,i){return(await Promise.all(this.trackers.map(o=>o.getMigration(e,r,n,i)))).find(o=>!!o)}async saveMigration(e,r,n){await Promise.all(this.trackers.map(i=>i.saveMigration(e,r,n)))}}class Gme{constructor(e,r,n){this.tracker=e,this.cache=r,this.contexts=n}async loadPresignedConfiguration(e){var r=this;const n=[this.tracker.loadPresignedConfiguration(e),this.cache.loadPresignedConfiguration(e)];let i;const[s,o]=await Promise.all(n);if(s.length>0&&o.length>0&&s[s.length-1].nextImageHash===o[o.length-1].nextImageHash)i=e.longestPath===!0?s.length>o.length?s:o:s.lengthf&&(!u||f.checkpoint.gt(u.checkpoint))?f:u))==null?void 0:c.result)!=null?a:[]}return i||[]}async savePresignedConfiguration(e){await Promise.all([this.tracker.savePresignedConfiguration(e),this.cache.savePresignedConfiguration(e)])}async configOfImageHash(e){if(e.noCache!==!0){const n=await this.cache.configOfImageHash(e);if(n)return n}const r=await this.tracker.configOfImageHash(e);return r&&await this.cache.saveWalletConfig({config:r}),r}async saveWalletConfig(e){await Promise.all([this.tracker.saveWalletConfig(e),this.cache.saveWalletConfig(e)])}async imageHashOfCounterfactualWallet(e){if(e.noCache!==!0){const n=await this.cache.imageHashOfCounterfactualWallet(e);if(n)return n}const r=await this.tracker.imageHashOfCounterfactualWallet(e);if(r){const n=await this.configOfImageHash({imageHash:r.imageHash});n&&await this.cache.saveCounterfactualWallet({config:n,context:[r.context]})}return r}async saveCounterfactualWallet(e){await Promise.all([this.tracker.saveCounterfactualWallet(e),this.cache.saveCounterfactualWallet(e)])}async walletsOfSigner(e){if(e.noCache)return this.tracker.walletsOfSigner(e);const r=await Promise.all([this.tracker.walletsOfSigner(e),this.cache.walletsOfSigner(e)]),n=new Map;for(const i of r)for(const s of i)n.set(s.wallet,s);return Array.from(n.values())}async saveWitnesses(e){await Promise.all([this.tracker.saveWitnesses(e),this.cache.saveWitnesses(e)])}async getMigration(e,r,n,i){const s=await this.cache.getMigration(e,r,n,i);if(s)return s;const o=await this.tracker.getMigration(e,r,n,i);return o&&await this.cache.saveMigration(e,o,this.contexts),o}async saveMigration(e,r,n){await Promise.all([this.tracker.saveMigration(e,r,n),this.cache.saveMigration(e,r,n)])}}class BT{constructor(){this.cache=new Map}do(e,r,n,...i){e=`${e}:${Be(wt(JSON.stringify(i,Kme)))}`;let s=this.cache.get(e);if(s&&s.expiration&&new Date>=s.expiration&&(s=void 0,this.cache.delete(e)),!s){const o={promise:n(...i)};r!==void 0&&(o.promise=o.promise.then(a=>(o.expiration=new Date(Date.now()+r),a))),s=o,this.cache.set(e,s)}return s.promise}}function Kme(t,e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).sort()):e}function Qme(t){return t instanceof tU}class tU{constructor(e,r=50,n=!1){this.cache=new BT,this.tracker=e,this.window=r,this.verbose=n}invalidateCache(){this.cache=new BT}configOfImageHash(e){return this.cache.do("configOfImageHash",this.window,r=>this.tracker.configOfImageHash(r),e)}getMigration(e,r,n,i){return this.cache.do("getMigration",this.window,(...s)=>this.tracker.getMigration(...s),e,r,n,i)}saveMigration(e,r,n){return this.cache.do("saveMigration",void 0,(...i)=>this.tracker.saveMigration(...i),e,r,n)}loadPresignedConfiguration(e){return this.cache.do("loadPresignedConfiguration",this.window,r=>this.tracker.loadPresignedConfiguration(r),e)}savePresignedConfiguration(e){return this.cache.do("savePresignedConfiguration",void 0,r=>this.tracker.savePresignedConfiguration(r),e)}saveWitnesses(e){return this.cache.do("saveWitnesses",void 0,r=>this.tracker.saveWitnesses(r),e)}saveWalletConfig(e){return this.cache.do("saveWalletConfig",void 0,r=>this.tracker.saveWalletConfig(r),e)}imageHashOfCounterfactualWallet(e){return this.cache.do("imageHashOfCounterfactualWallet",void 0,r=>this.tracker.imageHashOfCounterfactualWallet(r),e)}saveCounterfactualWallet(e){return this.cache.do("saveCounterfactualWallet",void 0,r=>this.tracker.saveCounterfactualWallet(r),e)}walletsOfSigner(e){return this.cache.do("walletsOfSigner",this.window,r=>this.tracker.walletsOfSigner(r),e)}updateProvider(e){this.tracker instanceof D8&&this.tracker.updateProvider(e)}}var L8=Object.freeze({__proto__:null,debug:Lme,local:jme,remote:qme,stores:Bme,raceUntil:u5,allSafe:gh,MultipleTracker:Vme,CachedTracker:Gme,isDedupedTracker:Qme,DedupedTracker:tU});const Yme=Object.freeze(Object.defineProperty({__proto__:null,tracker:Nme,trackers:L8},Symbol.toStringTag,{value:"Module"})),rU=60*60*24*7,Jme=60;class jT{constructor(e,r,n={}){this.proofStrings=new Map,this.onAuthCallbacks=[],this.indexerClients=new Map,this.account=e,this.settings=r,this.status=n}now(){return Math.floor(Date.now()/1e3)}get expiration(){var e;return Math.max((e=this.settings.metadata.expiration)!=null?e:rU,120)}onAuth(e){return this.onAuthCallbacks.push(e),()=>this.onAuthCallbacks=this.onAuthCallbacks.filter(r=>r!==e)}async dump(){return this.status.jwt?{jwt:{token:await this.status.jwt.token,expiration:this.status.jwt.expiration},metadata:this.status.metadata}:{metadata:this.settings.metadata}}auth(e=5){var r=this;return this._initialAuthRequest?this._initialAuthRequest:(this._initialAuthRequest=async function(){const n=r.settings.sequenceApiUrl;if(!n)throw Error("No sequence api url");let i;for(let s=1;;s++)try{i=(await r.getJWT(!0)).token;break}catch(o){if(s===e)throw console.error(`couldn't authenticate after ${e} attempts`,o),o}return new Hh(n,void 0,i)}(),this._initialAuthRequest)}async getJWT(e){var r=this;const n=this.settings.sequenceApiUrl;if(!n)throw Error("No sequence api url");if(this.status.jwt){const l=this.status.jwt,u=await l.token;if(this.now(){throw this.status.jwt=void 0,l}),expiration:o};return this.status.jwt=a,a.token.then(l=>{this.onAuthCallbacks.forEach(u=>{try{u({status:"fulfilled",value:l})}catch{}})}).catch(l=>{this.onAuthCallbacks.forEach(u=>{try{u({status:"rejected",reason:l})}catch{}})}),{token:await a.token,expiration:o}}getProofStringKey(){return`${this.account.address} - ${this.settings.metadata.name}`}async isProofStringValid(e){try{const r=new i1,n=J.from(this.settings.sequenceApiChainId),i=xs(this.account.networks,n);if(!i)throw Error("No network found");return r.chainId=n.toNumber(),r.provider=new Hm(s1(i.rpcUrl),{name:"",chainId:n.toNumber()}),await r.decodeProof(e),!0}catch{return!1}}async getAPIClient(e=!0){if(!this.apiClient){const r=this.settings.sequenceApiUrl;if(!r)throw Error("No sequence api url");const n=(await this.getJWT(e)).token;this.apiClient=new Hh(r,void 0,n)}return this.apiClient}async getMetadataClient(e=!0){if(!this.metadataClient){const r=(await this.getJWT(e)).token;this.metadataClient=new M8(this.settings.sequenceMetadataUrl,void 0,r)}return this.metadataClient}async getIndexerClient(e,r=!0){const n=xs(this.account.networks,e);if(!n)throw Error(`No network for chain ${e}`);if(!this.indexerClients.has(n.chainId))if(n.indexer)this.indexerClients.set(n.chainId,n.indexer);else if(n.indexerUrl){const i=(await this.getJWT(r)).token;this.indexerClients.set(n.chainId,new $8(n.indexerUrl,void 0,i))}else throw Error(`No indexer url for chain ${e}`);return this.indexerClients.get(n.chainId)}getProofString(e){if(this.proofStrings.has(e)){const c=this.proofStrings.get(e);if(this.now()(r.signature=c,n.encodeProof(r,!0))).catch(c=>{throw this.proofStrings.delete(e),c}),expiration:o};return this.proofStrings.set(e,a),a}}const nU=async(t,e,r)=>{const n=Ve(await t.getAddress());if(!n||n===""||n==="0x")throw iU;const i=new Ob;if(i.address=n,!r||!r.app||r.app==="")throw new F8("authorization options requires app to be set");i.claims.app=r.app,i.claims.ogn=r.origin,i.claims.n=r.nonce,i.setExpiryIn(r.expiry?Math.max(r.expiry,200):rU);const s=i.messageTypedData(),o=HB(e);i.signature=await(t instanceof Mo?t.signTypedData(s.domain,s.types,s.message,o,"eip6492"):t.signTypedData(s.domain,s.types,s.message,o));const c=await new i1().encodeProof(i,!0);return{typedData:s,proofString:c}};class F8 extends Error{constructor(e){super(e),this.name="AuthError"}}const iU=new F8("auth error: account address is empty");function al(){return al=Object.assign?Object.assign.bind():function(t){for(var e=1;eI.wallet)));let T;if(P){if(T=new Mo({address:P,tracker:y,networks:b,contexts:v,orchestrator:p}),l&&l.length>0){let I=await T.status(g);if(I.original.version!==I.version||T.version!==I.version){const{migratedAllChains:H,failedChains:K}=await T.isMigratedAllChains();if(K.some(B=>f5.includes(B)))throw Error(`Failed to fetch account status on ${K.join(", ")}`);if(!H){if(h&&!await h(T))throw Error("Migration cancelled, cannot open session");const{failedChains:B}=await T.signAllMigrations(d||(_=>_));if(B.some(_=>f5.includes(_)))throw Error(`Failed to sign migrations on ${B.join(", ")}`);L8.isDedupedTracker(y)&&y.invalidateCache();let E;if([E,I]=await Promise.all([T.isMigratedAllChains().then(_=>_.migratedAllChains),T.status(g)]),!E)throw Error("Failed to migrate account")}}I.onChain.version!==I.version&&await T.doBootstrap(g,void 0,I);const F=I.config,j=T.coders.config.editConfig(F,{add:l,threshold:c});if(T.coders.config.imageHashOf(F)!==T.coders.config.imageHashOf(j)){const H=T.coders.config.editConfig(j,{checkpoint:T.coders.config.checkpointOf(F).add(1)});await T.updateConfig(H)}}}else{if(!l||l.length===0)throw Error("Cannot create new account without signers");if(!c)throw Error("Cannot create new account without threshold");if(T=await Mo.new({config:{threshold:c,checkpoint:0,signers:l},tracker:y,contexts:v,orchestrator:p,networks:b}),P=await u([T.address]),await T.publishWitness(),!(await y.walletsOfSigner({signer:a,noCache:!0})).some(F=>F.wallet===T.address))throw Error("Account not found on tracker")}let w;return m&&(w=new jT(T,m),w.auth(),w.onAuth(I=>{I.status==="fulfilled"&&T.setJwt(I.value)})),new e0(b,v,T,w)}static async load(e){const{dump:r,settings:n,editConfigOnMigration:i,onMigration:s,orchestrator:o}=e,{contexts:a,networks:c,tracker:l,services:u}=al({},Qv,n);let f;if(sU(r)){var d,h,p;const S=r.config.address||he.context.addressOf(a[1],Oo.config.ConfigCoder.imageHashOf(al({},r.config,{version:1}))),P=((d=(h=r.jwt)==null?void 0:h.expiration)!=null?d:0)T.migratedAllChains)){if(s&&!await s(f))throw Error("Migration cancelled, cannot open session");if(console.log("Migrating account..."),await f.signAllMigrations(i),!await f.isMigratedAllChains().then(T=>T.migratedAllChains))throw Error("Failed to migrate account")}}else if(oU(r)){var v,b,y;const S=((v=(b=r.jwt)==null?void 0:b.expiration)!=null?v:0)async(n,i,s)=>{const o=s.messageDigest();return{isValid:await t(i).isValidSignature(s.address,o,s.signature)}},Zme=Object.freeze(Object.defineProperty({__proto__:null,AuthError:F8,CRITICAL_CHAINS:f5,ErrAccountIsRequired:iU,Session:e0,SessionSettingsDefault:Qv,ValidateSequenceWalletProof:Xme,isSessionDumpV1:sU,isSessionDumpV2:oU,signAuthorization:nU},Symbol.toStringTag,{value:"Module"}));function Iy(){return Iy=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),Pn({},n)).then(i=>Tn(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),Pn({},n)).then(i=>Tn(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),Pn({},n)).then(i=>Tn(i).then(s=>({status:s.status}))),this.getSignerConfig=(n,i)=>this.fetch(this.url("GetSignerConfig"),Pn(n,i)).then(s=>Tn(s).then(o=>({signerConfig:o.signerConfig}))),this.sign=(n,i)=>this.fetch(this.url("Sign"),Pn(n,i)).then(s=>Tn(s).then(o=>({sig:o.sig}))),this.signWith=(n,i)=>this.fetch(this.url("SignWith"),Pn(n,i)).then(s=>Tn(s).then(o=>({sig:o.sig}))),this.authMethods=(n,i)=>this.fetch(this.url("AuthMethods"),Pn(n,i)).then(s=>Tn(s).then(o=>({methods:o.methods,active:o.active}))),this.setPIN=(n,i)=>this.fetch(this.url("SetPIN"),Pn(n,i)).then(s=>Tn(s).then(o=>({}))),this.resetPIN=(n,i)=>this.fetch(this.url("ResetPIN"),Pn(n,i)).then(s=>Tn(s).then(o=>({}))),this.createTOTP=(n,i)=>this.fetch(this.url("CreateTOTP"),Pn(n,i)).then(s=>Tn(s).then(o=>({uri:o.uri}))),this.commitTOTP=(n,i)=>this.fetch(this.url("CommitTOTP"),Pn(n,i)).then(s=>Tn(s).then(o=>({codes:o.codes}))),this.resetTOTP=(n,i)=>this.fetch(this.url("ResetTOTP"),Pn(n,i)).then(s=>Tn(s).then(o=>({}))),this.reset2FA=(n,i)=>this.fetch(this.url("Reset2FA"),Pn(n,i)).then(s=>Tn(s).then(o=>({}))),this.recoveryCodes=(n,i)=>this.fetch(this.url("RecoveryCodes"),Pn(n,i)).then(s=>Tn(s).then(o=>({codes:o.codes}))),this.resetRecoveryCodes=(n,i)=>this.fetch(this.url("ResetRecoveryCodes"),Pn(n,i)).then(s=>Tn(s).then(o=>({codes:o.codes}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Pn=(t={},e={})=>({method:"POST",headers:Iy({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),Tn=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),tye=typeof global=="object"?global.fetch:window.fetch;class rye{constructor(e,r,n=!1){this.address=e,this.url=r,this.appendSuffix=n,this.guard=new eye(r,tye)}async getAddress(){return this.address}async buildDeployTransaction(e){}async predecorateSignedTransactions(e){return[]}async decorateTransactions(e,r){return e}async requestSignature(e,r,n,i){var s;const{onSignature:o,onRejection:a}=i;if(!he.isWalletSignRequestMetadata(n))return a("expected sequence signature request metadata"),!1;const c=n.guardTotpCode,l=Zr.genericCoderFor(n.config.version),{encoded:u}=l.signature.encodeSigners(n.config,(s=n.parts)!=null?s:new Map,[],n.chainId);try{const{sig:h}=await this.guard.signWith({signer:this.address,request:{msg:te(r),auxData:this.packMsgAndSig(n.address,n.digest,u,n.chainId),chainId:J.from(n.chainId).toNumber()},token:c?{id:Oy.TOTP,token:c}:void 0});if(re(h).length===0)throw new Error("guard response contained no signature data");return o(h),!0}catch(h){var f,d;return a(`unable to request guard signature: ${(f=(d=h.message)!=null?d:h.msg)!=null?f:h}`),!1}}notifyStatusChange(e,r,n){}async getAuthMethods(e){let r;if("jwt"in e)r=await this.guard.authMethods({},{Authorization:`BEARER ${e.jwt}`});else{const n=await UT(e);r=await this.guard.authMethods({proof:{wallet:n.walletAddress,timestamp:n.timestamp.getTime(),signer:n.signerAddress,signature:n.signature}})}return Iy({},r,{methods:r.methods.map(nye)})}async setPin(e,r){const n=await nh(r);e===void 0?await this.guard.resetPIN({timestamp:n.timestamp.getTime(),signature:n.signature},{Authorization:`BEARER ${r.jwt}`}):await this.guard.setPIN({pin:e,timestamp:n.timestamp.getTime(),signature:n.signature},{Authorization:`BEARER ${r.jwt}`})}resetPin(e){return this.setPin(void 0,e)}async createTotp(e){const r=await nh(e),{uri:n}=await this.guard.createTOTP({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return new URL(n)}async commitTotp(e,r){const{codes:n}=await this.guard.commitTOTP({token:e},{Authorization:`BEARER ${r}`});return n}async resetTotp(e){const r=await nh(e);await this.guard.resetTOTP({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`})}async reset2fa(e,r){if("jwt"in r)await this.guard.reset2FA({code:e},{Authorization:`BEARER ${r.jwt}`});else{const n=await UT(r);await this.guard.reset2FA({code:e,proof:{wallet:n.walletAddress,timestamp:n.timestamp.getTime(),signer:n.signerAddress,signature:n.signature}})}}async getRecoveryCodes(e){const r=await nh(e),{codes:n}=await this.guard.recoveryCodes({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return n}async resetRecoveryCodes(e){const r=await nh(e),{codes:n}=await this.guard.resetRecoveryCodes({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return n}packMsgAndSig(e,r,n,i){return Bn.encode(["address","uint256","bytes","bytes"],[e,i,r,n])}suffix(){return this.appendSuffix?[3]:[]}}let Oy=function(t){return t.PIN="PIN",t.TOTP="TOTP",t}({});function nye(t){switch(t){case Oy.PIN:case Oy.TOTP:return t;default:throw new Error(`unknown auth method '${t}'`)}}function iye(t){return"signerAddress"in t&&typeof t.signerAddress=="string"}async function UT(t){if(iye(t))return t;{const e=o5.isSapientSigner(t.signer)?t.signer:new o5.SignerWrapper(t.signer),r=await e.getAddress(),n=new Date,i=aU(t.walletAddress,n),s=Q1(i),o=te(T1(32));return new Promise((a,c)=>e.requestSignature(o,s,{},{onSignature(l){a({walletAddress:t.walletAddress,timestamp:n,signerAddress:r,signature:te(l)})},onRejection:c,onStatus(l){}}))}}async function nh(t){if("wallet"in t){var e;const r=new Date,n=cU(r),i=await t.wallet.signTypedData(n.domain,n.types,n.message,(e=n.domain.chainId)!=null?e:1,"eip6492");return{jwt:t.jwt,timestamp:r,signature:i}}else return t}function aU(t,e){return{domain:lU,types:{AuthMethods:[{name:"wallet",type:"address"},{name:"timestamp",type:"string"}]},message:{wallet:Ve(t),timestamp:uU(e)}}}function cU(t){return{domain:lU,types:{AuthUpdate:[{name:"timestamp",type:"string"}]},message:{timestamp:uU(t)}}}const lU={name:"Sequence Guard",version:"1",chainId:1};function uU(t){return t.toUTCString().replace("GMT","UTC")}const sye=Object.freeze(Object.defineProperty({__proto__:null,AuthMethod:Oy,GuardSigner:rye,getAuthUpdateProofTypedData:cU,getOwnershipProofTypedData:aU},Symbol.toStringTag,{value:"Module"}));function Ry(){return Ry=Object.assign?Object.assign.bind():function(t){for(var e=1;e{this.queue.length>0&&(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.run,this.options.timeWindow))},this.handle=(n,i,s)=>{if(this.batchableJsonRpcMethods.find(o=>o===i.method)){this.queue.push({request:i,callback:s,next:n}),this.options.verbose&&console.log("Scheduling call",i.method),this.scheduleExecution();return}return this.options.verbose&&console.log("Forwarded call",i.method),n(i,s)},this.run=async function(){r.options.verbose&&console.log("Processing multicall");const n=Math.min(r.options.batchSize,r.queue.length);if(n===0){r.options.verbose&&console.log("Skip multicall, empty queue");return}if(n===1){r.forward(r.queue[0]),r.queue=[],r.options.verbose&&console.log("Skip multicall, single item");return}r.options.verbose&&console.log("Resolving",n);var a=r.queue.slice(0,n);r.queue=n===r.queue.length?[]:r.queue.slice(n),r.options.verbose&&console.log("Updated queue",r.queue.length),r.queue.length!==0&&(r.options.verbose&&console.log("Scheduling next batch"),r.scheduleExecution());const i=a[0].next;let s;var[a,c]=zT(a,h=>{try{if(h.next!==i)return!1;switch(h.request.method){case $r.ethCall:if(h.request.params[0].from||h.request.params[0].gasPrice||h.request.params[0].value)return!1;case $r.ethGetBalance:case $r.ethGetCode:const p=aye(h.request.params[1]);if(s===void 0&&(s=p),!cye(p,s))return!1}return!0}catch{return!1}});if(c.length!==0&&(r.options.verbose&&console.log("Forwarding incompatible calls",c.length),r.forward(c),a.length===0)){r.options.verbose&&console.log("Skip multicall, all calls are incompatible");return}let o=a.map(h=>{try{switch(h.request.method){case $r.ethCall:return{delegateCall:!1,revertOnError:!1,target:h.request.params[0].to,data:h.request.params[0].data,gasLimit:h.request.params[0].gas?h.request.params[0].gas:0,value:0};case $r.ethGetCode:return{delegateCall:!1,revertOnError:!1,target:r.options.contract,gasLimit:0,value:0,data:r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("callCode"),[h.request.params[0]])};case $r.ethGetBalance:return{delegateCall:!1,revertOnError:!1,target:r.options.contract,gasLimit:0,value:0,data:r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("callBalanceOf"),[h.request.params[0]])};default:return null}}catch{return null}});var[a,c]=zT(a,(h,p)=>o[p]!==void 0);if(o=o.filter(h=>h),c.length!==0&&(r.options.verbose&&console.log("Forwarding calls on error",c.length),r.forward(c),a.length===0)){r.options.verbose&&console.log("Skip multicall, all calls had encoding errors");return}let l;try{r.options.verbose&&console.log("Encoding multicall"),l=r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("multiCall"),[o])}catch(h){r.options.verbose&&console.warn("Error encoding multicall, forwarding one by one",h),r.forward(a);return}const u=u8(),f=await oye(l8(i)({id:u,jsonrpc:Gf,method:$r.ethCall,params:[{to:r.options.contract,value:0,data:l},J.isBigNumber(s)?s.toNumber():s]}),h=>({jsonrpc:Gf,id:u,result:void 0,error:h}));if(f.error)return r.options.verbose&&console.warn("Error calling multicall, forwarding one by one",f.error),r.forward(a);let d;try{d=r.multicallInterface.decodeFunctionResult(r.multicallInterface.getFunction("multiCall"),f.result)}catch(h){r.options.verbose&&console.warn("Error decoding multicall result, forwarding one by one",h),r.forward(a);return}r.options.verbose&&console.log("Got response for",a.length),a.forEach((h,p)=>{if(!d[0][p])r.options.verbose&&console.warn(`Multicall error for ${h.request.method} not found`),r.forward(h);else switch(h.request.method){case $r.ethCall:h.callback(void 0,{jsonrpc:h.request.jsonrpc,id:h.request.id,result:d[1][p]});break;case $r.ethGetCode:h.callback(void 0,{jsonrpc:h.request.jsonrpc,id:h.request.id,result:Bn.decode(["bytes"],d[1][p])[0]});break;case $r.ethGetBalance:h.callback(void 0,{jsonrpc:h.request.jsonrpc,id:h.request.id,result:Bn.decode(["uint256"],d[1][p])[0]});break}})},this.options=e?Ry({},Bi.DefaultOptions,e):Bi.DefaultOptions,this.options.batchSize<=0)throw new Error(`Invalid batch size of ${this.options.batchSize}`)}forward(e){Array.isArray(e)?e.forEach(r=>r.next(r.request,r.callback)):e.next(e.request,e.callback)}static isMulticall(e){return e&&e.handle!==void 0&&e.conf!==void 0&&Bi.isMulticallOptions(e.options)}static isMulticallOptions(e){return e!==void 0&&e.batchSize!==void 0&&e.timeWindow!==void 0&&e.contract!==void 0}}Bi.DefaultOptions=Ry({},lye);const fU=["getNetwork","getBlockNumber","getGasPrice","getTransactionCount","getStorageAt","sendTransaction","estimateGas","getBlock","getTransaction","getTransactionReceipt","getLogs","emit","litenerCount","addListener","removeListener","waitForTransaction","detectNetwork","getBlockWithTransactions"];class uye extends Og{constructor(e,r){var n;super(e.getNetwork()),n=this,this.getResolver=async function(i){const s=n.provider;if(s.getResolver){const o=await s.getResolver(await i);return o?new Mx(n,o.address,o.name):null}return s.getResolver(await i)},this.next=async function(i,s){try{switch(i.method){case $r.ethCall:n.callback(i,s,await n.provider.call(i.params[0],i.params[1]));break;case $r.ethGetCode:n.callback(i,s,await n.provider.getCode(i.params[0],i.params[1]));break;case $r.ethGetBalance:n.callback(i,s,await n.provider.getBalance(i.params[0],i.params[1]));break}}catch(o){n.callback(i,s,void 0,o)}},this.provider=e,this.listenerCount=e.listenerCount.bind(e),this.multicall=Bi.isMulticall(r)?r:new Bi(r),fU.forEach(i=>{e[i]!==void 0&&(this[i]=(...s)=>e[i](...s))})}callback(e,r,n,i){r(i,{jsonrpc:Gf,id:e.id,result:n,error:i})}async call(e,r){return this.rpcCall($r.ethCall,e,r)}async getCode(e,r){return this.rpcCall($r.ethGetCode,e,r)}async getBalance(e,r){return this.rpcCall($r.ethGetBalance,e,r)}async rpcCall(e,...r){const n=u8();return(await l8(this.multicall.handle)(this.next,{jsonrpc:Gf,id:n,method:e,params:r})).result}}class fye{constructor(e,r){if(this.provider=e,this.multicall=Bi.isMulticall(r)?r:new Bi(r),e.send){const n=async function(s,o){e.send(s,o)};this.send=(i,s)=>{this.multicall.handle(n,i,s)}}if(e.sendAsync){const n=async function(s,o){e.sendAsync(s,o)};this.sendAsync=(i,s)=>{this.multicall.handle(n,i,s)}}}get isMetaMask(){return this.provider.isMetaMask}get isStatus(){return this.provider.isStatus}}const dye=t=>e=>{const r=Bi.isMulticall(t)?t:new Bi(t);return(n,i)=>r.handle(e,n,i)};var hye=Object.freeze({__proto__:null,ProxyMethods:fU,MulticallProvider:uye,MulticallExternalProvider:fye,multicallMiddleware:dye});const pye=Object.freeze(Object.defineProperty({__proto__:null,Multicall:Bi,providers:hye},Symbol.toStringTag,{value:"Module"}));var dU={exports:{}};/*! * EventEmitter2 * https://github.com/hij1nx/EventEmitter2 * * Copyright (c) 2013 hij1nx * Licensed under the MIT license. - */(function(t,e){(function(r){var n=Object.hasOwnProperty,i=Array.isArray?Array.isArray:function(M){return Object.prototype.toString.call(M)==="[object Array]"},s=10,o=typeof process=="object"&&typeof process.nextTick=="function",a=typeof Symbol=="function",c=typeof Reflect=="object",l=typeof setImmediate=="function",u=l?setImmediate:setTimeout,f=a?c&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(k){var M=Object.getOwnPropertyNames(k);return M.push.apply(M,Object.getOwnPropertySymbols(k)),M}:Object.keys;function d(){this._events={},this._conf&&h.call(this,this._conf)}function h(k){k&&(this._conf=k,k.delimiter&&(this.delimiter=k.delimiter),k.maxListeners!==r&&(this._maxListeners=k.maxListeners),k.wildcard&&(this.wildcard=k.wildcard),k.newListener&&(this._newListener=k.newListener),k.removeListener&&(this._removeListener=k.removeListener),k.verboseMemoryLeak&&(this.verboseMemoryLeak=k.verboseMemoryLeak),k.ignoreErrors&&(this.ignoreErrors=k.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function p(k,M){var L="(node) warning: possible EventEmitter memory leak detected. "+k+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(L+=" Event name: "+M+"."),typeof process<"u"&&process.emitWarning){var $=new Error(L);$.name="MaxListenersExceededWarning",$.emitter=this,$.count=k,process.emitWarning($)}else console.error(L),console.trace&&console.trace()}var v=function(k,M,L){var $=arguments.length;switch($){case 0:return[];case 1:return[k];case 2:return[k,M];case 3:return[k,M,L];default:for(var A=new Array($);$--;)A[$]=arguments[$];return A}};function b(k,M){for(var L={},$,A=k.length,D=M?M.length:0,V=0;V0;)k=D[U],V.call(R,k,L[k]);this._listeners={},this._listenersCount=0,W()}}});function m(k,M,L,$){var A=Object.assign({},M);if(!k)return A;if(typeof k!="object")throw TypeError("options must be an object");var D=Object.keys(k),V=D.length,R,U,W;function q(X){throw Error('Invalid "'+R+'" option value'+(X?". Reason: "+X:""))}for(var Y=0;Y0;)if(R===k[U])return D;V(M)}}var P=S(["function"]),T=S(["object","function"]);function w(k,M,L){var $,A,D=0,V,R=new k(function(U,W,q){L=m(L,{timeout:0,overload:!1},{timeout:function(Z,ae){return Z*=1,(typeof Z!="number"||Z<0||!Number.isFinite(Z))&&ae("timeout must be a positive number"),Z}}),$=!L.overload&&typeof k.prototype.cancel=="function"&&typeof q=="function";function Y(){A&&(A=null),D&&(clearTimeout(D),D=0)}var X=function(Z){Y(),U(Z)},Q=function(Z){Y(),W(Z)};$?M(X,Q,q):(A=[function(Z){Q(Z||Error("canceled"))}],M(X,Q,function(Z){if(V)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof Z!="function")throw TypeError("onCancel callback must be a function");A.push(Z)}),V=!0),L.timeout>0&&(D=setTimeout(function(){var Z=Error("timeout");Z.code="ETIMEDOUT",D=0,R.cancel(Z),W(Z)},L.timeout))});return $||(R.cancel=function(U){if(A){for(var W=A.length,q=1;q0;)Q=Ae[R],Q!=="_listeners"&&(at=B(k,M,L[Q],$+1,A),at&&(X?X.push.apply(X,at):X=at));return X}else if(ot==="**"){for(ue=$+1===A||$+2===A&&Pe==="*",ue&&L._listeners&&(X=B(k,M,L,A,A)),Ae=f(L),R=Ae.length;R-- >0;)Q=Ae[R],Q!=="_listeners"&&(Q==="*"||Q==="**"?(L[Q]._listeners&&!ue&&(at=B(k,M,L[Q],A,A),at&&(X?X.push.apply(X,at):X=at)),at=B(k,M,L[Q],$,A)):Q===Pe?at=B(k,M,L[Q],$+2,A):at=B(k,M,L[Q],$,A),at&&(X?X.push.apply(X,at):X=at));return X}else L[ot]&&(X=B(k,M,L[ot],$+1,A));if(Z=L["*"],Z&&B(k,M,Z,$+1,A),ae=L["**"],ae)if($0;)Q=Ae[R],Q!=="_listeners"&&(Q===Pe?B(k,M,ae[Q],$+2,A):Q===ot?B(k,M,ae[Q],$+1,A):(se={},se[Q]=ae[Q],B(k,M,{"**":se},$+1,A)));else ae._listeners?B(k,M,ae,A,A):ae["*"]&&ae["*"]._listeners&&B(k,M,ae["*"],A,A);return X}function j(k,M,L){var $=0,A=0,D,V=this.delimiter,R=V.length,U;if(typeof k=="string")if((D=k.indexOf(V))!==-1){U=new Array(5);do U[$++]=k.slice(A,D),A=D+R;while((D=k.indexOf(V,A))!==-1);U[$++]=k.slice(A)}else U=[k],$=1;else U=k,$=k.length;if($>1){for(D=0;D+1<$;D++)if(U[D]==="**"&&U[D+1]==="**")return}var W=this.listenerTree,q;for(D=0;D<$;D++)if(q=U[D],W=W[q]||(W[q]={}),D===$-1)return W._listeners?(typeof W._listeners=="function"&&(W._listeners=[W._listeners]),L?W._listeners.unshift(M):W._listeners.push(M),!W._listeners.warned&&this._maxListeners>0&&W._listeners.length>this._maxListeners&&(W._listeners.warned=!0,p.call(this,W._listeners.length,q))):W._listeners=M,!0;return!0}function H(k,M,L,$){for(var A=f(k),D=A.length,V,R,U,W=k._listeners,q;D-- >0;)R=A[D],V=k[R],R==="_listeners"?U=L:U=L?L.concat(R):[R],q=$||typeof R=="symbol",W&&M.push(q?U:U.join(this.delimiter)),typeof V=="object"&&H.call(this,V,M,U,q);return M}function K(k){for(var M=f(k),L=M.length,$,A,D;L-- >0;)A=M[L],$=k[A],$&&(D=!0,A!=="_listeners"&&!K($)&&delete k[A]);return D}function F(k,M,L){this.emitter=k,this.event=M,this.listener=L}F.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function E(k,M,L){if(L===!0)A=!0;else if(L===!1)$=!0;else{if(!L||typeof L!="object")throw TypeError("options should be an object or true");var $=L.async,A=L.promisify,D=L.nextTick,V=L.objectify}if($||D||A){var R=M,U=M._origin||M;if(D&&!o)throw Error("process.nextTick is not supported");A===r&&(A=M.constructor.name==="AsyncFunction"),M=function(){var W=arguments,q=this,Y=this.event;return A?D?Promise.resolve():new Promise(function(X){u(X)}).then(function(){return q.event=Y,R.apply(q,W)}):(D?process.nextTick:u)(function(){q.event=Y,R.apply(q,W)})},M._async=!0,M._origin=U}return[M,V?new F(this,k,M):this]}function _(k){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,h.call(this,k)}_.EventEmitter2=_,_.prototype.listenTo=function(k,M,L){if(typeof k!="object")throw TypeError("target musts be an object");var $=this;L=m(L,{on:r,off:r,reducers:r},{on:P,off:P,reducers:T});function A(D){if(typeof D!="object")throw TypeError("events must be an object");var V=L.reducers,R=I.call($,k),U;R===-1?U=new y($,k,L):U=$._observers[R];for(var W=f(D),q=W.length,Y,X=typeof V=="function",Q=0;Q0;)A=L[$],(!k||A._target===k)&&(A.unsubscribe(M),D=!0);return D},_.prototype.delimiter=".",_.prototype.setMaxListeners=function(k){k!==r&&(this._maxListeners=k,this._conf||(this._conf={}),this._conf.maxListeners=k)},_.prototype.getMaxListeners=function(){return this._maxListeners},_.prototype.event="",_.prototype.once=function(k,M,L){return this._once(k,M,!1,L)},_.prototype.prependOnceListener=function(k,M,L){return this._once(k,M,!0,L)},_.prototype._once=function(k,M,L,$){return this._many(k,1,M,L,$)},_.prototype.many=function(k,M,L,$){return this._many(k,M,L,!1,$)},_.prototype.prependMany=function(k,M,L,$){return this._many(k,M,L,!0,$)},_.prototype._many=function(k,M,L,$,A){var D=this;if(typeof L!="function")throw new Error("many only accepts instances of Function");function V(){return--M===0&&D.off(k,V),L.apply(this,arguments)}return V._origin=L,this._on(k,V,$,A)},_.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||d.call(this);var k=arguments[0],M,L=this.wildcard,$,A,D,V,R;if(k==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(L&&(M=k,k!=="newListener"&&k!=="removeListener"&&typeof k=="object")){if(A=k.length,a){for(D=0;D3)for($=new Array(U-1),V=1;V3)for(A=new Array(W-1),R=1;R0&&this._events[k].length>this._maxListeners&&(this._events[k].warned=!0,p.call(this,this._events[k].length,k))):this._events[k]=M,A)},_.prototype.off=function(k,M){if(typeof M!="function")throw new Error("removeListener only takes instances of Function");var L,$=[];if(this.wildcard){var A=typeof k=="string"?k.split(this.delimiter):k.slice();if($=B.call(this,null,A,this.listenerTree,0),!$)return this}else{if(!this._events[k])return this;L=this._events[k],$.push({_listeners:L})}for(var D=0;D<$.length;D++){var V=$[D];if(L=V._listeners,i(L)){for(var R=-1,U=0,W=L.length;U0){for($=this._all,M=0,L=$.length;M0;)$=M[L[D]],typeof $=="function"?A.push($):A.push.apply(A,$);return A}else{if(this.wildcard){if(V=this.listenerTree,!V)return[];var R=[],U=typeof k=="string"?k.split(this.delimiter):k.slice();return B.call(this,R,U,V,0),R}return M?($=M[k],$?typeof $=="function"?[$]:$:[]):[]}},_.prototype.eventNames=function(k){var M=this._events;return this.wildcard?H.call(this,this.listenerTree,[],null,k):M?f(M):[]},_.prototype.listenerCount=function(k){return this.listeners(k).length},_.prototype.hasListeners=function(k){if(this.wildcard){var M=[],L=typeof k=="string"?k.split(this.delimiter):k.slice();return B.call(this,M,L,this.listenerTree,0),M.length>0}var $=this._events,A=this._all;return!!(A&&A.length||$&&(k===r?f($).length:$[k]))},_.prototype.listenersAny=function(){return this._all?this._all:[]},_.prototype.waitFor=function(k,M){var L=this,$=typeof M;return $==="number"?M={timeout:M}:$==="function"&&(M={filter:M}),M=m(M,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:P,Promise:g}),w(M.Promise,function(A,D,V){function R(){var U=M.filter;if(!(U&&!U.apply(L,arguments)))if(L.off(k,R),M.handleError){var W=arguments[0];W?D(W):A(v.apply(null,arguments).slice(1))}else A(v.apply(null,arguments))}V(function(){L.off(k,R)}),L._on(k,R,!1)},{timeout:M.timeout,overload:M.overload})};function O(k,M,L){L=m(L,{Promise,timeout:0,overload:!1},{Promise:g});var $=L.Promise;return w($,function(A,D,V){var R;if(typeof k.addEventListener=="function"){R=function(){A(v.apply(null,arguments))},V(function(){k.removeEventListener(M,R)}),k.addEventListener(M,R,{once:!0});return}var U=function(){W&&k.removeListener("error",W),A(v.apply(null,arguments))},W;M!=="error"&&(W=function(q){k.removeListener(M,U),D(q)},k.once("error",W)),V(function(){W&&k.removeListener("error",W),k.removeListener(M,U)}),k.once(M,U)},{timeout:L.timeout,overload:L.overload})}var N=_.prototype;Object.defineProperties(_,{defaultMaxListeners:{get:function(){return N._maxListeners},set:function(k){if(typeof k!="number"||k<0||Number.isNaN(k))throw TypeError("n must be a non-negative number");N._maxListeners=k},enumerable:!0},once:{value:O,writable:!0,configurable:!0}}),Object.defineProperties(N,{_maxListeners:{value:s,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof r=="function"&&r.amd?r(function(){return _}):t.exports=_})()})(Dj);var Mb=Dj.exports;function Yn(){return Yn=Object.assign?Object.assign.bind():function(t){for(var e=1;e++$me;class Y1{constructor(){var e=this;this.pendingMessageRequests=[],this.responseCallbacks=new Map,this.confirmationOnly=!1,this.events=new Mb.EventEmitter2,this.sendAsync=async function(r,n,i){e.state===Oi.CLOSED&&(e.confirmationOnly=!0),e.openWallet(void 0,{type:"jsonRpcRequest",method:r.method},i);try{e.isOpened()||await e.waitUntilOpened();const s=await e.sendMessageRequest({idx:jj(),type:Ke.MESSAGE,data:r,chainId:i});n(void 0,s.data)}catch(s){n(s)}},this.sendMessageRequest=async function(r){return new Promise((n,i)=>{(!r.idx||r.idx<=0)&&r.type!=="init"&&i(new Error("message idx not set"));const s=(a,c)=>{if(a)i(a);else if(c)n(c);else throw new Error("no valid response to return")},o=r.idx;e.responseCallbacks.get(o)?i(new Error("duplicate message idx, should never happen")):e.responseCallbacks.set(o,s),e.isOpened()?e.sendMessage(r):(ge.debug("pushing to pending requests",r),e.pendingMessageRequests.push(r))})},this.waitUntilOpened=async function(r=T8){let n=!1;return Promise.race([new Promise((i,s)=>{const o=setTimeout(()=>{clearTimeout(o),n||(e.state=Oi.CLOSED,e.events.emit("close",{code:1005,message:"opening wallet timed out"})),s(new Error("opening wallet timed out"))},r)}),new Promise(i=>{if(e.isOpened()){var s;n=!0,i((s=e.openPayload)==null?void 0:s.session);return}e.events.once("open",o=>{e.openPayload=o,n=!0,i(o.session)})})])},this.waitUntilConnected=async function(){await e.waitUntilOpened();const r=new Promise(i=>{if(e.connectPayload){i(e.connectPayload);return}e.events.once("connect",s=>{e.connectPayload=s,i(s)})}),n=new Promise((i,s)=>{e.events.once("close",o=>{s(o?new Error(`wallet closed due to ${JSON.stringify(o)}`):new Error("user closed the wallet"))})});return Promise.race([r,n])},this.state=Oi.CLOSED,this._registered=!1,this._init=Wt.NIL}get registered(){return this._registered}register(){throw new Error("abstract method")}unregister(){throw new Error("abstract method")}openWallet(e,r,n){throw new Error("abstract method")}closeWallet(){throw new Error("abstract method")}isOpened(){return this.registered&&this.state===Oi.OPENED}isConnected(){var e;const r=(e=this.openPayload)==null?void 0:e.session;return this.registered&&r!==void 0&&!!r.accountAddress&&r.accountAddress.length===42&&!!r.networks&&r.networks.length>0}handleMessage(e){var r=this;if(e.type===Ke.INIT){ge.debug("MessageProvider, received INIT message",e);const{nonce:c}=e.data;if(!c||c.length==0){ge.error("invalid init nonce");return}this._init=Wt.OK,this.sendMessage({idx:-1,type:Ke.INIT,data:{sessionId:this._sessionId,nonce:c}})}if(this._init!==Wt.OK)return;ge.debug("RECEIVED MESSAGE FROM WALLET",e.idx,e);const n=e.idx,i=this.responseCallbacks.get(n);if(n&&this.responseCallbacks.delete(n),e.type===Ke.OPEN&&!this.isOpened()){var s,o;if(this._sessionId&&this._sessionId!==((s=e.data)==null?void 0:s.sessionId)){ge.debug("open event received from wallet, but does not match sessionId",this._sessionId);return}if((o=e.data)!=null&&o.error){var a;const c=new Error(`opening wallet failed: received ${(a=e.data)==null?void 0:a.error}`);throw ge.error(c),this.close(),c}this.state=Oi.OPENED,this.openPayload=e.data,this.events.emit("open",this.openPayload),this.pendingMessageRequests.length!==0&&this.pendingMessageRequests.splice(0,this.pendingMessageRequests.length).forEach(async function(l){r.sendMessage(l)});return}if(e.type===Ke.MESSAGE){if(this.confirmationOnly&&setTimeout(()=>{this.responseCallbacks.size===0&&this.closeWallet()},500),!i)throw new Error("impossible state");if(i){this.events.emit("message",e),i(e.data.error,e);return}}if(e.type===Ke.ACCOUNTS_CHANGED){this.accountsChangedPayload={accounts:[]},e.data&&e.data.length>0?(this.accountsChangedPayload={accounts:[qe(e.data[0])],origin:e.origin},this.events.emit("accountsChanged",this.accountsChangedPayload.accounts,this.accountsChangedPayload.origin)):this.events.emit("accountsChanged",[],e.origin);return}if(e.type===Ke.CHAIN_CHANGED){this.events.emit("chainChanged",e.data,e.origin);return}if(e.type===Ke.NETWORKS){this.networksPayload=e.data,this.events.emit("networks",this.networksPayload);return}if(e.type===Ke.WALLET_CONTEXT){this.walletContextPayload=e.data,this.events.emit("walletContext",this.walletContextPayload);return}e.type===Ke.CLOSE&&this.state!==Oi.CLOSED&&this.close(e.data),e.type===Ke.CONNECT&&(this.connectPayload=e.data,this.events.emit("connect",this.connectPayload)),e.type===Ke.DISCONNECT&&this.isConnected()&&(this.events.emit("disconnect",e.data,e.origin),this.close())}sendMessage(e){throw new Error("abstract method")}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}emit(e,...r){return this.events.emit(e,...r)}close(e){this.state!==Oi.CLOSED&&(this.state=Oi.CLOSED,this.confirmationOnly=!1,this._sessionId=void 0,ge.info("closing wallet and flushing!"),this.pendingMessageRequests.length=0,this.responseCallbacks.forEach(r=>{r(Yn({},new Error("wallet closed"),{code:4001}))}),this.responseCallbacks.clear(),this.connectPayload=void 0,this.openPayload=void 0,this.accountsChangedPayload=void 0,this.networksPayload=void 0,this.walletContextPayload=void 0,this.events.emit("close",e))}}function Nme(t){return Dme.some(e=>e.predicate(t))}const Dme=[{name:"Decentraland Exception",predicate:Bme},{name:"0x v3 Exception",predicate:Fme}],Lme=/^Decentraland Login\nEphemeral address: 0x[a-fA-F0-9]{40}\nExpiration: (\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)((-(\d{2}):(\d{2})|Z)?)$/;function Bme(t){try{const e=la(t);return Lme.test(e)}catch{return!1}}function Fme(t){const e=new Br(jme);try{return e.decodeFunctionData("OrderWithHash",t),!0}catch{return!1}}const jme=[{inputs:[{components:[{internalType:"address",name:"makerAddress",type:"address"},{internalType:"address",name:"takerAddress",type:"address"},{internalType:"address",name:"feeRecipientAddress",type:"address"},{internalType:"address",name:"senderAddress",type:"address"},{internalType:"uint256",name:"makerAssetAmount",type:"uint256"},{internalType:"uint256",name:"takerAssetAmount",type:"uint256"},{internalType:"uint256",name:"makerFee",type:"uint256"},{internalType:"uint256",name:"takerFee",type:"uint256"},{internalType:"uint256",name:"expirationTimeSeconds",type:"uint256"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes",name:"makerAssetData",type:"bytes"},{internalType:"bytes",name:"takerAssetData",type:"bytes"},{internalType:"bytes",name:"makerFeeAssetData",type:"bytes"},{internalType:"bytes",name:"takerFeeAssetData",type:"bytes"}],internalType:"struct IEIP1271Data.Order",name:"order",type:"tuple"},{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderWithHash",outputs:[],stateMutability:"pure",type:"function"}],qv=wt(`Ethereum Signed Message: -`),Uj=t=>aa(t)||Fe(t)?re(t):wt(t),$b=t=>{const e=Uj(t);return Nme(e)?e:qt([qv,wt(String(e.length)),e])},Ume=t=>{if(JSON.stringify(t.slice(0,qv.length))!==JSON.stringify(qv))return t;const e=t.slice(qv.length),r=String(e.length).length;let n,i;try{i=Number(la(e.slice(0,r)))}catch{i=Number(te(e.slice(0,r)))}return i>e.length||!Number.isInteger(i)?n=r-1:n=r,e.slice(n)},Vf=async(t,e,r,n)=>new he.reader.OnChainReader(n).isValidSignature(t,e,r),zj=async(t,e,r,n)=>{const i=$b(e),s=XS(i);return Vf(t,s,r,n)},Wj=(t,e,r,n)=>Vf(t,H1(e),r,n),_y=()=>window.location.protocol==="chrome-extension:"||window.location.protocol==="moz-extension:",Hj=()=>!!navigator.userAgent.match(/UnitySequence/i),qj=t=>t.onChain.deployed&&t.fullyMigrated;class Vj{constructor(){this.callbacks=[],this.store={}}getItem(e){return this.store[e]||null}setItem(e,r){this.store[e]=r,this.callbacks.filter(n=>n.key===e).forEach(n=>n.cb(r))}removeItem(e){delete this.store[e]}onItemChange(e,r){return this.callbacks.push({key:e,cb:r}),()=>{this.callbacks=this.callbacks.filter(n=>n.cb!==r)}}}class s1{static isAvailable(){return typeof window=="object"&&typeof window.localStorage=="object"}constructor(){if(this.callbacks=[],!s1.isAvailable())throw new Error("LocalStorage is not available");window.addEventListener("storage",e=>{const{key:r}=e;this.callbacks.filter(i=>i.key===r).forEach(i=>i.cb(this.getItem(r)))})}getItem(e){return window.localStorage.getItem(e)}setItem(e,r){window.localStorage.setItem(e,r),this.callbacks.filter(n=>n.key===e).forEach(n=>n.cb(r))}removeItem(e){window.localStorage.removeItem(e),this.callbacks.filter(r=>r.key===e).forEach(r=>r.cb(null))}onItemChange(e,r){return this.callbacks.push({key:e,cb:r}),()=>{this.callbacks=this.callbacks.filter(n=>n.cb!==r)}}}function Py(){return s1.isAvailable()?new s1:new Vj}async function Gj(t){return Array.isArray(t)?Promise.all(t.map(e=>vt(e))):vt(t)}const MT="@sequence.transportSession";class J1{constructor(e){var r=this;this.sendAsync=async function(n,i,s){throw new Error("abstract method")},this.handleMessage=async function(n){const i=n;if(r._init!==Wt.OK){if(i.type===Ke.INIT)if(r.isValidInitAck(n))r._initCallback&&r._initCallback();else{r._initCallback&&r._initCallback("invalid init");return}return}switch(i.type){case Ke.OPEN:{if(r._init!==Wt.OK)return;const s={sessionId:i.data.sessionId,intent:i.data.intent,networkId:i.data.networkId};await r.open(s);return}case Ke.CLOSE:return r._init!==Wt.OK,void 0;case Ke.MESSAGE:{const s=await r.walletRequestHandler.sendMessageRequest(i);r.sendMessage(s),s.data.error;return}default:ge.error(`unexpected payload type ${i.type}`)}},this.sendMessageRequest=async function(n){return r.walletRequestHandler.sendMessageRequest(n)},this.open=async function({sessionId:n,intent:i,networkId:s}){n&&(r._sessionId=nF(n),r.saveTransportSession({sessionId:n,intent:i,networkId:s})),r.walletRequestHandler.setOpenIntent(i),await r.init();let o;try{if(s){const a=r8(s);if(a)o=a.chainId;else throw new Error(`unknown network ${s}`)}else o=r.walletRequestHandler.defaultChainId()}catch(a){console.error(a)}if(i&&i.type==="connect"&&i.options){const a=i.options,c=a;if(r.appOrigin&&c!=null&&c.origin){if(!_y()&&c.origin!==r.appOrigin)throw new Error("origin is invalid")}else!r.appOrigin&&c!=null&&c.origin?a.origin=sF(c.origin):r.appOrigin&&(a.origin=r.appOrigin);a.app&&(a.app=iF(a.app)),a.networkId?s=a.networkId:s&&(a.networkId=s),r.walletRequestHandler.setConnectOptions(a)}else r.walletRequestHandler.setConnectOptions(void 0);if(await r.walletRequestHandler.getAccount(),await r.walletRequestHandler.isSignedIn())if(i&&i.type==="connect"){(!o||o<=0)&&console.log("Failed to set default network on open"),r.notifyOpen({sessionId:r._sessionId});try{const a=await r.walletRequestHandler.promptConnect(i.options);a.connected&&r.walletRequestHandler.notifyConnect(a)}catch(a){ge.warn("promptConnect not connected:",a)}finally{(!i.options||i.options.keepWalletOpened!==!0)&&r.notifyClose()}}else{if(!o||o<=0)return r.notifyOpen({sessionId:r._sessionId,error:`failed to open wallet on network ${s}`}),!1;r.notifyOpen({sessionId:r._sessionId,chainId:`${o}`,session:await r.walletRequestHandler.walletSession(o)})}else return r.notifyOpen({sessionId:r._sessionId}),!0;return!0},this.saveTransportSession=n=>{Py().setItem(MT,JSON.stringify(n))},this.getCachedTransportSession=async function(){const n=Py().getItem(MT);try{return n?JSON.parse(n):null}catch{return console.error(`unable to parse transport session: ${n}`),null}},this.walletRequestHandler=e,this._init=Wt.NIL,this.walletRequestHandler.on("connect",n=>{this.registered&&this.notifyConnect(n)}),this.walletRequestHandler.on("disconnect",(n,i)=>{this.registered&&this.notifyDisconnect(n,i)}),this.walletRequestHandler.on("accountsChanged",(n,i)=>{this.registered&&this.notifyAccountsChanged(n,i)}),this.walletRequestHandler.on("networks",n=>{this.registered&&(this.notifyNetworks(n),!n||n.length===0?this.notifyChainChanged("0x0"):this.notifyChainChanged(gs(n.find(i=>i.isDefaultChain).chainId)))}),this.walletRequestHandler.on("chainChanged",(n,i)=>{this.notifyChainChanged(n,i)}),this.walletRequestHandler.on("walletContext",n=>{!this.registered||!n||this.notifyWalletContext(n)}),this.walletRequestHandler.on("close",n=>{this.registered&&this.notifyClose(n)})}get registered(){return this._registered}register(){throw new Error("abstract method")}unregister(){throw new Error("abstract method")}sendMessage(e){throw new Error("abstract method")}notifyOpen(e){const{chainId:r,sessionId:n,session:i,error:s}=e;this.sendMessage({idx:-1,type:Ke.OPEN,data:{chainId:r,sessionId:n,session:i,error:s}})}notifyClose(e){this.sendMessage({idx:-1,type:Ke.CLOSE,data:e?{error:e}:null})}notifyConnect(e){this.sendMessage({idx:-1,type:Ke.CONNECT,data:e})}notifyDisconnect(e,r){this.sendMessage({idx:-1,type:Ke.DISCONNECT,data:e?{error:e}:null,origin:r})}notifyAccountsChanged(e,r){this.sendMessage({idx:-1,type:Ke.ACCOUNTS_CHANGED,data:e,origin:r})}notifyChainChanged(e,r){this.sendMessage({idx:-1,type:Ke.CHAIN_CHANGED,data:e,origin:r})}notifyNetworks(e){this.sendMessage({idx:-1,type:Ke.NETWORKS,data:e})}notifyWalletContext(e){this.sendMessage({idx:-1,type:Ke.WALLET_CONTEXT,data:e})}isValidInitAck(e){if(this._init===Wt.OK)return ge.warn("isValidInitAck, already in init'd state, so inquiry is invalid."),!1;if(e.type!==Ke.INIT)return ge.warn("isValidInitAck, invalid message type, expecting init"),!1;const{sessionId:r,nonce:n}=e.data;return!r||r.length===0||!n||n.length===0?(ge.error("invalid init ack"),!1):r!==this._sessionId||n!==this._initNonce?(ge.error("invalid init ack match"),!1):!0}init(){return new Promise((e,r)=>{if(this._init===Wt.OK){e();return}if(this._init!==Wt.NIL||this._initCallback){r("transport init is in progress");return}const n=setTimeout(()=>{ge.warn("transport init timed out"),this._initCallback&&this._initCallback("transport init timed out")},T8/2);this._initCallback=i=>{this._initCallback=void 0,clearTimeout(n),i?r(i):(this._init=Wt.OK,e())},this._initNonce=`${performance.now()}`,this.sendMessage({idx:-1,type:Ke.INIT,data:{nonce:this._initNonce}}),this._init=Wt.SENT_NONCE})}}class zme{constructor(){const e=new i5,r=new i5;e.conn=r,r.conn=e,this.app=e,this.wallet=r}}class i5{constructor(){this.events=new Mb.EventEmitter2,this.handleMessage=e=>{throw new Error("ProxyMessageChannelPort is not registered")},this.sendMessage=e=>{this.conn.handleMessage(e),e.type==="open"&&this.events.emit("open",e),e.type==="close"&&this.events.emit("close",e),e.type==="connect"&&this.events.emit("connect",e),e.type==="disconnect"&&this.events.emit("disconnect",e)}}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}}class Kj extends Y1{constructor(e){if(super(),this.register=()=>{this.port.handleMessage=r=>{this.handleMessage(r)},this.on("open",(...r)=>{this.port.events.emit("open",...r)}),this.on("close",(...r)=>{this.port.events.emit("close",...r)}),this.on("connect",(...r)=>{this.port.events.emit("connect",...r)}),this.on("disconnect",(...r)=>{this.port.events.emit("disconnect",...r)}),this._registered=!0},this.unregister=()=>{this._registered=!1,this.closeWallet(),this.events.removeAllListeners(),this.port.handleMessage=void 0},this.openWallet=(r,n,i)=>{if(this.state===Oi.CLOSED){this.state=Oi.OPENING;const s=`${performance.now()}`;this._sessionId=s,this.sendMessage({idx:-1,type:Ke.OPEN,data:{path:r,intent:n,networkId:i,sessionId:s}})}},this.state=Oi.CLOSED,this.port=e,!e)throw new Error("port argument cannot be empty");this._init=Wt.OK}closeWallet(){this.sendMessage({idx:-1,type:Ke.CLOSE,data:null}),this.close()}sendMessage(e){if(!e.idx)throw new Error("message idx is empty");this.port.sendMessage(e)}}class Wme extends J1{constructor(e,r){super(e),this.port=r,this._init=Wt.OK}register(){this.port.handleMessage=e=>{this.handleMessage(e)},this._registered=!0}async restoreSession(){const e=await this.getCachedTransportSession();e&&this.open(e)}unregister(){this.port.handleMessage=void 0,this._registered=!1}sendMessage(e){this.port.sendMessage(e)}}function Qj(t){var e;if((e=window.ue)!=null&&e.sequencewallettransport&&!window.logsOverriddenForUnreal){var r;const n=(r=window.ue)==null?void 0:r.sequencewallettransport;console.log=(...i)=>{n.logfromjs(`${t}: ${K2(i)}`)},console.warn=(...i)=>{n.warnfromjs(`${t}: ${K2(i)}`)},console.error=(...i)=>{n.errorfromjs(`${t}: ${K2(i)}`)},window.logsOverriddenForUnreal=!0}}function K2(t){return t.map(e=>typeof e=="object"?e instanceof Error?e.message:JSON.stringify(e):String(e)).join(" ")}let gu;class Yj extends Y1{constructor(e){super(),this.register=()=>{var r;Qj("dapp"),gu&&(gu.unregister(),gu=this),(r=window.ue)!=null&&r.sequencewallettransport&&(window.ue.sequencewallettransport.onmessagefromwallet=this.onUnrealCallback),gu=this,this._registered=!0,console.log("registering transport!")},this.unregister=()=>{var r,n;this._registered=!1,this.closeWallet(),gu===this&&(gu=void 0),((r=window.ue)==null||(n=r.sequencewallettransport)==null?void 0:n.onmessagefromwallet)===this.onUnrealCallback&&delete window.ue.sequencewallettransport.onmessagefromwallet,this.events.removeAllListeners()},this.openWallet=(r,n,i)=>{if(this.isOpened()){console.log("wallet already open!");return}console.log("opening wallet!");const s=new URL(this.walletURL.href),o=new Q1;r&&(s.pathname=r.toLowerCase()),this._init=Wt.NIL,this._sessionId=`${performance.now()}`,o.set("sid",this._sessionId),n&&o.set("intent",YS(n)),i&&o.set("net",`${i}`),s.search=o.toString(),console.log("opening wallet to",s.href),window.open(s.href)},this.onUnrealCallback=r=>{if(!r)throw new Error("ProviderMessage object is empty");this.handleMessage(r)},this.walletURL=new URL(e)}closeWallet(){this.close()}sendMessage(e){var r,n;const i=typeof e!="string"?JSON.stringify(e):e;console.log("Sending message to wallet:",i),(r=window.ue)==null||(n=r.sequencewallettransport)==null||n.sendmessagetowallet(i)}}class Hme extends J1{constructor(e){super(e),this.onMessageFromUnreal=r=>{ge.debug("RECEIVED MESSAGE",r),this.handleMessage(r)},this.getUnrealTransportSession=r=>{const n=new Q1(r);return{sessionId:n.get("sid"),networkId:n.get("net"),intent:JS(n.get("intent"))}},this._init=Wt.NIL}async register(e){var r;if(((r=window.ue)==null?void 0:r.sequencewallettransport)===void 0)return;Qj("wallet");const{search:n}=new URL(e||window.location.href);let i=this.getUnrealTransportSession(n);if(!!i.sessionId||(i=await this.getCachedTransportSession()),!i){ge.error("unreal session is undefined");return}window.ue.sequencewallettransport.onmessagefromsequencejs=this.onMessageFromUnreal,this._registered=!0,this.open(i).then(o=>{if(!o){var a;const c=`failed to open to network ${(a=i)==null?void 0:a.networkId}`;ge.error(c),this.notifyClose({message:c}),window.close()}}).catch(o=>{var a;const c=`failed to open to network ${(a=i)==null?void 0:a.networkId}, due to: ${o}`;ge.error(c),this.notifyClose({message:c}),window.close()})}unregister(){var e,r;((e=window.ue)==null||(r=e.sequencewallettransport)==null?void 0:r.onmessagefromsequencejs)===this.onMessageFromUnreal&&delete window.ue.sequencewallettransport.onmessagefromsequencejs,this._registered=!1}sendMessage(e){var r,n;if(e.type!==Ke.INIT&&this._init!==Wt.OK){ge.error("impossible state, should not be calling postMessage until inited");return}const i=JSON.stringify(e);(r=window.ue)==null||(n=r.sequencewallettransport)==null||n.sendmessagetosequencejs(i)}}const I8="sequence-extension-message-handler";class qme extends J1{constructor(e,r){super(e),this.runtime=r,this._init=Wt.OK}register(){this._registered=!0,this.port=this.runtime.connect({name:I8})}sendMessage(e){ge.info("[ExtensionMessageHandler send]",e),this.port.postMessage(e)}}class Jj extends Y1{constructor(e){super(),this.register=()=>{this._registered=!0},e.onConnect.addListener(r=>{r.name===I8&&(this._init=Wt.OK,r.onMessage.addListener(n=>{this.handleMessage(n)}))})}sendMessage(e){}unregister(){}openWallet(e,r,n){}closeWallet(){}}class Vme extends Mb.EventEmitter2{constructor(e){var r;super(),r=this,this.responseCallbacks=new Map,this._messageIdx=0,this.nextMessageIdx=()=>++this._messageIdx,this.handleMessage=n=>{if(!n.type||!n.data)return;ge.info("[received message]",n);const i=n.idx,s=this.responseCallbacks.get(i);switch(i&&this.responseCallbacks.delete(i),n.type){case Ke.MESSAGE:if(s)this.emit(Ke.MESSAGE,n),s(n.data.error,n);else throw new Error("impossible state");break;case Ke.DISCONNECT:case Ke.ACCOUNTS_CHANGED:case Ke.CHAIN_CHANGED:this.emit(n.type,n.data);break;default:console.error("unknown message type",n);break}},this.sendMessageRequest=async function(n){return new Promise((i,s)=>{(!n.idx||n.idx<=0)&&s(new Error("message idx not set"));const o=(c,l)=>{if(c)s(c);else if(l)i(l);else throw new Error("no valid response to return")},{idx:a}=n;r.responseCallbacks.get(a)?s(new Error("duplicate message idx, should never happen")):r.responseCallbacks.set(a,o),r.sendMessage(n)})},this.stream=e,this.stream.on("data",this.handleMessage)}sendMessage(e){this.stream.writable||console.error("window post message stream is not writable"),this.stream.write(e)}}let bu;class Xj extends Y1{constructor(e){super(),this.register=()=>{bu&&(bu.unregister(),bu=this),window.addEventListener("message",this.onWindowEvent),bu=this,this.on("open",()=>{const r=this.walletWindow,n=setInterval(()=>{r&&r.closed&&(clearInterval(n),this.close())},500)}),this.on("close",()=>{this.walletWindow&&(this.walletWindow.close(),this.walletWindow=null)}),this._registered=!0},this.unregister=()=>{this._registered=!1,this.closeWallet(),bu===this&&(bu=void 0),window.removeEventListener("message",this.onWindowEvent),this.events.removeAllListeners()},this.openWallet=(r,n,i)=>{if(this.walletWindow&&this.isOpened()){this.walletWindow.focus();return}const s=new URL(this.walletURL.href),o=new Q1;r&&r!==""&&(s.pathname=r.toLowerCase()),this._init=Wt.NIL,this._sessionId=`${performance.now()}`,o.set("sid",this._sessionId),n&&(n.type==="connect"&&(n.options||(n.options={app:window.location.origin}),!_y()&&!Hj()&&n.options&&(n.options.origin=window.location.origin)),o.set("intent",YS(n))),i&&o.set("net",`${i}`);let a,c;_y()?(a=[450,750],c=[Math.abs(window.screen.width/2-a[0]/2),Math.abs(window.screen.height/2-a[1]/2)]):(a=[450,750],c=[Math.abs(window.screenX+window.innerWidth/2-a[0]/2),Math.abs(window.screenY+window.innerHeight/2-a[1]/2)]);const l=`toolbar=0,location=0,menubar=0,scrollbars=yes,status=yes,width=${a[0]},height=${a[1]},left=${c[0]},top=${c[1]}`;s.search=o.toString(),this.walletWindow=window.open(s.href,"sequence.app",l)},this.onWindowEvent=r=>{if(r.origin!==this.walletURL.origin)return;let n;try{n=JSON.parse(r.data)}catch{return}if(!n)throw new Error("ProviderMessage object is empty");this.handleMessage(n)},this.walletURL=new URL(e)}closeWallet(){var e;this.close(),(e=this.walletWindow)==null||e.close()}sendMessage(e){if(!this.walletWindow){ge.warn("WindowMessageProvider: sendMessage failed as walletWindow is unavailable");return}const r=typeof e!="string"?JSON.stringify(e):e;this.walletWindow.postMessage(r,this.walletURL.origin)}}class Gme extends J1{constructor(e){var r;super(e),r=this,this._isPopup=!1,this.onWindowEvent=async function(n){if(!n.origin||n.origin===""||r.appOrigin&&n.origin!==r.appOrigin)return;let i;try{i=JSON.parse(n.data)}catch{return}if(ge.debug("RECEIVED MESSAGE",i),r._init!==Wt.OK&&r.isValidInitAck(i)&&(r.appOrigin=n.origin),r._init===Wt.OK&&(!r.appOrigin||r.appOrigin.length<8)){ge.error("impossible state, init.OK and appOrigin required");return}r.handleMessage(i)},this.getWindowTransportSession=n=>{const i=new Q1(n);return{sessionId:i.get("sid"),networkId:i.get("net"),intent:JS(i.get("intent"))}},this._init=Wt.NIL}async register(e){const r=parent.window.opener!==null;if(this._isPopup=r,r!==!0)return;const{pathname:n,search:i}=new URL(e||window.location.href);let s=this.getWindowTransportSession(i);if(!!s.sessionId||(s=await this.getCachedTransportSession()),!s){ge.error("window session is undefined");return}this.parentWindow=parent.window.opener,window.addEventListener("message",this.onWindowEvent,!1),this._registered=!0,this.open(s).then(a=>{if(!a){var c;const l=`failed to open to network ${(c=s)==null?void 0:c.networkId}`;ge.error(l),this.notifyClose({message:l}),window.close()}}).catch(a=>{var c;const l=`failed to open to network ${(c=s)==null?void 0:c.networkId}, due to: ${a}`;ge.error(l),this.notifyClose({message:l}),window.close()})}unregister(){window.removeEventListener("message",this.onWindowEvent),this._registered=!1}sendMessage(e){const r=JSON.stringify(e);e.type===Ke.INIT?this.postMessage(r,!0):this.postMessage(r)}get isPopup(){return this._isPopup}postMessage(e,r=!1){if(r!==!0&&this._init!==Wt.OK){ge.error("impossible state, should not be calling postMessage until inited");return}r?this.parentWindow.postMessage(e,"*"):this.appOrigin&&this.appOrigin.length>4?this.parentWindow.postMessage(e,this.appOrigin):ge.error("unable to postMessage as parentOrigin is invalid")}}function Zj(t){return t&&typeof t=="object"&&(t.windowTransport&&typeof t.windowTransport=="object"||t.proxyTransport&&typeof t.proxyTransport=="object"||t.extensionTransport&&typeof t.extensionTransport=="object"||t.unrealTransport&&typeof t.unrealTransport=="object")&&(t.windowTransport&&t.windowTransport.enabled||t.proxyTransport&&t.proxyTransport.enabled||t.extensionTransport&&t.extensionTransport.enabled||t.unrealTransport&&t.unrealTransport.enabled)}class Nb{constructor(...e){var r=this;this.register=()=>{if(this.messageProviders.length===1){this.provider=this.messageProviders[0],this.provider.register();return}this.messageProviders.forEach(n=>{n.register(),n.once("open",()=>{this.provider||(this.provider=n,this.messageProviders.forEach(i=>{this.provider!==i&&i.unregister()}))})})},this.unregister=()=>{this.messageProviders.forEach(n=>n.unregister()),this.provider=void 0},this.openWallet=(n,i,s)=>{if(this.provider){this.provider.openWallet(n,i,s);return}this.messageProviders.forEach(o=>o.openWallet(n,i,s))},this.sendAsync=async function(n,i,s){if(r.provider){r.provider.sendAsync(n,i,s);return}throw new Error("impossible state, wallet must be opened first")},this.sendMessageRequest=async function(n){if(r.provider)return r.provider.sendMessageRequest(n);throw new Error("impossible state, wallet must be opened first")},this.waitUntilOpened=async function(){return r.provider?r.provider.waitUntilOpened():Promise.race(r.messageProviders.map(n=>n.waitUntilOpened()))},this.waitUntilConnected=async function(){if(r.provider)return r.provider.waitUntilConnected();throw new Error("impossible state, wallet must be opened first")},this.messageProviders=e,this.provider=void 0}static new(e){var r,n,i,s;const o=new Nb;if((r=e.windowTransport)!=null&&r.enabled&&typeof window=="object"&&e.walletAppURL){const a=new Xj(e.walletAppURL);o.add(a)}if((n=e.proxyTransport)!=null&&n.enabled){const a=new Kj(e.proxyTransport.appPort);o.add(a)}if((i=e.extensionTransport)!=null&&i.enabled){const a=new Jj(e.extensionTransport.runtime);o.add(a)}if((s=e.unrealTransport)!=null&&s.enabled&&e.windowTransport&&e.walletAppURL){const a=new Yj(e.walletAppURL);o.add(a)}return o.register(),o}add(...e){this.messageProviders.push(...e)}closeWallet(){this.provider&&this.provider.closeWallet()}isOpened(){return this.provider?this.provider.isOpened():!1}isConnected(){return this.provider?this.provider.isConnected():!1}on(e,r){if(this.provider){this.provider.on(e,r);return}this.messageProviders.forEach(n=>{n.on(e,r)})}once(e,r){if(this.provider){this.provider.once(e,r);return}this.messageProviders.forEach(n=>{n.once(e,r)})}emit(e,...r){if(this.provider)return this.provider.emit(e,...r);for(let n=0;nYme(t,i))}function Yme(t,e){if(e.to.toLowerCase()===t.toLowerCase()&&e.data){const r=re(e.data);if(r.length>=4&&!Jme(r))throw new Error("self calls are forbidden")}if(e.delegateCall)throw new Error("delegate calls are forbidden")}function Jme(t){const e=new Br(rn.mainModule.abi);try{return e.decodeFunctionData("createContract",t),!0}catch{return!1}}const Xme=1e4;class Zme{constructor(e,r,n){var i=this;this.signerReadyCallbacks=[],this.events=new Mb.EventEmitter2,this.onConnectOptionsChange=void 0,this.promptConnect=async function(s){if(!s&&!i._connectOptions)throw new Error("prompter connect options are empty");if(!i.prompter)return i.connect(s);const o=await i.prompter.promptConnect(s||i._connectOptions).catch(c=>({connected:!1})),a=o;return a.connected&&!a.session&&(a.session=await i.walletSession(s==null?void 0:s.networkId)),o},this.sendAsync=async function(s,o,a){const c={jsonrpc:"2.0",id:s.id,result:null};await i.getAccount();try{var l;if((!i.account||i.account===null)&&!eye.includes(s.method))throw Fj;const f=i.account;if(!f)throw new Error("WalletRequestHandler: wallet account is not configured");const d=(l=i.account)==null?void 0:l.providerFor(a??i.defaultChainId());if(!d)throw new Error(`WalletRequestHandler: wallet provider is not configured for chainId ${a}`);const h=d instanceof Ko?d:void 0;switch(s.method){case"net_version":{if(!h)throw new Error("Account provider doesn't support send method");const p=await h.send("net_version",[]);c.result=p;break}case"eth_chainId":{if(!h)throw new Error("Account provider doesn't support send method");const p=await h.send("eth_chainId",[]);c.result=p;break}case"eth_accounts":{const p=f.address;c.result=[p];break}case"eth_getBalance":{const[p,v]=s.params,b=await d.getBalance(p,v);c.result=b.toHexString();break}case"sequence_sign":case"personal_sign":case"eth_sign":{let p;switch(s.method){case"sequence_sign":case"personal_sign":{const[m,g]=s.params;p=m;break}case"eth_sign":{const[m,g]=s.params;p=g;break}}let v="";const b=$b(p),y=s.method==="sequence_sign";if(i.prompter===null?v=await f.signMessage(b,a??i.defaultChainId(),y?"eip6492":"ignore"):v=await i.prompter.promptSignMessage({chainId:a,message:b,eip6492:y},i.connectOptions),v&&v.length>0)c.result=v;else throw new Error("declined by user");break}case"sequence_signTypedData_v4":case"eth_signTypedData":case"eth_signTypedData_v4":{const[p,v]=s.params;let b;if(typeof v=="string")try{b=JSON.parse(v)}catch(g){console.warn("walletRequestHandler: error parsing typedData",g)}else b=v;if(!b||!b.domain||!b.types||!b.message)throw new Error("invalid typedData object");let y="";const m=s.method==="sequence_signTypedData_v4";if(i.prompter===null?y=await f.signTypedData(b.domain,b.types,b.message,a??i.defaultChainId(),m?"eip6492":"ignore"):y=await i.prompter.promptSignMessage({chainId:a,typedData:b,eip6492:m},i.connectOptions),y&&y.length>0)c.result=y;else throw new Error("declined by user");break}case"eth_sendTransaction":{const p=Qme(s.params[0]).map(b=>("gas"in b&&b.gasLimit===void 0&&(b.gasLimit=b.gas,delete b.gas),b));$T(f.address,p);let v="";if(i.prompter===null){var u;const b=await f.sendTransaction(p,a??i.defaultChainId());v=(u=b==null?void 0:b.hash)!=null?u:""}else v=await i.prompter.promptSendTransaction(p,a,i.connectOptions);if(v)c.result=v;else throw new Error("declined by user");break}case"eth_signTransaction":{const[p]=s.params;if(qe(p.from)!==f.address)throw new Error("sender address does not match wallet");$T(f.address,p),i.prompter===null?c.result=await f.signTransactions(p,a??i.defaultChainId()):c.result=await i.prompter.promptSignTransaction(p,a,i.connectOptions);break}case"eth_sendRawTransaction":{if(he.transaction.isSignedTransactionBundle(s.params[0])){const p=J.from(s.params[0].chainId).toNumber(),v=await f.relayer(p).relay(s.params[0]);c.result=v.hash}else{const p=await d.sendTransaction(s.params[0]);c.result=p.hash}break}case"eth_getTransactionCount":{const p=qe(s.params[0]),v=s.params[1],b=await d.getTransactionCount(p,v);c.result=J.from(b).toHexString();break}case"eth_blockNumber":{c.result=await d.getBlockNumber();break}case"eth_getBlockByNumber":{c.result=await d.getBlock(s.params[0]);break}case"eth_getBlockByHash":{c.result=await d.getBlock(s.params[0]);break}case"eth_getTransactionByHash":{c.result=await d.getTransaction(s.params[0]);break}case"eth_call":{const[p,v]=s.params;c.result=await d.call(p,v);break}case"eth_getCode":{const[p,v]=s.params;c.result=await d.getCode(p,v);break}case"eth_estimateGas":{const[p]=s.params;c.result=await d.estimateGas(p);break}case"eth_gasPrice":{const p=await d.getGasPrice();c.result=p.toHexString();break}case"wallet_switchEthereumChain":{const[p]=s.params;if(!p.chainId||p.chainId.length===0)throw new Error("invalid chainId");const v=J.from(p.chainId);i.setDefaultChainId(v.toNumber()),c.result=null;break}case"sequence_getWalletContext":{c.result=f.contexts;break}case"sequence_getWalletConfig":{const[p]=s.params;p?c.result=[(await f.status(p)).onChain.config]:c.result=await Promise.all(f.networks.map(async function(v){return(await f.status(v.chainId)).onChain.config}));break}case"sequence_getWalletState":{const[p]=s.params;p?c.result=[NT(p,await f.status(p))]:c.result=await Promise.all(f.networks.map(async function(v){const b=await f.status(v.chainId);return NT(v.chainId,b)}));break}case"sequence_getNetworks":{c.result=await i.getNetworks(!0);break}case"sequence_isSequence":{c.result=!0;break}case"sequence_updateConfig":throw new Error("sequence_updateConfig method is not allowed from a dapp");case"sequence_publishConfig":throw new Error("sequence_publishConfig method is not allowed from a dapp");case"sequence_gasRefundOptions":break;case"sequence_getNonce":break;case"sequence_relay":break;case"sequence_setDefaultNetwork":{const[p]=s.params;if(!p)throw new Error("invalid request, method argument defaultChainId cannot be empty");i.setDefaultChainId(p),c.result=await i.getNetworks(!0);break}default:{if(!h)throw new Error("Account provider doesn't support send method");const p=await h.send(s.method,s.params);c.result=p}}}catch(f){ge.error(f),c.result=null,c.error=Yn({},new Error(f),{code:4001})}o(void 0,c)},this.isSignedIn=async function(){return await i.signerReady(),!!i.account},this.getAccount=async function(){if(await i.signerReady(),i.account===void 0)throw new Error("signerReady failed resolve");return i.account},this.account=e,this.prompter=r,this.networks=n}defaultChainId(){var e,r;return(e=(r=this.prompter)==null?void 0:r.getDefaultChainId())!=null?e:this.networks[0].chainId}async signIn(e,r={}){this.setAccount(e);const{connect:n,defaultNetworkId:i}=r;if(n){const a=this._connectOptions;let c;if(this.prompter!==null){var s;c=await((s=this.prompter)==null?void 0:s.promptSignInConnect(a))}else c=await this.connect(a);this.notifyConnect(c),(!a||a.keepWalletOpened!==!0)&&this.notifyClose()}if(i&&this.defaultChainId()!==i){var o;await((o=this.prompter)==null?void 0:o.promptChangeNetwork(i))}}signOut(){this.setAccount(null)}signerReset(){this.account=void 0}signerReady(e=Xme){return new Promise((r,n)=>{this.account!==void 0?r():(setTimeout(()=>{this.account===void 0&&(this.signerReadyCallbacks=[],n("signerReady timed out"))},e),this.signerReadyCallbacks.push(r))})}async connect(e){var r,n;if(!this.account)return{connected:!1,chainId:"0x0",error:"unable to connect without signed in account"};const i=(r=(n=e==null?void 0:e.networkId)!=null?n:this.defaultChainId())!=null?r:ce.MAINNET,s=r8(i).chainId,o={connected:!0,chainId:gs(s)};if(e&&e.authorize){const a={app:e.app,origin:e.origin,expiry:e.expiry,nonce:e.authorizeNonce};try{o.proof=await _j(this.account,s,a)}catch(c){return ge.warn(`connect, signAuthorization failed for options: ${JSON.stringify(e)}, due to: ${c.message}`),{connected:!1,chainId:"0x0",error:`signAuthorization failed: ${c.message}`}}}return o.session=this.walletSession(s),o}sendMessageRequest(e){return new Promise(r=>{this.sendAsync(e.data,(n,i)=>{const s=Yn({},e,{data:i});r(s)},e.chainId)})}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}async getAddress(){var e,r;return(e=(r=this.account)==null?void 0:r.address)!=null?e:""}get openIntent(){return this._openIntent}setOpenIntent(e){this._openIntent=e}get connectOptions(){return this._connectOptions}setConnectOptions(e){var r;this._connectOptions=e,(r=this.onConnectOptionsChange)==null||r.call(this,e)}async setDefaultChainId(e){var r;return await((r=this.prompter)==null?void 0:r.promptChangeNetwork(e)),this.defaultChainId()}async getNetworks(e){return this.account?e?this.account.networks.map(r=>{const n=Yn({},r);return n.provider=void 0,n.relayer=void 0,n}):this.account.networks:(ge.warn("signer not set: getNetworks is returning an empty list"),[])}walletSession(e){if(!this.account)return;const r={walletContext:this.account.contexts,accountAddress:this.account.address,networks:this.account.networks.map(i=>Yn({},i,{provider:void 0,relayer:void 0}))};if(e){const i=bs(r.networks,e);if(i){var n;(n=r.networks)==null||n.forEach(s=>delete s.isDefaultChain),i.isDefaultChain=!0}}return r}notifyConnect(e,r){var n;if(console.log("emit connect",e),this.events.emit("connect",e),(n=e.session)!=null&&n.accountAddress){var i;this.events.emit("accountsChanged",[(i=e.session)==null?void 0:i.accountAddress],r)}}notifyDisconnect(e){this.events.emit("accountsChanged",[],e),this.events.emit("disconnect",void 0,e)}notifyChainChanged(e,r){this.events.emit("chainChanged",gs(e),r)}async notifyNetworks(e){const r=e||await this.getNetworks(!0);if(this.events.emit("networks",r),r.length>0){const n=r.find(i=>i.chainId===this.defaultChainId());n&&this.events.emit("chainChanged",gs(n.chainId))}else this.events.emit("chainChanged","0x0")}async notifyWalletContext(){if(!this.account){ge.warn("signer not set: skipping to notify wallet context");return}const e=this.account.contexts;this.events.emit("walletContext",e)}notifyClose(e){this.events.emit("close",e)}setAccount(e){if(this.account=e,e!==void 0){for(let r=0;rc.canOnchainValidate||c.original.version===2&&n,o=await r.status(i);if(s(o))return!0;if(await e.promptConfirmWalletDeploy(i,this.connectOptions)){const c=await r.status(i);return s(c)?!0:(ge.error("WalletRequestHandler: result for promptConfirmWalletDeploy is not correct"),!1)}return!1}}function NT(t,e){return{context:e.original.context,config:e.onChain.config,address:he.context.addressOf(e.original.context,e.original.imageHash),chainId:t,deployed:e.onChain.deployed,imageHash:e.imageHash,lastImageHash:e.onChain.imageHash,published:!0,status:e}}const eye=["net_version","eth_chainId","eth_getBalance","eth_getTransactionCount","eth_blockNumber","eth_getBlockByNumber","eth_getBlockByHash","eth_getTransactionByHash","eth_getCode","eth_estimateGas","eth_gasPrice","sequence_getWalletContext","sequence_getNetworks","sequence_setDefaultNetwork"];class Sd{get utils(){return this.provider.utils}constructor(e,r){this.singleNetworkSigners={},this._isSigner=!0,this._isSequenceSigner=!0,this.client=e,this.provider=r}async getAddress(){return this.client.getAddress()}connect(e){if(!kd.is(e))throw new Error("SequenceSigner can only be connected to a SequenceProvider");return new Sd(this.client,e)}getSigner(e){if(!e)return this;const r=this.provider.toChainId(e);return this.singleNetworkSigners[r]||(this.singleNetworkSigners[r]=new O8(this.client,this.provider,r)),this.singleNetworkSigners[r]}useChainId(e){return this.provider.toChainId(e)||this.client.getChainId()}async signMessage(e,r){const{eip6492:n=!0}=r||{},i=this.useChainId(r==null?void 0:r.chainId);return this.client.signMessage(e,{eip6492:n,chainId:i})}async signTypedData(e,r,n,i){const{eip6492:s=!0}=i||{},o=this.useChainId(i==null?void 0:i.chainId);return this.client.signTypedData({domain:e,types:r,message:n},{eip6492:s,chainId:o})}getProvider(e){return this.provider.getProvider(e)}async sendTransaction(e,r){const n=this.useChainId(r==null?void 0:r.chainId),i=await Gj(e),s=await this.client.sendTransaction(i,{chainId:n}),o=this.getProvider(n);try{return await za(async function(){const a=await o.getTransaction(s);return a?o._wrapTransaction(a,s):void 0},{onceBlock:o})}catch(a){throw a.transactionHash=s,a}}async getWalletConfig(e){const r=this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}getNetworks(){return this.client.getNetworks()}async getBalance(e,r){return this.getProvider(r==null?void 0:r.chainId).getBalance(this.getAddress(),e)}async estimateGas(e,r){return this.getProvider(r==null?void 0:r.chainId).estimateGas(e)}async call(e,r,n){return this.getProvider(n==null?void 0:n.chainId).call(e,r)}getChainId(){return Promise.resolve(this.client.getChainId())}async getGasPrice(e){return this.getProvider(e==null?void 0:e.chainId).getGasPrice()}async getFeeData(e){return this.getProvider(e==null?void 0:e.chainId).getFeeData()}async resolveName(e){const r=await this.provider.resolveName(e);if(r===null)throw new Error(`ENS name not found: ${e}`);return r}_checkProvider(e){}populateTransaction(e){throw new Error("SequenceSigner does not support populateTransaction")}checkTransaction(e){throw new Error("SequenceSigner does not support checkTransaction")}getTransactionCount(e){throw new Error("SequenceSigner does not support getTransactionCount")}signTransaction(e){throw new Error("SequenceWallet does not support signTransaction, use sendTransaction instead.")}static is(e){return e&&typeof e=="object"&&e._isSequenceSigner===!0}}class O8 extends Sd{constructor(e,r,n){super(e,r.getProvider(n)),this._isSingleNetworkSequenceSigner=!0,this.chainId=n}_useChainId(e){const r=this.provider.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This signer only supports the network ${this.chainId}, but ${r} was requested.`);return r||this.provider.toChainId(this.chainId)}useChainId(e){return this._useChainId(e)}getChainId(){return Promise.resolve(this.provider.toChainId(this.chainId))}getProvider(e){return super.getProvider(this._useChainId(e))}getSigner(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceSigner===!0}}class tye{constructor(e){if(this.signer=e,O8.is(e))throw new Error("WalletUtils does not support SingleNetworkSequenceSigner")}signMessage(e,r,n){return this.signer.signMessage(e,{chainId:r,eip6492:n})}signTypedData(e,r,n,i,s){return this.signer.signTypedData(e,r,n,{chainId:i,eip6492:s})}async isValidSignature(e,r,n,i){return Vf(e,r,n,this.signer.getProvider(i))}async isValidMessageSignature(e,r,n,i){const s=this.signer.getProvider(i),o=$b(r),a=XS(o);return Vf(e,a,n,s)}isValidTypedDataSignature(e,r,n,i){return this.isValidSignature(e,H1(r),n,i)}}class kd extends kg{constructor(e,r,n=Wf){super(e.getChainId()),this.singleNetworkProviders={},this._isSequenceProvider=!0,this.client=e,this.providerFor=r,this.networks=n,e.onConnect(i=>{this.emit("connect",i)}),e.onDisconnect(i=>{this.emit("disconnect",i)}),e.onDefaultChainIdChanged(i=>{this.emit("chainChanged",i)}),e.onAccountsChanged(i=>{this.emit("accountsChanged",i)}),this.signer=new Sd(this.client,this),this.utils=new tye(this.signer)}getSigner(e){return this.signer.getSigner(e)}connect(e){return this.client.connect(e)}disconnect(){return this.client.disconnect()}isConnected(){return this.client.isConnected()}getSession(){return this.client.getSession()}listAccounts(){return[this.client.getAddress()]}getAddress(){return this.client.getAddress()}getNetworks(){return this.client.getNetworks()}getChainId(){return this.client.getChainId()}setDefaultChainId(e){return this.client.setDefaultChainId(this.toChainId(e))}isOpened(){return this.client.isOpened()}closeWallet(){return this.client.closeWallet()}getWalletContext(){return this.client.getWalletContext()}async getWalletConfig(e){const r=await this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}authorize(e){return this.client.connect(Yn({},e,{authorize:!0}))}async openWallet(e,r){return await this.client.openWallet(e,r),!0}toChainId(e){if(e===void 0)return;const r=bs(this.networks,e);if(!r)throw new Error(`Unsupported network ${e}`);return r.chainId}async useChainId(e){return this.toChainId(e)||this.client.getChainId()}getProvider(e){if(!e)return this;const r=this.toChainId(e);return this.singleNetworkProviders[r]||(this.singleNetworkProviders[r]=new tU(this.client,this.providerFor,r)),this.singleNetworkProviders[r]}async _getSubprovider(e){const r=await this.useChainId(e),n=this.providerFor(r);if(!n)throw new Error(`Unsupported network ${r}`);return n}async perform(e,r){var n;if(e==="eth_chainId")return gs(await this.useChainId());if(e==="eth_accounts")return[this.client.getAddress()];if(e==="wallet_switchEthereumChain"){const o=r[0],a=eU(o);return this.setDefaultChainId(a)}if(e==="eth_sendTransaction"||e==="eth_sign"||e==="eth_signTypedData"||e==="eth_signTypedData_v4"||e==="personal_sign"||e==="sequence_sign"||e==="sequence_signTypedData_v4")return this.client.send({method:e,params:r},this.getChainId());const i=await this._getSubprovider(),s=(n=i.prepareRequest(e,r))!=null?n:[e,r];return i.send(s[0],s[1])}send(e,r){return this.perform(e,r)}request(e){return this.perform(e.method,e.params)}async detectNetwork(){const e=this.client.getChainId(),r=bs(this.networks,e);if(!r)throw new Error(`Unknown network ${e}`);return r}async waitForTransaction(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).waitForTransaction(e,r,n)}async getBlockNumber(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getBlockNumber()}async getGasPrice(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getGasPrice()}async getBalance(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getBalance(e,r)}async getTransactionCount(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getTransactionCount(e,r)}async getCode(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getCode(e,r)}async getStorageAt(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).getStorageAt(e,r,n)}async call(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).call(e,r)}async estimateGas(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).estimateGas(e)}async getBlock(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getBlock(e)}async getTransaction(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getTransaction(e)}async getLogs(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getLogs(e)}async supportsENS(){return(await this.getNetworks()).some(r=>r.chainId===1)}async getResolver(e){return await this.supportsENS()?(await this._getSubprovider(1)).getResolver(e):null}async resolveName(e){return IR(await e)?e:await this.supportsENS()?(await this._getSubprovider(1)).resolveName(e):null}async lookupAddress(e){return await this.supportsENS()?(await this._getSubprovider(1)).lookupAddress(e):null}async getAvatar(e){return await this.supportsENS()?(await this._getSubprovider(1)).getAvatar(e):null}}kd.is=t=>t&&typeof t=="object"&&t._isSequenceProvider===!0;function eU(t){return typeof t=="object"?eU(t.chainId):J.from(t).toNumber()}class tU extends kd{constructor(e,r,n){super(e,r),this._isSingleNetworkSequenceProvider=!0,this.chainId=n}_useChainId(e){const r=this.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This provider only supports the network ${this.chainId}, but ${r} was requested.`);return r||super.toChainId(this.chainId)}useChainId(e){return Promise.resolve(this._useChainId(e))}getChainId(){return super.toChainId(this.chainId)}async getNetwork(){const e=await this.client.getNetworks(),r=bs(e,this.chainId);if(!r)throw new Error(`Unsupported network ${this.chainId}`);return r}getProvider(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}getSigner(e){return super.getSigner(this._useChainId(e))}setDefaultChainId(e){throw new Error(`This provider only supports the network ${this.chainId}; use the parent provider to switch networks.`)}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceProvider===!0}}var rye={name:"@0xsequence/provider",version:"1.4.9",description:"provider sub-package for Sequence",repository:"https://github.com/0xsequence/sequence.js/tree/master/packages/provider",source:"src/index.ts",main:"dist/0xsequence-provider.cjs.js",module:"dist/0xsequence-provider.esm.js",author:"Horizon Blockchain Games",license:"Apache-2.0",scripts:{test:"pnpm test:concurrently 'pnpm test:run'","test:run":"pnpm test:file tests/**/*.spec.ts","test:file":"NODE_OPTIONS='--loader tsx' mocha --timeout 30000",typecheck:"tsc --noEmit","test:concurrently":"concurrently -k --success first 'pnpm start:hardhat1' 'pnpm start:hardhat2'","start:hardhat1":"pnpm start:hardhat1:verbose > /dev/null 2>&1","start:hardhat2":"pnpm start:hardhat2:verbose > /dev/null 2>&1","start:hardhat1:verbose":"hardhat node --config hardhat1.config.js --hostname 0.0.0.0 --port 9595","start:hardhat2:verbose":"hardhat node --config hardhat2.config.js --hostname 0.0.0.0 --port 8595"},dependencies:{"@0xsequence/abi":"workspace:*","@0xsequence/account":"workspace:*","@0xsequence/auth":"workspace:*","@0xsequence/core":"workspace:*","@0xsequence/migration":"workspace:*","@0xsequence/network":"workspace:*","@0xsequence/relayer":"workspace:*","@0xsequence/utils":"workspace:*","@0xsequence/wallet":"workspace:*",eventemitter2:"^6.4.5","webextension-polyfill":"^0.10.0"},peerDependencies:{ethers:">=5.5 < 6"},devDependencies:{"@types/webextension-polyfill":"^0.10.0",hardhat:"^2.12.2",ethers:"^5.7.2"},files:["src","dist"]};class Cl{constructor(e){this.store=e}connectedSession(){const e=this.getSession();if(e&&e.accountAddress&&e.walletContext&&e.networks)return{accountAddress:e.accountAddress,walletContext:e.walletContext,networks:e.networks};throw new Error("Sequence session not connected")}hasSession(){var e;return((e=this.getSession())==null?void 0:e.accountAddress)!==void 0}setSession(e){return this.store.setItem(Cl.SESSION_LOCALSTORE_KEY,JSON.stringify(e))}getSession(){const e=this.store.getItem(Cl.SESSION_LOCALSTORE_KEY);if(e)return JSON.parse(e)}async clearSession(){return this.store.removeItem(Cl.SESSION_LOCALSTORE_KEY)}}Cl.SESSION_LOCALSTORE_KEY="@sequence.session";class Sl{constructor(e,r=1){this.callbacks=[],this.store=e,this.startingChainId=r,e.onItemChange(Sl.SESSION_CHAIN_ID_KEY,n=>{if(n){const i=parseInt(n);this.callbacks.forEach(s=>s(i))}})}onDefaultChainIdChanged(e){return this.callbacks.push(e),()=>{this.callbacks=this.callbacks.filter(r=>r!==e)}}setDefaultChainId(e){e!==this.getDefaultChainId()&&this.store.setItem(Sl.SESSION_CHAIN_ID_KEY,e.toString())}getDefaultChainId(){const e=this.store.getItem(Sl.SESSION_CHAIN_ID_KEY);return!e||e.length===0?this.startingChainId:parseInt(e)}}Sl.SESSION_CHAIN_ID_KEY="@sequence.session.defaultChainId";class R8{constructor(e,r,n,i){var s;if(this.callbacks={},this.projectAccessKey=i,Zj(e))this.transport=Nb.new(e);else if(Lj(e))this.transport=e;else throw new Error("Invalid transport");const o=typeof n=="number"?n:n==null?void 0:n.defaultChainId;this.defaultEIP6492=typeof n=="number"?!1:(s=n==null?void 0:n.defaultEIP6492)!=null?s:!1,this.session=new Cl(r),this.defaultChainId=new Sl(r,o),this.transport.on("accountsChanged",a=>{var c;a.length>1&&console.warn("SequenceClient: wallet-webapp returned more than one account"),(c=this.callbacks.accountsChanged)==null||c.forEach(l=>l(a))}),this.transport.on("connect",a=>{var c;const l=gs(this.getChainId());(c=this.callbacks.connect)==null||c.forEach(u=>u(Yn({},a,{chainId:l})))}),this.transport.on("disconnect",(a,c)=>{var l;(l=this.callbacks.disconnect)==null||l.forEach(u=>u(a,c))}),this.transport.on("networks",a=>{var c;(c=this.callbacks.networks)==null||c.forEach(l=>l(a))}),this.transport.on("walletContext",a=>{var c;(c=this.callbacks.walletContext)==null||c.forEach(l=>l(a))}),this.transport.on("open",a=>{var c;(c=this.callbacks.open)==null||c.forEach(l=>l(a))}),this.transport.on("close",()=>{var a;(a=this.callbacks.close)==null||a.forEach(c=>c())}),this.transport.on("chainChanged",(a,c)=>{var l;(l=this.callbacks.chainChanged)==null||l.forEach(u=>u(a,c))}),this.defaultChainId.onDefaultChainIdChanged(a=>{var c;const l=gs(a);(c=this.callbacks.chainChanged)==null||c.forEach(u=>u(l))})}registerCallback(e,r){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(r),()=>{this.callbacks[e]=this.callbacks[e].filter(n=>n!==r)}}onOpen(e){return this.registerCallback("open",e)}onClose(e){return this.registerCallback("close",e)}onConnect(e){return this.registerCallback("connect",e)}onDisconnect(e){return this.registerCallback("disconnect",e)}onNetworks(e){return this.registerCallback("networks",e)}onAccountsChanged(e){return this.registerCallback("accountsChanged",e)}onWalletContext(e){return this.registerCallback("walletContext",e)}onChainChanged(e){return this.registerCallback("chainChanged",e)}onDefaultChainIdChanged(e){return this.registerCallback("chainChanged",e)}getChainId(){return this.defaultChainId.getDefaultChainId()}setDefaultChainId(e){return this.defaultChainId.setDefaultChainId(e)}async openWallet(e,r){return this.transport.openWallet(e,r,this.getChainId()),await this.transport.waitUntilOpened(),this.isOpened()}closeWallet(){return this.transport.closeWallet()}isOpened(){return this.transport.isOpened()}isConnected(){return this.session.hasSession()}getSession(){return this.session.getSession()}getAddress(){return this.session.connectedSession().accountAddress}async connect(e){if((e==null?void 0:e.authorizeVersion)===void 0&&(e.authorizeVersion=2),(e==null?void 0:e.refresh)===!0&&this.disconnect(),e.projectAccessKey=this.projectAccessKey,e&&e.authorize){if(!e.app)throw new Error("connecting with 'authorize' option also requires 'app' to be set");e.authorizeVersion===void 0&&(e.authorizeVersion=2)}await this.openWallet(void 0,{type:"connect",options:Yn({},e,{networkId:this.getChainId(),clientVersion:rye.version})});const r=await this.transport.waitUntilConnected().catch(n=>n instanceof Error?{connected:!1,error:n.message}:{connected:!1,error:JSON.stringify(n)});if(r.chainId&&(r.chainId=J.from(r.chainId).toString()),r.connected){if(!r.session)throw new Error("impossible state, connect response is missing session");this.session.setSession(r.session)}return r}disconnect(){return this.isOpened()&&this.closeWallet(),this.session.clearSession()}send(e,r){return e.method=this.mapSignMethod(e.method),new Promise((n,i)=>{this.transport.sendAsync(e,(s,o)=>{s?i(s):o===void 0?i(new Error(`Got undefined response for request: ${e}`)):typeof o=="object"&&o.error?i(o.error):typeof o=="object"&&o.result?n(o.result):i(new Error(`Got invalid response for request: ${e}`))},r||this.getChainId())})}async getNetworks(e){const r=this.session.connectedSession();return e&&(r.networks=await this.send({method:"sequence_getNetworks"}),this.session.setSession(r)),r.networks}signMethod(e){return(e==null?void 0:e.eip6492)===void 0?"personal_sign":e.eip6492?"sequence_sign":"legacy_sign"}signTypedDataMethod(e){return(e==null?void 0:e.eip6492)===void 0?"eth_signTypedData_v4":e.eip6492?"sequence_signTypedData_v4":"legacy_signTypedData_v4"}mapSignMethod(e){return e==="personal_sign"?this.defaultEIP6492?"sequence_sign":"personal_sign":e==="eth_signTypedData_v4"?this.defaultEIP6492?"sequence_signTypedData_v4":"eth_signTypedData_v4":e==="legacy_sign"?"personal_sign":e==="legacy_signTypedData_v4"?"eth_signTypedData_v4":e}async signMessage(e,r){const n=this.signMethod(r);return this.send({method:n,params:[e,this.getAddress()]},r==null?void 0:r.chainId)}async signTypedData(e,r){const n=this.signTypedDataMethod(r),i=Wr.getPayload(e.domain,e.types,e.message);return this.send({method:n,params:[this.getAddress(),i]},(r==null?void 0:r.chainId)||e.domain.chainId&&J.from(e.domain.chainId).toNumber()||this.getChainId())}async sendTransaction(e,r){const n=Array.isArray(e)?e:[e],i=Kme(n);return this.send({method:"eth_sendTransaction",params:[i]},r==null?void 0:r.chainId)}async getWalletContext(){return this.send({method:"sequence_getWalletContext"})}async getOnchainWalletConfig(e){const r=await this.send({method:"sequence_getWalletConfig",params:[(e==null?void 0:e.chainId)||this.getChainId()]},e==null?void 0:e.chainId);return Array.isArray(r)?r[0]:r}}const s5={transports:{walletAppURL:"https://sequence.app",windowTransport:{enabled:!0},proxyTransport:{enabled:!1}},defaultNetwork:1};let Ys;const rU=t=>{var e,r,n;const i=t==null?void 0:t.projectAccessKey;if(i||console.warn("Please pass a projectAccessKey in initWallet config as it will be required in near future."),Ys)return Ys;const s=Yn({},s5,t,{transports:Yn({},s5.transports,t==null?void 0:t.transports)}),o={},a=(e=(r=s.networks)==null?void 0:r.filter(h=>{h.rpcUrl!==void 0&&h.chainId!==void 0&&Wf.find(p=>p.chainId===h.chainId)}))!=null?e:[],c=Wf.map(h=>{var p;const v=(p=s.networks)==null?void 0:p.find(b=>b.chainId===h.chainId);return v?Yn({},h,v):h}).concat(a).map(h=>{const p=i?`/${i}`:"";return h.rpcUrl=h.rpcUrl+p,h}),l=h=>{if(!o[h]){var p;const v=(p=c.find(m=>m.chainId===h))==null?void 0:p.rpcUrl;if(!v)throw new Error(`no rpcUrl found for chainId: ${h}`);const b=new Ko(v),y=new n8([wF,bF,new i8],new my(b));o[h]=new HM(y,h)}return o[h]},u=s.defaultNetwork?(n=bs(c,s.defaultNetwork))==null?void 0:n.chainId:void 0;if(!u&&s.defaultNetwork)throw new Error(`defaultNetwork not found for chainId: ${s.defaultNetwork}`);const f=s.localStorage||Py(),d=new R8(s.transports,f,{defaultChainId:u,defaultEIP6492:s.defaultEIP6492},i);return Ys=new kd(d,l),Ys},nU=()=>{Ys&&(Ys.client.closeWallet(),Ys.client.transport.unregister(),Ys=void 0)},iU=()=>{if(!Ys)throw new Error("Wallet has not been initialized, call sequence.initWallet(config) first.");return Ys},nye=Object.freeze(Object.defineProperty({__proto__:null,BaseInjectedTransport:Vme,BaseProviderTransport:Y1,BaseWalletTransport:J1,CHANNEL_ID:I8,DefaultChainIdTracker:Sl,DefaultProviderConfig:s5,ErrSignedInRequired:Fj,EventType:Ke,ExtensionMessageHandler:qme,ExtensionMessageProvider:Jj,InitState:Wt,LocalStorage:s1,MemoryItemStore:Vj,MuxMessageProvider:Nb,OpenState:Oi,PROVIDER_OPEN_TIMEOUT:T8,ProviderError:Bj,ProxyMessageChannel:zme,ProxyMessageChannelPort:i5,ProxyMessageHandler:Wme,ProxyMessageProvider:Kj,SequenceClient:R8,SequenceClientSession:Cl,SequenceProvider:kd,SequenceSigner:Sd,SingleNetworkSequenceProvider:tU,SingleNetworkSequenceSigner:O8,UnrealMessageHandler:Hme,UnrealMessageProvider:Yj,WalletRequestHandler:Zme,WindowMessageHandler:Gme,WindowMessageProvider:Xj,WindowSessionParams:Q1,getWallet:iU,initWallet:rU,isBrowserExtension:_y,isMuxTransportTemplate:Zj,isProviderTransport:Lj,isUnityPlugin:Hj,isValidMessageSignature:zj,isValidSignature:Vf,isValidTypedDataSignature:Wj,isWalletUpToDate:qj,messageToBytes:Uj,nextMessageIdx:jj,prefixEIP191Message:$b,resolveArrayProperties:Gj,trimEIP191Prefix:Ume,unregisterWallet:nU,useBestStore:Py},Symbol.toStringTag,{value:"Module"}));function An(t,e){return e.forEach(function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach(function(n){if(n!=="default"&&!(n in t)){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}})}),Object.freeze(t)}var iye=An({__proto__:null},[J0e]),sye=An({__proto__:null},[i1e]),oye=An({__proto__:null},[gme]),aye=An({__proto__:null},[Sme]),cye=An({__proto__:null},[_ve]),lye=An({__proto__:null},[Nve]),uye=An({__proto__:null},[Mme]),fye=An({__proto__:null},[epe]),dye=An({__proto__:null},[nye]),hye=An({__proto__:null},[uve]);const pye=he.transaction;var vye=Object.freeze({__proto__:null,transactions:pye}),mye=An({__proto__:null,isValidSignature:Vf,isValidMessageSignature:zj,isValidTypedDataSignature:Wj,isWalletUpToDate:qj},[F1e]),yye=An({__proto__:null},[Wpe]),gye=An({__proto__:null},[fve]),bye=An({__proto__:null},[vme]),wye=An({__proto__:null},[Qpe]),Eye=An({__proto__:null},[gve]),sU=Object.freeze({__proto__:null,abi:iye,api:sye,auth:oye,guard:aye,indexer:cye,metadata:lye,multicall:uye,network:fye,provider:dye,relayer:hye,transactions:vye,utils:mye,core:yye,signhub:gye,sessions:bye,migration:wye,account:Eye,initWallet:rU,getWallet:iU,unregisterWallet:nU,SequenceProvider:kd,SequenceClient:R8,SequenceSigner:Sd}),Vv,xye=class extends xB{constructor({chains:t,options:e}={}){const r={name:"MetaMask",shimDisconnect:!0,getProvider(){function n(s){if(s!=null&&s.isMetaMask&&!(s.isBraveWallet&&!s._events&&!s._state)&&!s.isApexWallet&&!s.isAvalanche&&!s.isBitKeep&&!s.isBlockWallet&&!s.isMathWallet&&!(s.isOkxWallet||s.isOKExWallet)&&!(s.isOneInchIOSWallet||s.isOneInchAndroidWallet)&&!s.isOpera&&!s.isPortal&&!s.isRabby&&!s.isDefiant&&!s.isTokenPocket&&!s.isTokenary&&!s.isZerion)return s}if(typeof window>"u")return;const i=window.ethereum;return i!=null&&i.providers?i.providers.find(n):n(i)},...e};super({chains:t,options:r}),st(this,"id","metaMask"),st(this,"shimDisconnectKey",`${this.id}.shimDisconnect`),Jr(this,Vv,void 0),Mo(this,Vv,r.UNSTABLE_shimOnConnectSelectAccount)}async connect({chainId:t}={}){var e,r,n,i;try{const s=await this.getProvider();if(!s)throw new Ma;s.on&&(s.on("accountsChanged",this.onAccountsChanged),s.on("chainChanged",this.onChainChanged),s.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});let o=null;if(Je(this,Vv)&&((e=this.options)!=null&&e.shimDisconnect)&&!((r=this.storage)!=null&&r.getItem(this.shimDisconnectKey))&&(o=await this.getAccount().catch(()=>null),!!o))try{await s.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}),o=await this.getAccount()}catch(u){if(this.isUserRejectedRequestError(u))throw new Vr(u);if(u.code===new vc(u).code)throw u}if(!o){const l=await s.request({method:"eth_requestAccounts"});o=Li(l[0])}let a=await this.getChainId(),c=this.isChainUnsupported(a);return t&&a!==t&&(a=(await this.switchChain(t)).id,c=this.isChainUnsupported(a)),(n=this.options)!=null&&n.shimDisconnect&&((i=this.storage)==null||i.setItem(this.shimDisconnectKey,!0)),{account:o,chain:{id:a,unsupported:c},provider:s}}catch(s){throw this.isUserRejectedRequestError(s)?new Vr(s):s.code===-32002?new vc(s):s}}};Vv=new WeakMap;var M8={},Db={},Ue={},oU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,c){var l=a>>>16&65535,u=a&65535,f=c>>>16&65535,d=c&65535;return u*d+(l*d+u*f<<16>>>0)|0}t.mul=Math.imul||e;function r(a,c){return a+c|0}t.add=r;function n(a,c){return a-c|0}t.sub=n;function i(a,c){return a<>>32-c}t.rotl=i;function s(a,c){return a<<32-c|a>>>c}t.rotr=s;function o(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(a){return t.isInteger(a)&&a>=-t.MAX_SAFE_INTEGER&&a<=t.MAX_SAFE_INTEGER}})(oU);Object.defineProperty(Ue,"__esModule",{value:!0});var aU=oU;function Cye(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}Ue.readInt16BE=Cye;function Sye(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}Ue.readUint16BE=Sye;function kye(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}Ue.readInt16LE=kye;function Aye(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}Ue.readUint16LE=Aye;function cU(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}Ue.writeUint16BE=cU;Ue.writeInt16BE=cU;function lU(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}Ue.writeUint16LE=lU;Ue.writeInt16LE=lU;function o5(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}Ue.readInt32BE=o5;function a5(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}Ue.readUint32BE=a5;function c5(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}Ue.readInt32LE=c5;function l5(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}Ue.readUint32LE=l5;function Ty(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}Ue.writeUint32BE=Ty;Ue.writeInt32BE=Ty;function Iy(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}Ue.writeUint32LE=Iy;Ue.writeInt32LE=Iy;function _ye(t,e){e===void 0&&(e=0);var r=o5(t,e),n=o5(t,e+4);return r*4294967296+n-(n>>31)*4294967296}Ue.readInt64BE=_ye;function Pye(t,e){e===void 0&&(e=0);var r=a5(t,e),n=a5(t,e+4);return r*4294967296+n}Ue.readUint64BE=Pye;function Tye(t,e){e===void 0&&(e=0);var r=c5(t,e),n=c5(t,e+4);return n*4294967296+r-(r>>31)*4294967296}Ue.readInt64LE=Tye;function Iye(t,e){e===void 0&&(e=0);var r=l5(t,e),n=l5(t,e+4);return n*4294967296+r}Ue.readUint64LE=Iye;function uU(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Ty(t/4294967296>>>0,e,r),Ty(t>>>0,e,r+4),e}Ue.writeUint64BE=uU;Ue.writeInt64BE=uU;function fU(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Iy(t>>>0,e,r),Iy(t/4294967296>>>0,e,r+4),e}Ue.writeUint64LE=fU;Ue.writeInt64LE=fU;function Oye(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=t/8+r-1;s>=r;s--)n+=e[s]*i,i*=256;return n}Ue.readUintBE=Oye;function Rye(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=r;s=n;s--)r[s]=e/i&255,i*=256;return r}Ue.writeUintBE=Mye;function $ye(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!aU.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s>>32-16|_<<16,H=H+_|0,w^=H,w=w>>>32-12|w<<12,S=S+I|0,O^=S,O=O>>>32-16|O<<16,K=K+O|0,I^=K,I=I>>>32-12|I<<12,P=P+B|0,N^=P,N=N>>>32-16|N<<16,F=F+N|0,B^=F,B=B>>>32-12|B<<12,T=T+j|0,k^=T,k=k>>>32-16|k<<16,E=E+k|0,j^=E,j=j>>>32-12|j<<12,P=P+B|0,N^=P,N=N>>>32-8|N<<8,F=F+N|0,B^=F,B=B>>>32-7|B<<7,T=T+j|0,k^=T,k=k>>>32-8|k<<8,E=E+k|0,j^=E,j=j>>>32-7|j<<7,S=S+I|0,O^=S,O=O>>>32-8|O<<8,K=K+O|0,I^=K,I=I>>>32-7|I<<7,g=g+w|0,_^=g,_=_>>>32-8|_<<8,H=H+_|0,w^=H,w=w>>>32-7|w<<7,g=g+I|0,k^=g,k=k>>>32-16|k<<16,F=F+k|0,I^=F,I=I>>>32-12|I<<12,S=S+B|0,_^=S,_=_>>>32-16|_<<16,E=E+_|0,B^=E,B=B>>>32-12|B<<12,P=P+j|0,O^=P,O=O>>>32-16|O<<16,H=H+O|0,j^=H,j=j>>>32-12|j<<12,T=T+w|0,N^=T,N=N>>>32-16|N<<16,K=K+N|0,w^=K,w=w>>>32-12|w<<12,P=P+j|0,O^=P,O=O>>>32-8|O<<8,H=H+O|0,j^=H,j=j>>>32-7|j<<7,T=T+w|0,N^=T,N=N>>>32-8|N<<8,K=K+N|0,w^=K,w=w>>>32-7|w<<7,S=S+B|0,_^=S,_=_>>>32-8|_<<8,E=E+_|0,B^=E,B=B>>>32-7|B<<7,g=g+I|0,k^=g,k=k>>>32-8|k<<8,F=F+k|0,I^=F,I=I>>>32-7|I<<7;dn.writeUint32LE(g+n|0,t,0),dn.writeUint32LE(S+i|0,t,4),dn.writeUint32LE(P+s|0,t,8),dn.writeUint32LE(T+o|0,t,12),dn.writeUint32LE(w+a|0,t,16),dn.writeUint32LE(I+c|0,t,20),dn.writeUint32LE(B+l|0,t,24),dn.writeUint32LE(j+u|0,t,28),dn.writeUint32LE(H+f|0,t,32),dn.writeUint32LE(K+d|0,t,36),dn.writeUint32LE(F+h|0,t,40),dn.writeUint32LE(E+p|0,t,44),dn.writeUint32LE(_+v|0,t,48),dn.writeUint32LE(O+b|0,t,52),dn.writeUint32LE(N+y|0,t,56),dn.writeUint32LE(k+m|0,t,60)}function dU(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var hU={},Lc={};Object.defineProperty(Lc,"__esModule",{value:!0});function Kye(t,e,r){return~(t-1)&e|t-1&r}Lc.select=Kye;function Qye(t,e){return(t|0)-(e|0)-1>>>31&1}Lc.lessOrEqual=Qye;function pU(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n>>8}Lc.compare=pU;function Yye(t,e){return t.length===0||e.length===0?!1:pU(t,e)!==0}Lc.equal=Yye;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Lc,r=_s;t.DIGEST_LENGTH=16;var n=function(){function o(a){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=a[0]|a[1]<<8;this._r[0]=c&8191;var l=a[2]|a[3]<<8;this._r[1]=(c>>>13|l<<3)&8191;var u=a[4]|a[5]<<8;this._r[2]=(l>>>10|u<<6)&7939;var f=a[6]|a[7]<<8;this._r[3]=(u>>>7|f<<9)&8191;var d=a[8]|a[9]<<8;this._r[4]=(f>>>4|d<<12)&255,this._r[5]=d>>>1&8190;var h=a[10]|a[11]<<8;this._r[6]=(d>>>14|h<<2)&8191;var p=a[12]|a[13]<<8;this._r[7]=(h>>>11|p<<5)&8065;var v=a[14]|a[15]<<8;this._r[8]=(p>>>8|v<<8)&8191,this._r[9]=v>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return o.prototype._blocks=function(a,c,l){for(var u=this._fin?0:2048,f=this._h[0],d=this._h[1],h=this._h[2],p=this._h[3],v=this._h[4],b=this._h[5],y=this._h[6],m=this._h[7],g=this._h[8],S=this._h[9],P=this._r[0],T=this._r[1],w=this._r[2],I=this._r[3],B=this._r[4],j=this._r[5],H=this._r[6],K=this._r[7],F=this._r[8],E=this._r[9];l>=16;){var _=a[c+0]|a[c+1]<<8;f+=_&8191;var O=a[c+2]|a[c+3]<<8;d+=(_>>>13|O<<3)&8191;var N=a[c+4]|a[c+5]<<8;h+=(O>>>10|N<<6)&8191;var k=a[c+6]|a[c+7]<<8;p+=(N>>>7|k<<9)&8191;var M=a[c+8]|a[c+9]<<8;v+=(k>>>4|M<<12)&8191,b+=M>>>1&8191;var L=a[c+10]|a[c+11]<<8;y+=(M>>>14|L<<2)&8191;var $=a[c+12]|a[c+13]<<8;m+=(L>>>11|$<<5)&8191;var A=a[c+14]|a[c+15]<<8;g+=($>>>8|A<<8)&8191,S+=A>>>5|u;var D=0,V=D;V+=f*P,V+=d*(5*E),V+=h*(5*F),V+=p*(5*K),V+=v*(5*H),D=V>>>13,V&=8191,V+=b*(5*j),V+=y*(5*B),V+=m*(5*I),V+=g*(5*w),V+=S*(5*T),D+=V>>>13,V&=8191;var R=D;R+=f*T,R+=d*P,R+=h*(5*E),R+=p*(5*F),R+=v*(5*K),D=R>>>13,R&=8191,R+=b*(5*H),R+=y*(5*j),R+=m*(5*B),R+=g*(5*I),R+=S*(5*w),D+=R>>>13,R&=8191;var U=D;U+=f*w,U+=d*T,U+=h*P,U+=p*(5*E),U+=v*(5*F),D=U>>>13,U&=8191,U+=b*(5*K),U+=y*(5*H),U+=m*(5*j),U+=g*(5*B),U+=S*(5*I),D+=U>>>13,U&=8191;var W=D;W+=f*I,W+=d*w,W+=h*T,W+=p*P,W+=v*(5*E),D=W>>>13,W&=8191,W+=b*(5*F),W+=y*(5*K),W+=m*(5*H),W+=g*(5*j),W+=S*(5*B),D+=W>>>13,W&=8191;var q=D;q+=f*B,q+=d*I,q+=h*w,q+=p*T,q+=v*P,D=q>>>13,q&=8191,q+=b*(5*E),q+=y*(5*F),q+=m*(5*K),q+=g*(5*H),q+=S*(5*j),D+=q>>>13,q&=8191;var Y=D;Y+=f*j,Y+=d*B,Y+=h*I,Y+=p*w,Y+=v*T,D=Y>>>13,Y&=8191,Y+=b*P,Y+=y*(5*E),Y+=m*(5*F),Y+=g*(5*K),Y+=S*(5*H),D+=Y>>>13,Y&=8191;var X=D;X+=f*H,X+=d*j,X+=h*B,X+=p*I,X+=v*w,D=X>>>13,X&=8191,X+=b*T,X+=y*P,X+=m*(5*E),X+=g*(5*F),X+=S*(5*K),D+=X>>>13,X&=8191;var Q=D;Q+=f*K,Q+=d*H,Q+=h*j,Q+=p*B,Q+=v*I,D=Q>>>13,Q&=8191,Q+=b*w,Q+=y*T,Q+=m*P,Q+=g*(5*E),Q+=S*(5*F),D+=Q>>>13,Q&=8191;var Z=D;Z+=f*F,Z+=d*K,Z+=h*H,Z+=p*j,Z+=v*B,D=Z>>>13,Z&=8191,Z+=b*I,Z+=y*w,Z+=m*T,Z+=g*P,Z+=S*(5*E),D+=Z>>>13,Z&=8191;var ae=D;ae+=f*E,ae+=d*F,ae+=h*K,ae+=p*H,ae+=v*j,D=ae>>>13,ae&=8191,ae+=b*B,ae+=y*I,ae+=m*w,ae+=g*T,ae+=S*P,D+=ae>>>13,ae&=8191,D=(D<<2)+D|0,D=D+V|0,V=D&8191,D=D>>>13,R+=D,f=V,d=R,h=U,p=W,v=q,b=Y,y=X,m=Q,g=Z,S=ae,c+=16,l-=16}this._h[0]=f,this._h[1]=d,this._h[2]=h,this._h[3]=p,this._h[4]=v,this._h[5]=b,this._h[6]=y,this._h[7]=m,this._h[8]=g,this._h[9]=S},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),u,f,d,h;if(this._leftover){for(h=this._leftover,this._buffer[h++]=1;h<16;h++)this._buffer[h]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(u=this._h[1]>>>13,this._h[1]&=8191,h=2;h<10;h++)this._h[h]+=u,u=this._h[h]>>>13,this._h[h]&=8191;for(this._h[0]+=u*5,u=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=u,u=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=u,l[0]=this._h[0]+5,u=l[0]>>>13,l[0]&=8191,h=1;h<10;h++)l[h]=this._h[h]+u,u=l[h]>>>13,l[h]&=8191;for(l[9]-=8192,f=(u^1)-1,h=0;h<10;h++)l[h]&=f;for(f=~f,h=0;h<10;h++)this._h[h]=this._h[h]&f|l[h];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,d=this._h[0]+this._pad[0],this._h[0]=d&65535,h=1;h<8;h++)d=(this._h[h]+this._pad[h]|0)+(d>>>16)|0,this._h[h]=d&65535;return a[c+0]=this._h[0]>>>0,a[c+1]=this._h[0]>>>8,a[c+2]=this._h[1]>>>0,a[c+3]=this._h[1]>>>8,a[c+4]=this._h[2]>>>0,a[c+5]=this._h[2]>>>8,a[c+6]=this._h[3]>>>0,a[c+7]=this._h[3]>>>8,a[c+8]=this._h[4]>>>0,a[c+9]=this._h[4]>>>8,a[c+10]=this._h[5]>>>0,a[c+11]=this._h[5]>>>8,a[c+12]=this._h[6]>>>0,a[c+13]=this._h[6]>>>8,a[c+14]=this._h[7]>>>0,a[c+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(a){var c=0,l=a.length,u;if(this._leftover){u=16-this._leftover,u>l&&(u=l);for(var f=0;f=16&&(u=l-l%16,this._blocks(a,c,u),c+=u,l-=u),l){for(var f=0;f16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var h=new Uint8Array(16);h.set(l,h.length-l.length);var p=new Uint8Array(32);e.stream(this._key,h,p,4);var v=u.length+this.tagLength,b;if(d){if(d.length!==v)throw new Error("ChaCha20Poly1305: incorrect destination length");b=d}else b=new Uint8Array(v);return e.streamXOR(this._key,h,u,b,4),this._authenticate(b.subarray(b.length-this.tagLength,b.length),p,b.subarray(0,b.length-this.tagLength),f),n.wipe(h),b},c.prototype.open=function(l,u,f,d){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(u.length0&&h.update(o.subarray(d.length%16))),h.update(f),f.length%16>0&&h.update(o.subarray(f.length%16));var p=new Uint8Array(8);d&&i.writeUint64LE(d.length,p),h.update(p),i.writeUint64LE(f.length,p),h.update(p);for(var v=h.digest(),b=0;bthis.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n256)throw new Error("randomString charset is too long");let d="";const h=u.length,p=256-256%h;for(;l>0;){const v=i(Math.ceil(l*256/p),f);for(let b=0;b0;b++){const y=v[b];y0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[u++],l--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(u=s(this._temp,this._state,c,u,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[u++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,u=this._bufferLength,f=l/536870912|0,d=l<<3,h=l%64<56?64:128;this._buffer[u]=128;for(var p=u+1;p0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function s(a,c,l,u,f){for(;f>=64;){for(var d=c[0],h=c[1],p=c[2],v=c[3],b=c[4],y=c[5],m=c[6],g=c[7],S=0;S<16;S++){var P=u+S*4;a[S]=e.readUint32BE(l,P)}for(var S=16;S<64;S++){var T=a[S-2],w=(T>>>17|T<<32-17)^(T>>>19|T<<32-19)^T>>>10;T=a[S-15];var I=(T>>>7|T<<32-7)^(T>>>18|T<<32-18)^T>>>3;a[S]=(w+a[S-7]|0)+(I+a[S-16]|0)}for(var S=0;S<64;S++){var w=(((b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+(b&y^~b&m)|0)+(g+(i[S]+a[S]|0)|0)|0,I=((d>>>2|d<<32-2)^(d>>>13|d<<32-13)^(d>>>22|d<<32-22))+(d&h^d&p^h&p)|0;g=m,m=y,y=b,b=v+w|0,v=p,p=h,h=d,d=w+I|0}c[0]+=d,c[1]+=h,c[2]+=p,c[3]+=v,c[4]+=b,c[5]+=y,c[6]+=m,c[7]+=g,u+=64,f-=64}return u}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Ub);var N8={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=Lb,r=_s;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(S){const P=new Float64Array(16);if(S)for(let T=0;T>16&1),T[j-1]&=65535;T[15]=w[15]-32767-(T[14]>>16&1);const B=T[15]>>16&1;T[14]&=65535,a(w,T,1-B)}for(let I=0;I<16;I++)S[2*I]=w[I]&255,S[2*I+1]=w[I]>>8}function l(S,P){for(let T=0;T<16;T++)S[T]=P[2*T]+(P[2*T+1]<<8);S[15]&=32767}function u(S,P,T){for(let w=0;w<16;w++)S[w]=P[w]+T[w]}function f(S,P,T){for(let w=0;w<16;w++)S[w]=P[w]-T[w]}function d(S,P,T){let w,I,B=0,j=0,H=0,K=0,F=0,E=0,_=0,O=0,N=0,k=0,M=0,L=0,$=0,A=0,D=0,V=0,R=0,U=0,W=0,q=0,Y=0,X=0,Q=0,Z=0,ae=0,se=0,ue=0,ot=0,Pe=0,Ae=0,at=0,xe=T[0],be=T[1],Kt=T[2],Te=T[3],Ie=T[4],Qt=T[5],Oe=T[6],Re=T[7],Yt=T[8],Me=T[9],$e=T[10],Jt=T[11],Ne=T[12],De=T[13],Xt=T[14],Le=T[15];w=P[0],B+=w*xe,j+=w*be,H+=w*Kt,K+=w*Te,F+=w*Ie,E+=w*Qt,_+=w*Oe,O+=w*Re,N+=w*Yt,k+=w*Me,M+=w*$e,L+=w*Jt,$+=w*Ne,A+=w*De,D+=w*Xt,V+=w*Le,w=P[1],j+=w*xe,H+=w*be,K+=w*Kt,F+=w*Te,E+=w*Ie,_+=w*Qt,O+=w*Oe,N+=w*Re,k+=w*Yt,M+=w*Me,L+=w*$e,$+=w*Jt,A+=w*Ne,D+=w*De,V+=w*Xt,R+=w*Le,w=P[2],H+=w*xe,K+=w*be,F+=w*Kt,E+=w*Te,_+=w*Ie,O+=w*Qt,N+=w*Oe,k+=w*Re,M+=w*Yt,L+=w*Me,$+=w*$e,A+=w*Jt,D+=w*Ne,V+=w*De,R+=w*Xt,U+=w*Le,w=P[3],K+=w*xe,F+=w*be,E+=w*Kt,_+=w*Te,O+=w*Ie,N+=w*Qt,k+=w*Oe,M+=w*Re,L+=w*Yt,$+=w*Me,A+=w*$e,D+=w*Jt,V+=w*Ne,R+=w*De,U+=w*Xt,W+=w*Le,w=P[4],F+=w*xe,E+=w*be,_+=w*Kt,O+=w*Te,N+=w*Ie,k+=w*Qt,M+=w*Oe,L+=w*Re,$+=w*Yt,A+=w*Me,D+=w*$e,V+=w*Jt,R+=w*Ne,U+=w*De,W+=w*Xt,q+=w*Le,w=P[5],E+=w*xe,_+=w*be,O+=w*Kt,N+=w*Te,k+=w*Ie,M+=w*Qt,L+=w*Oe,$+=w*Re,A+=w*Yt,D+=w*Me,V+=w*$e,R+=w*Jt,U+=w*Ne,W+=w*De,q+=w*Xt,Y+=w*Le,w=P[6],_+=w*xe,O+=w*be,N+=w*Kt,k+=w*Te,M+=w*Ie,L+=w*Qt,$+=w*Oe,A+=w*Re,D+=w*Yt,V+=w*Me,R+=w*$e,U+=w*Jt,W+=w*Ne,q+=w*De,Y+=w*Xt,X+=w*Le,w=P[7],O+=w*xe,N+=w*be,k+=w*Kt,M+=w*Te,L+=w*Ie,$+=w*Qt,A+=w*Oe,D+=w*Re,V+=w*Yt,R+=w*Me,U+=w*$e,W+=w*Jt,q+=w*Ne,Y+=w*De,X+=w*Xt,Q+=w*Le,w=P[8],N+=w*xe,k+=w*be,M+=w*Kt,L+=w*Te,$+=w*Ie,A+=w*Qt,D+=w*Oe,V+=w*Re,R+=w*Yt,U+=w*Me,W+=w*$e,q+=w*Jt,Y+=w*Ne,X+=w*De,Q+=w*Xt,Z+=w*Le,w=P[9],k+=w*xe,M+=w*be,L+=w*Kt,$+=w*Te,A+=w*Ie,D+=w*Qt,V+=w*Oe,R+=w*Re,U+=w*Yt,W+=w*Me,q+=w*$e,Y+=w*Jt,X+=w*Ne,Q+=w*De,Z+=w*Xt,ae+=w*Le,w=P[10],M+=w*xe,L+=w*be,$+=w*Kt,A+=w*Te,D+=w*Ie,V+=w*Qt,R+=w*Oe,U+=w*Re,W+=w*Yt,q+=w*Me,Y+=w*$e,X+=w*Jt,Q+=w*Ne,Z+=w*De,ae+=w*Xt,se+=w*Le,w=P[11],L+=w*xe,$+=w*be,A+=w*Kt,D+=w*Te,V+=w*Ie,R+=w*Qt,U+=w*Oe,W+=w*Re,q+=w*Yt,Y+=w*Me,X+=w*$e,Q+=w*Jt,Z+=w*Ne,ae+=w*De,se+=w*Xt,ue+=w*Le,w=P[12],$+=w*xe,A+=w*be,D+=w*Kt,V+=w*Te,R+=w*Ie,U+=w*Qt,W+=w*Oe,q+=w*Re,Y+=w*Yt,X+=w*Me,Q+=w*$e,Z+=w*Jt,ae+=w*Ne,se+=w*De,ue+=w*Xt,ot+=w*Le,w=P[13],A+=w*xe,D+=w*be,V+=w*Kt,R+=w*Te,U+=w*Ie,W+=w*Qt,q+=w*Oe,Y+=w*Re,X+=w*Yt,Q+=w*Me,Z+=w*$e,ae+=w*Jt,se+=w*Ne,ue+=w*De,ot+=w*Xt,Pe+=w*Le,w=P[14],D+=w*xe,V+=w*be,R+=w*Kt,U+=w*Te,W+=w*Ie,q+=w*Qt,Y+=w*Oe,X+=w*Re,Q+=w*Yt,Z+=w*Me,ae+=w*$e,se+=w*Jt,ue+=w*Ne,ot+=w*De,Pe+=w*Xt,Ae+=w*Le,w=P[15],V+=w*xe,R+=w*be,U+=w*Kt,W+=w*Te,q+=w*Ie,Y+=w*Qt,X+=w*Oe,Q+=w*Re,Z+=w*Yt,ae+=w*Me,se+=w*$e,ue+=w*Jt,ot+=w*Ne,Pe+=w*De,Ae+=w*Xt,at+=w*Le,B+=38*R,j+=38*U,H+=38*W,K+=38*q,F+=38*Y,E+=38*X,_+=38*Q,O+=38*Z,N+=38*ae,k+=38*se,M+=38*ue,L+=38*ot,$+=38*Pe,A+=38*Ae,D+=38*at,I=1,w=B+I+65535,I=Math.floor(w/65536),B=w-I*65536,w=j+I+65535,I=Math.floor(w/65536),j=w-I*65536,w=H+I+65535,I=Math.floor(w/65536),H=w-I*65536,w=K+I+65535,I=Math.floor(w/65536),K=w-I*65536,w=F+I+65535,I=Math.floor(w/65536),F=w-I*65536,w=E+I+65535,I=Math.floor(w/65536),E=w-I*65536,w=_+I+65535,I=Math.floor(w/65536),_=w-I*65536,w=O+I+65535,I=Math.floor(w/65536),O=w-I*65536,w=N+I+65535,I=Math.floor(w/65536),N=w-I*65536,w=k+I+65535,I=Math.floor(w/65536),k=w-I*65536,w=M+I+65535,I=Math.floor(w/65536),M=w-I*65536,w=L+I+65535,I=Math.floor(w/65536),L=w-I*65536,w=$+I+65535,I=Math.floor(w/65536),$=w-I*65536,w=A+I+65535,I=Math.floor(w/65536),A=w-I*65536,w=D+I+65535,I=Math.floor(w/65536),D=w-I*65536,w=V+I+65535,I=Math.floor(w/65536),V=w-I*65536,B+=I-1+37*(I-1),I=1,w=B+I+65535,I=Math.floor(w/65536),B=w-I*65536,w=j+I+65535,I=Math.floor(w/65536),j=w-I*65536,w=H+I+65535,I=Math.floor(w/65536),H=w-I*65536,w=K+I+65535,I=Math.floor(w/65536),K=w-I*65536,w=F+I+65535,I=Math.floor(w/65536),F=w-I*65536,w=E+I+65535,I=Math.floor(w/65536),E=w-I*65536,w=_+I+65535,I=Math.floor(w/65536),_=w-I*65536,w=O+I+65535,I=Math.floor(w/65536),O=w-I*65536,w=N+I+65535,I=Math.floor(w/65536),N=w-I*65536,w=k+I+65535,I=Math.floor(w/65536),k=w-I*65536,w=M+I+65535,I=Math.floor(w/65536),M=w-I*65536,w=L+I+65535,I=Math.floor(w/65536),L=w-I*65536,w=$+I+65535,I=Math.floor(w/65536),$=w-I*65536,w=A+I+65535,I=Math.floor(w/65536),A=w-I*65536,w=D+I+65535,I=Math.floor(w/65536),D=w-I*65536,w=V+I+65535,I=Math.floor(w/65536),V=w-I*65536,B+=I-1+37*(I-1),S[0]=B,S[1]=j,S[2]=H,S[3]=K,S[4]=F,S[5]=E,S[6]=_,S[7]=O,S[8]=N,S[9]=k,S[10]=M,S[11]=L,S[12]=$,S[13]=A,S[14]=D,S[15]=V}function h(S,P){d(S,P,P)}function p(S,P){const T=n();for(let w=0;w<16;w++)T[w]=P[w];for(let w=253;w>=0;w--)h(T,T),w!==2&&w!==4&&d(T,T,P);for(let w=0;w<16;w++)S[w]=T[w]}function v(S,P){const T=new Uint8Array(32),w=new Float64Array(80),I=n(),B=n(),j=n(),H=n(),K=n(),F=n();for(let N=0;N<31;N++)T[N]=S[N];T[31]=S[31]&127|64,T[0]&=248,l(w,P);for(let N=0;N<16;N++)B[N]=w[N];I[0]=H[0]=1;for(let N=254;N>=0;--N){const k=T[N>>>3]>>>(N&7)&1;a(I,B,k),a(j,H,k),u(K,I,j),f(I,I,j),u(j,B,H),f(B,B,H),h(H,K),h(F,I),d(I,j,I),d(j,B,K),u(K,I,j),f(I,I,j),h(B,I),f(j,H,F),d(I,j,s),u(I,I,H),d(j,j,I),d(I,H,F),d(H,B,w),h(B,K),a(I,B,k),a(j,H,k)}for(let N=0;N<16;N++)w[N+16]=I[N],w[N+32]=j[N],w[N+48]=B[N],w[N+64]=H[N];const E=w.subarray(32),_=w.subarray(16);p(E,E),d(_,_,E);const O=new Uint8Array(32);return c(O,_),O}t.scalarMult=v;function b(S){return v(S,i)}t.scalarMultBase=b;function y(S){if(S.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const P=new Uint8Array(S);return{publicKey:b(P),secretKey:P}}t.generateKeyPairFromSeed=y;function m(S){const P=(0,e.randomBytes)(32,S),T=y(P);return(0,r.wipe)(P),T}t.generateKeyPair=m;function g(S,P,T=!1){if(S.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(P.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const w=v(S,P);if(T){let I=0;for(let B=0;Bi+s.length,0));const r=yU(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return D8(r)}function uge(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,S=new Uint8Array(g);y!==m;){for(var P=p[y],T=0,w=g-1;(P!==0||T>>0,S[w]=P%a>>>0,P=P/a>>>0;if(P!==0)throw new Error("Non-zero carry");b=T,y++}for(var I=g-b;I!==g&&S[I]===0;)I++;for(var B=c.repeat(v);I>>0,g=new Uint8Array(m);p[v];){var S=r[p.charCodeAt(v)];if(S===255)return;for(var P=0,T=m-1;(S!==0||P>>0,g[T]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");y=P,v++}if(p[v]!==" "){for(var w=m-y;w!==m&&g[w]===0;)w++;for(var I=new Uint8Array(b+(m-w)),B=b;w!==m;)I[B++]=g[w++];return I}}}function h(p){var v=d(p);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:d,decode:h}}var fge=uge,dge=fge;const hge=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},pge=t=>new TextEncoder().encode(t),vge=t=>new TextDecoder().decode(t);class mge{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class yge{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return gU(this,e)}}class gge{constructor(e){this.decoders=e}or(e){return gU(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const gU=(t,e)=>new gge({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class bge{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new mge(e,r,n),this.decoder=new yge(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const zb=({name:t,prefix:e,encode:r,decode:n})=>new bge(t,e,r,n),Z1=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=dge(r,e);return zb({prefix:t,name:e,encode:n,decode:s=>hge(i(s))})},wge=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},Ege=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<zb({prefix:e,name:t,encode(i){return Ege(i,n,r)},decode(i){return wge(i,n,r,t)}}),xge=zb({prefix:"\0",name:"identity",encode:t=>vge(t),decode:t=>pge(t)}),Cge=Object.freeze(Object.defineProperty({__proto__:null,identity:xge},Symbol.toStringTag,{value:"Module"})),Sge=cn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),kge=Object.freeze(Object.defineProperty({__proto__:null,base2:Sge},Symbol.toStringTag,{value:"Module"})),Age=cn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),_ge=Object.freeze(Object.defineProperty({__proto__:null,base8:Age},Symbol.toStringTag,{value:"Module"})),Pge=Z1({prefix:"9",name:"base10",alphabet:"0123456789"}),Tge=Object.freeze(Object.defineProperty({__proto__:null,base10:Pge},Symbol.toStringTag,{value:"Module"})),Ige=cn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Oge=cn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),Rge=Object.freeze(Object.defineProperty({__proto__:null,base16:Ige,base16upper:Oge},Symbol.toStringTag,{value:"Module"})),Mge=cn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),$ge=cn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Nge=cn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Dge=cn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Lge=cn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Bge=cn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Fge=cn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),jge=cn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Uge=cn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),zge=Object.freeze(Object.defineProperty({__proto__:null,base32:Mge,base32hex:Lge,base32hexpad:Fge,base32hexpadupper:jge,base32hexupper:Bge,base32pad:Nge,base32padupper:Dge,base32upper:$ge,base32z:Uge},Symbol.toStringTag,{value:"Module"})),Wge=Z1({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Hge=Z1({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),qge=Object.freeze(Object.defineProperty({__proto__:null,base36:Wge,base36upper:Hge},Symbol.toStringTag,{value:"Module"})),Vge=Z1({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Gge=Z1({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Kge=Object.freeze(Object.defineProperty({__proto__:null,base58btc:Vge,base58flickr:Gge},Symbol.toStringTag,{value:"Module"})),Qge=cn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Yge=cn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Jge=cn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Xge=cn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Zge=Object.freeze(Object.defineProperty({__proto__:null,base64:Qge,base64pad:Yge,base64url:Jge,base64urlpad:Xge},Symbol.toStringTag,{value:"Module"})),bU=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),ebe=bU.reduce((t,e,r)=>(t[r]=e,t),[]),tbe=bU.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function rbe(t){return t.reduce((e,r)=>(e+=ebe[r],e),"")}function nbe(t){const e=[];for(const r of t){const n=tbe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const ibe=zb({prefix:"🚀",name:"base256emoji",encode:rbe,decode:nbe}),sbe=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:ibe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const jT={...Cge,...kge,..._ge,...Tge,...Rge,...zge,...qge,...Kge,...Zge,...sbe};function wU(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const UT=wU("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Q2=wU("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=yU(t.length);for(let r=0;r"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ube:typeof navigator<"u"?qT(navigator.userAgent):ybe()}function vbe(t){return t!==""&&hbe.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1)}function qT(t){var e=vbe(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new lbe;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length0;)k=D[U],V.call(R,k,L[k]);this._listeners={},this._listenersCount=0,W()}}});function m(k,$,L,M){var A=Object.assign({},$);if(!k)return A;if(typeof k!="object")throw TypeError("options must be an object");var D=Object.keys(k),V=D.length,R,U,W;function q(X){throw Error('Invalid "'+R+'" option value'+(X?". Reason: "+X:""))}for(var Y=0;Y0;)if(R===k[U])return D;V($)}}var P=S(["function"]),T=S(["object","function"]);function w(k,$,L){var M,A,D=0,V,R=new k(function(U,W,q){L=m(L,{timeout:0,overload:!1},{timeout:function(Z,ae){return Z*=1,(typeof Z!="number"||Z<0||!Number.isFinite(Z))&&ae("timeout must be a positive number"),Z}}),M=!L.overload&&typeof k.prototype.cancel=="function"&&typeof q=="function";function Y(){A&&(A=null),D&&(clearTimeout(D),D=0)}var X=function(Z){Y(),U(Z)},Q=function(Z){Y(),W(Z)};M?$(X,Q,q):(A=[function(Z){Q(Z||Error("canceled"))}],$(X,Q,function(Z){if(V)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof Z!="function")throw TypeError("onCancel callback must be a function");A.push(Z)}),V=!0),L.timeout>0&&(D=setTimeout(function(){var Z=Error("timeout");Z.code="ETIMEDOUT",D=0,R.cancel(Z),W(Z)},L.timeout))});return M||(R.cancel=function(U){if(A){for(var W=A.length,q=1;q0;)Q=_e[R],Q!=="_listeners"&&(at=F(k,$,L[Q],M+1,A),at&&(X?X.push.apply(X,at):X=at));return X}else if(ot==="**"){for(ue=M+1===A||M+2===A&&Te==="*",ue&&L._listeners&&(X=F(k,$,L,A,A)),_e=f(L),R=_e.length;R-- >0;)Q=_e[R],Q!=="_listeners"&&(Q==="*"||Q==="**"?(L[Q]._listeners&&!ue&&(at=F(k,$,L[Q],A,A),at&&(X?X.push.apply(X,at):X=at)),at=F(k,$,L[Q],M,A)):Q===Te?at=F(k,$,L[Q],M+2,A):at=F(k,$,L[Q],M,A),at&&(X?X.push.apply(X,at):X=at));return X}else L[ot]&&(X=F(k,$,L[ot],M+1,A));if(Z=L["*"],Z&&F(k,$,Z,M+1,A),ae=L["**"],ae)if(M0;)Q=_e[R],Q!=="_listeners"&&(Q===Te?F(k,$,ae[Q],M+2,A):Q===ot?F(k,$,ae[Q],M+1,A):(se={},se[Q]=ae[Q],F(k,$,{"**":se},M+1,A)));else ae._listeners?F(k,$,ae,A,A):ae["*"]&&ae["*"]._listeners&&F(k,$,ae["*"],A,A);return X}function j(k,$,L){var M=0,A=0,D,V=this.delimiter,R=V.length,U;if(typeof k=="string")if((D=k.indexOf(V))!==-1){U=new Array(5);do U[M++]=k.slice(A,D),A=D+R;while((D=k.indexOf(V,A))!==-1);U[M++]=k.slice(A)}else U=[k],M=1;else U=k,M=k.length;if(M>1){for(D=0;D+10&&W._listeners.length>this._maxListeners&&(W._listeners.warned=!0,p.call(this,W._listeners.length,q))):W._listeners=$,!0;return!0}function H(k,$,L,M){for(var A=f(k),D=A.length,V,R,U,W=k._listeners,q;D-- >0;)R=A[D],V=k[R],R==="_listeners"?U=L:U=L?L.concat(R):[R],q=M||typeof R=="symbol",W&&$.push(q?U:U.join(this.delimiter)),typeof V=="object"&&H.call(this,V,$,U,q);return $}function K(k){for(var $=f(k),L=$.length,M,A,D;L-- >0;)A=$[L],M=k[A],M&&(D=!0,A!=="_listeners"&&!K(M)&&delete k[A]);return D}function B(k,$,L){this.emitter=k,this.event=$,this.listener=L}B.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function E(k,$,L){if(L===!0)A=!0;else if(L===!1)M=!0;else{if(!L||typeof L!="object")throw TypeError("options should be an object or true");var M=L.async,A=L.promisify,D=L.nextTick,V=L.objectify}if(M||D||A){var R=$,U=$._origin||$;if(D&&!o)throw Error("process.nextTick is not supported");A===r&&(A=$.constructor.name==="AsyncFunction"),$=function(){var W=arguments,q=this,Y=this.event;return A?D?Promise.resolve():new Promise(function(X){u(X)}).then(function(){return q.event=Y,R.apply(q,W)}):(D?process.nextTick:u)(function(){q.event=Y,R.apply(q,W)})},$._async=!0,$._origin=U}return[$,V?new B(this,k,$):this]}function _(k){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,h.call(this,k)}_.EventEmitter2=_,_.prototype.listenTo=function(k,$,L){if(typeof k!="object")throw TypeError("target musts be an object");var M=this;L=m(L,{on:r,off:r,reducers:r},{on:P,off:P,reducers:T});function A(D){if(typeof D!="object")throw TypeError("events must be an object");var V=L.reducers,R=I.call(M,k),U;R===-1?U=new y(M,k,L):U=M._observers[R];for(var W=f(D),q=W.length,Y,X=typeof V=="function",Q=0;Q0;)A=L[M],(!k||A._target===k)&&(A.unsubscribe($),D=!0);return D},_.prototype.delimiter=".",_.prototype.setMaxListeners=function(k){k!==r&&(this._maxListeners=k,this._conf||(this._conf={}),this._conf.maxListeners=k)},_.prototype.getMaxListeners=function(){return this._maxListeners},_.prototype.event="",_.prototype.once=function(k,$,L){return this._once(k,$,!1,L)},_.prototype.prependOnceListener=function(k,$,L){return this._once(k,$,!0,L)},_.prototype._once=function(k,$,L,M){return this._many(k,1,$,L,M)},_.prototype.many=function(k,$,L,M){return this._many(k,$,L,!1,M)},_.prototype.prependMany=function(k,$,L,M){return this._many(k,$,L,!0,M)},_.prototype._many=function(k,$,L,M,A){var D=this;if(typeof L!="function")throw new Error("many only accepts instances of Function");function V(){return--$===0&&D.off(k,V),L.apply(this,arguments)}return V._origin=L,this._on(k,V,M,A)},_.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||d.call(this);var k=arguments[0],$,L=this.wildcard,M,A,D,V,R;if(k==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(L&&($=k,k!=="newListener"&&k!=="removeListener"&&typeof k=="object")){if(A=k.length,a){for(D=0;D3)for(M=new Array(U-1),V=1;V3)for(A=new Array(W-1),R=1;R0&&this._events[k].length>this._maxListeners&&(this._events[k].warned=!0,p.call(this,this._events[k].length,k))):this._events[k]=$,A)},_.prototype.off=function(k,$){if(typeof $!="function")throw new Error("removeListener only takes instances of Function");var L,M=[];if(this.wildcard){var A=typeof k=="string"?k.split(this.delimiter):k.slice();if(M=F.call(this,null,A,this.listenerTree,0),!M)return this}else{if(!this._events[k])return this;L=this._events[k],M.push({_listeners:L})}for(var D=0;D0){for(M=this._all,$=0,L=M.length;$0;)M=$[L[D]],typeof M=="function"?A.push(M):A.push.apply(A,M);return A}else{if(this.wildcard){if(V=this.listenerTree,!V)return[];var R=[],U=typeof k=="string"?k.split(this.delimiter):k.slice();return F.call(this,R,U,V,0),R}return $?(M=$[k],M?typeof M=="function"?[M]:M:[]):[]}},_.prototype.eventNames=function(k){var $=this._events;return this.wildcard?H.call(this,this.listenerTree,[],null,k):$?f($):[]},_.prototype.listenerCount=function(k){return this.listeners(k).length},_.prototype.hasListeners=function(k){if(this.wildcard){var $=[],L=typeof k=="string"?k.split(this.delimiter):k.slice();return F.call(this,$,L,this.listenerTree,0),$.length>0}var M=this._events,A=this._all;return!!(A&&A.length||M&&(k===r?f(M).length:M[k]))},_.prototype.listenersAny=function(){return this._all?this._all:[]},_.prototype.waitFor=function(k,$){var L=this,M=typeof $;return M==="number"?$={timeout:$}:M==="function"&&($={filter:$}),$=m($,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:P,Promise:g}),w($.Promise,function(A,D,V){function R(){var U=$.filter;if(!(U&&!U.apply(L,arguments)))if(L.off(k,R),$.handleError){var W=arguments[0];W?D(W):A(v.apply(null,arguments).slice(1))}else A(v.apply(null,arguments))}V(function(){L.off(k,R)}),L._on(k,R,!1)},{timeout:$.timeout,overload:$.overload})};function O(k,$,L){L=m(L,{Promise,timeout:0,overload:!1},{Promise:g});var M=L.Promise;return w(M,function(A,D,V){var R;if(typeof k.addEventListener=="function"){R=function(){A(v.apply(null,arguments))},V(function(){k.removeEventListener($,R)}),k.addEventListener($,R,{once:!0});return}var U=function(){W&&k.removeListener("error",W),A(v.apply(null,arguments))},W;$!=="error"&&(W=function(q){k.removeListener($,U),D(q)},k.once("error",W)),V(function(){W&&k.removeListener("error",W),k.removeListener($,U)}),k.once($,U)},{timeout:L.timeout,overload:L.overload})}var N=_.prototype;Object.defineProperties(_,{defaultMaxListeners:{get:function(){return N._maxListeners},set:function(k){if(typeof k!="number"||k<0||Number.isNaN(k))throw TypeError("n must be a non-negative number");N._maxListeners=k},enumerable:!0},once:{value:O,writable:!0,configurable:!0}}),Object.defineProperties(N,{_maxListeners:{value:s,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof r=="function"&&r.amd?r(function(){return _}):t.exports=_})()})(dU);var jb=dU.exports;function Jn(){return Jn=Object.assign?Object.assign.bind():function(t){for(var e=1;e++vye;class tp{constructor(){var e=this;this.pendingMessageRequests=[],this.responseCallbacks=new Map,this.confirmationOnly=!1,this.events=new jb.EventEmitter2,this.sendAsync=async function(r,n,i){e.state===Ri.CLOSED&&(e.confirmationOnly=!0),e.openWallet(void 0,{type:"jsonRpcRequest",method:r.method},i);try{e.isOpened()||await e.waitUntilOpened();const s=await e.sendMessageRequest({idx:mU(),type:Ye.MESSAGE,data:r,chainId:i});n(void 0,s.data)}catch(s){n(s)}},this.sendMessageRequest=async function(r){return new Promise((n,i)=>{(!r.idx||r.idx<=0)&&r.type!=="init"&&i(new Error("message idx not set"));const s=(a,c)=>{if(a)i(a);else if(c)n(c);else throw new Error("no valid response to return")},o=r.idx;e.responseCallbacks.get(o)?i(new Error("duplicate message idx, should never happen")):e.responseCallbacks.set(o,s),e.isOpened()?e.sendMessage(r):(ge.debug("pushing to pending requests",r),e.pendingMessageRequests.push(r))})},this.waitUntilOpened=async function(r=B8){let n=!1;return Promise.race([new Promise((i,s)=>{const o=setTimeout(()=>{clearTimeout(o),n||(e.state=Ri.CLOSED,e.events.emit("close",{code:1005,message:"opening wallet timed out"})),s(new Error("opening wallet timed out"))},r)}),new Promise(i=>{if(e.isOpened()){var s;n=!0,i((s=e.openPayload)==null?void 0:s.session);return}e.events.once("open",o=>{e.openPayload=o,n=!0,i(o.session)})})])},this.waitUntilConnected=async function(){await e.waitUntilOpened();const r=new Promise(i=>{if(e.connectPayload){i(e.connectPayload);return}e.events.once("connect",s=>{e.connectPayload=s,i(s)})}),n=new Promise((i,s)=>{e.events.once("close",o=>{s(o?new Error(`wallet closed due to ${JSON.stringify(o)}`):new Error("user closed the wallet"))})});return Promise.race([r,n])},this.state=Ri.CLOSED,this._registered=!1,this._init=Wt.NIL}get registered(){return this._registered}register(){throw new Error("abstract method")}unregister(){throw new Error("abstract method")}openWallet(e,r,n){throw new Error("abstract method")}closeWallet(){throw new Error("abstract method")}isOpened(){return this.registered&&this.state===Ri.OPENED}isConnected(){var e;const r=(e=this.openPayload)==null?void 0:e.session;return this.registered&&r!==void 0&&!!r.accountAddress&&r.accountAddress.length===42&&!!r.networks&&r.networks.length>0}handleMessage(e){var r=this;if(e.type===Ye.INIT){ge.debug("MessageProvider, received INIT message",e);const{nonce:c}=e.data;if(!c||c.length==0){ge.error("invalid init nonce");return}this._init=Wt.OK,this.sendMessage({idx:-1,type:Ye.INIT,data:{sessionId:this._sessionId,nonce:c}})}if(this._init!==Wt.OK)return;ge.debug("RECEIVED MESSAGE FROM WALLET",e.idx,e);const n=e.idx,i=this.responseCallbacks.get(n);if(n&&this.responseCallbacks.delete(n),e.type===Ye.OPEN&&!this.isOpened()){var s,o;if(this._sessionId&&this._sessionId!==((s=e.data)==null?void 0:s.sessionId)){ge.debug("open event received from wallet, but does not match sessionId",this._sessionId);return}if((o=e.data)!=null&&o.error){var a;const c=new Error(`opening wallet failed: received ${(a=e.data)==null?void 0:a.error}`);throw ge.error(c),this.close(),c}this.state=Ri.OPENED,this.openPayload=e.data,this.events.emit("open",this.openPayload),this.pendingMessageRequests.length!==0&&this.pendingMessageRequests.splice(0,this.pendingMessageRequests.length).forEach(async function(l){r.sendMessage(l)});return}if(e.type===Ye.MESSAGE){if(this.confirmationOnly&&setTimeout(()=>{this.responseCallbacks.size===0&&this.closeWallet()},500),!i)throw new Error("impossible state");if(i){this.events.emit("message",e),i(e.data.error,e);return}}if(e.type===Ye.ACCOUNTS_CHANGED){this.accountsChangedPayload={accounts:[]},e.data&&e.data.length>0?(this.accountsChangedPayload={accounts:[Ve(e.data[0])],origin:e.origin},this.events.emit("accountsChanged",this.accountsChangedPayload.accounts,this.accountsChangedPayload.origin)):this.events.emit("accountsChanged",[],e.origin);return}if(e.type===Ye.CHAIN_CHANGED){this.events.emit("chainChanged",e.data,e.origin);return}if(e.type===Ye.NETWORKS){this.networksPayload=e.data,this.events.emit("networks",this.networksPayload);return}if(e.type===Ye.WALLET_CONTEXT){this.walletContextPayload=e.data,this.events.emit("walletContext",this.walletContextPayload);return}e.type===Ye.CLOSE&&this.state!==Ri.CLOSED&&this.close(e.data),e.type===Ye.CONNECT&&(this.connectPayload=e.data,this.events.emit("connect",this.connectPayload)),e.type===Ye.DISCONNECT&&this.isConnected()&&(this.events.emit("disconnect",e.data,e.origin),this.close())}sendMessage(e){throw new Error("abstract method")}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}emit(e,...r){return this.events.emit(e,...r)}close(e){this.state!==Ri.CLOSED&&(this.state=Ri.CLOSED,this.confirmationOnly=!1,this._sessionId=void 0,ge.info("closing wallet and flushing!"),this.pendingMessageRequests.length=0,this.responseCallbacks.forEach(r=>{r(Jn({},new Error("wallet closed"),{code:4001}))}),this.responseCallbacks.clear(),this.connectPayload=void 0,this.openPayload=void 0,this.accountsChangedPayload=void 0,this.networksPayload=void 0,this.walletContextPayload=void 0,this.events.emit("close",e))}}function mye(t){return yye.some(e=>e.predicate(t))}const yye=[{name:"Decentraland Exception",predicate:bye},{name:"0x v3 Exception",predicate:wye}],gye=/^Decentraland Login\nEphemeral address: 0x[a-fA-F0-9]{40}\nExpiration: (\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)((-(\d{2}):(\d{2})|Z)?)$/;function bye(t){try{const e=ua(t);return gye.test(e)}catch{return!1}}function wye(t){const e=new jr(Eye);try{return e.decodeFunctionData("OrderWithHash",t),!0}catch{return!1}}const Eye=[{inputs:[{components:[{internalType:"address",name:"makerAddress",type:"address"},{internalType:"address",name:"takerAddress",type:"address"},{internalType:"address",name:"feeRecipientAddress",type:"address"},{internalType:"address",name:"senderAddress",type:"address"},{internalType:"uint256",name:"makerAssetAmount",type:"uint256"},{internalType:"uint256",name:"takerAssetAmount",type:"uint256"},{internalType:"uint256",name:"makerFee",type:"uint256"},{internalType:"uint256",name:"takerFee",type:"uint256"},{internalType:"uint256",name:"expirationTimeSeconds",type:"uint256"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes",name:"makerAssetData",type:"bytes"},{internalType:"bytes",name:"takerAssetData",type:"bytes"},{internalType:"bytes",name:"makerFeeAssetData",type:"bytes"},{internalType:"bytes",name:"takerFeeAssetData",type:"bytes"}],internalType:"struct IEIP1271Data.Order",name:"order",type:"tuple"},{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderWithHash",outputs:[],stateMutability:"pure",type:"function"}],Yv=wt(`Ethereum Signed Message: +`),yU=t=>ca(t)||je(t)?re(t):wt(t),Ub=t=>{const e=yU(t);return mye(e)?e:qt([Yv,wt(String(e.length)),e])},xye=t=>{if(JSON.stringify(t.slice(0,Yv.length))!==JSON.stringify(Yv))return t;const e=t.slice(Yv.length),r=String(e.length).length;let n,i;try{i=Number(ua(e.slice(0,r)))}catch{i=Number(te(e.slice(0,r)))}return i>e.length||!Number.isInteger(i)?n=r-1:n=r,e.slice(n)},Qf=async(t,e,r,n)=>new he.reader.OnChainReader(n).isValidSignature(t,e,r),gU=async(t,e,r,n)=>{const i=Ub(e),s=c8(i);return Qf(t,s,r,n)},bU=(t,e,r,n)=>Qf(t,Q1(e),r,n),$y=()=>window.location.protocol==="chrome-extension:"||window.location.protocol==="moz-extension:",wU=()=>!!navigator.userAgent.match(/UnitySequence/i),EU=t=>t.onChain.deployed&&t.fullyMigrated;class xU{constructor(){this.callbacks=[],this.store={}}getItem(e){return this.store[e]||null}setItem(e,r){this.store[e]=r,this.callbacks.filter(n=>n.key===e).forEach(n=>n.cb(r))}removeItem(e){delete this.store[e]}onItemChange(e,r){return this.callbacks.push({key:e,cb:r}),()=>{this.callbacks=this.callbacks.filter(n=>n.cb!==r)}}}class c1{static isAvailable(){return typeof window=="object"&&typeof window.localStorage=="object"}constructor(){if(this.callbacks=[],!c1.isAvailable())throw new Error("LocalStorage is not available");window.addEventListener("storage",e=>{const{key:r}=e;this.callbacks.filter(i=>i.key===r).forEach(i=>i.cb(this.getItem(r)))})}getItem(e){return window.localStorage.getItem(e)}setItem(e,r){window.localStorage.setItem(e,r),this.callbacks.filter(n=>n.key===e).forEach(n=>n.cb(r))}removeItem(e){window.localStorage.removeItem(e),this.callbacks.filter(r=>r.key===e).forEach(r=>r.cb(null))}onItemChange(e,r){return this.callbacks.push({key:e,cb:r}),()=>{this.callbacks=this.callbacks.filter(n=>n.cb!==r)}}}function My(){return c1.isAvailable()?new c1:new xU}async function CU(t){return Array.isArray(t)?Promise.all(t.map(e=>vt(e))):vt(t)}const WT="@sequence.transportSession";class rp{constructor(e){var r=this;this.sendAsync=async function(n,i,s){throw new Error("abstract method")},this.handleMessage=async function(n){const i=n;if(r._init!==Wt.OK){if(i.type===Ye.INIT)if(r.isValidInitAck(n))r._initCallback&&r._initCallback();else{r._initCallback&&r._initCallback("invalid init");return}return}switch(i.type){case Ye.OPEN:{if(r._init!==Wt.OK)return;const s={sessionId:i.data.sessionId,intent:i.data.intent,networkId:i.data.networkId};await r.open(s);return}case Ye.CLOSE:return r._init!==Wt.OK,void 0;case Ye.MESSAGE:{const s=await r.walletRequestHandler.sendMessageRequest(i);r.sendMessage(s),s.data.error;return}default:ge.error(`unexpected payload type ${i.type}`)}},this.sendMessageRequest=async function(n){return r.walletRequestHandler.sendMessageRequest(n)},this.open=async function({sessionId:n,intent:i,networkId:s}){n&&(r._sessionId=$B(n),r.saveTransportSession({sessionId:n,intent:i,networkId:s})),r.walletRequestHandler.setOpenIntent(i),await r.init();let o;try{if(s){const a=d8(s);if(a)o=a.chainId;else throw new Error(`unknown network ${s}`)}else o=r.walletRequestHandler.defaultChainId()}catch(a){console.error(a)}if(i&&i.type==="connect"&&i.options){const a=i.options,c=a;if(r.appOrigin&&c!=null&&c.origin){if(!$y()&&c.origin!==r.appOrigin)throw new Error("origin is invalid")}else!r.appOrigin&&c!=null&&c.origin?a.origin=NB(c.origin):r.appOrigin&&(a.origin=r.appOrigin);a.app&&(a.app=MB(a.app)),a.networkId?s=a.networkId:s&&(a.networkId=s),r.walletRequestHandler.setConnectOptions(a)}else r.walletRequestHandler.setConnectOptions(void 0);if(await r.walletRequestHandler.getAccount(),await r.walletRequestHandler.isSignedIn())if(i&&i.type==="connect"){(!o||o<=0)&&console.log("Failed to set default network on open"),r.notifyOpen({sessionId:r._sessionId});try{const a=await r.walletRequestHandler.promptConnect(i.options);a.connected&&r.walletRequestHandler.notifyConnect(a)}catch(a){ge.warn("promptConnect not connected:",a)}finally{(!i.options||i.options.keepWalletOpened!==!0)&&r.notifyClose()}}else{if(!o||o<=0)return r.notifyOpen({sessionId:r._sessionId,error:`failed to open wallet on network ${s}`}),!1;r.notifyOpen({sessionId:r._sessionId,chainId:`${o}`,session:await r.walletRequestHandler.walletSession(o)})}else return r.notifyOpen({sessionId:r._sessionId}),!0;return!0},this.saveTransportSession=n=>{My().setItem(WT,JSON.stringify(n))},this.getCachedTransportSession=async function(){const n=My().getItem(WT);try{return n?JSON.parse(n):null}catch{return console.error(`unable to parse transport session: ${n}`),null}},this.walletRequestHandler=e,this._init=Wt.NIL,this.walletRequestHandler.on("connect",n=>{this.registered&&this.notifyConnect(n)}),this.walletRequestHandler.on("disconnect",(n,i)=>{this.registered&&this.notifyDisconnect(n,i)}),this.walletRequestHandler.on("accountsChanged",(n,i)=>{this.registered&&this.notifyAccountsChanged(n,i)}),this.walletRequestHandler.on("networks",n=>{this.registered&&(this.notifyNetworks(n),!n||n.length===0?this.notifyChainChanged("0x0"):this.notifyChainChanged(Es(n.find(i=>i.isDefaultChain).chainId)))}),this.walletRequestHandler.on("chainChanged",(n,i)=>{this.notifyChainChanged(n,i)}),this.walletRequestHandler.on("walletContext",n=>{!this.registered||!n||this.notifyWalletContext(n)}),this.walletRequestHandler.on("close",n=>{this.registered&&this.notifyClose(n)})}get registered(){return this._registered}register(){throw new Error("abstract method")}unregister(){throw new Error("abstract method")}sendMessage(e){throw new Error("abstract method")}notifyOpen(e){const{chainId:r,sessionId:n,session:i,error:s}=e;this.sendMessage({idx:-1,type:Ye.OPEN,data:{chainId:r,sessionId:n,session:i,error:s}})}notifyClose(e){this.sendMessage({idx:-1,type:Ye.CLOSE,data:e?{error:e}:null})}notifyConnect(e){this.sendMessage({idx:-1,type:Ye.CONNECT,data:e})}notifyDisconnect(e,r){this.sendMessage({idx:-1,type:Ye.DISCONNECT,data:e?{error:e}:null,origin:r})}notifyAccountsChanged(e,r){this.sendMessage({idx:-1,type:Ye.ACCOUNTS_CHANGED,data:e,origin:r})}notifyChainChanged(e,r){this.sendMessage({idx:-1,type:Ye.CHAIN_CHANGED,data:e,origin:r})}notifyNetworks(e){this.sendMessage({idx:-1,type:Ye.NETWORKS,data:e})}notifyWalletContext(e){this.sendMessage({idx:-1,type:Ye.WALLET_CONTEXT,data:e})}isValidInitAck(e){if(this._init===Wt.OK)return ge.warn("isValidInitAck, already in init'd state, so inquiry is invalid."),!1;if(e.type!==Ye.INIT)return ge.warn("isValidInitAck, invalid message type, expecting init"),!1;const{sessionId:r,nonce:n}=e.data;return!r||r.length===0||!n||n.length===0?(ge.error("invalid init ack"),!1):r!==this._sessionId||n!==this._initNonce?(ge.error("invalid init ack match"),!1):!0}init(){return new Promise((e,r)=>{if(this._init===Wt.OK){e();return}if(this._init!==Wt.NIL||this._initCallback){r("transport init is in progress");return}const n=setTimeout(()=>{ge.warn("transport init timed out"),this._initCallback&&this._initCallback("transport init timed out")},B8/2);this._initCallback=i=>{this._initCallback=void 0,clearTimeout(n),i?r(i):(this._init=Wt.OK,e())},this._initNonce=`${performance.now()}`,this.sendMessage({idx:-1,type:Ye.INIT,data:{nonce:this._initNonce}}),this._init=Wt.SENT_NONCE})}}class Cye{constructor(){const e=new d5,r=new d5;e.conn=r,r.conn=e,this.app=e,this.wallet=r}}class d5{constructor(){this.events=new jb.EventEmitter2,this.handleMessage=e=>{throw new Error("ProxyMessageChannelPort is not registered")},this.sendMessage=e=>{this.conn.handleMessage(e),e.type==="open"&&this.events.emit("open",e),e.type==="close"&&this.events.emit("close",e),e.type==="connect"&&this.events.emit("connect",e),e.type==="disconnect"&&this.events.emit("disconnect",e)}}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}}class SU extends tp{constructor(e){if(super(),this.register=()=>{this.port.handleMessage=r=>{this.handleMessage(r)},this.on("open",(...r)=>{this.port.events.emit("open",...r)}),this.on("close",(...r)=>{this.port.events.emit("close",...r)}),this.on("connect",(...r)=>{this.port.events.emit("connect",...r)}),this.on("disconnect",(...r)=>{this.port.events.emit("disconnect",...r)}),this._registered=!0},this.unregister=()=>{this._registered=!1,this.closeWallet(),this.events.removeAllListeners(),this.port.handleMessage=void 0},this.openWallet=(r,n,i)=>{if(this.state===Ri.CLOSED){this.state=Ri.OPENING;const s=`${performance.now()}`;this._sessionId=s,this.sendMessage({idx:-1,type:Ye.OPEN,data:{path:r,intent:n,networkId:i,sessionId:s}})}},this.state=Ri.CLOSED,this.port=e,!e)throw new Error("port argument cannot be empty");this._init=Wt.OK}closeWallet(){this.sendMessage({idx:-1,type:Ye.CLOSE,data:null}),this.close()}sendMessage(e){if(!e.idx)throw new Error("message idx is empty");this.port.sendMessage(e)}}class Sye extends rp{constructor(e,r){super(e),this.port=r,this._init=Wt.OK}register(){this.port.handleMessage=e=>{this.handleMessage(e)},this._registered=!0}async restoreSession(){const e=await this.getCachedTransportSession();e&&this.open(e)}unregister(){this.port.handleMessage=void 0,this._registered=!1}sendMessage(e){this.port.sendMessage(e)}}function kU(t){var e;if((e=window.ue)!=null&&e.sequencewallettransport&&!window.logsOverriddenForUnreal){var r;const n=(r=window.ue)==null?void 0:r.sequencewallettransport;console.log=(...i)=>{n.logfromjs(`${t}: ${tE(i)}`)},console.warn=(...i)=>{n.warnfromjs(`${t}: ${tE(i)}`)},console.error=(...i)=>{n.errorfromjs(`${t}: ${tE(i)}`)},window.logsOverriddenForUnreal=!0}}function tE(t){return t.map(e=>typeof e=="object"?e instanceof Error?e.message:JSON.stringify(e):String(e)).join(" ")}let bu;class AU extends tp{constructor(e){super(),this.register=()=>{var r;kU("dapp"),bu&&(bu.unregister(),bu=this),(r=window.ue)!=null&&r.sequencewallettransport&&(window.ue.sequencewallettransport.onmessagefromwallet=this.onUnrealCallback),bu=this,this._registered=!0,console.log("registering transport!")},this.unregister=()=>{var r,n;this._registered=!1,this.closeWallet(),bu===this&&(bu=void 0),((r=window.ue)==null||(n=r.sequencewallettransport)==null?void 0:n.onmessagefromwallet)===this.onUnrealCallback&&delete window.ue.sequencewallettransport.onmessagefromwallet,this.events.removeAllListeners()},this.openWallet=(r,n,i)=>{if(this.isOpened()){console.log("wallet already open!");return}console.log("opening wallet!");const s=new URL(this.walletURL.href),o=new ep;r&&(s.pathname=r.toLowerCase()),this._init=Wt.NIL,this._sessionId=`${performance.now()}`,o.set("sid",this._sessionId),n&&o.set("intent",o8(n)),i&&o.set("net",`${i}`),s.search=o.toString(),console.log("opening wallet to",s.href),window.open(s.href)},this.onUnrealCallback=r=>{if(!r)throw new Error("ProviderMessage object is empty");this.handleMessage(r)},this.walletURL=new URL(e)}closeWallet(){this.close()}sendMessage(e){var r,n;const i=typeof e!="string"?JSON.stringify(e):e;console.log("Sending message to wallet:",i),(r=window.ue)==null||(n=r.sequencewallettransport)==null||n.sendmessagetowallet(i)}}class kye extends rp{constructor(e){super(e),this.onMessageFromUnreal=r=>{ge.debug("RECEIVED MESSAGE",r),this.handleMessage(r)},this.getUnrealTransportSession=r=>{const n=new ep(r);return{sessionId:n.get("sid"),networkId:n.get("net"),intent:a8(n.get("intent"))}},this._init=Wt.NIL}async register(e){var r;if(((r=window.ue)==null?void 0:r.sequencewallettransport)===void 0)return;kU("wallet");const{search:n}=new URL(e||window.location.href);let i=this.getUnrealTransportSession(n);if(!!i.sessionId||(i=await this.getCachedTransportSession()),!i){ge.error("unreal session is undefined");return}window.ue.sequencewallettransport.onmessagefromsequencejs=this.onMessageFromUnreal,this._registered=!0,this.open(i).then(o=>{if(!o){var a;const c=`failed to open to network ${(a=i)==null?void 0:a.networkId}`;ge.error(c),this.notifyClose({message:c}),window.close()}}).catch(o=>{var a;const c=`failed to open to network ${(a=i)==null?void 0:a.networkId}, due to: ${o}`;ge.error(c),this.notifyClose({message:c}),window.close()})}unregister(){var e,r;((e=window.ue)==null||(r=e.sequencewallettransport)==null?void 0:r.onmessagefromsequencejs)===this.onMessageFromUnreal&&delete window.ue.sequencewallettransport.onmessagefromsequencejs,this._registered=!1}sendMessage(e){var r,n;if(e.type!==Ye.INIT&&this._init!==Wt.OK){ge.error("impossible state, should not be calling postMessage until inited");return}const i=JSON.stringify(e);(r=window.ue)==null||(n=r.sequencewallettransport)==null||n.sendmessagetosequencejs(i)}}const j8="sequence-extension-message-handler";class Aye extends rp{constructor(e,r){super(e),this.runtime=r,this._init=Wt.OK}register(){this._registered=!0,this.port=this.runtime.connect({name:j8})}sendMessage(e){ge.info("[ExtensionMessageHandler send]",e),this.port.postMessage(e)}}class _U extends tp{constructor(e){super(),this.register=()=>{this._registered=!0},e.onConnect.addListener(r=>{r.name===j8&&(this._init=Wt.OK,r.onMessage.addListener(n=>{this.handleMessage(n)}))})}sendMessage(e){}unregister(){}openWallet(e,r,n){}closeWallet(){}}class _ye extends jb.EventEmitter2{constructor(e){var r;super(),r=this,this.responseCallbacks=new Map,this._messageIdx=0,this.nextMessageIdx=()=>++this._messageIdx,this.handleMessage=n=>{if(!n.type||!n.data)return;ge.info("[received message]",n);const i=n.idx,s=this.responseCallbacks.get(i);switch(i&&this.responseCallbacks.delete(i),n.type){case Ye.MESSAGE:if(s)this.emit(Ye.MESSAGE,n),s(n.data.error,n);else throw new Error("impossible state");break;case Ye.DISCONNECT:case Ye.ACCOUNTS_CHANGED:case Ye.CHAIN_CHANGED:this.emit(n.type,n.data);break;default:console.error("unknown message type",n);break}},this.sendMessageRequest=async function(n){return new Promise((i,s)=>{(!n.idx||n.idx<=0)&&s(new Error("message idx not set"));const o=(c,l)=>{if(c)s(c);else if(l)i(l);else throw new Error("no valid response to return")},{idx:a}=n;r.responseCallbacks.get(a)?s(new Error("duplicate message idx, should never happen")):r.responseCallbacks.set(a,o),r.sendMessage(n)})},this.stream=e,this.stream.on("data",this.handleMessage)}sendMessage(e){this.stream.writable||console.error("window post message stream is not writable"),this.stream.write(e)}}let wu;class PU extends tp{constructor(e){super(),this.register=()=>{wu&&(wu.unregister(),wu=this),window.addEventListener("message",this.onWindowEvent),wu=this,this.on("open",()=>{const r=this.walletWindow,n=setInterval(()=>{r&&r.closed&&(clearInterval(n),this.close())},500)}),this.on("close",()=>{this.walletWindow&&(this.walletWindow.close(),this.walletWindow=null)}),this._registered=!0},this.unregister=()=>{this._registered=!1,this.closeWallet(),wu===this&&(wu=void 0),window.removeEventListener("message",this.onWindowEvent),this.events.removeAllListeners()},this.openWallet=(r,n,i)=>{if(this.walletWindow&&this.isOpened()){this.walletWindow.focus();return}const s=new URL(this.walletURL.href),o=new ep;r&&r!==""&&(s.pathname=r.toLowerCase()),this._init=Wt.NIL,this._sessionId=`${performance.now()}`,o.set("sid",this._sessionId),n&&(n.type==="connect"&&(n.options||(n.options={app:window.location.origin}),!$y()&&!wU()&&n.options&&(n.options.origin=window.location.origin)),o.set("intent",o8(n))),i&&o.set("net",`${i}`);let a,c;$y()?(a=[450,750],c=[Math.abs(window.screen.width/2-a[0]/2),Math.abs(window.screen.height/2-a[1]/2)]):(a=[450,750],c=[Math.abs(window.screenX+window.innerWidth/2-a[0]/2),Math.abs(window.screenY+window.innerHeight/2-a[1]/2)]);const l=`toolbar=0,location=0,menubar=0,scrollbars=yes,status=yes,width=${a[0]},height=${a[1]},left=${c[0]},top=${c[1]}`;s.search=o.toString(),this.walletWindow=window.open(s.href,"sequence.app",l)},this.onWindowEvent=r=>{if(r.origin!==this.walletURL.origin)return;let n;try{n=JSON.parse(r.data)}catch{return}if(!n)throw new Error("ProviderMessage object is empty");this.handleMessage(n)},this.walletURL=new URL(e)}closeWallet(){var e;this.close(),(e=this.walletWindow)==null||e.close()}sendMessage(e){if(!this.walletWindow){ge.warn("WindowMessageProvider: sendMessage failed as walletWindow is unavailable");return}const r=typeof e!="string"?JSON.stringify(e):e;this.walletWindow.postMessage(r,this.walletURL.origin)}}class Pye extends rp{constructor(e){var r;super(e),r=this,this._isPopup=!1,this.onWindowEvent=async function(n){if(!n.origin||n.origin===""||r.appOrigin&&n.origin!==r.appOrigin)return;let i;try{i=JSON.parse(n.data)}catch{return}if(ge.debug("RECEIVED MESSAGE",i),r._init!==Wt.OK&&r.isValidInitAck(i)&&(r.appOrigin=n.origin),r._init===Wt.OK&&(!r.appOrigin||r.appOrigin.length<8)){ge.error("impossible state, init.OK and appOrigin required");return}r.handleMessage(i)},this.getWindowTransportSession=n=>{const i=new ep(n);return{sessionId:i.get("sid"),networkId:i.get("net"),intent:a8(i.get("intent"))}},this._init=Wt.NIL}async register(e){const r=parent.window.opener!==null;if(this._isPopup=r,r!==!0)return;const{pathname:n,search:i}=new URL(e||window.location.href);let s=this.getWindowTransportSession(i);if(!!s.sessionId||(s=await this.getCachedTransportSession()),!s){ge.error("window session is undefined");return}this.parentWindow=parent.window.opener,window.addEventListener("message",this.onWindowEvent,!1),this._registered=!0,this.open(s).then(a=>{if(!a){var c;const l=`failed to open to network ${(c=s)==null?void 0:c.networkId}`;ge.error(l),this.notifyClose({message:l}),window.close()}}).catch(a=>{var c;const l=`failed to open to network ${(c=s)==null?void 0:c.networkId}, due to: ${a}`;ge.error(l),this.notifyClose({message:l}),window.close()})}unregister(){window.removeEventListener("message",this.onWindowEvent),this._registered=!1}sendMessage(e){const r=JSON.stringify(e);e.type===Ye.INIT?this.postMessage(r,!0):this.postMessage(r)}get isPopup(){return this._isPopup}postMessage(e,r=!1){if(r!==!0&&this._init!==Wt.OK){ge.error("impossible state, should not be calling postMessage until inited");return}r?this.parentWindow.postMessage(e,"*"):this.appOrigin&&this.appOrigin.length>4?this.parentWindow.postMessage(e,this.appOrigin):ge.error("unable to postMessage as parentOrigin is invalid")}}function TU(t){return t&&typeof t=="object"&&(t.windowTransport&&typeof t.windowTransport=="object"||t.proxyTransport&&typeof t.proxyTransport=="object"||t.extensionTransport&&typeof t.extensionTransport=="object"||t.unrealTransport&&typeof t.unrealTransport=="object")&&(t.windowTransport&&t.windowTransport.enabled||t.proxyTransport&&t.proxyTransport.enabled||t.extensionTransport&&t.extensionTransport.enabled||t.unrealTransport&&t.unrealTransport.enabled)}class zb{constructor(...e){var r=this;this.register=()=>{if(this.messageProviders.length===1){this.provider=this.messageProviders[0],this.provider.register();return}this.messageProviders.forEach(n=>{n.register(),n.once("open",()=>{this.provider||(this.provider=n,this.messageProviders.forEach(i=>{this.provider!==i&&i.unregister()}))})})},this.unregister=()=>{this.messageProviders.forEach(n=>n.unregister()),this.provider=void 0},this.openWallet=(n,i,s)=>{if(this.provider){this.provider.openWallet(n,i,s);return}this.messageProviders.forEach(o=>o.openWallet(n,i,s))},this.sendAsync=async function(n,i,s){if(r.provider){r.provider.sendAsync(n,i,s);return}throw new Error("impossible state, wallet must be opened first")},this.sendMessageRequest=async function(n){if(r.provider)return r.provider.sendMessageRequest(n);throw new Error("impossible state, wallet must be opened first")},this.waitUntilOpened=async function(){return r.provider?r.provider.waitUntilOpened():Promise.race(r.messageProviders.map(n=>n.waitUntilOpened()))},this.waitUntilConnected=async function(){if(r.provider)return r.provider.waitUntilConnected();throw new Error("impossible state, wallet must be opened first")},this.messageProviders=e,this.provider=void 0}static new(e){var r,n,i,s;const o=new zb;if((r=e.windowTransport)!=null&&r.enabled&&typeof window=="object"&&e.walletAppURL){const a=new PU(e.walletAppURL);o.add(a)}if((n=e.proxyTransport)!=null&&n.enabled){const a=new SU(e.proxyTransport.appPort);o.add(a)}if((i=e.extensionTransport)!=null&&i.enabled){const a=new _U(e.extensionTransport.runtime);o.add(a)}if((s=e.unrealTransport)!=null&&s.enabled&&e.windowTransport&&e.walletAppURL){const a=new AU(e.walletAppURL);o.add(a)}return o.register(),o}add(...e){this.messageProviders.push(...e)}closeWallet(){this.provider&&this.provider.closeWallet()}isOpened(){return this.provider?this.provider.isOpened():!1}isConnected(){return this.provider?this.provider.isConnected():!1}on(e,r){if(this.provider){this.provider.on(e,r);return}this.messageProviders.forEach(n=>{n.on(e,r)})}once(e,r){if(this.provider){this.provider.once(e,r);return}this.messageProviders.forEach(n=>{n.once(e,r)})}emit(e,...r){if(this.provider)return this.provider.emit(e,...r);for(let n=0;nOye(t,i))}function Oye(t,e){if(e.to.toLowerCase()===t.toLowerCase()&&e.data){const r=re(e.data);if(r.length>=4&&!Rye(r))throw new Error("self calls are forbidden")}if(e.delegateCall)throw new Error("delegate calls are forbidden")}function Rye(t){const e=new jr(rn.mainModule.abi);try{return e.decodeFunctionData("createContract",t),!0}catch{return!1}}const $ye=1e4;class Mye{constructor(e,r,n){var i=this;this.signerReadyCallbacks=[],this.events=new jb.EventEmitter2,this.onConnectOptionsChange=void 0,this.promptConnect=async function(s){if(!s&&!i._connectOptions)throw new Error("prompter connect options are empty");if(!i.prompter)return i.connect(s);const o=await i.prompter.promptConnect(s||i._connectOptions).catch(c=>({connected:!1})),a=o;return a.connected&&!a.session&&(a.session=await i.walletSession(s==null?void 0:s.networkId)),o},this.sendAsync=async function(s,o,a){const c={jsonrpc:"2.0",id:s.id,result:null};await i.getAccount();try{var l;if((!i.account||i.account===null)&&!Nye.includes(s.method))throw vU;const f=i.account;if(!f)throw new Error("WalletRequestHandler: wallet account is not configured");const d=(l=i.account)==null?void 0:l.providerFor(a??i.defaultChainId());if(!d)throw new Error(`WalletRequestHandler: wallet provider is not configured for chainId ${a}`);const h=d instanceof Ko?d:void 0;switch(s.method){case"net_version":{if(!h)throw new Error("Account provider doesn't support send method");const p=await h.send("net_version",[]);c.result=p;break}case"eth_chainId":{if(!h)throw new Error("Account provider doesn't support send method");const p=await h.send("eth_chainId",[]);c.result=p;break}case"eth_accounts":{const p=f.address;c.result=[p];break}case"eth_getBalance":{const[p,v]=s.params,b=await d.getBalance(p,v);c.result=b.toHexString();break}case"sequence_sign":case"personal_sign":case"eth_sign":{let p;switch(s.method){case"sequence_sign":case"personal_sign":{const[m,g]=s.params;p=m;break}case"eth_sign":{const[m,g]=s.params;p=g;break}}let v="";const b=Ub(p),y=s.method==="sequence_sign";if(i.prompter===null?v=await f.signMessage(b,a??i.defaultChainId(),y?"eip6492":"ignore"):v=await i.prompter.promptSignMessage({chainId:a,message:b,eip6492:y},i.connectOptions),v&&v.length>0)c.result=v;else throw new Error("declined by user");break}case"sequence_signTypedData_v4":case"eth_signTypedData":case"eth_signTypedData_v4":{const[p,v]=s.params;let b;if(typeof v=="string")try{b=JSON.parse(v)}catch(g){console.warn("walletRequestHandler: error parsing typedData",g)}else b=v;if(!b||!b.domain||!b.types||!b.message)throw new Error("invalid typedData object");let y="";const m=s.method==="sequence_signTypedData_v4";if(i.prompter===null?y=await f.signTypedData(b.domain,b.types,b.message,a??i.defaultChainId(),m?"eip6492":"ignore"):y=await i.prompter.promptSignMessage({chainId:a,typedData:b,eip6492:m},i.connectOptions),y&&y.length>0)c.result=y;else throw new Error("declined by user");break}case"eth_sendTransaction":{const p=Iye(s.params[0]).map(b=>("gas"in b&&b.gasLimit===void 0&&(b.gasLimit=b.gas,delete b.gas),b));HT(f.address,p);let v="";if(i.prompter===null){var u;const b=await f.sendTransaction(p,a??i.defaultChainId());v=(u=b==null?void 0:b.hash)!=null?u:""}else v=await i.prompter.promptSendTransaction(p,a,i.connectOptions);if(v)c.result=v;else throw new Error("declined by user");break}case"eth_signTransaction":{const[p]=s.params;if(Ve(p.from)!==f.address)throw new Error("sender address does not match wallet");HT(f.address,p),i.prompter===null?c.result=await f.signTransactions(p,a??i.defaultChainId()):c.result=await i.prompter.promptSignTransaction(p,a,i.connectOptions);break}case"eth_sendRawTransaction":{if(he.transaction.isSignedTransactionBundle(s.params[0])){const p=J.from(s.params[0].chainId).toNumber(),v=await f.relayer(p).relay(s.params[0]);c.result=v.hash}else{const p=await d.sendTransaction(s.params[0]);c.result=p.hash}break}case"eth_getTransactionCount":{const p=Ve(s.params[0]),v=s.params[1],b=await d.getTransactionCount(p,v);c.result=J.from(b).toHexString();break}case"eth_blockNumber":{c.result=await d.getBlockNumber();break}case"eth_getBlockByNumber":{c.result=await d.getBlock(s.params[0]);break}case"eth_getBlockByHash":{c.result=await d.getBlock(s.params[0]);break}case"eth_getTransactionByHash":{c.result=await d.getTransaction(s.params[0]);break}case"eth_call":{const[p,v]=s.params;c.result=await d.call(p,v);break}case"eth_getCode":{const[p,v]=s.params;c.result=await d.getCode(p,v);break}case"eth_estimateGas":{const[p]=s.params;c.result=await d.estimateGas(p);break}case"eth_gasPrice":{const p=await d.getGasPrice();c.result=p.toHexString();break}case"wallet_switchEthereumChain":{const[p]=s.params;if(!p.chainId||p.chainId.length===0)throw new Error("invalid chainId");const v=J.from(p.chainId);i.setDefaultChainId(v.toNumber()),c.result=null;break}case"sequence_getWalletContext":{c.result=f.contexts;break}case"sequence_getWalletConfig":{const[p]=s.params;p?c.result=[(await f.status(p)).onChain.config]:c.result=await Promise.all(f.networks.map(async function(v){return(await f.status(v.chainId)).onChain.config}));break}case"sequence_getWalletState":{const[p]=s.params;p?c.result=[qT(p,await f.status(p))]:c.result=await Promise.all(f.networks.map(async function(v){const b=await f.status(v.chainId);return qT(v.chainId,b)}));break}case"sequence_getNetworks":{c.result=await i.getNetworks(!0);break}case"sequence_isSequence":{c.result=!0;break}case"sequence_updateConfig":throw new Error("sequence_updateConfig method is not allowed from a dapp");case"sequence_publishConfig":throw new Error("sequence_publishConfig method is not allowed from a dapp");case"sequence_gasRefundOptions":break;case"sequence_getNonce":break;case"sequence_relay":break;case"sequence_setDefaultNetwork":{const[p]=s.params;if(!p)throw new Error("invalid request, method argument defaultChainId cannot be empty");i.setDefaultChainId(p),c.result=await i.getNetworks(!0);break}default:{if(!h)throw new Error("Account provider doesn't support send method");const p=await h.send(s.method,s.params);c.result=p}}}catch(f){ge.error(f),c.result=null,c.error=Jn({},new Error(f),{code:4001})}o(void 0,c)},this.isSignedIn=async function(){return await i.signerReady(),!!i.account},this.getAccount=async function(){if(await i.signerReady(),i.account===void 0)throw new Error("signerReady failed resolve");return i.account},this.account=e,this.prompter=r,this.networks=n}defaultChainId(){var e,r;return(e=(r=this.prompter)==null?void 0:r.getDefaultChainId())!=null?e:this.networks[0].chainId}async signIn(e,r={}){this.setAccount(e);const{connect:n,defaultNetworkId:i}=r;if(n){const a=this._connectOptions;let c;if(this.prompter!==null){var s;c=await((s=this.prompter)==null?void 0:s.promptSignInConnect(a))}else c=await this.connect(a);this.notifyConnect(c),(!a||a.keepWalletOpened!==!0)&&this.notifyClose()}if(i&&this.defaultChainId()!==i){var o;await((o=this.prompter)==null?void 0:o.promptChangeNetwork(i))}}signOut(){this.setAccount(null)}signerReset(){this.account=void 0}signerReady(e=$ye){return new Promise((r,n)=>{this.account!==void 0?r():(setTimeout(()=>{this.account===void 0&&(this.signerReadyCallbacks=[],n("signerReady timed out"))},e),this.signerReadyCallbacks.push(r))})}async connect(e){var r,n;if(!this.account)return{connected:!1,chainId:"0x0",error:"unable to connect without signed in account"};const i=(r=(n=e==null?void 0:e.networkId)!=null?n:this.defaultChainId())!=null?r:ce.MAINNET,s=d8(i).chainId,o={connected:!0,chainId:Es(s)};if(e&&e.authorize){const a={app:e.app,origin:e.origin,expiry:e.expiry,nonce:e.authorizeNonce};try{o.proof=await nU(this.account,s,a)}catch(c){return ge.warn(`connect, signAuthorization failed for options: ${JSON.stringify(e)}, due to: ${c.message}`),{connected:!1,chainId:"0x0",error:`signAuthorization failed: ${c.message}`}}}return o.session=this.walletSession(s),o}sendMessageRequest(e){return new Promise(r=>{this.sendAsync(e.data,(n,i)=>{const s=Jn({},e,{data:i});r(s)},e.chainId)})}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}async getAddress(){var e,r;return(e=(r=this.account)==null?void 0:r.address)!=null?e:""}get openIntent(){return this._openIntent}setOpenIntent(e){this._openIntent=e}get connectOptions(){return this._connectOptions}setConnectOptions(e){var r;this._connectOptions=e,(r=this.onConnectOptionsChange)==null||r.call(this,e)}async setDefaultChainId(e){var r;return await((r=this.prompter)==null?void 0:r.promptChangeNetwork(e)),this.defaultChainId()}async getNetworks(e){return this.account?e?this.account.networks.map(r=>{const n=Jn({},r);return n.provider=void 0,n.relayer=void 0,n}):this.account.networks:(ge.warn("signer not set: getNetworks is returning an empty list"),[])}walletSession(e){if(!this.account)return;const r={walletContext:this.account.contexts,accountAddress:this.account.address,networks:this.account.networks.map(i=>Jn({},i,{provider:void 0,relayer:void 0}))};if(e){const i=xs(r.networks,e);if(i){var n;(n=r.networks)==null||n.forEach(s=>delete s.isDefaultChain),i.isDefaultChain=!0}}return r}notifyConnect(e,r){var n;if(console.log("emit connect",e),this.events.emit("connect",e),(n=e.session)!=null&&n.accountAddress){var i;this.events.emit("accountsChanged",[(i=e.session)==null?void 0:i.accountAddress],r)}}notifyDisconnect(e){this.events.emit("accountsChanged",[],e),this.events.emit("disconnect",void 0,e)}notifyChainChanged(e,r){this.events.emit("chainChanged",Es(e),r)}async notifyNetworks(e){const r=e||await this.getNetworks(!0);if(this.events.emit("networks",r),r.length>0){const n=r.find(i=>i.chainId===this.defaultChainId());n&&this.events.emit("chainChanged",Es(n.chainId))}else this.events.emit("chainChanged","0x0")}async notifyWalletContext(){if(!this.account){ge.warn("signer not set: skipping to notify wallet context");return}const e=this.account.contexts;this.events.emit("walletContext",e)}notifyClose(e){this.events.emit("close",e)}setAccount(e){if(this.account=e,e!==void 0){for(let r=0;rc.canOnchainValidate||c.original.version===2&&n,o=await r.status(i);if(s(o))return!0;if(await e.promptConfirmWalletDeploy(i,this.connectOptions)){const c=await r.status(i);return s(c)?!0:(ge.error("WalletRequestHandler: result for promptConfirmWalletDeploy is not correct"),!1)}return!1}}function qT(t,e){return{context:e.original.context,config:e.onChain.config,address:he.context.addressOf(e.original.context,e.original.imageHash),chainId:t,deployed:e.onChain.deployed,imageHash:e.imageHash,lastImageHash:e.onChain.imageHash,published:!0,status:e}}const Nye=["net_version","eth_chainId","eth_getBalance","eth_getTransactionCount","eth_blockNumber","eth_getBlockByNumber","eth_getBlockByHash","eth_getTransactionByHash","eth_getCode","eth_estimateGas","eth_gasPrice","sequence_getWalletContext","sequence_getNetworks","sequence_setDefaultNetwork"];class _d{get utils(){return this.provider.utils}constructor(e,r){this.singleNetworkSigners={},this._isSigner=!0,this._isSequenceSigner=!0,this.client=e,this.provider=r}async getAddress(){return this.client.getAddress()}connect(e){if(!Pd.is(e))throw new Error("SequenceSigner can only be connected to a SequenceProvider");return new _d(this.client,e)}getSigner(e){if(!e)return this;const r=this.provider.toChainId(e);return this.singleNetworkSigners[r]||(this.singleNetworkSigners[r]=new U8(this.client,this.provider,r)),this.singleNetworkSigners[r]}useChainId(e){return this.provider.toChainId(e)||this.client.getChainId()}async signMessage(e,r){const{eip6492:n=!0}=r||{},i=this.useChainId(r==null?void 0:r.chainId);return this.client.signMessage(e,{eip6492:n,chainId:i})}async signTypedData(e,r,n,i){const{eip6492:s=!0}=i||{},o=this.useChainId(i==null?void 0:i.chainId);return this.client.signTypedData({domain:e,types:r,message:n},{eip6492:s,chainId:o})}getProvider(e){return this.provider.getProvider(e)}async sendTransaction(e,r){const n=this.useChainId(r==null?void 0:r.chainId),i=await CU(e),s=await this.client.sendTransaction(i,{chainId:n}),o=this.getProvider(n);try{return await Wa(async function(){const a=await o.getTransaction(s);return a?o._wrapTransaction(a,s):void 0},{onceBlock:o})}catch(a){throw a.transactionHash=s,a}}async getWalletConfig(e){const r=this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}getNetworks(){return this.client.getNetworks()}async getBalance(e,r){return this.getProvider(r==null?void 0:r.chainId).getBalance(this.getAddress(),e)}async estimateGas(e,r){return this.getProvider(r==null?void 0:r.chainId).estimateGas(e)}async call(e,r,n){return this.getProvider(n==null?void 0:n.chainId).call(e,r)}getChainId(){return Promise.resolve(this.client.getChainId())}async getGasPrice(e){return this.getProvider(e==null?void 0:e.chainId).getGasPrice()}async getFeeData(e){return this.getProvider(e==null?void 0:e.chainId).getFeeData()}async resolveName(e){const r=await this.provider.resolveName(e);if(r===null)throw new Error(`ENS name not found: ${e}`);return r}_checkProvider(e){}populateTransaction(e){throw new Error("SequenceSigner does not support populateTransaction")}checkTransaction(e){throw new Error("SequenceSigner does not support checkTransaction")}getTransactionCount(e){throw new Error("SequenceSigner does not support getTransactionCount")}signTransaction(e){throw new Error("SequenceWallet does not support signTransaction, use sendTransaction instead.")}static is(e){return e&&typeof e=="object"&&e._isSequenceSigner===!0}}class U8 extends _d{constructor(e,r,n){super(e,r.getProvider(n)),this._isSingleNetworkSequenceSigner=!0,this.chainId=n}_useChainId(e){const r=this.provider.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This signer only supports the network ${this.chainId}, but ${r} was requested.`);return r||this.provider.toChainId(this.chainId)}useChainId(e){return this._useChainId(e)}getChainId(){return Promise.resolve(this.provider.toChainId(this.chainId))}getProvider(e){return super.getProvider(this._useChainId(e))}getSigner(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceSigner===!0}}class Dye{constructor(e){if(this.signer=e,U8.is(e))throw new Error("WalletUtils does not support SingleNetworkSequenceSigner")}signMessage(e,r,n){return this.signer.signMessage(e,{chainId:r,eip6492:n})}signTypedData(e,r,n,i,s){return this.signer.signTypedData(e,r,n,{chainId:i,eip6492:s})}async isValidSignature(e,r,n,i){return Qf(e,r,n,this.signer.getProvider(i))}async isValidMessageSignature(e,r,n,i){const s=this.signer.getProvider(i),o=Ub(r),a=c8(o);return Qf(e,a,n,s)}isValidTypedDataSignature(e,r,n,i){return this.isValidSignature(e,Q1(r),n,i)}}class Pd extends Og{constructor(e,r,n=Vf){super(e.getChainId()),this.singleNetworkProviders={},this._isSequenceProvider=!0,this.client=e,this.providerFor=r,this.networks=n,e.onConnect(i=>{this.emit("connect",i)}),e.onDisconnect(i=>{this.emit("disconnect",i)}),e.onDefaultChainIdChanged(i=>{this.emit("chainChanged",i)}),e.onAccountsChanged(i=>{this.emit("accountsChanged",i)}),this.signer=new _d(this.client,this),this.utils=new Dye(this.signer)}getSigner(e){return this.signer.getSigner(e)}connect(e){return this.client.connect(e)}disconnect(){return this.client.disconnect()}isConnected(){return this.client.isConnected()}getSession(){return this.client.getSession()}listAccounts(){return[this.client.getAddress()]}getAddress(){return this.client.getAddress()}getNetworks(){return this.client.getNetworks()}getChainId(){return this.client.getChainId()}setDefaultChainId(e){return this.client.setDefaultChainId(this.toChainId(e))}isOpened(){return this.client.isOpened()}closeWallet(){return this.client.closeWallet()}getWalletContext(){return this.client.getWalletContext()}async getWalletConfig(e){const r=await this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}authorize(e){return this.client.connect(Jn({},e,{authorize:!0}))}async openWallet(e,r){return await this.client.openWallet(e,r),!0}toChainId(e){if(e===void 0)return;const r=xs(this.networks,e);if(!r)throw new Error(`Unsupported network ${e}`);return r.chainId}async useChainId(e){return this.toChainId(e)||this.client.getChainId()}getProvider(e){if(!e)return this;const r=this.toChainId(e);return this.singleNetworkProviders[r]||(this.singleNetworkProviders[r]=new OU(this.client,this.providerFor,r)),this.singleNetworkProviders[r]}async _getSubprovider(e){const r=await this.useChainId(e),n=this.providerFor(r);if(!n)throw new Error(`Unsupported network ${r}`);return n}async perform(e,r){var n;if(e==="eth_chainId")return Es(await this.useChainId());if(e==="eth_accounts")return[this.client.getAddress()];if(e==="wallet_switchEthereumChain"){const o=r[0],a=IU(o);return this.setDefaultChainId(a)}if(e==="eth_sendTransaction"||e==="eth_sign"||e==="eth_signTypedData"||e==="eth_signTypedData_v4"||e==="personal_sign"||e==="sequence_sign"||e==="sequence_signTypedData_v4")return this.client.send({method:e,params:r},this.getChainId());const i=await this._getSubprovider(),s=(n=i.prepareRequest(e,r))!=null?n:[e,r];return i.send(s[0],s[1])}send(e,r){return this.perform(e,r)}request(e){return this.perform(e.method,e.params)}async detectNetwork(){const e=this.client.getChainId(),r=xs(this.networks,e);if(!r)throw new Error(`Unknown network ${e}`);return r}async waitForTransaction(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).waitForTransaction(e,r,n)}async getBlockNumber(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getBlockNumber()}async getGasPrice(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getGasPrice()}async getBalance(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getBalance(e,r)}async getTransactionCount(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getTransactionCount(e,r)}async getCode(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getCode(e,r)}async getStorageAt(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).getStorageAt(e,r,n)}async call(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).call(e,r)}async estimateGas(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).estimateGas(e)}async getBlock(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getBlock(e)}async getTransaction(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getTransaction(e)}async getLogs(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getLogs(e)}async supportsENS(){return(await this.getNetworks()).some(r=>r.chainId===1)}async getResolver(e){return await this.supportsENS()?(await this._getSubprovider(1)).getResolver(e):null}async resolveName(e){return UR(await e)?e:await this.supportsENS()?(await this._getSubprovider(1)).resolveName(e):null}async lookupAddress(e){return await this.supportsENS()?(await this._getSubprovider(1)).lookupAddress(e):null}async getAvatar(e){return await this.supportsENS()?(await this._getSubprovider(1)).getAvatar(e):null}}Pd.is=t=>t&&typeof t=="object"&&t._isSequenceProvider===!0;function IU(t){return typeof t=="object"?IU(t.chainId):J.from(t).toNumber()}class OU extends Pd{constructor(e,r,n){super(e,r),this._isSingleNetworkSequenceProvider=!0,this.chainId=n}_useChainId(e){const r=this.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This provider only supports the network ${this.chainId}, but ${r} was requested.`);return r||super.toChainId(this.chainId)}useChainId(e){return Promise.resolve(this._useChainId(e))}getChainId(){return super.toChainId(this.chainId)}async getNetwork(){const e=await this.client.getNetworks(),r=xs(e,this.chainId);if(!r)throw new Error(`Unsupported network ${this.chainId}`);return r}getProvider(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}getSigner(e){return super.getSigner(this._useChainId(e))}setDefaultChainId(e){throw new Error(`This provider only supports the network ${this.chainId}; use the parent provider to switch networks.`)}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceProvider===!0}}var Lye={name:"@0xsequence/provider",version:"1.4.9",description:"provider sub-package for Sequence",repository:"https://github.com/0xsequence/sequence.js/tree/master/packages/provider",source:"src/index.ts",main:"dist/0xsequence-provider.cjs.js",module:"dist/0xsequence-provider.esm.js",author:"Horizon Blockchain Games",license:"Apache-2.0",scripts:{test:"pnpm test:concurrently 'pnpm test:run'","test:run":"pnpm test:file tests/**/*.spec.ts","test:file":"NODE_OPTIONS='--loader tsx' mocha --timeout 30000",typecheck:"tsc --noEmit","test:concurrently":"concurrently -k --success first 'pnpm start:hardhat1' 'pnpm start:hardhat2'","start:hardhat1":"pnpm start:hardhat1:verbose > /dev/null 2>&1","start:hardhat2":"pnpm start:hardhat2:verbose > /dev/null 2>&1","start:hardhat1:verbose":"hardhat node --config hardhat1.config.js --hostname 0.0.0.0 --port 9595","start:hardhat2:verbose":"hardhat node --config hardhat2.config.js --hostname 0.0.0.0 --port 8595"},dependencies:{"@0xsequence/abi":"workspace:*","@0xsequence/account":"workspace:*","@0xsequence/auth":"workspace:*","@0xsequence/core":"workspace:*","@0xsequence/migration":"workspace:*","@0xsequence/network":"workspace:*","@0xsequence/relayer":"workspace:*","@0xsequence/utils":"workspace:*","@0xsequence/wallet":"workspace:*",eventemitter2:"^6.4.5","webextension-polyfill":"^0.10.0"},peerDependencies:{ethers:">=5.5 < 6"},devDependencies:{"@types/webextension-polyfill":"^0.10.0",hardhat:"^2.12.2",ethers:"^5.7.2"},files:["src","dist"]};class Sl{constructor(e){this.store=e}connectedSession(){const e=this.getSession();if(e&&e.accountAddress&&e.walletContext&&e.networks)return{accountAddress:e.accountAddress,walletContext:e.walletContext,networks:e.networks};throw new Error("Sequence session not connected")}hasSession(){var e;return((e=this.getSession())==null?void 0:e.accountAddress)!==void 0}setSession(e){return this.store.setItem(Sl.SESSION_LOCALSTORE_KEY,JSON.stringify(e))}getSession(){const e=this.store.getItem(Sl.SESSION_LOCALSTORE_KEY);if(e)return JSON.parse(e)}async clearSession(){return this.store.removeItem(Sl.SESSION_LOCALSTORE_KEY)}}Sl.SESSION_LOCALSTORE_KEY="@sequence.session";class kl{constructor(e,r=1){this.callbacks=[],this.store=e,this.startingChainId=r,e.onItemChange(kl.SESSION_CHAIN_ID_KEY,n=>{if(n){const i=parseInt(n);this.callbacks.forEach(s=>s(i))}})}onDefaultChainIdChanged(e){return this.callbacks.push(e),()=>{this.callbacks=this.callbacks.filter(r=>r!==e)}}setDefaultChainId(e){e!==this.getDefaultChainId()&&this.store.setItem(kl.SESSION_CHAIN_ID_KEY,e.toString())}getDefaultChainId(){const e=this.store.getItem(kl.SESSION_CHAIN_ID_KEY);return!e||e.length===0?this.startingChainId:parseInt(e)}}kl.SESSION_CHAIN_ID_KEY="@sequence.session.defaultChainId";class z8{constructor(e,r,n,i){var s;if(this.callbacks={},this.projectAccessKey=i,TU(e))this.transport=zb.new(e);else if(hU(e))this.transport=e;else throw new Error("Invalid transport");const o=typeof n=="number"?n:n==null?void 0:n.defaultChainId;this.defaultEIP6492=typeof n=="number"?!1:(s=n==null?void 0:n.defaultEIP6492)!=null?s:!1,this.session=new Sl(r),this.defaultChainId=new kl(r,o),this.transport.on("accountsChanged",a=>{var c;a.length>1&&console.warn("SequenceClient: wallet-webapp returned more than one account"),(c=this.callbacks.accountsChanged)==null||c.forEach(l=>l(a))}),this.transport.on("connect",a=>{var c;const l=Es(this.getChainId());(c=this.callbacks.connect)==null||c.forEach(u=>u(Jn({},a,{chainId:l})))}),this.transport.on("disconnect",(a,c)=>{var l;(l=this.callbacks.disconnect)==null||l.forEach(u=>u(a,c))}),this.transport.on("networks",a=>{var c;(c=this.callbacks.networks)==null||c.forEach(l=>l(a))}),this.transport.on("walletContext",a=>{var c;(c=this.callbacks.walletContext)==null||c.forEach(l=>l(a))}),this.transport.on("open",a=>{var c;(c=this.callbacks.open)==null||c.forEach(l=>l(a))}),this.transport.on("close",()=>{var a;(a=this.callbacks.close)==null||a.forEach(c=>c())}),this.transport.on("chainChanged",(a,c)=>{var l;(l=this.callbacks.chainChanged)==null||l.forEach(u=>u(a,c))}),this.defaultChainId.onDefaultChainIdChanged(a=>{var c;const l=Es(a);(c=this.callbacks.chainChanged)==null||c.forEach(u=>u(l))})}registerCallback(e,r){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(r),()=>{this.callbacks[e]=this.callbacks[e].filter(n=>n!==r)}}onOpen(e){return this.registerCallback("open",e)}onClose(e){return this.registerCallback("close",e)}onConnect(e){return this.registerCallback("connect",e)}onDisconnect(e){return this.registerCallback("disconnect",e)}onNetworks(e){return this.registerCallback("networks",e)}onAccountsChanged(e){return this.registerCallback("accountsChanged",e)}onWalletContext(e){return this.registerCallback("walletContext",e)}onChainChanged(e){return this.registerCallback("chainChanged",e)}onDefaultChainIdChanged(e){return this.registerCallback("chainChanged",e)}getChainId(){return this.defaultChainId.getDefaultChainId()}setDefaultChainId(e){return this.defaultChainId.setDefaultChainId(e)}async openWallet(e,r){return this.transport.openWallet(e,r,this.getChainId()),await this.transport.waitUntilOpened(),this.isOpened()}closeWallet(){return this.transport.closeWallet()}isOpened(){return this.transport.isOpened()}isConnected(){return this.session.hasSession()}getSession(){return this.session.getSession()}getAddress(){return this.session.connectedSession().accountAddress}async connect(e){if((e==null?void 0:e.authorizeVersion)===void 0&&(e.authorizeVersion=2),(e==null?void 0:e.refresh)===!0&&this.disconnect(),e.projectAccessKey=this.projectAccessKey,e&&e.authorize){if(!e.app)throw new Error("connecting with 'authorize' option also requires 'app' to be set");e.authorizeVersion===void 0&&(e.authorizeVersion=2)}await this.openWallet(void 0,{type:"connect",options:Jn({},e,{networkId:this.getChainId(),clientVersion:Lye.version})});const r=await this.transport.waitUntilConnected().catch(n=>n instanceof Error?{connected:!1,error:n.message}:{connected:!1,error:JSON.stringify(n)});if(r.chainId&&(r.chainId=J.from(r.chainId).toString()),r.connected){if(!r.session)throw new Error("impossible state, connect response is missing session");this.session.setSession(r.session)}return r}disconnect(){return this.isOpened()&&this.closeWallet(),this.session.clearSession()}send(e,r){return e.method=this.mapSignMethod(e.method),new Promise((n,i)=>{this.transport.sendAsync(e,(s,o)=>{s?i(s):o===void 0?i(new Error(`Got undefined response for request: ${e}`)):typeof o=="object"&&o.error?i(o.error):typeof o=="object"&&o.result?n(o.result):i(new Error(`Got invalid response for request: ${e}`))},r||this.getChainId())})}async getNetworks(e){const r=this.session.connectedSession();return e&&(r.networks=await this.send({method:"sequence_getNetworks"}),this.session.setSession(r)),r.networks}signMethod(e){return(e==null?void 0:e.eip6492)===void 0?"personal_sign":e.eip6492?"sequence_sign":"legacy_sign"}signTypedDataMethod(e){return(e==null?void 0:e.eip6492)===void 0?"eth_signTypedData_v4":e.eip6492?"sequence_signTypedData_v4":"legacy_signTypedData_v4"}mapSignMethod(e){return e==="personal_sign"?this.defaultEIP6492?"sequence_sign":"personal_sign":e==="eth_signTypedData_v4"?this.defaultEIP6492?"sequence_signTypedData_v4":"eth_signTypedData_v4":e==="legacy_sign"?"personal_sign":e==="legacy_signTypedData_v4"?"eth_signTypedData_v4":e}async signMessage(e,r){const n=this.signMethod(r);return this.send({method:n,params:[e,this.getAddress()]},r==null?void 0:r.chainId)}async signTypedData(e,r){const n=this.signTypedDataMethod(r),i=qr.getPayload(e.domain,e.types,e.message);return this.send({method:n,params:[this.getAddress(),i]},(r==null?void 0:r.chainId)||e.domain.chainId&&J.from(e.domain.chainId).toNumber()||this.getChainId())}async sendTransaction(e,r){const n=Array.isArray(e)?e:[e],i=Tye(n);return this.send({method:"eth_sendTransaction",params:[i]},r==null?void 0:r.chainId)}async getWalletContext(){return this.send({method:"sequence_getWalletContext"})}async getOnchainWalletConfig(e){const r=await this.send({method:"sequence_getWalletConfig",params:[(e==null?void 0:e.chainId)||this.getChainId()]},e==null?void 0:e.chainId);return Array.isArray(r)?r[0]:r}}const h5={transports:{walletAppURL:"https://sequence.app",windowTransport:{enabled:!0},proxyTransport:{enabled:!1}},defaultNetwork:1};let Js;const RU=t=>{var e,r,n;const i=t==null?void 0:t.projectAccessKey;if(i||console.warn("Please pass a projectAccessKey in initWallet config as it will be required in near future."),Js)return Js;const s=Jn({},h5,t,{transports:Jn({},h5.transports,t==null?void 0:t.transports)}),o={},a=(e=(r=s.networks)==null?void 0:r.filter(h=>{h.rpcUrl!==void 0&&h.chainId!==void 0&&Vf.find(p=>p.chainId===h.chainId)}))!=null?e:[],c=Vf.map(h=>{var p;const v=(p=s.networks)==null?void 0:p.find(b=>b.chainId===h.chainId);return v?Jn({},h,v):h}).concat(a).map(h=>{const p=i?`/${i}`:"";return h.rpcUrl=h.rpcUrl+p,h}),l=h=>{if(!o[h]){var p;const v=(p=c.find(m=>m.chainId===h))==null?void 0:p.rpcUrl;if(!v)throw new Error(`no rpcUrl found for chainId: ${h}`);const b=new Ko(v),y=new h8([YB,QB,new p8],new xy(b));o[h]=new tM(y,h)}return o[h]},u=s.defaultNetwork?(n=xs(c,s.defaultNetwork))==null?void 0:n.chainId:void 0;if(!u&&s.defaultNetwork)throw new Error(`defaultNetwork not found for chainId: ${s.defaultNetwork}`);const f=s.localStorage||My(),d=new z8(s.transports,f,{defaultChainId:u,defaultEIP6492:s.defaultEIP6492},i);return Js=new Pd(d,l),Js},$U=()=>{Js&&(Js.client.closeWallet(),Js.client.transport.unregister(),Js=void 0)},MU=()=>{if(!Js)throw new Error("Wallet has not been initialized, call sequence.initWallet(config) first.");return Js},Fye=Object.freeze(Object.defineProperty({__proto__:null,BaseInjectedTransport:_ye,BaseProviderTransport:tp,BaseWalletTransport:rp,CHANNEL_ID:j8,DefaultChainIdTracker:kl,DefaultProviderConfig:h5,ErrSignedInRequired:vU,EventType:Ye,ExtensionMessageHandler:Aye,ExtensionMessageProvider:_U,InitState:Wt,LocalStorage:c1,MemoryItemStore:xU,MuxMessageProvider:zb,OpenState:Ri,PROVIDER_OPEN_TIMEOUT:B8,ProviderError:pU,ProxyMessageChannel:Cye,ProxyMessageChannelPort:d5,ProxyMessageHandler:Sye,ProxyMessageProvider:SU,SequenceClient:z8,SequenceClientSession:Sl,SequenceProvider:Pd,SequenceSigner:_d,SingleNetworkSequenceProvider:OU,SingleNetworkSequenceSigner:U8,UnrealMessageHandler:kye,UnrealMessageProvider:AU,WalletRequestHandler:Mye,WindowMessageHandler:Pye,WindowMessageProvider:PU,WindowSessionParams:ep,getWallet:MU,initWallet:RU,isBrowserExtension:$y,isMuxTransportTemplate:TU,isProviderTransport:hU,isUnityPlugin:wU,isValidMessageSignature:gU,isValidSignature:Qf,isValidTypedDataSignature:bU,isWalletUpToDate:EU,messageToBytes:yU,nextMessageIdx:mU,prefixEIP191Message:Ub,resolveArrayProperties:CU,trimEIP191Prefix:xye,unregisterWallet:$U,useBestStore:My},Symbol.toStringTag,{value:"Module"}));function An(t,e){return e.forEach(function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach(function(n){if(n!=="default"&&!(n in t)){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}})}),Object.freeze(t)}var Bye=An({__proto__:null},[R1e]),jye=An({__proto__:null},[B1e]),Uye=An({__proto__:null},[Zme]),zye=An({__proto__:null},[sye]),Wye=An({__proto__:null},[cme]),Hye=An({__proto__:null},[mme]),qye=An({__proto__:null},[pye]),Vye=An({__proto__:null},[Npe]),Gye=An({__proto__:null},[Fye]),Kye=An({__proto__:null},[qve]);const Qye=he.transaction;var Yye=Object.freeze({__proto__:null,transactions:Qye}),Jye=An({__proto__:null,isValidSignature:Qf,isValidMessageSignature:gU,isValidTypedDataSignature:bU,isWalletUpToDate:EU},[wpe]),Xye=An({__proto__:null},[Sve]),Zye=An({__proto__:null},[Vve]),ege=An({__proto__:null},[Yme]),tge=An({__proto__:null},[Ive]),rge=An({__proto__:null},[Zve]),NU=Object.freeze({__proto__:null,abi:Bye,api:jye,auth:Uye,guard:zye,indexer:Wye,metadata:Hye,multicall:qye,network:Vye,provider:Gye,relayer:Kye,transactions:Yye,utils:Jye,core:Xye,signhub:Zye,sessions:ege,migration:tge,account:rge,initWallet:RU,getWallet:MU,unregisterWallet:$U,SequenceProvider:Pd,SequenceClient:z8,SequenceSigner:_d}),bh,$u,nge=class extends j1{constructor({chains:t,options:e}){super({chains:t,options:{reloadOnDisconnect:!1,...e}}),Ke(this,"id","coinbaseWallet"),Ke(this,"name","Coinbase Wallet"),Ke(this,"ready",!0),Mr(this,bh,void 0),Mr(this,$u,void 0),Ke(this,"onAccountsChanged",r=>{r.length===0?this.emit("disconnect"):this.emit("change",{account:Dn(r[0])})}),Ke(this,"onChainChanged",r=>{const n=El(r),i=this.isChainUnsupported(n);this.emit("change",{chain:{id:n,unsupported:i}})}),Ke(this,"onDisconnect",()=>{this.emit("disconnect")})}async connect({chainId:t}={}){try{const e=await this.getProvider();e.on("accountsChanged",this.onAccountsChanged),e.on("chainChanged",this.onChainChanged),e.on("disconnect",this.onDisconnect),this.emit("message",{type:"connecting"});const r=await e.enable(),n=Dn(r[0]);let i=await this.getChainId(),s=this.isChainUnsupported(i);return t&&i!==t&&(i=(await this.switchChain(t)).id,s=this.isChainUnsupported(i)),{account:n,chain:{id:i,unsupported:s}}}catch(e){throw/(user closed modal|accounts received is empty)/i.test(e.message)?new Pr(e):e}}async disconnect(){if(!We(this,$u))return;const t=await this.getProvider();t.removeListener("accountsChanged",this.onAccountsChanged),t.removeListener("chainChanged",this.onChainChanged),t.removeListener("disconnect",this.onDisconnect),t.disconnect(),t.close()}async getAccount(){const e=await(await this.getProvider()).request({method:"eth_accounts"});return Dn(e[0])}async getChainId(){const t=await this.getProvider();return El(t.chainId)}async getProvider(){var t;if(!We(this,$u)){let e=(await HS(()=>import("./index-748504a6.js").then(o=>o.i),["./index-748504a6.js","./events-d5745873.js","./index-cc134824.js"],import.meta.url)).default;typeof e!="function"&&typeof e.default=="function"&&(e=e.default),ys(this,bh,new e(this.options));const r=(t=We(this,bh).walletExtension)==null?void 0:t.getChainId(),n=this.chains.find(o=>this.options.chainId?o.id===this.options.chainId:o.id===r)||this.chains[0],i=this.options.chainId||(n==null?void 0:n.id),s=this.options.jsonRpcUrl||(n==null?void 0:n.rpcUrls.default.http[0]);ys(this,$u,We(this,bh).makeWeb3Provider(s,i))}return We(this,$u)}async getWalletClient({chainId:t}={}){const[e,r]=await Promise.all([this.getProvider(),this.getAccount()]),n=this.chains.find(i=>i.id===t);if(!e)throw new Error("provider is required.");return K1({account:r,chain:n,transport:kb(e)})}async isAuthorized(){try{return!!await this.getAccount()}catch{return!1}}async switchChain(t){var n;const e=await this.getProvider(),r=Ue(t);try{return await e.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]}),this.chains.find(i=>i.id===t)??{id:t,name:`Chain ${r}`,network:`${r}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}}catch(i){const s=this.chains.find(o=>o.id===t);if(!s)throw new uF({chainId:t,connectorId:this.id});if(i.code===4902)try{return await e.request({method:"wallet_addEthereumChain",params:[{chainId:r,chainName:s.name,nativeCurrency:s.nativeCurrency,rpcUrls:[((n=s.rpcUrls.public)==null?void 0:n.http[0])??""],blockExplorerUrls:this.getBlockExplorerUrls(s)}]}),s}catch(o){throw new Pr(o)}throw new ea(i)}}async watchAsset({address:t,decimals:e=18,image:r,symbol:n}){return(await this.getProvider()).request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:t,decimals:e,image:r,symbol:n}}})}};bh=new WeakMap;$u=new WeakMap;var Jv,ige=class extends XF{constructor({chains:t,options:e}={}){const r={name:"MetaMask",shimDisconnect:!0,getProvider(){function n(s){if(s!=null&&s.isMetaMask&&!(s.isBraveWallet&&!s._events&&!s._state)&&!s.isApexWallet&&!s.isAvalanche&&!s.isBitKeep&&!s.isBlockWallet&&!s.isMathWallet&&!(s.isOkxWallet||s.isOKExWallet)&&!(s.isOneInchIOSWallet||s.isOneInchAndroidWallet)&&!s.isOpera&&!s.isPortal&&!s.isRabby&&!s.isDefiant&&!s.isTokenPocket&&!s.isTokenary&&!s.isZerion)return s}if(typeof window>"u")return;const i=window.ethereum;return i!=null&&i.providers?i.providers.find(n):n(i)},...e};super({chains:t,options:r}),Ke(this,"id","metaMask"),Ke(this,"shimDisconnectKey",`${this.id}.shimDisconnect`),Mr(this,Jv,void 0),ys(this,Jv,r.UNSTABLE_shimOnConnectSelectAccount)}async connect({chainId:t}={}){var e,r,n,i;try{const s=await this.getProvider();if(!s)throw new Ma;s.on&&(s.on("accountsChanged",this.onAccountsChanged),s.on("chainChanged",this.onChainChanged),s.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});let o=null;if(We(this,Jv)&&((e=this.options)!=null&&e.shimDisconnect)&&!((r=this.storage)!=null&&r.getItem(this.shimDisconnectKey))&&(o=await this.getAccount().catch(()=>null),!!o))try{await s.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}),o=await this.getAccount()}catch(u){if(this.isUserRejectedRequestError(u))throw new Pr(u);if(u.code===new mc(u).code)throw u}if(!o){const l=await s.request({method:"eth_requestAccounts"});o=Dn(l[0])}let a=await this.getChainId(),c=this.isChainUnsupported(a);return t&&a!==t&&(a=(await this.switchChain(t)).id,c=this.isChainUnsupported(a)),(n=this.options)!=null&&n.shimDisconnect&&((i=this.storage)==null||i.setItem(this.shimDisconnectKey,!0)),{account:o,chain:{id:a,unsupported:c},provider:s}}catch(s){throw this.isUserRejectedRequestError(s)?new Pr(s):s.code===-32002?new mc(s):s}}};Jv=new WeakMap;var nl,Bs,sge=class{constructor(t){Ke(this,"events",new JL),Ke(this,"chainId"),Mr(this,nl,void 0),Mr(this,Bs,void 0),this.chainId=t.chainId,ys(this,nl,t)}async enable(){var e;if((e=We(this,nl).flags)!=null&&e.failConnect)throw new Pr(new Error("Failed to connect."));We(this,Bs)||ys(this,Bs,We(this,nl).walletClient);const t=We(this,Bs).account.address;return this.events.emit("accountsChanged",[t]),[t]}async disconnect(){this.events.emit("disconnect"),ys(this,Bs,void 0)}async getAccounts(){var e;const t=(e=We(this,Bs))==null?void 0:e.account.address;return t?[Dn(t)]:[]}getWalletClient(){const t=We(this,Bs);if(!t)throw new Error("walletClient not found");return t}async switchChain(t){var e;if((e=We(this,nl).flags)!=null&&e.failSwitchChain)throw new Pr(new Error("Failed to switch chain."));We(this,nl).chainId=t,this.chainId=t,this.events.emit("chainChanged",t)}async switchWalletClient(t){const e=t.account.address;ys(this,Bs,t),this.events.emit("accountsChanged",[e])}async watchAsset(t){return!0}async request({method:t,params:e}){var r;return(r=We(this,Bs))==null?void 0:r.transport.request({method:t,params:e})}on(t,e){return this.events.on(t,e),this}removeListener(t,e){return this.events.removeListener(t,e),this}toJSON(){return""}};nl=new WeakMap;Bs=new WeakMap;var wh,p5,DU,oge=class extends j1{constructor({chains:t,options:e}){var r;super({chains:t,options:{...e,chainId:e.chainId??((r=t==null?void 0:t[0])==null?void 0:r.id)}}),Mr(this,p5),Ke(this,"id","mock"),Ke(this,"name","Mock"),Ke(this,"ready",!0),Mr(this,wh,void 0),Ke(this,"onAccountsChanged",n=>{n.length===0?this.emit("disconnect"):this.emit("change",{account:Dn(n[0])})}),Ke(this,"onChainChanged",n=>{const i=El(n),s=this.isChainUnsupported(i);this.emit("change",{chain:{id:i,unsupported:s}})}),Ke(this,"onDisconnect",()=>{this.emit("disconnect")})}async connect({chainId:t}={}){var a;const e=await this.getProvider({chainId:t});e.on("accountsChanged",this.onAccountsChanged),e.on("chainChanged",this.onChainChanged),e.on("disconnect",this.onDisconnect),this.emit("message",{type:"connecting"});const r=await e.enable(),n=Dn(r[0]),i=El(e.chainId),s=this.isChainUnsupported(i),o={account:n,chain:{id:i,unsupported:s},provider:e};return(a=this.options.flags)!=null&&a.noSwitchChain||(this.switchChain=Rr(this,p5,DU)),new Promise(c=>setTimeout(()=>c(o),100))}async disconnect(){const t=await this.getProvider();await t.disconnect(),t.removeListener("accountsChanged",this.onAccountsChanged),t.removeListener("chainChanged",this.onChainChanged),t.removeListener("disconnect",this.onDisconnect)}async getAccount(){const r=(await(await this.getProvider()).getAccounts())[0];if(!r)throw new Error("Failed to get account");return Dn(r)}async getChainId(){const t=await this.getProvider();return El(t.chainId)}async getProvider({chainId:t}={}){return(!We(this,wh)||t)&&ys(this,wh,new sge({...this.options,chainId:t??this.options.chainId??this.chains[0].id})),We(this,wh)}async getWalletClient(){return(await this.getProvider()).getWalletClient()}async isAuthorized(){var t;try{const r=await(await this.getProvider()).getAccounts();return((t=this.options.flags)==null?void 0:t.isAuthorized)??!!r}catch{return!1}}async watchAsset(t){return(await this.getProvider()).watchAsset(t)}toJSON(){return""}};wh=new WeakMap;p5=new WeakSet;DU=async function(t){return await(await this.getProvider()).switchChain(t),this.chains.find(r=>r.id===t)??{id:t,name:`Chain ${t}`,network:`${t}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}};var W8={},Wb={},ze={},LU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,c){var l=a>>>16&65535,u=a&65535,f=c>>>16&65535,d=c&65535;return u*d+(l*d+u*f<<16>>>0)|0}t.mul=Math.imul||e;function r(a,c){return a+c|0}t.add=r;function n(a,c){return a-c|0}t.sub=n;function i(a,c){return a<>>32-c}t.rotl=i;function s(a,c){return a<<32-c|a>>>c}t.rotr=s;function o(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(a){return t.isInteger(a)&&a>=-t.MAX_SAFE_INTEGER&&a<=t.MAX_SAFE_INTEGER}})(LU);Object.defineProperty(ze,"__esModule",{value:!0});var FU=LU;function age(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}ze.readInt16BE=age;function cge(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}ze.readUint16BE=cge;function lge(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}ze.readInt16LE=lge;function uge(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}ze.readUint16LE=uge;function BU(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}ze.writeUint16BE=BU;ze.writeInt16BE=BU;function jU(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}ze.writeUint16LE=jU;ze.writeInt16LE=jU;function v5(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}ze.readInt32BE=v5;function m5(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}ze.readUint32BE=m5;function y5(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}ze.readInt32LE=y5;function g5(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}ze.readUint32LE=g5;function Ny(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}ze.writeUint32BE=Ny;ze.writeInt32BE=Ny;function Dy(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}ze.writeUint32LE=Dy;ze.writeInt32LE=Dy;function fge(t,e){e===void 0&&(e=0);var r=v5(t,e),n=v5(t,e+4);return r*4294967296+n-(n>>31)*4294967296}ze.readInt64BE=fge;function dge(t,e){e===void 0&&(e=0);var r=m5(t,e),n=m5(t,e+4);return r*4294967296+n}ze.readUint64BE=dge;function hge(t,e){e===void 0&&(e=0);var r=y5(t,e),n=y5(t,e+4);return n*4294967296+r-(r>>31)*4294967296}ze.readInt64LE=hge;function pge(t,e){e===void 0&&(e=0);var r=g5(t,e),n=g5(t,e+4);return n*4294967296+r}ze.readUint64LE=pge;function UU(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Ny(t/4294967296>>>0,e,r),Ny(t>>>0,e,r+4),e}ze.writeUint64BE=UU;ze.writeInt64BE=UU;function zU(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Dy(t>>>0,e,r),Dy(t/4294967296>>>0,e,r+4),e}ze.writeUint64LE=zU;ze.writeInt64LE=zU;function vge(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=t/8+r-1;s>=r;s--)n+=e[s]*i,i*=256;return n}ze.readUintBE=vge;function mge(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=r;s=n;s--)r[s]=e/i&255,i*=256;return r}ze.writeUintBE=yge;function gge(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!FU.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s>>32-16|_<<16,H=H+_|0,w^=H,w=w>>>32-12|w<<12,S=S+I|0,O^=S,O=O>>>32-16|O<<16,K=K+O|0,I^=K,I=I>>>32-12|I<<12,P=P+F|0,N^=P,N=N>>>32-16|N<<16,B=B+N|0,F^=B,F=F>>>32-12|F<<12,T=T+j|0,k^=T,k=k>>>32-16|k<<16,E=E+k|0,j^=E,j=j>>>32-12|j<<12,P=P+F|0,N^=P,N=N>>>32-8|N<<8,B=B+N|0,F^=B,F=F>>>32-7|F<<7,T=T+j|0,k^=T,k=k>>>32-8|k<<8,E=E+k|0,j^=E,j=j>>>32-7|j<<7,S=S+I|0,O^=S,O=O>>>32-8|O<<8,K=K+O|0,I^=K,I=I>>>32-7|I<<7,g=g+w|0,_^=g,_=_>>>32-8|_<<8,H=H+_|0,w^=H,w=w>>>32-7|w<<7,g=g+I|0,k^=g,k=k>>>32-16|k<<16,B=B+k|0,I^=B,I=I>>>32-12|I<<12,S=S+F|0,_^=S,_=_>>>32-16|_<<16,E=E+_|0,F^=E,F=F>>>32-12|F<<12,P=P+j|0,O^=P,O=O>>>32-16|O<<16,H=H+O|0,j^=H,j=j>>>32-12|j<<12,T=T+w|0,N^=T,N=N>>>32-16|N<<16,K=K+N|0,w^=K,w=w>>>32-12|w<<12,P=P+j|0,O^=P,O=O>>>32-8|O<<8,H=H+O|0,j^=H,j=j>>>32-7|j<<7,T=T+w|0,N^=T,N=N>>>32-8|N<<8,K=K+N|0,w^=K,w=w>>>32-7|w<<7,S=S+F|0,_^=S,_=_>>>32-8|_<<8,E=E+_|0,F^=E,F=F>>>32-7|F<<7,g=g+I|0,k^=g,k=k>>>32-8|k<<8,B=B+k|0,I^=B,I=I>>>32-7|I<<7;dn.writeUint32LE(g+n|0,t,0),dn.writeUint32LE(S+i|0,t,4),dn.writeUint32LE(P+s|0,t,8),dn.writeUint32LE(T+o|0,t,12),dn.writeUint32LE(w+a|0,t,16),dn.writeUint32LE(I+c|0,t,20),dn.writeUint32LE(F+l|0,t,24),dn.writeUint32LE(j+u|0,t,28),dn.writeUint32LE(H+f|0,t,32),dn.writeUint32LE(K+d|0,t,36),dn.writeUint32LE(B+h|0,t,40),dn.writeUint32LE(E+p|0,t,44),dn.writeUint32LE(_+v|0,t,48),dn.writeUint32LE(O+b|0,t,52),dn.writeUint32LE(N+y|0,t,56),dn.writeUint32LE(k+m|0,t,60)}function WU(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var HU={},Lc={};Object.defineProperty(Lc,"__esModule",{value:!0});function Rge(t,e,r){return~(t-1)&e|t-1&r}Lc.select=Rge;function $ge(t,e){return(t|0)-(e|0)-1>>>31&1}Lc.lessOrEqual=$ge;function qU(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n>>8}Lc.compare=qU;function Mge(t,e){return t.length===0||e.length===0?!1:qU(t,e)!==0}Lc.equal=Mge;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Lc,r=Is;t.DIGEST_LENGTH=16;var n=function(){function o(a){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=a[0]|a[1]<<8;this._r[0]=c&8191;var l=a[2]|a[3]<<8;this._r[1]=(c>>>13|l<<3)&8191;var u=a[4]|a[5]<<8;this._r[2]=(l>>>10|u<<6)&7939;var f=a[6]|a[7]<<8;this._r[3]=(u>>>7|f<<9)&8191;var d=a[8]|a[9]<<8;this._r[4]=(f>>>4|d<<12)&255,this._r[5]=d>>>1&8190;var h=a[10]|a[11]<<8;this._r[6]=(d>>>14|h<<2)&8191;var p=a[12]|a[13]<<8;this._r[7]=(h>>>11|p<<5)&8065;var v=a[14]|a[15]<<8;this._r[8]=(p>>>8|v<<8)&8191,this._r[9]=v>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return o.prototype._blocks=function(a,c,l){for(var u=this._fin?0:2048,f=this._h[0],d=this._h[1],h=this._h[2],p=this._h[3],v=this._h[4],b=this._h[5],y=this._h[6],m=this._h[7],g=this._h[8],S=this._h[9],P=this._r[0],T=this._r[1],w=this._r[2],I=this._r[3],F=this._r[4],j=this._r[5],H=this._r[6],K=this._r[7],B=this._r[8],E=this._r[9];l>=16;){var _=a[c+0]|a[c+1]<<8;f+=_&8191;var O=a[c+2]|a[c+3]<<8;d+=(_>>>13|O<<3)&8191;var N=a[c+4]|a[c+5]<<8;h+=(O>>>10|N<<6)&8191;var k=a[c+6]|a[c+7]<<8;p+=(N>>>7|k<<9)&8191;var $=a[c+8]|a[c+9]<<8;v+=(k>>>4|$<<12)&8191,b+=$>>>1&8191;var L=a[c+10]|a[c+11]<<8;y+=($>>>14|L<<2)&8191;var M=a[c+12]|a[c+13]<<8;m+=(L>>>11|M<<5)&8191;var A=a[c+14]|a[c+15]<<8;g+=(M>>>8|A<<8)&8191,S+=A>>>5|u;var D=0,V=D;V+=f*P,V+=d*(5*E),V+=h*(5*B),V+=p*(5*K),V+=v*(5*H),D=V>>>13,V&=8191,V+=b*(5*j),V+=y*(5*F),V+=m*(5*I),V+=g*(5*w),V+=S*(5*T),D+=V>>>13,V&=8191;var R=D;R+=f*T,R+=d*P,R+=h*(5*E),R+=p*(5*B),R+=v*(5*K),D=R>>>13,R&=8191,R+=b*(5*H),R+=y*(5*j),R+=m*(5*F),R+=g*(5*I),R+=S*(5*w),D+=R>>>13,R&=8191;var U=D;U+=f*w,U+=d*T,U+=h*P,U+=p*(5*E),U+=v*(5*B),D=U>>>13,U&=8191,U+=b*(5*K),U+=y*(5*H),U+=m*(5*j),U+=g*(5*F),U+=S*(5*I),D+=U>>>13,U&=8191;var W=D;W+=f*I,W+=d*w,W+=h*T,W+=p*P,W+=v*(5*E),D=W>>>13,W&=8191,W+=b*(5*B),W+=y*(5*K),W+=m*(5*H),W+=g*(5*j),W+=S*(5*F),D+=W>>>13,W&=8191;var q=D;q+=f*F,q+=d*I,q+=h*w,q+=p*T,q+=v*P,D=q>>>13,q&=8191,q+=b*(5*E),q+=y*(5*B),q+=m*(5*K),q+=g*(5*H),q+=S*(5*j),D+=q>>>13,q&=8191;var Y=D;Y+=f*j,Y+=d*F,Y+=h*I,Y+=p*w,Y+=v*T,D=Y>>>13,Y&=8191,Y+=b*P,Y+=y*(5*E),Y+=m*(5*B),Y+=g*(5*K),Y+=S*(5*H),D+=Y>>>13,Y&=8191;var X=D;X+=f*H,X+=d*j,X+=h*F,X+=p*I,X+=v*w,D=X>>>13,X&=8191,X+=b*T,X+=y*P,X+=m*(5*E),X+=g*(5*B),X+=S*(5*K),D+=X>>>13,X&=8191;var Q=D;Q+=f*K,Q+=d*H,Q+=h*j,Q+=p*F,Q+=v*I,D=Q>>>13,Q&=8191,Q+=b*w,Q+=y*T,Q+=m*P,Q+=g*(5*E),Q+=S*(5*B),D+=Q>>>13,Q&=8191;var Z=D;Z+=f*B,Z+=d*K,Z+=h*H,Z+=p*j,Z+=v*F,D=Z>>>13,Z&=8191,Z+=b*I,Z+=y*w,Z+=m*T,Z+=g*P,Z+=S*(5*E),D+=Z>>>13,Z&=8191;var ae=D;ae+=f*E,ae+=d*B,ae+=h*K,ae+=p*H,ae+=v*j,D=ae>>>13,ae&=8191,ae+=b*F,ae+=y*I,ae+=m*w,ae+=g*T,ae+=S*P,D+=ae>>>13,ae&=8191,D=(D<<2)+D|0,D=D+V|0,V=D&8191,D=D>>>13,R+=D,f=V,d=R,h=U,p=W,v=q,b=Y,y=X,m=Q,g=Z,S=ae,c+=16,l-=16}this._h[0]=f,this._h[1]=d,this._h[2]=h,this._h[3]=p,this._h[4]=v,this._h[5]=b,this._h[6]=y,this._h[7]=m,this._h[8]=g,this._h[9]=S},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),u,f,d,h;if(this._leftover){for(h=this._leftover,this._buffer[h++]=1;h<16;h++)this._buffer[h]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(u=this._h[1]>>>13,this._h[1]&=8191,h=2;h<10;h++)this._h[h]+=u,u=this._h[h]>>>13,this._h[h]&=8191;for(this._h[0]+=u*5,u=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=u,u=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=u,l[0]=this._h[0]+5,u=l[0]>>>13,l[0]&=8191,h=1;h<10;h++)l[h]=this._h[h]+u,u=l[h]>>>13,l[h]&=8191;for(l[9]-=8192,f=(u^1)-1,h=0;h<10;h++)l[h]&=f;for(f=~f,h=0;h<10;h++)this._h[h]=this._h[h]&f|l[h];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,d=this._h[0]+this._pad[0],this._h[0]=d&65535,h=1;h<8;h++)d=(this._h[h]+this._pad[h]|0)+(d>>>16)|0,this._h[h]=d&65535;return a[c+0]=this._h[0]>>>0,a[c+1]=this._h[0]>>>8,a[c+2]=this._h[1]>>>0,a[c+3]=this._h[1]>>>8,a[c+4]=this._h[2]>>>0,a[c+5]=this._h[2]>>>8,a[c+6]=this._h[3]>>>0,a[c+7]=this._h[3]>>>8,a[c+8]=this._h[4]>>>0,a[c+9]=this._h[4]>>>8,a[c+10]=this._h[5]>>>0,a[c+11]=this._h[5]>>>8,a[c+12]=this._h[6]>>>0,a[c+13]=this._h[6]>>>8,a[c+14]=this._h[7]>>>0,a[c+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(a){var c=0,l=a.length,u;if(this._leftover){u=16-this._leftover,u>l&&(u=l);for(var f=0;f=16&&(u=l-l%16,this._blocks(a,c,u),c+=u,l-=u),l){for(var f=0;f16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var h=new Uint8Array(16);h.set(l,h.length-l.length);var p=new Uint8Array(32);e.stream(this._key,h,p,4);var v=u.length+this.tagLength,b;if(d){if(d.length!==v)throw new Error("ChaCha20Poly1305: incorrect destination length");b=d}else b=new Uint8Array(v);return e.streamXOR(this._key,h,u,b,4),this._authenticate(b.subarray(b.length-this.tagLength,b.length),p,b.subarray(0,b.length-this.tagLength),f),n.wipe(h),b},c.prototype.open=function(l,u,f,d){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(u.length0&&h.update(o.subarray(d.length%16))),h.update(f),f.length%16>0&&h.update(o.subarray(f.length%16));var p=new Uint8Array(8);d&&i.writeUint64LE(d.length,p),h.update(p),i.writeUint64LE(f.length,p),h.update(p);for(var v=h.digest(),b=0;bthis.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n256)throw new Error("randomString charset is too long");let d="";const h=u.length,p=256-256%h;for(;l>0;){const v=i(Math.ceil(l*256/p),f);for(let b=0;b0;b++){const y=v[b];y0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[u++],l--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(u=s(this._temp,this._state,c,u,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[u++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,u=this._bufferLength,f=l/536870912|0,d=l<<3,h=l%64<56?64:128;this._buffer[u]=128;for(var p=u+1;p0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function s(a,c,l,u,f){for(;f>=64;){for(var d=c[0],h=c[1],p=c[2],v=c[3],b=c[4],y=c[5],m=c[6],g=c[7],S=0;S<16;S++){var P=u+S*4;a[S]=e.readUint32BE(l,P)}for(var S=16;S<64;S++){var T=a[S-2],w=(T>>>17|T<<32-17)^(T>>>19|T<<32-19)^T>>>10;T=a[S-15];var I=(T>>>7|T<<32-7)^(T>>>18|T<<32-18)^T>>>3;a[S]=(w+a[S-7]|0)+(I+a[S-16]|0)}for(var S=0;S<64;S++){var w=(((b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+(b&y^~b&m)|0)+(g+(i[S]+a[S]|0)|0)|0,I=((d>>>2|d<<32-2)^(d>>>13|d<<32-13)^(d>>>22|d<<32-22))+(d&h^d&p^h&p)|0;g=m,m=y,y=b,b=v+w|0,v=p,p=h,h=d,d=w+I|0}c[0]+=d,c[1]+=h,c[2]+=p,c[3]+=v,c[4]+=b,c[5]+=y,c[6]+=m,c[7]+=g,u+=64,f-=64}return u}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(Kb);var q8={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=Hb,r=Is;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(S){const P=new Float64Array(16);if(S)for(let T=0;T>16&1),T[j-1]&=65535;T[15]=w[15]-32767-(T[14]>>16&1);const F=T[15]>>16&1;T[14]&=65535,a(w,T,1-F)}for(let I=0;I<16;I++)S[2*I]=w[I]&255,S[2*I+1]=w[I]>>8}function l(S,P){for(let T=0;T<16;T++)S[T]=P[2*T]+(P[2*T+1]<<8);S[15]&=32767}function u(S,P,T){for(let w=0;w<16;w++)S[w]=P[w]+T[w]}function f(S,P,T){for(let w=0;w<16;w++)S[w]=P[w]-T[w]}function d(S,P,T){let w,I,F=0,j=0,H=0,K=0,B=0,E=0,_=0,O=0,N=0,k=0,$=0,L=0,M=0,A=0,D=0,V=0,R=0,U=0,W=0,q=0,Y=0,X=0,Q=0,Z=0,ae=0,se=0,ue=0,ot=0,Te=0,_e=0,at=0,xe=T[0],be=T[1],Kt=T[2],Ie=T[3],Oe=T[4],Qt=T[5],Re=T[6],$e=T[7],Yt=T[8],Me=T[9],Ne=T[10],Jt=T[11],De=T[12],Le=T[13],Xt=T[14],Fe=T[15];w=P[0],F+=w*xe,j+=w*be,H+=w*Kt,K+=w*Ie,B+=w*Oe,E+=w*Qt,_+=w*Re,O+=w*$e,N+=w*Yt,k+=w*Me,$+=w*Ne,L+=w*Jt,M+=w*De,A+=w*Le,D+=w*Xt,V+=w*Fe,w=P[1],j+=w*xe,H+=w*be,K+=w*Kt,B+=w*Ie,E+=w*Oe,_+=w*Qt,O+=w*Re,N+=w*$e,k+=w*Yt,$+=w*Me,L+=w*Ne,M+=w*Jt,A+=w*De,D+=w*Le,V+=w*Xt,R+=w*Fe,w=P[2],H+=w*xe,K+=w*be,B+=w*Kt,E+=w*Ie,_+=w*Oe,O+=w*Qt,N+=w*Re,k+=w*$e,$+=w*Yt,L+=w*Me,M+=w*Ne,A+=w*Jt,D+=w*De,V+=w*Le,R+=w*Xt,U+=w*Fe,w=P[3],K+=w*xe,B+=w*be,E+=w*Kt,_+=w*Ie,O+=w*Oe,N+=w*Qt,k+=w*Re,$+=w*$e,L+=w*Yt,M+=w*Me,A+=w*Ne,D+=w*Jt,V+=w*De,R+=w*Le,U+=w*Xt,W+=w*Fe,w=P[4],B+=w*xe,E+=w*be,_+=w*Kt,O+=w*Ie,N+=w*Oe,k+=w*Qt,$+=w*Re,L+=w*$e,M+=w*Yt,A+=w*Me,D+=w*Ne,V+=w*Jt,R+=w*De,U+=w*Le,W+=w*Xt,q+=w*Fe,w=P[5],E+=w*xe,_+=w*be,O+=w*Kt,N+=w*Ie,k+=w*Oe,$+=w*Qt,L+=w*Re,M+=w*$e,A+=w*Yt,D+=w*Me,V+=w*Ne,R+=w*Jt,U+=w*De,W+=w*Le,q+=w*Xt,Y+=w*Fe,w=P[6],_+=w*xe,O+=w*be,N+=w*Kt,k+=w*Ie,$+=w*Oe,L+=w*Qt,M+=w*Re,A+=w*$e,D+=w*Yt,V+=w*Me,R+=w*Ne,U+=w*Jt,W+=w*De,q+=w*Le,Y+=w*Xt,X+=w*Fe,w=P[7],O+=w*xe,N+=w*be,k+=w*Kt,$+=w*Ie,L+=w*Oe,M+=w*Qt,A+=w*Re,D+=w*$e,V+=w*Yt,R+=w*Me,U+=w*Ne,W+=w*Jt,q+=w*De,Y+=w*Le,X+=w*Xt,Q+=w*Fe,w=P[8],N+=w*xe,k+=w*be,$+=w*Kt,L+=w*Ie,M+=w*Oe,A+=w*Qt,D+=w*Re,V+=w*$e,R+=w*Yt,U+=w*Me,W+=w*Ne,q+=w*Jt,Y+=w*De,X+=w*Le,Q+=w*Xt,Z+=w*Fe,w=P[9],k+=w*xe,$+=w*be,L+=w*Kt,M+=w*Ie,A+=w*Oe,D+=w*Qt,V+=w*Re,R+=w*$e,U+=w*Yt,W+=w*Me,q+=w*Ne,Y+=w*Jt,X+=w*De,Q+=w*Le,Z+=w*Xt,ae+=w*Fe,w=P[10],$+=w*xe,L+=w*be,M+=w*Kt,A+=w*Ie,D+=w*Oe,V+=w*Qt,R+=w*Re,U+=w*$e,W+=w*Yt,q+=w*Me,Y+=w*Ne,X+=w*Jt,Q+=w*De,Z+=w*Le,ae+=w*Xt,se+=w*Fe,w=P[11],L+=w*xe,M+=w*be,A+=w*Kt,D+=w*Ie,V+=w*Oe,R+=w*Qt,U+=w*Re,W+=w*$e,q+=w*Yt,Y+=w*Me,X+=w*Ne,Q+=w*Jt,Z+=w*De,ae+=w*Le,se+=w*Xt,ue+=w*Fe,w=P[12],M+=w*xe,A+=w*be,D+=w*Kt,V+=w*Ie,R+=w*Oe,U+=w*Qt,W+=w*Re,q+=w*$e,Y+=w*Yt,X+=w*Me,Q+=w*Ne,Z+=w*Jt,ae+=w*De,se+=w*Le,ue+=w*Xt,ot+=w*Fe,w=P[13],A+=w*xe,D+=w*be,V+=w*Kt,R+=w*Ie,U+=w*Oe,W+=w*Qt,q+=w*Re,Y+=w*$e,X+=w*Yt,Q+=w*Me,Z+=w*Ne,ae+=w*Jt,se+=w*De,ue+=w*Le,ot+=w*Xt,Te+=w*Fe,w=P[14],D+=w*xe,V+=w*be,R+=w*Kt,U+=w*Ie,W+=w*Oe,q+=w*Qt,Y+=w*Re,X+=w*$e,Q+=w*Yt,Z+=w*Me,ae+=w*Ne,se+=w*Jt,ue+=w*De,ot+=w*Le,Te+=w*Xt,_e+=w*Fe,w=P[15],V+=w*xe,R+=w*be,U+=w*Kt,W+=w*Ie,q+=w*Oe,Y+=w*Qt,X+=w*Re,Q+=w*$e,Z+=w*Yt,ae+=w*Me,se+=w*Ne,ue+=w*Jt,ot+=w*De,Te+=w*Le,_e+=w*Xt,at+=w*Fe,F+=38*R,j+=38*U,H+=38*W,K+=38*q,B+=38*Y,E+=38*X,_+=38*Q,O+=38*Z,N+=38*ae,k+=38*se,$+=38*ue,L+=38*ot,M+=38*Te,A+=38*_e,D+=38*at,I=1,w=F+I+65535,I=Math.floor(w/65536),F=w-I*65536,w=j+I+65535,I=Math.floor(w/65536),j=w-I*65536,w=H+I+65535,I=Math.floor(w/65536),H=w-I*65536,w=K+I+65535,I=Math.floor(w/65536),K=w-I*65536,w=B+I+65535,I=Math.floor(w/65536),B=w-I*65536,w=E+I+65535,I=Math.floor(w/65536),E=w-I*65536,w=_+I+65535,I=Math.floor(w/65536),_=w-I*65536,w=O+I+65535,I=Math.floor(w/65536),O=w-I*65536,w=N+I+65535,I=Math.floor(w/65536),N=w-I*65536,w=k+I+65535,I=Math.floor(w/65536),k=w-I*65536,w=$+I+65535,I=Math.floor(w/65536),$=w-I*65536,w=L+I+65535,I=Math.floor(w/65536),L=w-I*65536,w=M+I+65535,I=Math.floor(w/65536),M=w-I*65536,w=A+I+65535,I=Math.floor(w/65536),A=w-I*65536,w=D+I+65535,I=Math.floor(w/65536),D=w-I*65536,w=V+I+65535,I=Math.floor(w/65536),V=w-I*65536,F+=I-1+37*(I-1),I=1,w=F+I+65535,I=Math.floor(w/65536),F=w-I*65536,w=j+I+65535,I=Math.floor(w/65536),j=w-I*65536,w=H+I+65535,I=Math.floor(w/65536),H=w-I*65536,w=K+I+65535,I=Math.floor(w/65536),K=w-I*65536,w=B+I+65535,I=Math.floor(w/65536),B=w-I*65536,w=E+I+65535,I=Math.floor(w/65536),E=w-I*65536,w=_+I+65535,I=Math.floor(w/65536),_=w-I*65536,w=O+I+65535,I=Math.floor(w/65536),O=w-I*65536,w=N+I+65535,I=Math.floor(w/65536),N=w-I*65536,w=k+I+65535,I=Math.floor(w/65536),k=w-I*65536,w=$+I+65535,I=Math.floor(w/65536),$=w-I*65536,w=L+I+65535,I=Math.floor(w/65536),L=w-I*65536,w=M+I+65535,I=Math.floor(w/65536),M=w-I*65536,w=A+I+65535,I=Math.floor(w/65536),A=w-I*65536,w=D+I+65535,I=Math.floor(w/65536),D=w-I*65536,w=V+I+65535,I=Math.floor(w/65536),V=w-I*65536,F+=I-1+37*(I-1),S[0]=F,S[1]=j,S[2]=H,S[3]=K,S[4]=B,S[5]=E,S[6]=_,S[7]=O,S[8]=N,S[9]=k,S[10]=$,S[11]=L,S[12]=M,S[13]=A,S[14]=D,S[15]=V}function h(S,P){d(S,P,P)}function p(S,P){const T=n();for(let w=0;w<16;w++)T[w]=P[w];for(let w=253;w>=0;w--)h(T,T),w!==2&&w!==4&&d(T,T,P);for(let w=0;w<16;w++)S[w]=T[w]}function v(S,P){const T=new Uint8Array(32),w=new Float64Array(80),I=n(),F=n(),j=n(),H=n(),K=n(),B=n();for(let N=0;N<31;N++)T[N]=S[N];T[31]=S[31]&127|64,T[0]&=248,l(w,P);for(let N=0;N<16;N++)F[N]=w[N];I[0]=H[0]=1;for(let N=254;N>=0;--N){const k=T[N>>>3]>>>(N&7)&1;a(I,F,k),a(j,H,k),u(K,I,j),f(I,I,j),u(j,F,H),f(F,F,H),h(H,K),h(B,I),d(I,j,I),d(j,F,K),u(K,I,j),f(I,I,j),h(F,I),f(j,H,B),d(I,j,s),u(I,I,H),d(j,j,I),d(I,H,B),d(H,F,w),h(F,K),a(I,F,k),a(j,H,k)}for(let N=0;N<16;N++)w[N+16]=I[N],w[N+32]=j[N],w[N+48]=F[N],w[N+64]=H[N];const E=w.subarray(32),_=w.subarray(16);p(E,E),d(_,_,E);const O=new Uint8Array(32);return c(O,_),O}t.scalarMult=v;function b(S){return v(S,i)}t.scalarMultBase=b;function y(S){if(S.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const P=new Uint8Array(S);return{publicKey:b(P),secretKey:P}}t.generateKeyPairFromSeed=y;function m(S){const P=(0,e.randomBytes)(32,S),T=y(P);return(0,r.wipe)(P),T}t.generateKeyPair=m;function g(S,P,T=!1){if(S.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(P.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const w=v(S,P);if(T){let I=0;for(let F=0;Fi+s.length,0));const r=KU(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return V8(r)}function Kge(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,S=new Uint8Array(g);y!==m;){for(var P=p[y],T=0,w=g-1;(P!==0||T>>0,S[w]=P%a>>>0,P=P/a>>>0;if(P!==0)throw new Error("Non-zero carry");b=T,y++}for(var I=g-b;I!==g&&S[I]===0;)I++;for(var F=c.repeat(v);I>>0,g=new Uint8Array(m);p[v];){var S=r[p.charCodeAt(v)];if(S===255)return;for(var P=0,T=m-1;(S!==0||P>>0,g[T]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");y=P,v++}if(p[v]!==" "){for(var w=m-y;w!==m&&g[w]===0;)w++;for(var I=new Uint8Array(b+(m-w)),F=b;w!==m;)I[F++]=g[w++];return I}}}function h(p){var v=d(p);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:d,decode:h}}var Qge=Kge,Yge=Qge;const Jge=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},Xge=t=>new TextEncoder().encode(t),Zge=t=>new TextDecoder().decode(t);class ebe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class tbe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return QU(this,e)}}class rbe{constructor(e){this.decoders=e}or(e){return QU(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const QU=(t,e)=>new rbe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class nbe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ebe(e,r,n),this.decoder=new tbe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Qb=({name:t,prefix:e,encode:r,decode:n})=>new nbe(t,e,r,n),ip=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Yge(r,e);return Qb({prefix:t,name:e,encode:n,decode:s=>Jge(i(s))})},ibe=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},sbe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<Qb({prefix:e,name:t,encode(i){return sbe(i,n,r)},decode(i){return ibe(i,n,r,t)}}),obe=Qb({prefix:"\0",name:"identity",encode:t=>Zge(t),decode:t=>Xge(t)}),abe=Object.freeze(Object.defineProperty({__proto__:null,identity:obe},Symbol.toStringTag,{value:"Module"})),cbe=cn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),lbe=Object.freeze(Object.defineProperty({__proto__:null,base2:cbe},Symbol.toStringTag,{value:"Module"})),ube=cn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),fbe=Object.freeze(Object.defineProperty({__proto__:null,base8:ube},Symbol.toStringTag,{value:"Module"})),dbe=ip({prefix:"9",name:"base10",alphabet:"0123456789"}),hbe=Object.freeze(Object.defineProperty({__proto__:null,base10:dbe},Symbol.toStringTag,{value:"Module"})),pbe=cn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),vbe=cn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),mbe=Object.freeze(Object.defineProperty({__proto__:null,base16:pbe,base16upper:vbe},Symbol.toStringTag,{value:"Module"})),ybe=cn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),gbe=cn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),bbe=cn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),wbe=cn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ebe=cn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),xbe=cn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Cbe=cn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Sbe=cn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),kbe=cn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Abe=Object.freeze(Object.defineProperty({__proto__:null,base32:ybe,base32hex:Ebe,base32hexpad:Cbe,base32hexpadupper:Sbe,base32hexupper:xbe,base32pad:bbe,base32padupper:wbe,base32upper:gbe,base32z:kbe},Symbol.toStringTag,{value:"Module"})),_be=ip({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Pbe=ip({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Tbe=Object.freeze(Object.defineProperty({__proto__:null,base36:_be,base36upper:Pbe},Symbol.toStringTag,{value:"Module"})),Ibe=ip({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Obe=ip({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Rbe=Object.freeze(Object.defineProperty({__proto__:null,base58btc:Ibe,base58flickr:Obe},Symbol.toStringTag,{value:"Module"})),$be=cn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Mbe=cn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Nbe=cn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Dbe=cn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Lbe=Object.freeze(Object.defineProperty({__proto__:null,base64:$be,base64pad:Mbe,base64url:Nbe,base64urlpad:Dbe},Symbol.toStringTag,{value:"Module"})),YU=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Fbe=YU.reduce((t,e,r)=>(t[r]=e,t),[]),Bbe=YU.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function jbe(t){return t.reduce((e,r)=>(e+=Fbe[r],e),"")}function Ube(t){const e=[];for(const r of t){const n=Bbe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const zbe=Qb({prefix:"🚀",name:"base256emoji",encode:jbe,decode:Ube}),Wbe=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:zbe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const YT={...abe,...lbe,...fbe,...hbe,...mbe,...Abe,...Tbe,...Rbe,...Lbe,...Wbe};function JU(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const JT=JU("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),rE=JU("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=KU(t.length);for(let r=0;r"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Kbe:typeof navigator<"u"?t9(navigator.userAgent):twe()}function Zbe(t){return t!==""&&Jbe.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1)}function t9(t){var e=Zbe(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new Gbe;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function xbe(t,e){return function(r,n){e(r,n,t)}}function Cbe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Sbe(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function kbe(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function xU(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function Pbe(){for(var t=[],e=0;e1||a(d,h)})})}function a(d,h){try{c(n[d](h))}catch(p){f(s[0][3],p)}}function c(d){d.value instanceof o1?Promise.resolve(d.value.v).then(l,u):f(s[0][2],d)}function l(d){a("next",d)}function u(d){a("throw",d)}function f(d,h){d(h),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Obe(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:o1(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function Rbe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof h5=="function"?h5(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function Mbe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function $be(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Nbe(t){return t&&t.__esModule?t:{default:t}}function Dbe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Lbe(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const Bbe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return d5},__asyncDelegator:Obe,__asyncGenerator:Ibe,__asyncValues:Rbe,__await:o1,__awaiter:Sbe,__classPrivateFieldGet:Dbe,__classPrivateFieldSet:Lbe,__createBinding:Abe,__decorate:Ebe,__exportStar:_be,__extends:bbe,__generator:kbe,__importDefault:Nbe,__importStar:$be,__makeTemplateObject:Mbe,__metadata:Cbe,__param:xbe,__read:xU,__rest:wbe,__spread:Pbe,__spreadArrays:Tbe,__values:h5},Symbol.toStringTag,{value:"Module"})),Wb=ZI(Bbe);var Y2={},th={},VT;function Fbe(){if(VT)return th;VT=1,Object.defineProperty(th,"__esModule",{value:!0}),th.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return th.delay=t,th}var Jc={},J2={},Xc={},GT;function jbe(){return GT||(GT=1,Object.defineProperty(Xc,"__esModule",{value:!0}),Xc.ONE_THOUSAND=Xc.ONE_HUNDRED=void 0,Xc.ONE_HUNDRED=100,Xc.ONE_THOUSAND=1e3),Xc}var X2={},KT;function Ube(){return KT||(KT=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(X2)),X2}var QT;function CU(){return QT||(QT=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Wb;e.__exportStar(jbe(),t),e.__exportStar(Ube(),t)}(J2)),J2}var YT;function zbe(){if(YT)return Jc;YT=1,Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.fromMiliseconds=Jc.toMiliseconds=void 0;const t=CU();function e(n){return n*t.ONE_THOUSAND}Jc.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Jc.fromMiliseconds=r,Jc}var JT;function Wbe(){return JT||(JT=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Wb;e.__exportStar(Fbe(),t),e.__exportStar(zbe(),t)}(Y2)),Y2}var wu={},XT;function Hbe(){if(XT)return wu;XT=1,Object.defineProperty(wu,"__esModule",{value:!0}),wu.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return wu.Watch=t,wu.default=t,wu}var Z2={},rh={},ZT;function qbe(){if(ZT)return rh;ZT=1,Object.defineProperty(rh,"__esModule",{value:!0}),rh.IWatch=void 0;class t{}return rh.IWatch=t,rh}var e9;function Vbe(){return e9||(e9=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Wb.__exportStar(qbe(),t)}(Z2)),Z2}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Wb;e.__exportStar(Wbe(),t),e.__exportStar(Hbe(),t),e.__exportStar(Vbe(),t),e.__exportStar(CU(),t)})(kl);var pt={};Object.defineProperty(pt,"__esModule",{value:!0});pt.getLocalStorage=pt.getLocalStorageOrThrow=pt.getCrypto=pt.getCryptoOrThrow=kU=pt.getLocation=pt.getLocationOrThrow=L8=pt.getNavigator=pt.getNavigatorOrThrow=SU=pt.getDocument=pt.getDocumentOrThrow=pt.getFromWindowOrThrow=pt.getFromWindow=void 0;function su(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}pt.getFromWindow=su;function Ad(t){const e=su(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}pt.getFromWindowOrThrow=Ad;function Gbe(){return Ad("document")}pt.getDocumentOrThrow=Gbe;function Kbe(){return su("document")}var SU=pt.getDocument=Kbe;function Qbe(){return Ad("navigator")}pt.getNavigatorOrThrow=Qbe;function Ybe(){return su("navigator")}var L8=pt.getNavigator=Ybe;function Jbe(){return Ad("location")}pt.getLocationOrThrow=Jbe;function Xbe(){return su("location")}var kU=pt.getLocation=Xbe;function Zbe(){return Ad("crypto")}pt.getCryptoOrThrow=Zbe;function ewe(){return su("crypto")}pt.getCrypto=ewe;function twe(){return Ad("localStorage")}pt.getLocalStorageOrThrow=twe;function rwe(){return su("localStorage")}pt.getLocalStorage=rwe;var B8={};Object.defineProperty(B8,"__esModule",{value:!0});var AU=B8.getWindowMetadata=void 0;const t9=pt;function nwe(){let t,e;try{t=t9.getDocumentOrThrow(),e=t9.getLocationOrThrow()}catch{return null}function r(){const f=t.getElementsByTagName("link"),d=[];for(let h=0;h-1){const b=p.getAttribute("href");if(b)if(b.toLowerCase().indexOf("https:")===-1&&b.toLowerCase().indexOf("http:")===-1&&b.indexOf("//")!==0){let y=e.protocol+"//"+e.host;if(b.indexOf("/")===0)y+=b;else{const m=e.pathname.split("/");m.pop();const g=m.join("/");y+=g+"/"+b}d.push(y)}else if(b.indexOf("//")===0){const y=e.protocol+b;d.push(y)}else d.push(b)}}return d}function n(...f){const d=t.getElementsByTagName("meta");for(let h=0;hp.getAttribute(b)).filter(b=>b?f.includes(b):!1);if(v.length&&v){const b=p.getAttribute("content");if(b)return b}}return""}function i(){let f=n("name","og:site_name","og:title","twitter:title");return f||(f=t.title),f}function s(){return n("description","og:description","twitter:description","keywords")}const o=i(),a=s(),c=e.origin,l=r();return{description:a,url:c,icons:l,name:o}}AU=B8.getWindowMetadata=nwe;var a1={},iwe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),_U="%[a-f0-9]{2}",r9=new RegExp("("+_U+")|([^%]+?)","gi"),n9=new RegExp("("+_U+")+","gi");function p5(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],p5(r),p5(n))}function swe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(r9)||[],r=1;r{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},lwe=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),s=0;sm==null,o=Symbol("encodeFragmentIdentifier");function a(m){switch(m.arrayFormat){case"index":return g=>(S,P)=>{const T=S.length;return P===void 0||m.skipNull&&P===null||m.skipEmptyString&&P===""?S:P===null?[...S,[u(g,m),"[",T,"]"].join("")]:[...S,[u(g,m),"[",u(T,m),"]=",u(P,m)].join("")]};case"bracket":return g=>(S,P)=>P===void 0||m.skipNull&&P===null||m.skipEmptyString&&P===""?S:P===null?[...S,[u(g,m),"[]"].join("")]:[...S,[u(g,m),"[]=",u(P,m)].join("")];case"colon-list-separator":return g=>(S,P)=>P===void 0||m.skipNull&&P===null||m.skipEmptyString&&P===""?S:P===null?[...S,[u(g,m),":list="].join("")]:[...S,[u(g,m),":list=",u(P,m)].join("")];case"comma":case"separator":case"bracket-separator":{const g=m.arrayFormat==="bracket-separator"?"[]=":"=";return S=>(P,T)=>T===void 0||m.skipNull&&T===null||m.skipEmptyString&&T===""?P:(T=T===null?"":T,P.length===0?[[u(S,m),g,u(T,m)].join("")]:[[P,u(T,m)].join(m.arrayFormatSeparator)])}default:return g=>(S,P)=>P===void 0||m.skipNull&&P===null||m.skipEmptyString&&P===""?S:P===null?[...S,u(g,m)]:[...S,[u(g,m),"=",u(P,m)].join("")]}}function c(m){let g;switch(m.arrayFormat){case"index":return(S,P,T)=>{if(g=/\[(\d*)\]$/.exec(S),S=S.replace(/\[\d*\]$/,""),!g){T[S]=P;return}T[S]===void 0&&(T[S]={}),T[S][g[1]]=P};case"bracket":return(S,P,T)=>{if(g=/(\[\])$/.exec(S),S=S.replace(/\[\]$/,""),!g){T[S]=P;return}if(T[S]===void 0){T[S]=[P];return}T[S]=[].concat(T[S],P)};case"colon-list-separator":return(S,P,T)=>{if(g=/(:list)$/.exec(S),S=S.replace(/:list$/,""),!g){T[S]=P;return}if(T[S]===void 0){T[S]=[P];return}T[S]=[].concat(T[S],P)};case"comma":case"separator":return(S,P,T)=>{const w=typeof P=="string"&&P.includes(m.arrayFormatSeparator),I=typeof P=="string"&&!w&&f(P,m).includes(m.arrayFormatSeparator);P=I?f(P,m):P;const B=w||I?P.split(m.arrayFormatSeparator).map(j=>f(j,m)):P===null?P:f(P,m);T[S]=B};case"bracket-separator":return(S,P,T)=>{const w=/(\[\])$/.test(S);if(S=S.replace(/\[\]$/,""),!w){T[S]=P&&f(P,m);return}const I=P===null?[]:P.split(m.arrayFormatSeparator).map(B=>f(B,m));if(T[S]===void 0){T[S]=I;return}T[S]=[].concat(T[S],I)};default:return(S,P,T)=>{if(T[S]===void 0){T[S]=P;return}T[S]=[].concat(T[S],P)}}}function l(m){if(typeof m!="string"||m.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function u(m,g){return g.encode?g.strict?e(m):encodeURIComponent(m):m}function f(m,g){return g.decode?r(m):m}function d(m){return Array.isArray(m)?m.sort():typeof m=="object"?d(Object.keys(m)).sort((g,S)=>Number(g)-Number(S)).map(g=>m[g]):m}function h(m){const g=m.indexOf("#");return g!==-1&&(m=m.slice(0,g)),m}function p(m){let g="";const S=m.indexOf("#");return S!==-1&&(g=m.slice(S)),g}function v(m){m=h(m);const g=m.indexOf("?");return g===-1?"":m.slice(g+1)}function b(m,g){return g.parseNumbers&&!Number.isNaN(Number(m))&&typeof m=="string"&&m.trim()!==""?m=Number(m):g.parseBooleans&&m!==null&&(m.toLowerCase()==="true"||m.toLowerCase()==="false")&&(m=m.toLowerCase()==="true"),m}function y(m,g){g=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},g),l(g.arrayFormatSeparator);const S=c(g),P=Object.create(null);if(typeof m!="string"||(m=m.trim().replace(/^[?#&]/,""),!m))return P;for(const T of m.split("&")){if(T==="")continue;let[w,I]=n(g.decode?T.replace(/\+/g," "):T,"=");I=I===void 0?null:["comma","separator","bracket-separator"].includes(g.arrayFormat)?I:f(I,g),S(f(w,g),I,P)}for(const T of Object.keys(P)){const w=P[T];if(typeof w=="object"&&w!==null)for(const I of Object.keys(w))w[I]=b(w[I],g);else P[T]=b(w,g)}return g.sort===!1?P:(g.sort===!0?Object.keys(P).sort():Object.keys(P).sort(g.sort)).reduce((T,w)=>{const I=P[w];return I&&typeof I=="object"&&!Array.isArray(I)?T[w]=d(I):T[w]=I,T},Object.create(null))}t.extract=v,t.parse=y,t.stringify=(m,g)=>{if(!m)return"";g=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},g),l(g.arrayFormatSeparator);const S=I=>g.skipNull&&s(m[I])||g.skipEmptyString&&m[I]==="",P=a(g),T={};for(const I of Object.keys(m))S(I)||(T[I]=m[I]);const w=Object.keys(T);return g.sort!==!1&&w.sort(g.sort),w.map(I=>{const B=m[I];return B===void 0?"":B===null?u(I,g):Array.isArray(B)?B.length===0&&g.arrayFormat==="bracket-separator"?u(I,g)+"[]":B.reduce(P(I),[]).join("&"):u(I,g)+"="+u(B,g)}).filter(I=>I.length>0).join("&")},t.parseUrl=(m,g)=>{g=Object.assign({decode:!0},g);const[S,P]=n(m,"#");return Object.assign({url:S.split("?")[0]||"",query:y(v(m),g)},g&&g.parseFragmentIdentifier&&P?{fragmentIdentifier:f(P,g)}:{})},t.stringifyUrl=(m,g)=>{g=Object.assign({encode:!0,strict:!0,[o]:!0},g);const S=h(m.url).split("?")[0]||"",P=t.extract(m.url),T=t.parse(P,{sort:!1}),w=Object.assign(T,m.query);let I=t.stringify(w,g);I&&(I=`?${I}`);let B=p(m.url);return m.fragmentIdentifier&&(B=`#${g[o]?u(m.fragmentIdentifier,g):m.fragmentIdentifier}`),`${S}${I}${B}`},t.pick=(m,g,S)=>{S=Object.assign({parseFragmentIdentifier:!0,[o]:!1},S);const{url:P,query:T,fragmentIdentifier:w}=t.parseUrl(m,S);return t.stringifyUrl({url:P,query:i(T,g),fragmentIdentifier:w},S)},t.exclude=(m,g,S)=>{const P=Array.isArray(g)?T=>!g.includes(T):(T,w)=>!g(T,w);return t.pick(m,P,S)}})(a1);const uwe={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}};function BPe(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function PU(t,e){return t.includes(":")?[t]:e.chains||[]}const TU="base10",ti="base16",v5="base64pad",F8="utf8",IU=0,ep=1,fwe=0,i9=1,m5=12,j8=32;function FPe(){const t=N8.generateKeyPair();return{privateKey:Ss(t.secretKey,ti),publicKey:Ss(t.publicKey,ti)}}function jPe(){const t=Lb.randomBytes(j8);return Ss(t,ti)}function UPe(t,e){const r=N8.sharedKey(vs(t,ti),vs(e,ti)),n=new rge(Ub.SHA256,r).expand(j8);return Ss(n,ti)}function zPe(t){const e=Ub.hash(vs(t,ti));return Ss(e,ti)}function WPe(t){const e=Ub.hash(vs(t,F8));return Ss(e,ti)}function dwe(t){return vs(`${t}`,TU)}function Hb(t){return Number(Ss(t,TU))}function HPe(t){const e=dwe(typeof t.type<"u"?t.type:IU);if(Hb(e)===ep&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?vs(t.senderPublicKey,ti):void 0,n=typeof t.iv<"u"?vs(t.iv,ti):Lb.randomBytes(m5),i=new M8.ChaCha20Poly1305(vs(t.symKey,ti)).seal(n,vs(t.message,F8));return hwe({type:e,sealed:i,iv:n,senderPublicKey:r})}function qPe(t){const e=new M8.ChaCha20Poly1305(vs(t.symKey,ti)),{sealed:r,iv:n}=OU(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Ss(i,F8)}function hwe(t){if(Hb(t.type)===ep){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Ss(FT([t.type,t.senderPublicKey,t.iv,t.sealed]),v5)}return Ss(FT([t.type,t.iv,t.sealed]),v5)}function OU(t){const e=vs(t,v5),r=e.slice(fwe,i9),n=i9;if(Hb(r)===ep){const a=n+j8,c=a+m5,l=e.slice(n,a),u=e.slice(a,c),f=e.slice(c);return{type:r,sealed:f,iv:u,senderPublicKey:l}}const i=n+m5,s=e.slice(n,i),o=e.slice(i);return{type:r,sealed:o,iv:s}}function VPe(t,e){const r=OU(t);return pwe({type:Hb(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Ss(r.senderPublicKey,ti):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function pwe(t){const e=(t==null?void 0:t.type)||IU;if(e===ep){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function GPe(t){return t.type===ep&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var vwe=Object.defineProperty,s9=Object.getOwnPropertySymbols,mwe=Object.prototype.hasOwnProperty,ywe=Object.prototype.propertyIsEnumerable,o9=(t,e,r)=>e in t?vwe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,a9=(t,e)=>{for(var r in e||(e={}))mwe.call(e,r)&&o9(t,r,e[r]);if(s9)for(var r of s9(e))ywe.call(e,r)&&o9(t,r,e[r]);return t};const gwe="ReactNative",qa={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},bwe="js";function RU(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function wwe(){return!SU()&&!!L8()&&navigator.product===gwe}function Ewe(){return!RU()&&!!L8()}function U8(){return wwe()?qa.reactNative:RU()?qa.node:Ewe()?qa.browser:qa.unknown}function xwe(t,e){let r=a1.parse(t);return r=a9(a9({},r),e),t=a1.stringify(r),t}function KPe(){return AU()||{name:"",description:"",url:"",icons:[""]}}function Cwe(){if(U8()===qa.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=pbe();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function Swe(){var t;const e=U8();return e===qa.browser?[e,((t=kU())==null?void 0:t.host)||"unknown"].join(":"):e}function kwe(t,e,r){const n=Cwe(),i=Swe();return[[t,e].join("-"),[bwe,r].join("-"),n,i].join("/")}function QPe({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:o}){const a=r.split("?"),c=kwe(t,e,n),l={auth:i,ua:c,projectId:s,useOnCloseEvent:o||void 0},u=xwe(a[1]||"",l);return a[0]+"?"+u}function yl(t,e){return t.filter(r=>e.includes(r)).length===t.length}function YPe(t){return Object.fromEntries(t.entries())}function JPe(t){return new Map(Object.entries(t))}function XPe(t=kl.FIVE_MINUTES,e){const r=kl.toMiliseconds(t||kl.FIVE_MINUTES);let n,i,s;return{resolve:o=>{s&&n&&(clearTimeout(s),n(o))},reject:o=>{s&&i&&(clearTimeout(s),i(o))},done:()=>new Promise((o,a)=>{s=setTimeout(()=>{a(new Error(e))},r),n=o,i=a})}}function ZPe(t,e,r){return new Promise(async(n,i)=>{const s=setTimeout(()=>i(new Error(r)),e);try{const o=await t;n(o)}catch(o){i(o)}clearTimeout(s)})}function MU(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function eTe(t){return MU("topic",t)}function tTe(t){return MU("id",t)}function rTe(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function nTe(t,e){return kl.fromMiliseconds((e||Date.now())+kl.toMiliseconds(t))}function iTe(t){return Date.now()>=kl.toMiliseconds(t)}function sTe(t,e){return`${t}${e?`:${e}`:""}`}function eE(t=[],e=[]){return[...new Set([...t,...e])]}async function oTe({id:t,topic:e,wcDeepLink:r}){try{if(!r)return;const n=typeof r=="string"?JSON.parse(r):r;let i=n==null?void 0:n.href;if(typeof i!="string")return;i.endsWith("/")&&(i=i.slice(0,-1));const s=`${i}/wc?requestId=${t}&sessionTopic=${e}`,o=U8();o===qa.browser?s.startsWith("https://")?window.open(s,"_blank","noreferrer noopener"):window.open(s,"_self","noreferrer noopener"):o===qa.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(s)}catch(n){console.error(n)}}const Awe="irn";function aTe(t){return(t==null?void 0:t.relay)||{protocol:Awe}}function cTe(t){const e=uwe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var _we=Object.defineProperty,c9=Object.getOwnPropertySymbols,Pwe=Object.prototype.hasOwnProperty,Twe=Object.prototype.propertyIsEnumerable,l9=(t,e,r)=>e in t?_we(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Iwe=(t,e)=>{for(var r in e||(e={}))Pwe.call(e,r)&&l9(t,r,e[r]);if(c9)for(var r of c9(e))Twe.call(e,r)&&l9(t,r,e[r]);return t};function Owe(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),o=t[i];r[s]=o}}),r}function lTe(t){const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",o=a1.parse(s);return{protocol:n,topic:Rwe(i[0]),version:parseInt(i[1],10),symKey:o.symKey,relay:Owe(o)}}function Rwe(t){return t.startsWith("//")?t.substring(2):t}function Mwe(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=r+e+i;t[i]&&(n[s]=t[i])}),n}function uTe(t){return`${t.protocol}:${t.topic}@${t.version}?`+a1.stringify(Iwe({symKey:t.symKey},Mwe(t.relay)))}var $we=Object.defineProperty,Nwe=Object.defineProperties,Dwe=Object.getOwnPropertyDescriptors,u9=Object.getOwnPropertySymbols,Lwe=Object.prototype.hasOwnProperty,Bwe=Object.prototype.propertyIsEnumerable,f9=(t,e,r)=>e in t?$we(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Fwe=(t,e)=>{for(var r in e||(e={}))Lwe.call(e,r)&&f9(t,r,e[r]);if(u9)for(var r of u9(e))Bwe.call(e,r)&&f9(t,r,e[r]);return t},jwe=(t,e)=>Nwe(t,Dwe(e));function _d(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function Uwe(t){const e=[];return Object.values(t).forEach(r=>{e.push(..._d(r.accounts))}),e}function zwe(t,e){const r=[];return Object.values(t).forEach(n=>{_d(n.accounts).includes(e)&&r.push(...n.methods)}),r}function Wwe(t,e){const r=[];return Object.values(t).forEach(n=>{_d(n.accounts).includes(e)&&r.push(...n.events)}),r}function fTe(t,e){const r=Zwe(t,e);if(r)throw new Error(r.message);const n={};for(const[i,s]of Object.entries(t))n[i]={methods:s.methods,events:s.events,chains:s.accounts.map(o=>`${o.split(":")[0]}:${o.split(":")[1]}`)};return n}function $U(t){return t.includes(":")}function Hwe(t){return $U(t)?t.split(":")[0]:t}function NU(t){var e,r,n;const i={};if(!z8(t))return i;for(const[s,o]of Object.entries(t)){const a=$U(s)?[s]:o.chains,c=o.methods||[],l=o.events||[],u=Hwe(s);i[u]=jwe(Fwe({},i[u]),{chains:eE(a,(e=i[u])==null?void 0:e.chains),methods:eE(c,(r=i[u])==null?void 0:r.methods),events:eE(l,(n=i[u])==null?void 0:n.events)})}return i}const qwe={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},Vwe={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function La(t,e){const{message:r,code:n}=Vwe[t];return{message:e?`${r} ${e}`:r,code:n}}function Gf(t,e){const{message:r,code:n}=qwe[t];return{message:e?`${r} ${e}`:r,code:n}}function qb(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function z8(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Al(t){return typeof t>"u"}function Yi(t,e){return e&&Al(t)?!0:typeof t=="string"&&!!t.trim().length}function W8(t,e){return e&&Al(t)?!0:typeof t=="number"&&!isNaN(t)}function dTe(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return yl(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],u=_d(a),f=r[o];(!yl(PU(o,f),u)||!yl(f.methods,c)||!yl(f.events,l))&&(s=!1)}),s):!1}function Oy(t){return Yi(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Gwe(t){if(Yi(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&Oy(r)}}return!1}function hTe(t){if(Yi(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function pTe(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function vTe(t){return t==null?void 0:t.topic}function mTe(t,e){let r=null;return Yi(t==null?void 0:t.publicKey,!1)||(r=La("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function d9(t){let e=!0;return qb(t)?t.length&&(e=t.every(r=>Yi(r,!1))):e=!1,e}function Kwe(t,e,r){let n=null;return qb(e)&&e.length?e.forEach(i=>{n||Oy(i)||(n=Gf("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):Oy(t)||(n=Gf("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function Qwe(t,e,r){let n=null;return Object.entries(t).forEach(([i,s])=>{if(n)return;const o=Kwe(i,PU(i,s),`${e} ${r}`);o&&(n=o)}),n}function Ywe(t,e){let r=null;return qb(t)?t.forEach(n=>{r||Gwe(n)||(r=Gf("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=Gf("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function Jwe(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Ywe(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function Xwe(t,e){let r=null;return d9(t==null?void 0:t.methods)?d9(t==null?void 0:t.events)||(r=Gf("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Gf("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function DU(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Xwe(n,`${e}, namespace`);i&&(r=i)}),r}function yTe(t,e,r){let n=null;if(t&&z8(t)){const i=DU(t,e);i&&(n=i);const s=Qwe(t,e,r);s&&(n=s)}else n=La("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function Zwe(t,e){let r=null;if(t&&z8(t)){const n=DU(t,e);n&&(r=n);const i=Jwe(t,e);i&&(r=i)}else r=La("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function e2e(t){return Yi(t.protocol,!0)}function gTe(t,e){let r=!1;return e&&!t?r=!0:t&&qb(t)&&t.length&&t.forEach(n=>{r=e2e(n)}),r}function bTe(t){return typeof t=="number"}function wTe(t){return typeof t<"u"&&typeof t!==null}function ETe(t){return!(!t||typeof t!="object"||!t.code||!W8(t.code,!1)||!t.message||!Yi(t.message,!1))}function xTe(t){return!(Al(t)||!Yi(t.method,!1))}function CTe(t){return!(Al(t)||Al(t.result)&&Al(t.error)||!W8(t.id,!1)||!Yi(t.jsonrpc,!1))}function STe(t){return!(Al(t)||!Yi(t.name,!1))}function kTe(t,e){return!(!Oy(e)||!Uwe(t).includes(e))}function ATe(t,e,r){return Yi(r,!1)?zwe(t,e).includes(r):!1}function _Te(t,e,r){return Yi(r,!1)?Wwe(t,e).includes(r):!1}function PTe(t,e,r){let n=null;const i=t2e(t),s=r2e(e),o=Object.keys(i),a=Object.keys(s),c=h9(Object.keys(t)),l=h9(Object.keys(e)),u=c.filter(f=>!l.includes(f));return u.length&&(n=La("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. +***************************************************************************** */var w5=function(t,e){return w5=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},w5(t,e)};function nwe(t,e){w5(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var E5=function(){return E5=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function owe(t,e){return function(r,n){e(r,n,t)}}function awe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function cwe(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function lwe(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ZU(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function dwe(){for(var t=[],e=0;e1||a(d,h)})})}function a(d,h){try{c(n[d](h))}catch(p){f(s[0][3],p)}}function c(d){d.value instanceof l1?Promise.resolve(d.value.v).then(l,u):f(s[0][2],d)}function l(d){a("next",d)}function u(d){a("throw",d)}function f(d,h){d(h),s.shift(),s.length&&a(s[0][0],s[0][1])}}function vwe(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:l1(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function mwe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof x5=="function"?x5(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function ywe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function gwe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function bwe(t){return t&&t.__esModule?t:{default:t}}function wwe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Ewe(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const xwe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return E5},__asyncDelegator:vwe,__asyncGenerator:pwe,__asyncValues:mwe,__await:l1,__awaiter:cwe,__classPrivateFieldGet:wwe,__classPrivateFieldSet:Ewe,__createBinding:uwe,__decorate:swe,__exportStar:fwe,__extends:nwe,__generator:lwe,__importDefault:bwe,__importStar:gwe,__makeTemplateObject:ywe,__metadata:awe,__param:owe,__read:ZU,__rest:iwe,__spread:dwe,__spreadArrays:hwe,__values:x5},Symbol.toStringTag,{value:"Module"})),Yb=u7(xwe);var nE={},ih={},r9;function Cwe(){if(r9)return ih;r9=1,Object.defineProperty(ih,"__esModule",{value:!0}),ih.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return ih.delay=t,ih}var Jc={},iE={},Xc={},n9;function Swe(){return n9||(n9=1,Object.defineProperty(Xc,"__esModule",{value:!0}),Xc.ONE_THOUSAND=Xc.ONE_HUNDRED=void 0,Xc.ONE_HUNDRED=100,Xc.ONE_THOUSAND=1e3),Xc}var sE={},i9;function kwe(){return i9||(i9=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(sE)),sE}var s9;function ez(){return s9||(s9=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Yb;e.__exportStar(Swe(),t),e.__exportStar(kwe(),t)}(iE)),iE}var o9;function Awe(){if(o9)return Jc;o9=1,Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.fromMiliseconds=Jc.toMiliseconds=void 0;const t=ez();function e(n){return n*t.ONE_THOUSAND}Jc.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Jc.fromMiliseconds=r,Jc}var a9;function _we(){return a9||(a9=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Yb;e.__exportStar(Cwe(),t),e.__exportStar(Awe(),t)}(nE)),nE}var Eu={},c9;function Pwe(){if(c9)return Eu;c9=1,Object.defineProperty(Eu,"__esModule",{value:!0}),Eu.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return Eu.Watch=t,Eu.default=t,Eu}var oE={},sh={},l9;function Twe(){if(l9)return sh;l9=1,Object.defineProperty(sh,"__esModule",{value:!0}),sh.IWatch=void 0;class t{}return sh.IWatch=t,sh}var u9;function Iwe(){return u9||(u9=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Yb.__exportStar(Twe(),t)}(oE)),oE}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Yb;e.__exportStar(_we(),t),e.__exportStar(Pwe(),t),e.__exportStar(Iwe(),t),e.__exportStar(ez(),t)})(Al);var pt={};Object.defineProperty(pt,"__esModule",{value:!0});pt.getLocalStorage=pt.getLocalStorageOrThrow=pt.getCrypto=pt.getCryptoOrThrow=rz=pt.getLocation=pt.getLocationOrThrow=G8=pt.getNavigator=pt.getNavigatorOrThrow=tz=pt.getDocument=pt.getDocumentOrThrow=pt.getFromWindowOrThrow=pt.getFromWindow=void 0;function ou(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}pt.getFromWindow=ou;function Td(t){const e=ou(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}pt.getFromWindowOrThrow=Td;function Owe(){return Td("document")}pt.getDocumentOrThrow=Owe;function Rwe(){return ou("document")}var tz=pt.getDocument=Rwe;function $we(){return Td("navigator")}pt.getNavigatorOrThrow=$we;function Mwe(){return ou("navigator")}var G8=pt.getNavigator=Mwe;function Nwe(){return Td("location")}pt.getLocationOrThrow=Nwe;function Dwe(){return ou("location")}var rz=pt.getLocation=Dwe;function Lwe(){return Td("crypto")}pt.getCryptoOrThrow=Lwe;function Fwe(){return ou("crypto")}pt.getCrypto=Fwe;function Bwe(){return Td("localStorage")}pt.getLocalStorageOrThrow=Bwe;function jwe(){return ou("localStorage")}pt.getLocalStorage=jwe;var K8={};Object.defineProperty(K8,"__esModule",{value:!0});var nz=K8.getWindowMetadata=void 0;const f9=pt;function Uwe(){let t,e;try{t=f9.getDocumentOrThrow(),e=f9.getLocationOrThrow()}catch{return null}function r(){const f=t.getElementsByTagName("link"),d=[];for(let h=0;h-1){const b=p.getAttribute("href");if(b)if(b.toLowerCase().indexOf("https:")===-1&&b.toLowerCase().indexOf("http:")===-1&&b.indexOf("//")!==0){let y=e.protocol+"//"+e.host;if(b.indexOf("/")===0)y+=b;else{const m=e.pathname.split("/");m.pop();const g=m.join("/");y+=g+"/"+b}d.push(y)}else if(b.indexOf("//")===0){const y=e.protocol+b;d.push(y)}else d.push(b)}}return d}function n(...f){const d=t.getElementsByTagName("meta");for(let h=0;hp.getAttribute(b)).filter(b=>b?f.includes(b):!1);if(v.length&&v){const b=p.getAttribute("content");if(b)return b}}return""}function i(){let f=n("name","og:site_name","og:title","twitter:title");return f||(f=t.title),f}function s(){return n("description","og:description","twitter:description","keywords")}const o=i(),a=s(),c=e.origin,l=r();return{description:a,url:c,icons:l,name:o}}nz=K8.getWindowMetadata=Uwe;var u1={},zwe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),iz="%[a-f0-9]{2}",d9=new RegExp("("+iz+")|([^%]+?)","gi"),h9=new RegExp("("+iz+")+","gi");function C5(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],C5(r),C5(n))}function Wwe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(d9)||[],r=1;r{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},Gwe=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),s=0;sm==null,o=Symbol("encodeFragmentIdentifier");function a(m){switch(m.arrayFormat){case"index":return g=>(S,P)=>{const T=S.length;return P===void 0||m.skipNull&&P===null||m.skipEmptyString&&P===""?S:P===null?[...S,[u(g,m),"[",T,"]"].join("")]:[...S,[u(g,m),"[",u(T,m),"]=",u(P,m)].join("")]};case"bracket":return g=>(S,P)=>P===void 0||m.skipNull&&P===null||m.skipEmptyString&&P===""?S:P===null?[...S,[u(g,m),"[]"].join("")]:[...S,[u(g,m),"[]=",u(P,m)].join("")];case"colon-list-separator":return g=>(S,P)=>P===void 0||m.skipNull&&P===null||m.skipEmptyString&&P===""?S:P===null?[...S,[u(g,m),":list="].join("")]:[...S,[u(g,m),":list=",u(P,m)].join("")];case"comma":case"separator":case"bracket-separator":{const g=m.arrayFormat==="bracket-separator"?"[]=":"=";return S=>(P,T)=>T===void 0||m.skipNull&&T===null||m.skipEmptyString&&T===""?P:(T=T===null?"":T,P.length===0?[[u(S,m),g,u(T,m)].join("")]:[[P,u(T,m)].join(m.arrayFormatSeparator)])}default:return g=>(S,P)=>P===void 0||m.skipNull&&P===null||m.skipEmptyString&&P===""?S:P===null?[...S,u(g,m)]:[...S,[u(g,m),"=",u(P,m)].join("")]}}function c(m){let g;switch(m.arrayFormat){case"index":return(S,P,T)=>{if(g=/\[(\d*)\]$/.exec(S),S=S.replace(/\[\d*\]$/,""),!g){T[S]=P;return}T[S]===void 0&&(T[S]={}),T[S][g[1]]=P};case"bracket":return(S,P,T)=>{if(g=/(\[\])$/.exec(S),S=S.replace(/\[\]$/,""),!g){T[S]=P;return}if(T[S]===void 0){T[S]=[P];return}T[S]=[].concat(T[S],P)};case"colon-list-separator":return(S,P,T)=>{if(g=/(:list)$/.exec(S),S=S.replace(/:list$/,""),!g){T[S]=P;return}if(T[S]===void 0){T[S]=[P];return}T[S]=[].concat(T[S],P)};case"comma":case"separator":return(S,P,T)=>{const w=typeof P=="string"&&P.includes(m.arrayFormatSeparator),I=typeof P=="string"&&!w&&f(P,m).includes(m.arrayFormatSeparator);P=I?f(P,m):P;const F=w||I?P.split(m.arrayFormatSeparator).map(j=>f(j,m)):P===null?P:f(P,m);T[S]=F};case"bracket-separator":return(S,P,T)=>{const w=/(\[\])$/.test(S);if(S=S.replace(/\[\]$/,""),!w){T[S]=P&&f(P,m);return}const I=P===null?[]:P.split(m.arrayFormatSeparator).map(F=>f(F,m));if(T[S]===void 0){T[S]=I;return}T[S]=[].concat(T[S],I)};default:return(S,P,T)=>{if(T[S]===void 0){T[S]=P;return}T[S]=[].concat(T[S],P)}}}function l(m){if(typeof m!="string"||m.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function u(m,g){return g.encode?g.strict?e(m):encodeURIComponent(m):m}function f(m,g){return g.decode?r(m):m}function d(m){return Array.isArray(m)?m.sort():typeof m=="object"?d(Object.keys(m)).sort((g,S)=>Number(g)-Number(S)).map(g=>m[g]):m}function h(m){const g=m.indexOf("#");return g!==-1&&(m=m.slice(0,g)),m}function p(m){let g="";const S=m.indexOf("#");return S!==-1&&(g=m.slice(S)),g}function v(m){m=h(m);const g=m.indexOf("?");return g===-1?"":m.slice(g+1)}function b(m,g){return g.parseNumbers&&!Number.isNaN(Number(m))&&typeof m=="string"&&m.trim()!==""?m=Number(m):g.parseBooleans&&m!==null&&(m.toLowerCase()==="true"||m.toLowerCase()==="false")&&(m=m.toLowerCase()==="true"),m}function y(m,g){g=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},g),l(g.arrayFormatSeparator);const S=c(g),P=Object.create(null);if(typeof m!="string"||(m=m.trim().replace(/^[?#&]/,""),!m))return P;for(const T of m.split("&")){if(T==="")continue;let[w,I]=n(g.decode?T.replace(/\+/g," "):T,"=");I=I===void 0?null:["comma","separator","bracket-separator"].includes(g.arrayFormat)?I:f(I,g),S(f(w,g),I,P)}for(const T of Object.keys(P)){const w=P[T];if(typeof w=="object"&&w!==null)for(const I of Object.keys(w))w[I]=b(w[I],g);else P[T]=b(w,g)}return g.sort===!1?P:(g.sort===!0?Object.keys(P).sort():Object.keys(P).sort(g.sort)).reduce((T,w)=>{const I=P[w];return I&&typeof I=="object"&&!Array.isArray(I)?T[w]=d(I):T[w]=I,T},Object.create(null))}t.extract=v,t.parse=y,t.stringify=(m,g)=>{if(!m)return"";g=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},g),l(g.arrayFormatSeparator);const S=I=>g.skipNull&&s(m[I])||g.skipEmptyString&&m[I]==="",P=a(g),T={};for(const I of Object.keys(m))S(I)||(T[I]=m[I]);const w=Object.keys(T);return g.sort!==!1&&w.sort(g.sort),w.map(I=>{const F=m[I];return F===void 0?"":F===null?u(I,g):Array.isArray(F)?F.length===0&&g.arrayFormat==="bracket-separator"?u(I,g)+"[]":F.reduce(P(I),[]).join("&"):u(I,g)+"="+u(F,g)}).filter(I=>I.length>0).join("&")},t.parseUrl=(m,g)=>{g=Object.assign({decode:!0},g);const[S,P]=n(m,"#");return Object.assign({url:S.split("?")[0]||"",query:y(v(m),g)},g&&g.parseFragmentIdentifier&&P?{fragmentIdentifier:f(P,g)}:{})},t.stringifyUrl=(m,g)=>{g=Object.assign({encode:!0,strict:!0,[o]:!0},g);const S=h(m.url).split("?")[0]||"",P=t.extract(m.url),T=t.parse(P,{sort:!1}),w=Object.assign(T,m.query);let I=t.stringify(w,g);I&&(I=`?${I}`);let F=p(m.url);return m.fragmentIdentifier&&(F=`#${g[o]?u(m.fragmentIdentifier,g):m.fragmentIdentifier}`),`${S}${I}${F}`},t.pick=(m,g,S)=>{S=Object.assign({parseFragmentIdentifier:!0,[o]:!1},S);const{url:P,query:T,fragmentIdentifier:w}=t.parseUrl(m,S);return t.stringifyUrl({url:P,query:i(T,g),fragmentIdentifier:w},S)},t.exclude=(m,g,S)=>{const P=Array.isArray(g)?T=>!g.includes(T):(T,w)=>!g(T,w);return t.pick(m,P,S)}})(u1);const Kwe={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}};function xTe(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function sz(t,e){return t.includes(":")?[t]:e.chains||[]}const oz="base10",ri="base16",S5="base64pad",Q8="utf8",az=0,sp=1,Qwe=0,p9=1,k5=12,Y8=32;function CTe(){const t=q8.generateKeyPair();return{privateKey:_s(t.secretKey,ri),publicKey:_s(t.publicKey,ri)}}function STe(){const t=Hb.randomBytes(Y8);return _s(t,ri)}function kTe(t,e){const r=q8.sharedKey(gs(t,ri),gs(e,ri)),n=new jge(Kb.SHA256,r).expand(Y8);return _s(n,ri)}function ATe(t){const e=Kb.hash(gs(t,ri));return _s(e,ri)}function _Te(t){const e=Kb.hash(gs(t,Q8));return _s(e,ri)}function Ywe(t){return gs(`${t}`,oz)}function Jb(t){return Number(_s(t,oz))}function PTe(t){const e=Ywe(typeof t.type<"u"?t.type:az);if(Jb(e)===sp&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?gs(t.senderPublicKey,ri):void 0,n=typeof t.iv<"u"?gs(t.iv,ri):Hb.randomBytes(k5),i=new W8.ChaCha20Poly1305(gs(t.symKey,ri)).seal(n,gs(t.message,Q8));return Jwe({type:e,sealed:i,iv:n,senderPublicKey:r})}function TTe(t){const e=new W8.ChaCha20Poly1305(gs(t.symKey,ri)),{sealed:r,iv:n}=cz(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return _s(i,Q8)}function Jwe(t){if(Jb(t.type)===sp){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return _s(QT([t.type,t.senderPublicKey,t.iv,t.sealed]),S5)}return _s(QT([t.type,t.iv,t.sealed]),S5)}function cz(t){const e=gs(t,S5),r=e.slice(Qwe,p9),n=p9;if(Jb(r)===sp){const a=n+Y8,c=a+k5,l=e.slice(n,a),u=e.slice(a,c),f=e.slice(c);return{type:r,sealed:f,iv:u,senderPublicKey:l}}const i=n+k5,s=e.slice(n,i),o=e.slice(i);return{type:r,sealed:o,iv:s}}function ITe(t,e){const r=cz(t);return Xwe({type:Jb(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?_s(r.senderPublicKey,ri):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function Xwe(t){const e=(t==null?void 0:t.type)||az;if(e===sp){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function OTe(t){return t.type===sp&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var Zwe=Object.defineProperty,v9=Object.getOwnPropertySymbols,e2e=Object.prototype.hasOwnProperty,t2e=Object.prototype.propertyIsEnumerable,m9=(t,e,r)=>e in t?Zwe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,y9=(t,e)=>{for(var r in e||(e={}))e2e.call(e,r)&&m9(t,r,e[r]);if(v9)for(var r of v9(e))t2e.call(e,r)&&m9(t,r,e[r]);return t};const r2e="ReactNative",Va={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},n2e="js";function lz(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function i2e(){return!tz()&&!!G8()&&navigator.product===r2e}function s2e(){return!lz()&&!!G8()}function J8(){return i2e()?Va.reactNative:lz()?Va.node:s2e()?Va.browser:Va.unknown}function o2e(t,e){let r=u1.parse(t);return r=y9(y9({},r),e),t=u1.stringify(r),t}function RTe(){return nz()||{name:"",description:"",url:"",icons:[""]}}function a2e(){if(J8()===Va.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=Xbe();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function c2e(){var t;const e=J8();return e===Va.browser?[e,((t=rz())==null?void 0:t.host)||"unknown"].join(":"):e}function l2e(t,e,r){const n=a2e(),i=c2e();return[[t,e].join("-"),[n2e,r].join("-"),n,i].join("/")}function $Te({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:o}){const a=r.split("?"),c=l2e(t,e,n),l={auth:i,ua:c,projectId:s,useOnCloseEvent:o||void 0},u=o2e(a[1]||"",l);return a[0]+"?"+u}function yl(t,e){return t.filter(r=>e.includes(r)).length===t.length}function MTe(t){return Object.fromEntries(t.entries())}function NTe(t){return new Map(Object.entries(t))}function DTe(t=Al.FIVE_MINUTES,e){const r=Al.toMiliseconds(t||Al.FIVE_MINUTES);let n,i,s;return{resolve:o=>{s&&n&&(clearTimeout(s),n(o))},reject:o=>{s&&i&&(clearTimeout(s),i(o))},done:()=>new Promise((o,a)=>{s=setTimeout(()=>{a(new Error(e))},r),n=o,i=a})}}function LTe(t,e,r){return new Promise(async(n,i)=>{const s=setTimeout(()=>i(new Error(r)),e);try{const o=await t;n(o)}catch(o){i(o)}clearTimeout(s)})}function uz(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function FTe(t){return uz("topic",t)}function BTe(t){return uz("id",t)}function jTe(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function UTe(t,e){return Al.fromMiliseconds((e||Date.now())+Al.toMiliseconds(t))}function zTe(t){return Date.now()>=Al.toMiliseconds(t)}function WTe(t,e){return`${t}${e?`:${e}`:""}`}function aE(t=[],e=[]){return[...new Set([...t,...e])]}async function HTe({id:t,topic:e,wcDeepLink:r}){try{if(!r)return;const n=typeof r=="string"?JSON.parse(r):r;let i=n==null?void 0:n.href;if(typeof i!="string")return;i.endsWith("/")&&(i=i.slice(0,-1));const s=`${i}/wc?requestId=${t}&sessionTopic=${e}`,o=J8();o===Va.browser?s.startsWith("https://")?window.open(s,"_blank","noreferrer noopener"):window.open(s,"_self","noreferrer noopener"):o===Va.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(s)}catch(n){console.error(n)}}const u2e="irn";function qTe(t){return(t==null?void 0:t.relay)||{protocol:u2e}}function VTe(t){const e=Kwe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var f2e=Object.defineProperty,g9=Object.getOwnPropertySymbols,d2e=Object.prototype.hasOwnProperty,h2e=Object.prototype.propertyIsEnumerable,b9=(t,e,r)=>e in t?f2e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,p2e=(t,e)=>{for(var r in e||(e={}))d2e.call(e,r)&&b9(t,r,e[r]);if(g9)for(var r of g9(e))h2e.call(e,r)&&b9(t,r,e[r]);return t};function v2e(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),o=t[i];r[s]=o}}),r}function GTe(t){const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",o=u1.parse(s);return{protocol:n,topic:m2e(i[0]),version:parseInt(i[1],10),symKey:o.symKey,relay:v2e(o)}}function m2e(t){return t.startsWith("//")?t.substring(2):t}function y2e(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=r+e+i;t[i]&&(n[s]=t[i])}),n}function KTe(t){return`${t.protocol}:${t.topic}@${t.version}?`+u1.stringify(p2e({symKey:t.symKey},y2e(t.relay)))}var g2e=Object.defineProperty,b2e=Object.defineProperties,w2e=Object.getOwnPropertyDescriptors,w9=Object.getOwnPropertySymbols,E2e=Object.prototype.hasOwnProperty,x2e=Object.prototype.propertyIsEnumerable,E9=(t,e,r)=>e in t?g2e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,C2e=(t,e)=>{for(var r in e||(e={}))E2e.call(e,r)&&E9(t,r,e[r]);if(w9)for(var r of w9(e))x2e.call(e,r)&&E9(t,r,e[r]);return t},S2e=(t,e)=>b2e(t,w2e(e));function Id(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function k2e(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Id(r.accounts))}),e}function A2e(t,e){const r=[];return Object.values(t).forEach(n=>{Id(n.accounts).includes(e)&&r.push(...n.methods)}),r}function _2e(t,e){const r=[];return Object.values(t).forEach(n=>{Id(n.accounts).includes(e)&&r.push(...n.events)}),r}function QTe(t,e){const r=L2e(t,e);if(r)throw new Error(r.message);const n={};for(const[i,s]of Object.entries(t))n[i]={methods:s.methods,events:s.events,chains:s.accounts.map(o=>`${o.split(":")[0]}:${o.split(":")[1]}`)};return n}function fz(t){return t.includes(":")}function P2e(t){return fz(t)?t.split(":")[0]:t}function dz(t){var e,r,n;const i={};if(!X8(t))return i;for(const[s,o]of Object.entries(t)){const a=fz(s)?[s]:o.chains,c=o.methods||[],l=o.events||[],u=P2e(s);i[u]=S2e(C2e({},i[u]),{chains:aE(a,(e=i[u])==null?void 0:e.chains),methods:aE(c,(r=i[u])==null?void 0:r.methods),events:aE(l,(n=i[u])==null?void 0:n.events)})}return i}const T2e={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},I2e={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function Fa(t,e){const{message:r,code:n}=I2e[t];return{message:e?`${r} ${e}`:r,code:n}}function Yf(t,e){const{message:r,code:n}=T2e[t];return{message:e?`${r} ${e}`:r,code:n}}function Xb(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function X8(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function _l(t){return typeof t>"u"}function Ji(t,e){return e&&_l(t)?!0:typeof t=="string"&&!!t.trim().length}function Z8(t,e){return e&&_l(t)?!0:typeof t=="number"&&!isNaN(t)}function YTe(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return yl(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],u=Id(a),f=r[o];(!yl(sz(o,f),u)||!yl(f.methods,c)||!yl(f.events,l))&&(s=!1)}),s):!1}function Ly(t){return Ji(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function O2e(t){if(Ji(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&Ly(r)}}return!1}function JTe(t){if(Ji(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function XTe(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function ZTe(t){return t==null?void 0:t.topic}function e9e(t,e){let r=null;return Ji(t==null?void 0:t.publicKey,!1)||(r=Fa("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function x9(t){let e=!0;return Xb(t)?t.length&&(e=t.every(r=>Ji(r,!1))):e=!1,e}function R2e(t,e,r){let n=null;return Xb(e)&&e.length?e.forEach(i=>{n||Ly(i)||(n=Yf("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):Ly(t)||(n=Yf("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function $2e(t,e,r){let n=null;return Object.entries(t).forEach(([i,s])=>{if(n)return;const o=R2e(i,sz(i,s),`${e} ${r}`);o&&(n=o)}),n}function M2e(t,e){let r=null;return Xb(t)?t.forEach(n=>{r||O2e(n)||(r=Yf("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=Yf("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function N2e(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=M2e(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function D2e(t,e){let r=null;return x9(t==null?void 0:t.methods)?x9(t==null?void 0:t.events)||(r=Yf("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Yf("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function hz(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=D2e(n,`${e}, namespace`);i&&(r=i)}),r}function t9e(t,e,r){let n=null;if(t&&X8(t)){const i=hz(t,e);i&&(n=i);const s=$2e(t,e,r);s&&(n=s)}else n=Fa("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function L2e(t,e){let r=null;if(t&&X8(t)){const n=hz(t,e);n&&(r=n);const i=N2e(t,e);i&&(r=i)}else r=Fa("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function F2e(t){return Ji(t.protocol,!0)}function r9e(t,e){let r=!1;return e&&!t?r=!0:t&&Xb(t)&&t.length&&t.forEach(n=>{r=F2e(n)}),r}function n9e(t){return typeof t=="number"}function i9e(t){return typeof t<"u"&&typeof t!==null}function s9e(t){return!(!t||typeof t!="object"||!t.code||!Z8(t.code,!1)||!t.message||!Ji(t.message,!1))}function o9e(t){return!(_l(t)||!Ji(t.method,!1))}function a9e(t){return!(_l(t)||_l(t.result)&&_l(t.error)||!Z8(t.id,!1)||!Ji(t.jsonrpc,!1))}function c9e(t){return!(_l(t)||!Ji(t.name,!1))}function l9e(t,e){return!(!Ly(e)||!k2e(t).includes(e))}function u9e(t,e,r){return Ji(r,!1)?A2e(t,e).includes(r):!1}function f9e(t,e,r){return Ji(r,!1)?_2e(t,e).includes(r):!1}function d9e(t,e,r){let n=null;const i=B2e(t),s=j2e(e),o=Object.keys(i),a=Object.keys(s),c=C9(Object.keys(t)),l=C9(Object.keys(e)),u=c.filter(f=>!l.includes(f));return u.length&&(n=Fa("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. Required: ${u.toString()} - Received: ${Object.keys(e).toString()}`)),yl(o,a)||(n=La("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. + Received: ${Object.keys(e).toString()}`)),yl(o,a)||(n=Fa("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. Required: ${o.toString()} - Approved: ${a.toString()}`)),Object.keys(e).forEach(f=>{if(!f.includes(":")||n)return;const d=_d(e[f].accounts);d.includes(f)||(n=La("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${f} + Approved: ${a.toString()}`)),Object.keys(e).forEach(f=>{if(!f.includes(":")||n)return;const d=Id(e[f].accounts);d.includes(f)||(n=Fa("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${f} Required: ${f} - Approved: ${d.toString()}`))}),o.forEach(f=>{n||(yl(i[f].methods,s[f].methods)?yl(i[f].events,s[f].events)||(n=La("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${f}`)):n=La("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${f}`))}),n}function t2e(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function h9(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function r2e(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=_d(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(s=>s.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function TTe(t,e){return W8(t,!1)&&t<=e.max&&t>=e.min}var LU="eip155",n2e="store",BU="requestedChains",y5="wallet_addEthereumChain",or,Xh,Gv,g5,H8,FU,Kv,b5,w5,jU,Ry,q8,Ru,mh,My,V8,$y,G8,Ny,K8,i2e=class extends ab{constructor(t){super({...t,options:{isNewChainsStale:!0,...t.options}}),Jr(this,Gv),Jr(this,H8),Jr(this,Kv),Jr(this,w5),Jr(this,Ry),Jr(this,Ru),Jr(this,My),Jr(this,$y),Jr(this,Ny),st(this,"id","walletConnect"),st(this,"name","WalletConnect"),st(this,"ready",!0),Jr(this,or,void 0),Jr(this,Xh,void 0),st(this,"onAccountsChanged",e=>{e.length===0?this.emit("disconnect"):this.emit("change",{account:Li(e[0])})}),st(this,"onChainChanged",e=>{const r=Number(e),n=this.isChainUnsupported(r);this.emit("change",{chain:{id:r,unsupported:n}})}),st(this,"onDisconnect",()=>{Or(this,Ru,mh).call(this,[]),this.emit("disconnect")}),st(this,"onDisplayUri",e=>{this.emit("message",{type:"display_uri",data:e})}),st(this,"onConnect",()=>{this.emit("connect",{})}),Or(this,Gv,g5).call(this)}async connect({chainId:t,pairingTopic:e}={}){var r,n,i,s,o;try{let a=t;if(!a){const p=(r=this.storage)==null?void 0:r.getItem(n2e),v=(s=(i=(n=p==null?void 0:p.state)==null?void 0:n.data)==null?void 0:i.chain)==null?void 0:s.id;v&&!this.isChainUnsupported(v)?a=v:a=(o=this.chains[0])==null?void 0:o.id}if(!a)throw new Error("No chains found on connector.");const c=await this.getProvider();Or(this,w5,jU).call(this);const l=Or(this,Kv,b5).call(this);if(c.session&&l&&await c.disconnect(),!c.session||l){const p=this.chains.filter(v=>v.id!==a).map(v=>v.id);this.emit("message",{type:"connecting"}),await c.connect({pairingTopic:e,chains:[a],optionalChains:p.length?p:void 0}),Or(this,Ru,mh).call(this,this.chains.map(({id:v})=>v))}const u=await c.enable(),f=Li(u[0]),d=await this.getChainId(),h=this.isChainUnsupported(d);return{account:f,chain:{id:d,unsupported:h}}}catch(a){throw/user rejected/i.test(a==null?void 0:a.message)?new Vr(a):a}}async disconnect(){const t=await this.getProvider();try{await t.disconnect()}catch(e){if(!/No matching key/i.test(e.message))throw e}finally{Or(this,Ry,q8).call(this),Or(this,Ru,mh).call(this,[])}}async getAccount(){const{accounts:t}=await this.getProvider();return Li(t[0])}async getChainId(){const{chainId:t}=await this.getProvider();return t}async getProvider({chainId:t}={}){return Je(this,or)||await Or(this,Gv,g5).call(this),t&&await this.switchChain(t),Je(this,or)}async getWalletClient({chainId:t}={}){const[e,r]=await Promise.all([this.getProvider({chainId:t}),this.getAccount()]),n=this.chains.find(i=>i.id===t);if(!e)throw new Error("provider is required.");return bb({account:r,chain:n,transport:BS(e)})}async isAuthorized(){try{const[t,e]=await Promise.all([this.getAccount(),this.getProvider()]),r=Or(this,Kv,b5).call(this);if(!t)return!1;if(r&&e.session){try{await e.disconnect()}catch{}return!1}return!0}catch{return!1}}async switchChain(t){var r,n;const e=this.chains.find(i=>i.id===t);if(!e)throw new mc(new Error("chain not found on connector."));try{const i=await this.getProvider(),s=Or(this,$y,G8).call(this),o=Or(this,Ny,K8).call(this);if(!s.includes(t)&&o.includes(y5)){await i.request({method:y5,params:[{chainId:ze(e.id),blockExplorerUrls:[(n=(r=e.blockExplorers)==null?void 0:r.default)==null?void 0:n.url],chainName:e.name,nativeCurrency:e.nativeCurrency,rpcUrls:[...e.rpcUrls.default.http]}]});const c=Or(this,My,V8).call(this);c.push(t),Or(this,Ru,mh).call(this,c)}return await i.request({method:"wallet_switchEthereumChain",params:[{chainId:ze(t)}]}),e}catch(i){const s=typeof i=="string"?i:i==null?void 0:i.message;throw/user rejected request/i.test(s)?new Vr(i):new mc(i)}}};or=new WeakMap;Xh=new WeakMap;Gv=new WeakSet;g5=async function(){return!Je(this,Xh)&&typeof window<"u"&&Mo(this,Xh,Or(this,H8,FU).call(this)),Je(this,Xh)};H8=new WeakSet;FU=async function(){const{EthereumProvider:t,OPTIONAL_EVENTS:e,OPTIONAL_METHODS:r}=await XL(()=>import("./index.es-47158634.js"),[],import.meta.url),[n,...i]=this.chains.map(({id:s})=>s);if(n){const{projectId:s,showQrModal:o=!0,qrModalOptions:a,metadata:c,relayUrl:l}=this.options;Mo(this,or,await t.init({showQrModal:o,qrModalOptions:a,projectId:s,optionalMethods:r,optionalEvents:e,chains:[n],optionalChains:i.length?i:void 0,rpcMap:Object.fromEntries(this.chains.map(u=>[u.id,u.rpcUrls.default.http[0]])),metadata:c,relayUrl:l}))}};Kv=new WeakSet;b5=function(){if(Or(this,Ny,K8).call(this).includes(y5)||!this.options.isNewChainsStale)return!1;const e=Or(this,My,V8).call(this),r=this.chains.map(({id:i})=>i),n=Or(this,$y,G8).call(this);return n.length&&!n.some(i=>r.includes(i))?!1:!r.every(i=>e.includes(i))};w5=new WeakSet;jU=function(){Je(this,or)&&(Or(this,Ry,q8).call(this),Je(this,or).on("accountsChanged",this.onAccountsChanged),Je(this,or).on("chainChanged",this.onChainChanged),Je(this,or).on("disconnect",this.onDisconnect),Je(this,or).on("session_delete",this.onDisconnect),Je(this,or).on("display_uri",this.onDisplayUri),Je(this,or).on("connect",this.onConnect))};Ry=new WeakSet;q8=function(){Je(this,or)&&(Je(this,or).removeListener("accountsChanged",this.onAccountsChanged),Je(this,or).removeListener("chainChanged",this.onChainChanged),Je(this,or).removeListener("disconnect",this.onDisconnect),Je(this,or).removeListener("session_delete",this.onDisconnect),Je(this,or).removeListener("display_uri",this.onDisplayUri),Je(this,or).removeListener("connect",this.onConnect))};Ru=new WeakSet;mh=function(t){var e;(e=this.storage)==null||e.setItem(BU,t)};My=new WeakSet;V8=function(){var t;return((t=this.storage)==null?void 0:t.getItem(BU))??[]};$y=new WeakSet;G8=function(){var n,i,s;if(!Je(this,or))return[];const t=(n=Je(this,or).session)==null?void 0:n.namespaces;return t?((s=(i=NU(t)[LU])==null?void 0:i.chains)==null?void 0:s.map(o=>parseInt(o.split(":")[1]||"")))??[]:[]};Ny=new WeakSet;K8=function(){var n,i;if(!Je(this,or))return[];const t=(n=Je(this,or).session)==null?void 0:n.namespaces;return t?((i=NU(t)[LU])==null?void 0:i.methods)??[]:[]};var nl,Ls,s2e=class{constructor(t){st(this,"events",new EL),st(this,"chainId"),Jr(this,nl,void 0),Jr(this,Ls,void 0),this.chainId=t.chainId,Mo(this,nl,t)}async enable(){var e;if((e=Je(this,nl).flags)!=null&&e.failConnect)throw new Vr(new Error("Failed to connect."));Je(this,Ls)||Mo(this,Ls,Je(this,nl).walletClient);const t=Je(this,Ls).account.address;return this.events.emit("accountsChanged",[t]),[t]}async disconnect(){this.events.emit("disconnect"),Mo(this,Ls,void 0)}async getAccounts(){var e;const t=(e=Je(this,Ls))==null?void 0:e.account.address;return t?[Li(t)]:[]}getWalletClient(){const t=Je(this,Ls);if(!t)throw new Error("walletClient not found");return t}async switchChain(t){var e;if((e=Je(this,nl).flags)!=null&&e.failSwitchChain)throw new Vr(new Error("Failed to switch chain."));Je(this,nl).chainId=t,this.chainId=t,this.events.emit("chainChanged",t)}async switchWalletClient(t){const e=t.account.address;Mo(this,Ls,t),this.events.emit("accountsChanged",[e])}async watchAsset(t){return!0}async request({method:t,params:e}){var r;return(r=Je(this,Ls))==null?void 0:r.transport.request({method:t,params:e})}on(t,e){return this.events.on(t,e),this}removeListener(t,e){return this.events.removeListener(t,e),this}toJSON(){return""}};nl=new WeakMap;Ls=new WeakMap;var yh,E5,UU,o2e=class extends ab{constructor({chains:t,options:e}){var r;super({chains:t,options:{...e,chainId:e.chainId??((r=t==null?void 0:t[0])==null?void 0:r.id)}}),Jr(this,E5),st(this,"id","mock"),st(this,"name","Mock"),st(this,"ready",!0),Jr(this,yh,void 0),st(this,"onAccountsChanged",n=>{n.length===0?this.emit("disconnect"):this.emit("change",{account:Li(n[0])})}),st(this,"onChainChanged",n=>{const i=Fh(n),s=this.isChainUnsupported(i);this.emit("change",{chain:{id:i,unsupported:s}})}),st(this,"onDisconnect",()=>{this.emit("disconnect")})}async connect({chainId:t}={}){var a;const e=await this.getProvider({chainId:t});e.on("accountsChanged",this.onAccountsChanged),e.on("chainChanged",this.onChainChanged),e.on("disconnect",this.onDisconnect),this.emit("message",{type:"connecting"});const r=await e.enable(),n=Li(r[0]),i=Fh(e.chainId),s=this.isChainUnsupported(i),o={account:n,chain:{id:i,unsupported:s},provider:e};return(a=this.options.flags)!=null&&a.noSwitchChain||(this.switchChain=Or(this,E5,UU)),new Promise(c=>setTimeout(()=>c(o),100))}async disconnect(){const t=await this.getProvider();await t.disconnect(),t.removeListener("accountsChanged",this.onAccountsChanged),t.removeListener("chainChanged",this.onChainChanged),t.removeListener("disconnect",this.onDisconnect)}async getAccount(){const r=(await(await this.getProvider()).getAccounts())[0];if(!r)throw new Error("Failed to get account");return Li(r)}async getChainId(){const t=await this.getProvider();return Fh(t.chainId)}async getProvider({chainId:t}={}){return(!Je(this,yh)||t)&&Mo(this,yh,new s2e({...this.options,chainId:t??this.options.chainId??this.chains[0].id})),Je(this,yh)}async getWalletClient(){return(await this.getProvider()).getWalletClient()}async isAuthorized(){var t;try{const r=await(await this.getProvider()).getAccounts();return((t=this.options.flags)==null?void 0:t.isAuthorized)??!!r}catch{return!1}}async watchAsset(t){return(await this.getProvider()).watchAsset(t)}toJSON(){return""}};yh=new WeakMap;E5=new WeakSet;UU=async function(t){return await(await this.getProvider()).switchChain(t),this.chains.find(r=>r.id===t)??{id:t,name:`Chain ${t}`,network:`${t}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}};function je(){return je=Object.assign?Object.assign.bind():function(t){for(var e=1;e({account:l[0]}),this.onDisconnect=()=>{this==null||this.emit("disconnect")};const o=(r==null||(n=r.connect)==null||(n=n.settings)==null?void 0:n.signInOptions)||[],a=r==null||(i=r.connect)==null||(i=i.settings)==null?void 0:i.signInWith;if(r==null||(s=r.connect)==null||(s=s.settings)==null?void 0:s.signInWithEmail)this.id="email",this.name="Email";else if(a)this.id=a,this.name=`${a[0].toUpperCase()}${a.slice(1)}`;else if(o.length>0){const l=o[0],u=`${l[0].toUpperCase()}${l.slice(1)}`;this.id=l,this.name=u}this.provider=sU.initWallet({defaultNetwork:r==null?void 0:r.defaultNetwork,transports:{walletAppURL:"https://sequence.app"},defaultEIP6492:!0}),this.provider.on("chainChanged",l=>{this==null||this.emit("change",{chain:{id:x5(l),unsupported:!1}})}),this.provider.on("accountsChanged",l=>{this==null||this.emit("accountsChanged",this.onAccountsChanged(l))}),this.provider.on("disconnect",()=>{this.onDisconnect()})}async connect(){if(!this.provider.isConnected()){var e,r,n;this==null||this.emit("message",{type:"connecting"});const s=(e=this.options)==null?void 0:e.connect,o=localStorage.getItem(gn.Theme),a=localStorage.getItem(gn.EthAuthSettings),c=a?JSON.parse(a):{},l=je({authorize:!0},c,s,{settings:je({theme:o||"dark"},s==null?void 0:s.settings)}),u=await this.provider.connect(l);if(u.error)throw new Vr(new Error(u.error));if(!u.connected)throw new Vr(new Error("Wallet connection rejected"));const f=(r=u.proof)==null?void 0:r.proofString,d=(n=u.proof)==null?void 0:n.typedData;if(f){const h=JSON.stringify({proofString:f,typedData:d});localStorage.setItem(gn.EthAuthProof,h)}}return{account:await this.getAccount(),chain:{id:this.provider.getChainId(),unsupported:this.isChainUnsupported(this.provider.getChainId())}}}async getWalletClient({chainId:e}={}){const r=this.chains.find(n=>n.id===e);return bb({chain:r,account:await this.getAccount(),transport:BS(this.provider)})}onChainChanged(e){this.provider.setDefaultChainId(x5(e))}async switchChain(e){if(this.isChainUnsupported(e))throw new Error("Unsupported chain");return this.provider.setDefaultChainId(e),this.chains.find(r=>r.id===e)}async disconnect(){localStorage.removeItem(gn.EthAuthProof),this.provider.disconnect()}getAccount(){return this.provider.getSigner().getAddress()}async getChainId(){return this.provider.getChainId()}async getProvider(){return this.provider}async getSigner(){return this.provider.getSigner()}async isAuthorized(){try{return!!await this.getAccount()}catch{return!1}}isChainUnsupported(e){return this.provider.networks.findIndex(r=>r.chainId===e)===-1}}const x5=t=>typeof t=="object"?x5(t.chainId):typeof t=="string"?Number.parseInt(t,t.trim().substring(0,2)==="0x"?16:10):typeof t=="bigint"?Number(t):t;function Ps(t){if(t==null)throw new TypeError("Cannot destructure "+t)}const Dy=t=>{let e=je({},(Ps(t),t));return x.createElement(x.Fragment,null,x.createElement("svg",je({xmlns:"http://www.w3.org/2000/svg",style:{fill:"none"},id:"svg1316",version:"1.1",viewBox:"0 0 396 396"},e),x.createElement("g",{transform:"translate(0,38)",id:"g1256",clipPath:"url(#clip0_5_131)"},x.createElement("g",{id:"g1254",clipPath:"url(#clip1_5_131)"},x.createElement("path",{style:{fill:"#111111"},id:"path1232",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),x.createElement("path",{style:{fill:"url(#paint0_linear_5_13"},id:"path1234",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),x.createElement("path",{style:{fill:"url(#paint1_linear_5_131"},id:"path1236",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),x.createElement("path",{style:{fill:"url(#paint2_linear_5_131)"},id:"path1238",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),x.createElement("path",{style:{fill:"url(#paint3_linear_5_131)"},id:"path1240",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),x.createElement("path",{style:{fill:"url(#paint4_linear_5_131)"},id:"path1242",d:"m 98.9999,238.126 c 0,-10.965 -8.8648,-19.854 -19.8,-19.854 -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.966 8.8648,19.855 19.8,19.855 10.9352,0 19.8,-8.889 19.8,-19.855 z"}),x.createElement("path",{style:{fill:"url(#paint5_linear_5_131)"},id:"path1244",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),x.createElement("path",{style:{fill:"url(#paint6_linear_5_131)"},id:"path1246",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),x.createElement("path",{style:{fill:"url(#paint7_linear_5_131)"},id:"path1248",d:"M 316.8,59.5632 H 158.4 c -10.935,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.865,19.8544 19.8,19.8544 h 158.4 c 10.935,0 19.8,-8.8892 19.8,-19.8544 0,-10.9653 -8.865,-19.8544 -19.8,-19.8544 z"}),x.createElement("path",{style:{fill:"url(#paint8_linear_5_131)"},id:"path1250",d:"M 316.8,218.272 H 158.4 c -10.935,0 -19.8,8.889 -19.8,19.854 0,10.966 8.865,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.889 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}),x.createElement("path",{style:{fill:"url(#paint9_linear_5_131)"},id:"path1252",d:"M 237.6,138.981 H 79.2 c -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.965 8.8648,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.89 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}))),x.createElement("defs",{id:"defs1314"},x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"318",x2:"198",y1:"4.0585401e-05",x1:"198",id:"paint0_linear_5_131"},x.createElement("stop",{id:"stop1258",stopColor:"#1D273D"}),x.createElement("stop",{id:"stop1260",stopColor:"#0D0F13",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"63",x2:"92.5",y1:"99",x1:"65.5",id:"paint1_linear_5_131"},x.createElement("stop",{id:"stop1263",stopColor:"#4462FE"}),x.createElement("stop",{id:"stop1265",stopColor:"#7D69FA",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint2_linear_5_131"},x.createElement("stop",{id:"stop1268",stopColor:"#3757FD"}),x.createElement("stop",{id:"stop1270",stopColor:"#6980FA",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint3_linear_5_131"},x.createElement("stop",{id:"stop1273",stopColor:"#2447FF"}),x.createElement("stop",{id:"stop1275",stopColor:"#6980FA",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"223.5",x2:"91.5",y1:"251.5",x1:"65",id:"paint4_linear_5_131"},x.createElement("stop",{id:"stop1278",stopColor:"#BC3EE6"}),x.createElement("stop",{id:"stop1280",stopColor:"#D972F1",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"146",x2:"329.5",y1:"172",x1:"305",id:"paint5_linear_5_131"},x.createElement("stop",{id:"stop1283",stopColor:"#29BDFF"}),x.createElement("stop",{id:"stop1285",stopColor:"#96E7FB",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"176.772",x2:"334.56699",y1:"178.418",x1:"300.17999",id:"paint6_linear_5_131"},x.createElement("stop",{id:"stop1288",stopColor:"#23BBFF"}),x.createElement("stop",{id:"stop1290",stopColor:"#85E7FF",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"60",x2:"317.5",y1:"99",x1:"154.5",id:"paint7_linear_5_131"},x.createElement("stop",{id:"stop1293",stopColor:"#23BBFF"}),x.createElement("stop",{id:"stop1295",stopColor:"#85E7FF",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"218",x2:"312.5",y1:"258",x1:"156",id:"paint8_linear_5_131"},x.createElement("stop",{id:"stop1298",stopColor:"#2447FF"}),x.createElement("stop",{id:"stop1300",stopColor:"#6980FA",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"139",x2:"235.5",y1:"179",x1:"86.000099",id:"paint9_linear_5_131"},x.createElement("stop",{id:"stop1303",stopColor:"#6634FF"}),x.createElement("stop",{id:"stop1305",stopColor:"#9C6DFF",offset:"1"})),x.createElement("clipPath",{id:"clip0_5_131"},x.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1308",height:"317.67001",width:"396"})),x.createElement("clipPath",{id:"clip1_5_131"},x.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1311",height:"317.67001",width:"396"})))))},a2e=({chains:t,options:e})=>({id:"sequence",isSequenceBased:!0,logoDark:Dy,logoLight:Dy,name:"Sequence",createConnector:()=>new Pd({chains:t,options:e})}),p9=t=>{let e=je({},(Ps(t),t));return x.createElement(x.Fragment,null,x.createElement("svg",je({viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),x.createElement("rect",{width:"28",height:"28"}),x.createElement("path",{d:"M24.0891 3.1199L15.3446 9.61456L16.9617 5.7828L24.0891 3.1199Z",fill:"#E2761B",stroke:"#E2761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M3.90207 3.1199L12.5763 9.67608L11.0383 5.7828L3.90207 3.1199Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M20.9429 18.1745L18.6139 21.7426L23.597 23.1136L25.0295 18.2536L20.9429 18.1745Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M2.97929 18.2536L4.40301 23.1136L9.38607 21.7426L7.05713 18.1745L2.97929 18.2536Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M9.10483 12.1456L7.71626 14.2461L12.6642 14.4658L12.4884 9.14877L9.10483 12.1456Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M18.8864 12.1456L15.4589 9.08725L15.3446 14.4658L20.2837 14.2461L18.8864 12.1456Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M9.38606 21.7426L12.3566 20.2925L9.79033 18.2888L9.38606 21.7426Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M15.6347 20.2925L18.6139 21.7426L18.2009 18.2888L15.6347 20.2925Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M18.6139 21.7426L15.6347 20.2925L15.8719 22.2348L15.8456 23.0521L18.6139 21.7426Z",fill:"#D7C1B3",stroke:"#D7C1B3",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M9.38606 21.7426L12.1544 23.0521L12.1368 22.2348L12.3566 20.2925L9.38606 21.7426Z",fill:"#D7C1B3",stroke:"#D7C1B3",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M12.1984 17.0056L9.72002 16.2762L11.4689 15.4765L12.1984 17.0056Z",fill:"#233447",stroke:"#233447",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M15.7928 17.0056L16.5223 15.4765L18.28 16.2762L15.7928 17.0056Z",fill:"#233447",stroke:"#233447",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M9.38606 21.7426L9.80791 18.1745L7.05712 18.2536L9.38606 21.7426Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M18.1921 18.1745L18.6139 21.7426L20.9429 18.2536L18.1921 18.1745Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M20.2837 14.2461L15.3446 14.4658L15.8016 17.0057L16.5311 15.4765L18.2888 16.2762L20.2837 14.2461Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M9.72002 16.2762L11.4777 15.4765L12.1984 17.0057L12.6642 14.4658L7.71626 14.2461L9.72002 16.2762Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M7.71626 14.2461L9.79033 18.2888L9.72002 16.2762L7.71626 14.2461Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M18.2888 16.2762L18.2009 18.2888L20.2837 14.2461L18.2888 16.2762Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M12.6642 14.4658L12.1984 17.0057L12.7784 20.0025L12.9102 16.0565L12.6642 14.4658Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M15.3446 14.4658L15.1073 16.0477L15.2128 20.0025L15.8016 17.0057L15.3446 14.4658Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M15.8016 17.0056L15.2128 20.0025L15.6347 20.2925L18.2009 18.2888L18.2888 16.2762L15.8016 17.0056Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M9.72002 16.2762L9.79033 18.2888L12.3566 20.2925L12.7784 20.0025L12.1984 17.0056L9.72002 16.2762Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M15.8456 23.0521L15.8719 22.2348L15.6522 22.0414H12.339L12.1368 22.2348L12.1544 23.0521L9.38606 21.7426L10.3528 22.5336L12.3126 23.8958H15.6786L17.6472 22.5336L18.6139 21.7426L15.8456 23.0521Z",fill:"#C0AD9E",stroke:"#C0AD9E",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M15.6347 20.2925L15.2128 20.0025H12.7784L12.3566 20.2925L12.1368 22.2348L12.339 22.0414H15.6522L15.8719 22.2348L15.6347 20.2925Z",fill:"#161616",stroke:"#161616",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M24.4583 10.0364L25.2053 6.45072L24.0891 3.1199L15.6347 9.39485L18.8864 12.1456L23.4827 13.4903L24.5022 12.3038L24.0628 11.9874L24.7658 11.3459L24.221 10.924L24.924 10.3879L24.4583 10.0364Z",fill:"#763D16",stroke:"#763D16",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M2.79472 6.45072L3.54174 10.0364L3.06717 10.3879L3.77024 10.924L3.23415 11.3459L3.93722 11.9874L3.4978 12.3038L4.50847 13.4903L9.10483 12.1456L12.3566 9.39485L3.90207 3.1199L2.79472 6.45072Z",fill:"#763D16",stroke:"#763D16",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M23.4827 13.4903L18.8864 12.1456L20.2837 14.2461L18.2009 18.2888L20.9429 18.2536H25.0295L23.4827 13.4903Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M9.10484 12.1456L4.50848 13.4903L2.97929 18.2536H7.05713L9.79033 18.2888L7.71626 14.2461L9.10484 12.1456Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M15.3446 14.4658L15.6347 9.39485L16.9705 5.7828H11.0383L12.3566 9.39485L12.6642 14.4658L12.7696 16.0653L12.7784 20.0025H15.2128L15.2304 16.0653L15.3446 14.4658Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"})))},c2e=({chains:t})=>({id:"metamask",logoDark:p9,logoLight:p9,name:"Metamask",createConnector:()=>new xye({chains:t,options:{shimDisconnect:!0}})}),v9=t=>{let e=je({},(Ps(t),t));return x.createElement(x.Fragment,null,x.createElement("svg",je({fill:"none",viewBox:"0 0 480 332",xmlns:"http://www.w3.org/2000/svg"},e),x.createElement("path",{d:"m126.613 93.9842c62.622-61.3123 164.152-61.3123 226.775 0l7.536 7.3788c3.131 3.066 3.131 8.036 0 11.102l-25.781 25.242c-1.566 1.533-4.104 1.533-5.67 0l-10.371-10.154c-43.687-42.7734-114.517-42.7734-158.204 0l-11.107 10.874c-1.565 1.533-4.103 1.533-5.669 0l-25.781-25.242c-3.132-3.066-3.132-8.036 0-11.102zm280.093 52.2038 22.946 22.465c3.131 3.066 3.131 8.036 0 11.102l-103.463 101.301c-3.131 3.065-8.208 3.065-11.339 0l-73.432-71.896c-.783-.767-2.052-.767-2.835 0l-73.43 71.896c-3.131 3.065-8.208 3.065-11.339 0l-103.4657-101.302c-3.1311-3.066-3.1311-8.036 0-11.102l22.9456-22.466c3.1311-3.065 8.2077-3.065 11.3388 0l73.4333 71.897c.782.767 2.051.767 2.834 0l73.429-71.897c3.131-3.065 8.208-3.065 11.339 0l73.433 71.897c.783.767 2.052.767 2.835 0l73.431-71.895c3.132-3.066 8.208-3.066 11.339 0z",fill:"#3396ff"})))},l2e=({chains:t,options:e})=>({id:"wallet-connect",logoDark:v9,logoLight:v9,name:"Walletconnect",createConnector:()=>new i2e({chains:t,options:e})});window.ethereum=window.ethereum||{};const m9=t=>{let e=je({},(Ps(t),t));return x.createElement(x.Fragment,null,x.createElement("svg",je({viewBox:"0 0 41 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),x.createElement("g",{id:"Frame 2114"},x.createElement("g",{id:"Group"},x.createElement("path",{id:"Vector",d:"M20.7497 16.8828V23.5218H29.9756C29.5705 25.6568 28.3548 27.4647 26.5314 28.6803L32.095 32.9972C35.3366 30.0051 37.2068 25.6102 37.2068 20.3895C37.2068 19.1739 37.0977 18.005 36.895 16.883L20.7497 16.8828Z",fill:"#4285F4"}),x.createElement("path",{id:"Vector_2",d:"M11.1424 23.2627L9.88756 24.2232L5.44592 27.6829C8.2667 33.2777 14.0481 37.1427 20.7493 37.1427C25.3778 37.1427 29.2583 35.6154 32.0947 32.9973L26.5311 28.6803C25.0038 29.7089 23.0557 30.3324 20.7493 30.3324C16.2922 30.3324 12.5053 27.3246 11.1494 23.2726L11.1424 23.2627Z",fill:"#34A853"}),x.createElement("path",{id:"Vector_3",d:"M5.44594 12.3169C4.27718 14.6233 3.60712 17.2259 3.60712 19.9999C3.60712 22.7739 4.27718 25.3765 5.44594 27.6829C5.44594 27.6984 11.1499 23.2569 11.1499 23.2569C10.8071 22.2284 10.6044 21.1375 10.6044 19.9997C10.6044 18.8619 10.8071 17.7711 11.1499 16.7425L5.44594 12.3169Z",fill:"#FBBC05"}),x.createElement("path",{id:"Vector_4",d:"M20.7497 9.6829C23.2744 9.6829 25.5185 10.5556 27.3107 12.2387L32.2198 7.32972C29.2431 4.55574 25.3783 2.85693 20.7497 2.85693C14.0484 2.85693 8.2667 6.70628 5.44592 12.3167L11.1497 16.7427C12.5055 12.6907 16.2926 9.6829 20.7497 9.6829Z",fill:"#EA4335"})))))},y9=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=je({},(Ps(n),n));return x.createElement("svg",je({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),x.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.8355 14.7613C24.5584 13.5329 22.9441 12.9032 21.1356 12.9032C17.9377 12.9032 15.2302 15.0813 14.2595 18.0232L14.2593 18.023C14.0142 18.7662 13.8712 19.5609 13.8712 20.3866C13.8712 21.2124 14.004 22.0072 14.2594 22.7504L14.2587 22.751H14.2595C15.2302 25.6929 17.9377 27.871 21.1356 27.871C22.7907 27.871 24.1904 27.4168 25.2939 26.6736V26.6732C26.5812 25.7958 27.4497 24.5055 27.746 22.9777H21.1355V18.3223H32.6808C32.8034 19.0758 32.875 19.85 32.875 20.6655C32.875 24.4332 31.5467 27.6126 29.2377 29.77L29.2378 29.7703C27.2148 31.6594 24.446 32.7742 21.1356 32.7742C16.3438 32.7742 12.2059 29.9871 10.1931 25.9407V25.94L10.193 25.9401C9.35521 24.2678 8.875 22.3891 8.875 20.3866C8.875 18.384 9.35521 16.5053 10.193 14.833H10.1934C12.2063 10.7869 16.344 8 21.1356 8C24.446 8 27.2148 9.22839 29.3298 11.231L25.8355 14.7613Z",fill:e}))}},u2e=({chains:t,options:e={}})=>({id:"google",isSequenceBased:!0,logoDark:m9,logoLight:m9,monochromeLogoDark:y9({isDarkMode:!0}),monochromeLogoLight:y9({isDarkMode:!1}),name:"Google",createConnector:()=>{var r;return new Pd({chains:t,options:je({},e,{connect:je({},e==null?void 0:e.connect,{settings:je({},e==null||(r=e.connect)==null?void 0:r.settings,{signInWith:"google"})})})})}}),g9=t=>{let e=je({},(Ps(t),t));return x.createElement(x.Fragment,null,x.createElement("svg",je({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},e),x.createElement("path",{d:"M17.4214 36.9716C9.27855 35.5145 3.10712 28.4859 3.10712 20.0001C3.10712 10.5715 10.8214 2.85718 20.25 2.85718C29.6785 2.85718 37.3928 10.5715 37.3928 20.0001C37.3928 28.4859 31.2214 35.5145 23.0785 36.9716L22.1357 36.2002H18.3643L17.4214 36.9716Z",fill:"url(#paint0_linear_193_14528)"}),x.createElement("path",{d:"M26.9357 24.7999L27.7072 19.9999H23.1643V16.657C23.1643 15.2856 23.6786 14.257 25.7357 14.257H27.9643V9.88558C26.7643 9.71415 25.3929 9.54272 24.1929 9.54272C20.25 9.54272 17.5071 11.9427 17.5071 16.2285V19.9999H13.2214V24.7999H17.5071V36.8857C18.45 37.0571 19.3929 37.1429 20.3357 37.1429C21.2786 37.1429 22.2214 37.0571 23.1643 36.8857V24.7999H26.9357Z",fill:"white"}),x.createElement("defs",null,x.createElement("linearGradient",{id:"paint0_linear_193_14528",x1:"20.2508",y1:"35.9507",x2:"20.2508",y2:"2.85086",gradientUnits:"userSpaceOnUse"},x.createElement("stop",{"stop-color":"#0062E0"}),x.createElement("stop",{offset:"1","stop-color":"#19AFFF"})))))},b9=({isDarkMode:t})=>{const e=t?"#FFFFFF":"#000000";return n=>{let i=je({},(Ps(n),n));return x.createElement(x.Fragment,null,x.createElement("svg",je({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),x.createElement("path",{d:"M25.8582 10.4398C24.1222 10.4398 23.6288 11.2098 23.6288 12.9073V15.709H28.246L27.791 20.2476H23.6279V34H18.1024V20.2468H14.375V15.7081H18.1042V12.9851C18.1042 8.40625 19.9399 6 25.0891 6C26.1942 6 27.5163 6.0875 28.3055 6.19775V10.459",fill:e})))}},f2e=({chains:t,options:e={}})=>({id:"facebook",isSequenceBased:!0,logoDark:g9,logoLight:g9,monochromeLogoDark:b9({isDarkMode:!0}),monochromeLogoLight:b9({isDarkMode:!1}),name:"Facebook",createConnector:()=>{var r;return new Pd({chains:t,options:je({},e,{connect:je({},e==null?void 0:e.connect,{settings:je({},e==null||(r=e.connect)==null?void 0:r.settings,{signInWith:"facebook"})})})})}}),w9=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=je({},(Ps(n),n));return x.createElement(x.Fragment,null,x.createElement("svg",je({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 29 34",fill:"none"},i),x.createElement("path",{d:"M27.702 11.5918C27.5049 11.7448 24.0243 13.7068 24.0243 18.0694C24.0243 23.1155 28.4532 24.9007 28.5858 24.9449C28.5654 25.0537 27.8822 27.3897 26.2506 29.77C24.7958 31.8646 23.2765 33.9558 20.9651 33.9558C18.6538 33.9558 18.0589 32.6127 15.3907 32.6127C12.7904 32.6127 11.8659 34 9.75169 34C7.63748 34 6.1623 32.0618 4.46618 29.6816C2.50154 26.8865 0.914185 22.5443 0.914185 18.423C0.914185 11.8128 5.21057 8.30703 9.43897 8.30703C11.6857 8.30703 13.5586 9.78278 14.9692 9.78278C16.3118 9.78278 18.4056 8.21862 20.9617 8.21862C21.9304 8.21862 25.4111 8.30703 27.702 11.5918ZM19.7483 5.42014C20.8054 4.16542 21.5532 2.42444 21.5532 0.683468C21.5532 0.442044 21.5328 0.19722 21.4886 0C19.7687 0.0646065 17.7224 1.14591 16.4886 2.57746C15.5199 3.67917 14.6157 5.42014 14.6157 7.18492C14.6157 7.45014 14.6599 7.71537 14.6803 7.80038C14.7891 7.82078 14.9658 7.84458 15.1426 7.84458C16.6857 7.84458 18.6266 6.81088 19.7483 5.42014Z",fill:e})))}},E9=({isDarkMode:t})=>{const e=t?"#FFFFFF":"#000000";return n=>{let i=je({},(Ps(n),n));return x.createElement(x.Fragment,null,x.createElement("svg",je({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),x.createElement("path",{d:"M27.166 20.8774C27.1338 17.335 30.0617 15.633 30.1936 15.5493C28.5463 13.1395 25.9852 12.8113 25.0714 12.7727C22.8932 12.5507 20.8179 14.0565 19.7111 14.0565C18.6043 14.0565 16.8991 12.8049 15.0909 12.8403C12.7131 12.8757 10.5221 14.2205 9.2962 16.3505C6.8284 20.6297 8.66557 26.9777 11.0722 30.4557C12.2498 32.1545 13.6494 34.0689 15.493 33.9981C17.2691 33.9273 17.9383 32.8495 20.0811 32.8495C22.224 32.8495 22.8289 33.9981 24.7014 33.9627C26.6094 33.9241 27.8191 32.2253 28.9871 30.5201C30.3352 28.5478 30.8918 26.6366 30.924 26.5369C30.8822 26.5208 27.2046 25.1116 27.166 20.8774Z",fill:e}),x.createElement("path",{d:"M23.6429 10.4722C24.621 9.28822 25.2806 7.64089 25.1004 6C23.6911 6.05791 21.9859 6.93949 20.9756 8.12351C20.0715 9.16917 19.2768 10.8455 19.4923 12.4542C21.0592 12.5764 22.6648 11.653 23.6429 10.4722Z",fill:e})))}},d2e=({chains:t,options:e={}})=>({id:"apple",isSequenceBased:!0,logoDark:w9({isDarkMode:!0}),logoLight:w9({isDarkMode:!1}),monochromeLogoDark:E9({isDarkMode:!0}),monochromeLogoLight:E9({isDarkMode:!1}),name:"Apple",createConnector:()=>{var r;return new Pd({chains:t,options:je({},e,{connect:je({},e==null?void 0:e.connect,{settings:je({},e==null||(r=e.connect)==null?void 0:r.settings,{signInWith:"apple"})})})})}}),x9=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=je({},(Ps(n),n));return x.createElement(x.Fragment,null,x.createElement("svg",je({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35 34",fill:"none"},i),x.createElement("path",{d:"M17.0826 16.3805C17.1802 16.4598 17.32 16.4598 17.4176 16.3805L30.1401 6.04341C30.5283 5.72801 30.3053 5.09985 29.8051 5.09985H4.69499C4.19482 5.09985 3.9718 5.72801 4.35998 6.04341L17.0826 16.3805Z",fill:e}),x.createElement("path",{d:"M19.7626 19.2667L33.3838 8.19943C33.731 7.91735 34.2501 8.16441 34.2501 8.61174V24.2249C34.2501 26.5721 32.3473 28.4749 30.0001 28.4749H4.50006C2.15285 28.4749 0.250061 26.5721 0.250061 24.2249V8.61174C0.250061 8.16441 0.769134 7.91735 1.11631 8.19943L14.7375 19.2667C16.2014 20.4561 18.2987 20.4561 19.7626 19.2667Z",fill:e})))}},C5="@sequence.kit.connector.email",h2e=({chains:t,options:e={}})=>({id:"email",isSequenceBased:!0,logoDark:x9({isDarkMode:!0}),logoLight:x9({isDarkMode:!1}),name:"Email",createConnector:()=>{var r;const n=localStorage.getItem(C5);return new Pd({chains:t,options:je({},e,{connect:je({},e==null?void 0:e.connect,{settings:je({},e==null||(r=e.connect)==null?void 0:r.settings,{signInOptions:["email"],signInWithEmail:n||""})})})})}}),Zp=({isDarkMode:t})=>{let e;return t===void 0?e="#9146FF":e=t?"white":"black",n=>(je({},(Ps(n),n)),x.createElement(x.Fragment,null,x.createElement("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 2400 2800",transform:"scale(0.80)"},x.createElement("g",null,x.createElement("g",{id:"Layer_1-2"},x.createElement("path",{fill:e,d:"M500,0L0,500v1800h600v500l500-500h400l900-900V0H500z M2200,1300l-400,400h-400l-350,350v-350H600V200h1600 V1300z"}),x.createElement("rect",{x:"1700",y:"550",fill:e,width:"200",height:"600"}),x.createElement("rect",{x:"1150",y:"550",fill:e,width:"200",height:"600"}))))))},p2e=({chains:t,options:e={}})=>({id:"twitch",isSequenceBased:!0,logoDark:Zp({}),logoLight:Zp({}),monochromeLogoDark:Zp({isDarkMode:!0}),monochromeLogoLight:Zp({isDarkMode:!1}),name:"Twitch",createConnector:()=>{var r;return new Pd({chains:t,options:je({},e,{connect:je({},e==null?void 0:e.connect,{settings:je({},e==null||(r=e.connect)==null?void 0:r.settings,{signInWith:"twitch"})})})})}}),v2e=({chains:t,options:e})=>({id:"mock",isSequenceBased:!0,logoDark:Dy,logoLight:Dy,name:"Mock",createConnector:()=>{var r;return new o2e({chains:t,options:je({chainId:(e==null||(r=e.chain)==null?void 0:r.id)||137,walletClient:bb({account:e.account,chain:(e==null?void 0:e.chain)||Mue,transport:e.transport})},e)})}}),m2e=({chains:t,walletConnectProjectId:e,defaultChainId:r})=>{let n=t[0].id;if(r){const s=t.find(o=>o.id===r);s&&(n=s.id)}return oz([h2e({chains:t,options:{defaultNetwork:n}}),u2e({chains:t,options:{defaultNetwork:n}}),f2e({chains:t,options:{defaultNetwork:n}}),p2e({chains:t,options:{defaultNetwork:n}}),d2e({chains:t,options:{defaultNetwork:n}}),c2e({chains:t}),l2e({chains:t,options:{projectId:e}}),a2e({chains:t,options:{defaultNetwork:n}})])};function Q8(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function ev(){}function C9(){return typeof WeakMap<"u"?new WeakMap:y2e()}function y2e(){return{add:ev,delete:ev,get:ev,set:ev,has:function(t){return!1}}}var g2e=Object.prototype.hasOwnProperty,S5=function(t,e){return g2e.call(t,e)};function tE(t,e){for(var r in e)S5(e,r)&&(t[r]=e[r]);return t}var b2e=/^[ \t]*(?:\r\n|\r|\n)/,w2e=/(?:\r\n|\r|\n)[ \t]*$/,E2e=/^(?:[\r\n]|$)/,x2e=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,C2e=/^[ \t]*[\r\n][ \t\r\n]*$/;function S9(t,e,r){var n=0,i=t[0].match(x2e);i&&(n=i[1].length);var s="(\\r\\n|\\r|\\n).{0,"+n+"}",o=new RegExp(s,"g");e&&(t=t.slice(1));var a=r.newline,c=r.trimLeadingNewline,l=r.trimTrailingNewline,u=typeof a=="string",f=t.length,d=t.map(function(h,p){return h=h.replace(o,"$1"),p===0&&c&&(h=h.replace(b2e,"")),p===f-1&&l&&(h=h.replace(w2e,"")),u&&(h=h.replace(/\r\n|\n|\r/g,function(v){return a})),h});return d}function S2e(t,e){for(var r="",n=0,i=t.length;n{},registerClassName:()=>{},onEndFileScope:()=>{},registerComposition:()=>{},markCompositionUsed:()=>{},getIdentOption:()=>"short"},Qv=[A2e],ou=()=>{if(Qv.length<1)throw new Error("No adapter configured");return Qv[Qv.length-1]},WU=!1,_2e=t=>{WU||P2e(t)},P2e=t=>{if(!t)throw new Error('No adapter provided when calling "setAdapter"');WU=!0,Qv.push(t)},Vb=function(){return ou().appendCss(...arguments)},HU=function(){return ou().registerClassName(...arguments)},T2e=function(){return ou().registerComposition(...arguments)},qU=function(){return ou().markCompositionUsed(...arguments)},I2e=function(){for(var e,r,n=arguments.length,i=new Array(n),s=0;s{n||(yl(i[f].methods,s[f].methods)?yl(i[f].events,s[f].events)||(n=Fa("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${f}`)):n=Fa("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${f}`))}),n}function B2e(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function C9(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function j2e(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=Id(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(s=>s.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function h9e(t,e){return Z8(t,!1)&&t<=e.max&&t>=e.min}var pz="eip155",U2e="store",vz="requestedChains",A5="wallet_addEthereumChain",or,t0,Xv,_5,ek,mz,Zv,P5,T5,yz,Fy,tk,Mu,Eh,By,rk,jy,nk,Uy,ik,z2e=class extends j1{constructor(t){super({...t,options:{isNewChainsStale:!0,...t.options}}),Mr(this,Xv),Mr(this,ek),Mr(this,Zv),Mr(this,T5),Mr(this,Fy),Mr(this,Mu),Mr(this,By),Mr(this,jy),Mr(this,Uy),Ke(this,"id","walletConnect"),Ke(this,"name","WalletConnect"),Ke(this,"ready",!0),Mr(this,or,void 0),Mr(this,t0,void 0),Ke(this,"onAccountsChanged",e=>{e.length===0?this.emit("disconnect"):this.emit("change",{account:Dn(e[0])})}),Ke(this,"onChainChanged",e=>{const r=Number(e),n=this.isChainUnsupported(r);this.emit("change",{chain:{id:r,unsupported:n}})}),Ke(this,"onDisconnect",()=>{Rr(this,Mu,Eh).call(this,[]),this.emit("disconnect")}),Ke(this,"onDisplayUri",e=>{this.emit("message",{type:"display_uri",data:e})}),Ke(this,"onConnect",()=>{this.emit("connect",{})}),Rr(this,Xv,_5).call(this)}async connect({chainId:t,pairingTopic:e}={}){var r,n,i,s,o;try{let a=t;if(!a){const p=(r=this.storage)==null?void 0:r.getItem(U2e),v=(s=(i=(n=p==null?void 0:p.state)==null?void 0:n.data)==null?void 0:i.chain)==null?void 0:s.id;v&&!this.isChainUnsupported(v)?a=v:a=(o=this.chains[0])==null?void 0:o.id}if(!a)throw new Error("No chains found on connector.");const c=await this.getProvider();Rr(this,T5,yz).call(this);const l=Rr(this,Zv,P5).call(this);if(c.session&&l&&await c.disconnect(),!c.session||l){const p=this.chains.filter(v=>v.id!==a).map(v=>v.id);this.emit("message",{type:"connecting"}),await c.connect({pairingTopic:e,chains:[a],optionalChains:p.length?p:void 0}),Rr(this,Mu,Eh).call(this,this.chains.map(({id:v})=>v))}const u=await c.enable(),f=Dn(u[0]),d=await this.getChainId(),h=this.isChainUnsupported(d);return{account:f,chain:{id:d,unsupported:h}}}catch(a){throw/user rejected/i.test(a==null?void 0:a.message)?new Pr(a):a}}async disconnect(){const t=await this.getProvider();try{await t.disconnect()}catch(e){if(!/No matching key/i.test(e.message))throw e}finally{Rr(this,Fy,tk).call(this),Rr(this,Mu,Eh).call(this,[])}}async getAccount(){const{accounts:t}=await this.getProvider();return Dn(t[0])}async getChainId(){const{chainId:t}=await this.getProvider();return t}async getProvider({chainId:t}={}){return We(this,or)||await Rr(this,Xv,_5).call(this),t&&await this.switchChain(t),We(this,or)}async getWalletClient({chainId:t}={}){const[e,r]=await Promise.all([this.getProvider({chainId:t}),this.getAccount()]),n=this.chains.find(i=>i.id===t);if(!e)throw new Error("provider is required.");return K1({account:r,chain:n,transport:kb(e)})}async isAuthorized(){try{const[t,e]=await Promise.all([this.getAccount(),this.getProvider()]),r=Rr(this,Zv,P5).call(this);if(!t)return!1;if(r&&e.session){try{await e.disconnect()}catch{}return!1}return!0}catch{return!1}}async switchChain(t){var r,n;const e=this.chains.find(i=>i.id===t);if(!e)throw new ea(new Error("chain not found on connector."));try{const i=await this.getProvider(),s=Rr(this,jy,nk).call(this),o=Rr(this,Uy,ik).call(this);if(!s.includes(t)&&o.includes(A5)){await i.request({method:A5,params:[{chainId:Ue(e.id),blockExplorerUrls:[(n=(r=e.blockExplorers)==null?void 0:r.default)==null?void 0:n.url],chainName:e.name,nativeCurrency:e.nativeCurrency,rpcUrls:[...e.rpcUrls.default.http]}]});const c=Rr(this,By,rk).call(this);c.push(t),Rr(this,Mu,Eh).call(this,c)}return await i.request({method:"wallet_switchEthereumChain",params:[{chainId:Ue(t)}]}),e}catch(i){const s=typeof i=="string"?i:i==null?void 0:i.message;throw/user rejected request/i.test(s)?new Pr(i):new ea(i)}}};or=new WeakMap;t0=new WeakMap;Xv=new WeakSet;_5=async function(){return!We(this,t0)&&typeof window<"u"&&ys(this,t0,Rr(this,ek,mz).call(this)),We(this,t0)};ek=new WeakSet;mz=async function(){const{EthereumProvider:t,OPTIONAL_EVENTS:e,OPTIONAL_METHODS:r}=await HS(()=>import("./index.es-69483be7.js"),["./index.es-69483be7.js","./events-d5745873.js"],import.meta.url),[n,...i]=this.chains.map(({id:s})=>s);if(n){const{projectId:s,showQrModal:o=!0,qrModalOptions:a,metadata:c,relayUrl:l}=this.options;ys(this,or,await t.init({showQrModal:o,qrModalOptions:a,projectId:s,optionalMethods:r,optionalEvents:e,chains:[n],optionalChains:i.length?i:void 0,rpcMap:Object.fromEntries(this.chains.map(u=>[u.id,u.rpcUrls.default.http[0]])),metadata:c,relayUrl:l}))}};Zv=new WeakSet;P5=function(){if(Rr(this,Uy,ik).call(this).includes(A5)||!this.options.isNewChainsStale)return!1;const e=Rr(this,By,rk).call(this),r=this.chains.map(({id:i})=>i),n=Rr(this,jy,nk).call(this);return n.length&&!n.some(i=>r.includes(i))?!1:!r.every(i=>e.includes(i))};T5=new WeakSet;yz=function(){We(this,or)&&(Rr(this,Fy,tk).call(this),We(this,or).on("accountsChanged",this.onAccountsChanged),We(this,or).on("chainChanged",this.onChainChanged),We(this,or).on("disconnect",this.onDisconnect),We(this,or).on("session_delete",this.onDisconnect),We(this,or).on("display_uri",this.onDisplayUri),We(this,or).on("connect",this.onConnect))};Fy=new WeakSet;tk=function(){We(this,or)&&(We(this,or).removeListener("accountsChanged",this.onAccountsChanged),We(this,or).removeListener("chainChanged",this.onChainChanged),We(this,or).removeListener("disconnect",this.onDisconnect),We(this,or).removeListener("session_delete",this.onDisconnect),We(this,or).removeListener("display_uri",this.onDisplayUri),We(this,or).removeListener("connect",this.onConnect))};Mu=new WeakSet;Eh=function(t){var e;(e=this.storage)==null||e.setItem(vz,t)};By=new WeakSet;rk=function(){var t;return((t=this.storage)==null?void 0:t.getItem(vz))??[]};jy=new WeakSet;nk=function(){var n,i,s;if(!We(this,or))return[];const t=(n=We(this,or).session)==null?void 0:n.namespaces;return t?((s=(i=dz(t)[pz])==null?void 0:i.chains)==null?void 0:s.map(o=>parseInt(o.split(":")[1]||"")))??[]:[]};Uy=new WeakSet;ik=function(){var n,i;if(!We(this,or))return[];const t=(n=We(this,or).session)==null?void 0:n.namespaces;return t?((i=dz(t)[pz])==null?void 0:i.methods)??[]:[]};function ke(){return ke=Object.assign?Object.assign.bind():function(t){for(var e=1;e({account:l[0]}),this.onDisconnect=()=>{this==null||this.emit("disconnect")};const o=(r==null||(n=r.connect)==null||(n=n.settings)==null?void 0:n.signInOptions)||[],a=r==null||(i=r.connect)==null||(i=i.settings)==null?void 0:i.signInWith;if(r==null||(s=r.connect)==null||(s=s.settings)==null?void 0:s.signInWithEmail)this.id="email",this.name="Email";else if(a)this.id=a,this.name=`${a[0].toUpperCase()}${a.slice(1)}`;else if(o.length>0){const l=o[0],u=`${l[0].toUpperCase()}${l.slice(1)}`;this.id=l,this.name=u}this.provider=NU.initWallet({defaultNetwork:r==null?void 0:r.defaultNetwork,transports:{walletAppURL:"https://sequence.app"},defaultEIP6492:!0}),this.provider.on("chainChanged",l=>{this==null||this.emit("change",{chain:{id:I5(l),unsupported:!1}})}),this.provider.on("accountsChanged",l=>{this==null||this.emit("accountsChanged",this.onAccountsChanged(l))}),this.provider.on("disconnect",()=>{this.onDisconnect()})}async connect(){if(!this.provider.isConnected()){var e,r,n;this==null||this.emit("message",{type:"connecting"});const s=(e=this.options)==null?void 0:e.connect,o=localStorage.getItem(gn.Theme),a=localStorage.getItem(gn.EthAuthSettings),c=a?JSON.parse(a):{},l=ke({authorize:!0},c,s,{settings:ke({theme:o||"dark"},s==null?void 0:s.settings)}),u=await this.provider.connect(l);if(u.error)throw new Pr(new Error(u.error));if(!u.connected)throw new Pr(new Error("Wallet connection rejected"));const f=(r=u.proof)==null?void 0:r.proofString,d=(n=u.proof)==null?void 0:n.typedData;if(f){const h=JSON.stringify({proofString:f,typedData:d});localStorage.setItem(gn.EthAuthProof,h)}}return{account:await this.getAccount(),chain:{id:this.provider.getChainId(),unsupported:this.isChainUnsupported(this.provider.getChainId())}}}async getWalletClient({chainId:e}={}){const r=this.chains.find(n=>n.id===e);return K1({chain:r,account:await this.getAccount(),transport:kb(this.provider)})}onChainChanged(e){this.provider.setDefaultChainId(I5(e))}async switchChain(e){if(this.isChainUnsupported(e))throw new Error("Unsupported chain");return this.provider.setDefaultChainId(e),this.chains.find(r=>r.id===e)}async disconnect(){localStorage.removeItem(gn.EthAuthProof),this.provider.disconnect()}getAccount(){return this.provider.getSigner().getAddress()}async getChainId(){return this.provider.getChainId()}async getProvider(){return this.provider}async getSigner(){return this.provider.getSigner()}async isAuthorized(){try{return!!await this.getAccount()}catch{return!1}}isChainUnsupported(e){return this.provider.networks.findIndex(r=>r.chainId===e)===-1}}const I5=t=>typeof t=="object"?I5(t.chainId):typeof t=="string"?Number.parseInt(t,t.trim().substring(0,2)==="0x"?16:10):typeof t=="bigint"?Number(t):t;function Xi(t){if(t==null)throw new TypeError("Cannot destructure "+t)}const S9=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=ke({},(Xi(n),n));return x.createElement(x.Fragment,null,x.createElement("svg",ke({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 29 34",fill:"none"},i),x.createElement("path",{d:"M27.702 11.5918C27.5049 11.7448 24.0243 13.7068 24.0243 18.0694C24.0243 23.1155 28.4532 24.9007 28.5858 24.9449C28.5654 25.0537 27.8822 27.3897 26.2506 29.77C24.7958 31.8646 23.2765 33.9558 20.9651 33.9558C18.6538 33.9558 18.0589 32.6127 15.3907 32.6127C12.7904 32.6127 11.8659 34 9.75169 34C7.63748 34 6.1623 32.0618 4.46618 29.6816C2.50154 26.8865 0.914185 22.5443 0.914185 18.423C0.914185 11.8128 5.21057 8.30703 9.43897 8.30703C11.6857 8.30703 13.5586 9.78278 14.9692 9.78278C16.3118 9.78278 18.4056 8.21862 20.9617 8.21862C21.9304 8.21862 25.4111 8.30703 27.702 11.5918ZM19.7483 5.42014C20.8054 4.16542 21.5532 2.42444 21.5532 0.683468C21.5532 0.442044 21.5328 0.19722 21.4886 0C19.7687 0.0646065 17.7224 1.14591 16.4886 2.57746C15.5199 3.67917 14.6157 5.42014 14.6157 7.18492C14.6157 7.45014 14.6599 7.71537 14.6803 7.80038C14.7891 7.82078 14.9658 7.84458 15.1426 7.84458C16.6857 7.84458 18.6266 6.81088 19.7483 5.42014Z",fill:e})))}},k9=({isDarkMode:t})=>{const e=t?"#FFFFFF":"#000000";return n=>{let i=ke({},(Xi(n),n));return x.createElement(x.Fragment,null,x.createElement("svg",ke({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),x.createElement("path",{d:"M27.166 20.8774C27.1338 17.335 30.0617 15.633 30.1936 15.5493C28.5463 13.1395 25.9852 12.8113 25.0714 12.7727C22.8932 12.5507 20.8179 14.0565 19.7111 14.0565C18.6043 14.0565 16.8991 12.8049 15.0909 12.8403C12.7131 12.8757 10.5221 14.2205 9.2962 16.3505C6.8284 20.6297 8.66557 26.9777 11.0722 30.4557C12.2498 32.1545 13.6494 34.0689 15.493 33.9981C17.2691 33.9273 17.9383 32.8495 20.0811 32.8495C22.224 32.8495 22.8289 33.9981 24.7014 33.9627C26.6094 33.9241 27.8191 32.2253 28.9871 30.5201C30.3352 28.5478 30.8918 26.6366 30.924 26.5369C30.8822 26.5208 27.2046 25.1116 27.166 20.8774Z",fill:e}),x.createElement("path",{d:"M23.6429 10.4722C24.621 9.28822 25.2806 7.64089 25.1004 6C23.6911 6.05791 21.9859 6.93949 20.9756 8.12351C20.0715 9.16917 19.2768 10.8455 19.4923 12.4542C21.0592 12.5764 22.6648 11.653 23.6429 10.4722Z",fill:e})))}},W2e=({chains:t,options:e={}})=>({id:"apple",isSequenceBased:!0,logoDark:S9({isDarkMode:!0}),logoLight:S9({isDarkMode:!1}),monochromeLogoDark:k9({isDarkMode:!0}),monochromeLogoLight:k9({isDarkMode:!1}),name:"Apple",createConnector:()=>{var r;return new Od({chains:t,options:ke({},e,{connect:ke({},e==null?void 0:e.connect,{settings:ke({},e==null||(r=e.connect)==null?void 0:r.settings,{signInWith:"apple"})})})})}}),A9=t=>{let e=ke({},(Xi(t),t));return x.createElement(x.Fragment,null,x.createElement("svg",ke({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),x.createElement("rect",{width:"28",height:"28",fill:"#2C5FF6"}),x.createElement("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14 23.8C19.4124 23.8 23.8 19.4124 23.8 14C23.8 8.58761 19.4124 4.2 14 4.2C8.58761 4.2 4.2 8.58761 4.2 14C4.2 19.4124 8.58761 23.8 14 23.8ZM11.55 10.8C11.1358 10.8 10.8 11.1358 10.8 11.55V16.45C10.8 16.8642 11.1358 17.2 11.55 17.2H16.45C16.8642 17.2 17.2 16.8642 17.2 16.45V11.55C17.2 11.1358 16.8642 10.8 16.45 10.8H11.55Z",fill:"white"})))},H2e=t=>({id:"coinbase-wallet",logoDark:A9,logoLight:A9,name:"Coinbase Wallet",createConnector:()=>new nge(ke({},t))}),_9=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=ke({},(Xi(n),n));return x.createElement(x.Fragment,null,x.createElement("svg",ke({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35 34",fill:"none"},i),x.createElement("path",{d:"M17.0826 16.3805C17.1802 16.4598 17.32 16.4598 17.4176 16.3805L30.1401 6.04341C30.5283 5.72801 30.3053 5.09985 29.8051 5.09985H4.69499C4.19482 5.09985 3.9718 5.72801 4.35998 6.04341L17.0826 16.3805Z",fill:e}),x.createElement("path",{d:"M19.7626 19.2667L33.3838 8.19943C33.731 7.91735 34.2501 8.16441 34.2501 8.61174V24.2249C34.2501 26.5721 32.3473 28.4749 30.0001 28.4749H4.50006C2.15285 28.4749 0.250061 26.5721 0.250061 24.2249V8.61174C0.250061 8.16441 0.769134 7.91735 1.11631 8.19943L14.7375 19.2667C16.2014 20.4561 18.2987 20.4561 19.7626 19.2667Z",fill:e})))}},O5="@sequence.kit.connector.email",q2e=({chains:t,options:e={}})=>({id:"email",isSequenceBased:!0,logoDark:_9({isDarkMode:!0}),logoLight:_9({isDarkMode:!1}),name:"Email",createConnector:()=>{var r;const n=localStorage.getItem(O5);return new Od({chains:t,options:ke({},e,{connect:ke({},e==null?void 0:e.connect,{settings:ke({},e==null||(r=e.connect)==null?void 0:r.settings,{signInOptions:["email"],signInWithEmail:n||""})})})})}}),P9=t=>{let e=ke({},(Xi(t),t));return x.createElement(x.Fragment,null,x.createElement("svg",ke({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},e),x.createElement("path",{d:"M17.4214 36.9716C9.27855 35.5145 3.10712 28.4859 3.10712 20.0001C3.10712 10.5715 10.8214 2.85718 20.25 2.85718C29.6785 2.85718 37.3928 10.5715 37.3928 20.0001C37.3928 28.4859 31.2214 35.5145 23.0785 36.9716L22.1357 36.2002H18.3643L17.4214 36.9716Z",fill:"url(#paint0_linear_193_14528)"}),x.createElement("path",{d:"M26.9357 24.7999L27.7072 19.9999H23.1643V16.657C23.1643 15.2856 23.6786 14.257 25.7357 14.257H27.9643V9.88558C26.7643 9.71415 25.3929 9.54272 24.1929 9.54272C20.25 9.54272 17.5071 11.9427 17.5071 16.2285V19.9999H13.2214V24.7999H17.5071V36.8857C18.45 37.0571 19.3929 37.1429 20.3357 37.1429C21.2786 37.1429 22.2214 37.0571 23.1643 36.8857V24.7999H26.9357Z",fill:"white"}),x.createElement("defs",null,x.createElement("linearGradient",{id:"paint0_linear_193_14528",x1:"20.2508",y1:"35.9507",x2:"20.2508",y2:"2.85086",gradientUnits:"userSpaceOnUse"},x.createElement("stop",{"stop-color":"#0062E0"}),x.createElement("stop",{offset:"1","stop-color":"#19AFFF"})))))},T9=({isDarkMode:t})=>{const e=t?"#FFFFFF":"#000000";return n=>{let i=ke({},(Xi(n),n));return x.createElement(x.Fragment,null,x.createElement("svg",ke({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),x.createElement("path",{d:"M25.8582 10.4398C24.1222 10.4398 23.6288 11.2098 23.6288 12.9073V15.709H28.246L27.791 20.2476H23.6279V34H18.1024V20.2468H14.375V15.7081H18.1042V12.9851C18.1042 8.40625 19.9399 6 25.0891 6C26.1942 6 27.5163 6.0875 28.3055 6.19775V10.459",fill:e})))}},V2e=({chains:t,options:e={}})=>({id:"facebook",isSequenceBased:!0,logoDark:P9,logoLight:P9,monochromeLogoDark:T9({isDarkMode:!0}),monochromeLogoLight:T9({isDarkMode:!1}),name:"Facebook",createConnector:()=>{var r;return new Od({chains:t,options:ke({},e,{connect:ke({},e==null?void 0:e.connect,{settings:ke({},e==null||(r=e.connect)==null?void 0:r.settings,{signInWith:"facebook"})})})})}}),I9=t=>{let e=ke({},(Xi(t),t));return x.createElement(x.Fragment,null,x.createElement("svg",ke({viewBox:"0 0 41 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),x.createElement("g",{id:"Frame 2114"},x.createElement("g",{id:"Group"},x.createElement("path",{id:"Vector",d:"M20.7497 16.8828V23.5218H29.9756C29.5705 25.6568 28.3548 27.4647 26.5314 28.6803L32.095 32.9972C35.3366 30.0051 37.2068 25.6102 37.2068 20.3895C37.2068 19.1739 37.0977 18.005 36.895 16.883L20.7497 16.8828Z",fill:"#4285F4"}),x.createElement("path",{id:"Vector_2",d:"M11.1424 23.2627L9.88756 24.2232L5.44592 27.6829C8.2667 33.2777 14.0481 37.1427 20.7493 37.1427C25.3778 37.1427 29.2583 35.6154 32.0947 32.9973L26.5311 28.6803C25.0038 29.7089 23.0557 30.3324 20.7493 30.3324C16.2922 30.3324 12.5053 27.3246 11.1494 23.2726L11.1424 23.2627Z",fill:"#34A853"}),x.createElement("path",{id:"Vector_3",d:"M5.44594 12.3169C4.27718 14.6233 3.60712 17.2259 3.60712 19.9999C3.60712 22.7739 4.27718 25.3765 5.44594 27.6829C5.44594 27.6984 11.1499 23.2569 11.1499 23.2569C10.8071 22.2284 10.6044 21.1375 10.6044 19.9997C10.6044 18.8619 10.8071 17.7711 11.1499 16.7425L5.44594 12.3169Z",fill:"#FBBC05"}),x.createElement("path",{id:"Vector_4",d:"M20.7497 9.6829C23.2744 9.6829 25.5185 10.5556 27.3107 12.2387L32.2198 7.32972C29.2431 4.55574 25.3783 2.85693 20.7497 2.85693C14.0484 2.85693 8.2667 6.70628 5.44592 12.3167L11.1497 16.7427C12.5055 12.6907 16.2926 9.6829 20.7497 9.6829Z",fill:"#EA4335"})))))},O9=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=ke({},(Xi(n),n));return x.createElement("svg",ke({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),x.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.8355 14.7613C24.5584 13.5329 22.9441 12.9032 21.1356 12.9032C17.9377 12.9032 15.2302 15.0813 14.2595 18.0232L14.2593 18.023C14.0142 18.7662 13.8712 19.5609 13.8712 20.3866C13.8712 21.2124 14.004 22.0072 14.2594 22.7504L14.2587 22.751H14.2595C15.2302 25.6929 17.9377 27.871 21.1356 27.871C22.7907 27.871 24.1904 27.4168 25.2939 26.6736V26.6732C26.5812 25.7958 27.4497 24.5055 27.746 22.9777H21.1355V18.3223H32.6808C32.8034 19.0758 32.875 19.85 32.875 20.6655C32.875 24.4332 31.5467 27.6126 29.2377 29.77L29.2378 29.7703C27.2148 31.6594 24.446 32.7742 21.1356 32.7742C16.3438 32.7742 12.2059 29.9871 10.1931 25.9407V25.94L10.193 25.9401C9.35521 24.2678 8.875 22.3891 8.875 20.3866C8.875 18.384 9.35521 16.5053 10.193 14.833H10.1934C12.2063 10.7869 16.344 8 21.1356 8C24.446 8 27.2148 9.22839 29.3298 11.231L25.8355 14.7613Z",fill:e}))}},G2e=({chains:t,options:e={}})=>({id:"google",isSequenceBased:!0,logoDark:I9,logoLight:I9,monochromeLogoDark:O9({isDarkMode:!0}),monochromeLogoLight:O9({isDarkMode:!1}),name:"Google",createConnector:()=>{var r;return new Od({chains:t,options:ke({},e,{connect:ke({},e==null?void 0:e.connect,{settings:ke({},e==null||(r=e.connect)==null?void 0:r.settings,{signInWith:"google"})})})})}}),R9=t=>{let e=ke({},(Xi(t),t));return x.createElement(x.Fragment,null,x.createElement("svg",ke({viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),x.createElement("rect",{width:"28",height:"28"}),x.createElement("path",{d:"M24.0891 3.1199L15.3446 9.61456L16.9617 5.7828L24.0891 3.1199Z",fill:"#E2761B",stroke:"#E2761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M3.90207 3.1199L12.5763 9.67608L11.0383 5.7828L3.90207 3.1199Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M20.9429 18.1745L18.6139 21.7426L23.597 23.1136L25.0295 18.2536L20.9429 18.1745Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M2.97929 18.2536L4.40301 23.1136L9.38607 21.7426L7.05713 18.1745L2.97929 18.2536Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M9.10483 12.1456L7.71626 14.2461L12.6642 14.4658L12.4884 9.14877L9.10483 12.1456Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M18.8864 12.1456L15.4589 9.08725L15.3446 14.4658L20.2837 14.2461L18.8864 12.1456Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M9.38606 21.7426L12.3566 20.2925L9.79033 18.2888L9.38606 21.7426Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M15.6347 20.2925L18.6139 21.7426L18.2009 18.2888L15.6347 20.2925Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M18.6139 21.7426L15.6347 20.2925L15.8719 22.2348L15.8456 23.0521L18.6139 21.7426Z",fill:"#D7C1B3",stroke:"#D7C1B3",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M9.38606 21.7426L12.1544 23.0521L12.1368 22.2348L12.3566 20.2925L9.38606 21.7426Z",fill:"#D7C1B3",stroke:"#D7C1B3",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M12.1984 17.0056L9.72002 16.2762L11.4689 15.4765L12.1984 17.0056Z",fill:"#233447",stroke:"#233447",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M15.7928 17.0056L16.5223 15.4765L18.28 16.2762L15.7928 17.0056Z",fill:"#233447",stroke:"#233447",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M9.38606 21.7426L9.80791 18.1745L7.05712 18.2536L9.38606 21.7426Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M18.1921 18.1745L18.6139 21.7426L20.9429 18.2536L18.1921 18.1745Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M20.2837 14.2461L15.3446 14.4658L15.8016 17.0057L16.5311 15.4765L18.2888 16.2762L20.2837 14.2461Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M9.72002 16.2762L11.4777 15.4765L12.1984 17.0057L12.6642 14.4658L7.71626 14.2461L9.72002 16.2762Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M7.71626 14.2461L9.79033 18.2888L9.72002 16.2762L7.71626 14.2461Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M18.2888 16.2762L18.2009 18.2888L20.2837 14.2461L18.2888 16.2762Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M12.6642 14.4658L12.1984 17.0057L12.7784 20.0025L12.9102 16.0565L12.6642 14.4658Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M15.3446 14.4658L15.1073 16.0477L15.2128 20.0025L15.8016 17.0057L15.3446 14.4658Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M15.8016 17.0056L15.2128 20.0025L15.6347 20.2925L18.2009 18.2888L18.2888 16.2762L15.8016 17.0056Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M9.72002 16.2762L9.79033 18.2888L12.3566 20.2925L12.7784 20.0025L12.1984 17.0056L9.72002 16.2762Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M15.8456 23.0521L15.8719 22.2348L15.6522 22.0414H12.339L12.1368 22.2348L12.1544 23.0521L9.38606 21.7426L10.3528 22.5336L12.3126 23.8958H15.6786L17.6472 22.5336L18.6139 21.7426L15.8456 23.0521Z",fill:"#C0AD9E",stroke:"#C0AD9E",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M15.6347 20.2925L15.2128 20.0025H12.7784L12.3566 20.2925L12.1368 22.2348L12.339 22.0414H15.6522L15.8719 22.2348L15.6347 20.2925Z",fill:"#161616",stroke:"#161616",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M24.4583 10.0364L25.2053 6.45072L24.0891 3.1199L15.6347 9.39485L18.8864 12.1456L23.4827 13.4903L24.5022 12.3038L24.0628 11.9874L24.7658 11.3459L24.221 10.924L24.924 10.3879L24.4583 10.0364Z",fill:"#763D16",stroke:"#763D16",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M2.79472 6.45072L3.54174 10.0364L3.06717 10.3879L3.77024 10.924L3.23415 11.3459L3.93722 11.9874L3.4978 12.3038L4.50847 13.4903L9.10483 12.1456L12.3566 9.39485L3.90207 3.1199L2.79472 6.45072Z",fill:"#763D16",stroke:"#763D16",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M23.4827 13.4903L18.8864 12.1456L20.2837 14.2461L18.2009 18.2888L20.9429 18.2536H25.0295L23.4827 13.4903Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M9.10484 12.1456L4.50848 13.4903L2.97929 18.2536H7.05713L9.79033 18.2888L7.71626 14.2461L9.10484 12.1456Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),x.createElement("path",{d:"M15.3446 14.4658L15.6347 9.39485L16.9705 5.7828H11.0383L12.3566 9.39485L12.6642 14.4658L12.7696 16.0653L12.7784 20.0025H15.2128L15.2304 16.0653L15.3446 14.4658Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"})))},zy=t=>{let e=ke({},(Xi(t),t));return x.createElement(x.Fragment,null,x.createElement("svg",ke({xmlns:"http://www.w3.org/2000/svg",style:{fill:"none"},id:"svg1316",version:"1.1",viewBox:"0 0 396 396"},e),x.createElement("g",{transform:"translate(0,38)",id:"g1256",clipPath:"url(#clip0_5_131)"},x.createElement("g",{id:"g1254",clipPath:"url(#clip1_5_131)"},x.createElement("path",{style:{fill:"#111111"},id:"path1232",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),x.createElement("path",{style:{fill:"url(#paint0_linear_5_13"},id:"path1234",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),x.createElement("path",{style:{fill:"url(#paint1_linear_5_131"},id:"path1236",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),x.createElement("path",{style:{fill:"url(#paint2_linear_5_131)"},id:"path1238",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),x.createElement("path",{style:{fill:"url(#paint3_linear_5_131)"},id:"path1240",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),x.createElement("path",{style:{fill:"url(#paint4_linear_5_131)"},id:"path1242",d:"m 98.9999,238.126 c 0,-10.965 -8.8648,-19.854 -19.8,-19.854 -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.966 8.8648,19.855 19.8,19.855 10.9352,0 19.8,-8.889 19.8,-19.855 z"}),x.createElement("path",{style:{fill:"url(#paint5_linear_5_131)"},id:"path1244",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),x.createElement("path",{style:{fill:"url(#paint6_linear_5_131)"},id:"path1246",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),x.createElement("path",{style:{fill:"url(#paint7_linear_5_131)"},id:"path1248",d:"M 316.8,59.5632 H 158.4 c -10.935,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.865,19.8544 19.8,19.8544 h 158.4 c 10.935,0 19.8,-8.8892 19.8,-19.8544 0,-10.9653 -8.865,-19.8544 -19.8,-19.8544 z"}),x.createElement("path",{style:{fill:"url(#paint8_linear_5_131)"},id:"path1250",d:"M 316.8,218.272 H 158.4 c -10.935,0 -19.8,8.889 -19.8,19.854 0,10.966 8.865,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.889 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}),x.createElement("path",{style:{fill:"url(#paint9_linear_5_131)"},id:"path1252",d:"M 237.6,138.981 H 79.2 c -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.965 8.8648,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.89 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}))),x.createElement("defs",{id:"defs1314"},x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"318",x2:"198",y1:"4.0585401e-05",x1:"198",id:"paint0_linear_5_131"},x.createElement("stop",{id:"stop1258",stopColor:"#1D273D"}),x.createElement("stop",{id:"stop1260",stopColor:"#0D0F13",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"63",x2:"92.5",y1:"99",x1:"65.5",id:"paint1_linear_5_131"},x.createElement("stop",{id:"stop1263",stopColor:"#4462FE"}),x.createElement("stop",{id:"stop1265",stopColor:"#7D69FA",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint2_linear_5_131"},x.createElement("stop",{id:"stop1268",stopColor:"#3757FD"}),x.createElement("stop",{id:"stop1270",stopColor:"#6980FA",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint3_linear_5_131"},x.createElement("stop",{id:"stop1273",stopColor:"#2447FF"}),x.createElement("stop",{id:"stop1275",stopColor:"#6980FA",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"223.5",x2:"91.5",y1:"251.5",x1:"65",id:"paint4_linear_5_131"},x.createElement("stop",{id:"stop1278",stopColor:"#BC3EE6"}),x.createElement("stop",{id:"stop1280",stopColor:"#D972F1",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"146",x2:"329.5",y1:"172",x1:"305",id:"paint5_linear_5_131"},x.createElement("stop",{id:"stop1283",stopColor:"#29BDFF"}),x.createElement("stop",{id:"stop1285",stopColor:"#96E7FB",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"176.772",x2:"334.56699",y1:"178.418",x1:"300.17999",id:"paint6_linear_5_131"},x.createElement("stop",{id:"stop1288",stopColor:"#23BBFF"}),x.createElement("stop",{id:"stop1290",stopColor:"#85E7FF",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"60",x2:"317.5",y1:"99",x1:"154.5",id:"paint7_linear_5_131"},x.createElement("stop",{id:"stop1293",stopColor:"#23BBFF"}),x.createElement("stop",{id:"stop1295",stopColor:"#85E7FF",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"218",x2:"312.5",y1:"258",x1:"156",id:"paint8_linear_5_131"},x.createElement("stop",{id:"stop1298",stopColor:"#2447FF"}),x.createElement("stop",{id:"stop1300",stopColor:"#6980FA",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"139",x2:"235.5",y1:"179",x1:"86.000099",id:"paint9_linear_5_131"},x.createElement("stop",{id:"stop1303",stopColor:"#6634FF"}),x.createElement("stop",{id:"stop1305",stopColor:"#9C6DFF",offset:"1"})),x.createElement("clipPath",{id:"clip0_5_131"},x.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1308",height:"317.67001",width:"396"})),x.createElement("clipPath",{id:"clip1_5_131"},x.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1311",height:"317.67001",width:"396"})))))};window.ethereum=window.ethereum||{};const K2e=({chains:t})=>({id:"metamask",logoDark:R9,logoLight:R9,name:"Metamask",createConnector:()=>new ige({chains:t,options:{shimDisconnect:!0}})}),Q2e=({chains:t,options:e})=>({id:"mock",isSequenceBased:!0,logoDark:zy,logoLight:zy,name:"Mock",createConnector:()=>{var r;return new oge({chains:t,options:ke({chainId:(e==null||(r=e.chain)==null?void 0:r.id)||137,walletClient:K1({account:e.account,chain:(e==null?void 0:e.chain)||vfe,transport:e.transport})},e)})}}),Y2e=({chains:t,options:e})=>({id:"sequence",isSequenceBased:!0,logoDark:zy,logoLight:zy,name:"Sequence",createConnector:()=>new Od({chains:t,options:e})}),iv=({isDarkMode:t})=>{let e;return t===void 0?e="#9146FF":e=t?"white":"black",n=>(ke({},(Xi(n),n)),x.createElement(x.Fragment,null,x.createElement("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 2400 2800",transform:"scale(0.80)"},x.createElement("g",null,x.createElement("g",{id:"Layer_1-2"},x.createElement("path",{fill:e,d:"M500,0L0,500v1800h600v500l500-500h400l900-900V0H500z M2200,1300l-400,400h-400l-350,350v-350H600V200h1600 V1300z"}),x.createElement("rect",{x:"1700",y:"550",fill:e,width:"200",height:"600"}),x.createElement("rect",{x:"1150",y:"550",fill:e,width:"200",height:"600"}))))))},J2e=({chains:t,options:e={}})=>({id:"twitch",isSequenceBased:!0,logoDark:iv({}),logoLight:iv({}),monochromeLogoDark:iv({isDarkMode:!0}),monochromeLogoLight:iv({isDarkMode:!1}),name:"Twitch",createConnector:()=>{var r;return new Od({chains:t,options:ke({},e,{connect:ke({},e==null?void 0:e.connect,{settings:ke({},e==null||(r=e.connect)==null?void 0:r.settings,{signInWith:"twitch"})})})})}}),$9=t=>{let e=ke({},(Xi(t),t));return x.createElement(x.Fragment,null,x.createElement("svg",ke({fill:"none",viewBox:"0 0 480 332",xmlns:"http://www.w3.org/2000/svg"},e),x.createElement("path",{d:"m126.613 93.9842c62.622-61.3123 164.152-61.3123 226.775 0l7.536 7.3788c3.131 3.066 3.131 8.036 0 11.102l-25.781 25.242c-1.566 1.533-4.104 1.533-5.67 0l-10.371-10.154c-43.687-42.7734-114.517-42.7734-158.204 0l-11.107 10.874c-1.565 1.533-4.103 1.533-5.669 0l-25.781-25.242c-3.132-3.066-3.132-8.036 0-11.102zm280.093 52.2038 22.946 22.465c3.131 3.066 3.131 8.036 0 11.102l-103.463 101.301c-3.131 3.065-8.208 3.065-11.339 0l-73.432-71.896c-.783-.767-2.052-.767-2.835 0l-73.43 71.896c-3.131 3.065-8.208 3.065-11.339 0l-103.4657-101.302c-3.1311-3.066-3.1311-8.036 0-11.102l22.9456-22.466c3.1311-3.065 8.2077-3.065 11.3388 0l73.4333 71.897c.782.767 2.051.767 2.834 0l73.429-71.897c3.131-3.065 8.208-3.065 11.339 0l73.433 71.897c.783.767 2.052.767 2.835 0l73.431-71.895c3.132-3.066 8.208-3.066 11.339 0z",fill:"#3396ff"})))},X2e=({chains:t,options:e})=>({id:"wallet-connect",logoDark:$9,logoLight:$9,name:"Walletconnect",createConnector:()=>new z2e({chains:t,options:e})}),Z2e=({chains:t,walletConnectProjectId:e,defaultChainId:r})=>{let n=t[0].id;if(r){const s=t.find(o=>o.id===r);s&&(n=s.id)}return Dz([H2e({chains:t,options:{appName:"app"}}),q2e({chains:t,options:{defaultNetwork:n}}),G2e({chains:t,options:{defaultNetwork:n}}),V2e({chains:t,options:{defaultNetwork:n}}),J2e({chains:t,options:{defaultNetwork:n}}),W2e({chains:t,options:{defaultNetwork:n}}),K2e({chains:t}),X2e({chains:t,options:{projectId:e}}),Y2e({chains:t,options:{defaultNetwork:n}})])};function sk(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function sv(){}function M9(){return typeof WeakMap<"u"?new WeakMap:eEe()}function eEe(){return{add:sv,delete:sv,get:sv,set:sv,has:function(t){return!1}}}var tEe=Object.prototype.hasOwnProperty,R5=function(t,e){return tEe.call(t,e)};function cE(t,e){for(var r in e)R5(e,r)&&(t[r]=e[r]);return t}var rEe=/^[ \t]*(?:\r\n|\r|\n)/,nEe=/(?:\r\n|\r|\n)[ \t]*$/,iEe=/^(?:[\r\n]|$)/,sEe=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,oEe=/^[ \t]*[\r\n][ \t\r\n]*$/;function N9(t,e,r){var n=0,i=t[0].match(sEe);i&&(n=i[1].length);var s="(\\r\\n|\\r|\\n).{0,"+n+"}",o=new RegExp(s,"g");e&&(t=t.slice(1));var a=r.newline,c=r.trimLeadingNewline,l=r.trimTrailingNewline,u=typeof a=="string",f=t.length,d=t.map(function(h,p){return h=h.replace(o,"$1"),p===0&&c&&(h=h.replace(rEe,"")),p===f-1&&l&&(h=h.replace(nEe,"")),u&&(h=h.replace(/\r\n|\n|\r/g,function(v){return a})),h});return d}function aEe(t,e){for(var r="",n=0,i=t.length;n{},registerClassName:()=>{},onEndFileScope:()=>{},registerComposition:()=>{},markCompositionUsed:()=>{},getIdentOption:()=>"short"},em=[lEe],au=()=>{if(em.length<1)throw new Error("No adapter configured");return em[em.length-1]},bz=!1,uEe=t=>{bz||fEe(t)},fEe=t=>{if(!t)throw new Error('No adapter provided when calling "setAdapter"');bz=!0,em.push(t)},Zb=function(){return au().appendCss(...arguments)},wz=function(){return au().registerClassName(...arguments)},dEe=function(){return au().registerComposition(...arguments)},Ez=function(){return au().markCompositionUsed(...arguments)},hEe=function(){for(var e,r,n=arguments.length,i=new Array(n),s=0;s{var{fileScope:e,css:r}=t,n=e.packageName?[e.packageName,e.filePath].join("/"):e.filePath,i=A9[n];if(!i){var s=document.createElement("style");e.packageName&&s.setAttribute("data-package",e.packageName),s.setAttribute("data-file",e.filePath),s.setAttribute("type","text/css"),i=A9[n]=s,document.head.appendChild(s)}i.innerHTML=r};function N2e(t){var e=t.match(/^var\((.*)\)$/);return e?e[1]:t}/*! https://mths.be/cssesc v3.0.0 by @mathias */var D2e={},L2e=D2e.hasOwnProperty,B2e=function(e,r){if(!e)return r;var n={};for(var i in r)n[i]=L2e.call(e,i)?e[i]:r[i];return n},F2e=/[ -,\.\/:-@\[-\^`\{-~]/,j2e=/[ -,\.\/:-@\[\]\^`\{-~]/,U2e=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,J8=function t(e,r){r=B2e(r,t.options),r.quotes!="single"&&r.quotes!="double"&&(r.quotes="single");for(var n=r.quotes=="double"?'"':"'",i=r.isIdentifier,s=e.charAt(0),o="",a=0,c=e.length;a126){if(u>=55296&&u<=56319&&a0;){const a=o.shift();if(a!==void 0)for(const c in r[a]){const l=r[a][c];o.push(l);let u=s[a];for(;u>0&&!(c in r[u]);)u=s[u];if(c in r[u]){const f=r[u][c];s[l]=f,n[l]=[...n[l],...n[f]]}else s[l]=0}}return{gotoFn:r,output:n,failure:s}}search(e){let r=0;const n=[];for(let i=0;i0&&!(s in this.gotoFn[r]);)r=this.failure[r];if(s in this.gotoFn[r]&&(r=this.gotoFn[r][s],this.output[r].length>0)){const o=this.output[r];n.push([i,o])}}return n}}var ir;(function(t){t.Attribute="attribute",t.Pseudo="pseudo",t.PseudoElement="pseudo-element",t.Tag="tag",t.Universal="universal",t.Adjacent="adjacent",t.Child="child",t.Descendant="descendant",t.Parent="parent",t.Sibling="sibling",t.ColumnCombinator="column-combinator"})(ir||(ir={}));var $i;(function(t){t.Any="any",t.Element="element",t.End="end",t.Equals="equals",t.Exists="exists",t.Hyphen="hyphen",t.Not="not",t.Start="start"})($i||($i={}));const _9=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,H2e=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,q2e=new Map([[126,$i.Element],[94,$i.Start],[36,$i.End],[42,$i.Any],[33,$i.Not],[124,$i.Hyphen]]),V2e=new Set(["has","not","matches","is","where","host","host-context"]);function G2e(t){switch(t.type){case ir.Adjacent:case ir.Child:case ir.Descendant:case ir.Parent:case ir.Sibling:case ir.ColumnCombinator:return!0;default:return!1}}const K2e=new Set(["contains","icontains"]);function Q2e(t,e,r){const n=parseInt(e,16)-65536;return n!==n||r?e:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)}function nh(t){return t.replace(H2e,Q2e)}function rE(t){return t===39||t===34}function P9(t){return t===32||t===9||t===10||t===12||t===13}function Y2e(t){const e=[],r=VU(e,`${t}`,0);if(r0&&r0&&G2e(n[n.length-1]))throw new Error("Did not expect successive traversals.")}function l(d){if(n.length>0&&n[n.length-1].type===ir.Descendant){n[n.length-1].type=d;return}c(),n.push({type:d})}function u(d,h){n.push({type:ir.Attribute,name:d,action:h,value:i(1),namespace:null,ignoreCase:"quirks"})}function f(){if(n.length&&n[n.length-1].type===ir.Descendant&&n.pop(),n.length===0)throw new Error("Empty sub-selector");t.push(n)}if(s(0),e.length===r)return r;e:for(;r{var{fileScope:e,css:r}=t,n=e.packageName?[e.packageName,e.filePath].join("/"):e.filePath,i=L9[n];if(!i){var s=document.createElement("style");e.packageName&&s.setAttribute("data-package",e.packageName),s.setAttribute("data-file",e.filePath),s.setAttribute("type","text/css"),i=L9[n]=s,document.head.appendChild(s)}i.innerHTML=r};function gEe(t){var e=t.match(/^var\((.*)\)$/);return e?e[1]:t}/*! https://mths.be/cssesc v3.0.0 by @mathias */var bEe={},wEe=bEe.hasOwnProperty,EEe=function(e,r){if(!e)return r;var n={};for(var i in r)n[i]=wEe.call(e,i)?e[i]:r[i];return n},xEe=/[ -,\.\/:-@\[-\^`\{-~]/,CEe=/[ -,\.\/:-@\[\]\^`\{-~]/,SEe=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,ak=function t(e,r){r=EEe(r,t.options),r.quotes!="single"&&r.quotes!="double"&&(r.quotes="single");for(var n=r.quotes=="double"?'"':"'",i=r.isIdentifier,s=e.charAt(0),o="",a=0,c=e.length;a126){if(u>=55296&&u<=56319&&a0;){const a=o.shift();if(a!==void 0)for(const c in r[a]){const l=r[a][c];o.push(l);let u=s[a];for(;u>0&&!(c in r[u]);)u=s[u];if(c in r[u]){const f=r[u][c];s[l]=f,n[l]=[...n[l],...n[f]]}else s[l]=0}}return{gotoFn:r,output:n,failure:s}}search(e){let r=0;const n=[];for(let i=0;i0&&!(s in this.gotoFn[r]);)r=this.failure[r];if(s in this.gotoFn[r]&&(r=this.gotoFn[r][s],this.output[r].length>0)){const o=this.output[r];n.push([i,o])}}return n}}var ir;(function(t){t.Attribute="attribute",t.Pseudo="pseudo",t.PseudoElement="pseudo-element",t.Tag="tag",t.Universal="universal",t.Adjacent="adjacent",t.Child="child",t.Descendant="descendant",t.Parent="parent",t.Sibling="sibling",t.ColumnCombinator="column-combinator"})(ir||(ir={}));var Ni;(function(t){t.Any="any",t.Element="element",t.End="end",t.Equals="equals",t.Exists="exists",t.Hyphen="hyphen",t.Not="not",t.Start="start"})(Ni||(Ni={}));const F9=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,_Ee=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,PEe=new Map([[126,Ni.Element],[94,Ni.Start],[36,Ni.End],[42,Ni.Any],[33,Ni.Not],[124,Ni.Hyphen]]),TEe=new Set(["has","not","matches","is","where","host","host-context"]);function IEe(t){switch(t.type){case ir.Adjacent:case ir.Child:case ir.Descendant:case ir.Parent:case ir.Sibling:case ir.ColumnCombinator:return!0;default:return!1}}const OEe=new Set(["contains","icontains"]);function REe(t,e,r){const n=parseInt(e,16)-65536;return n!==n||r?e:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)}function oh(t){return t.replace(_Ee,REe)}function lE(t){return t===39||t===34}function B9(t){return t===32||t===9||t===10||t===12||t===13}function $Ee(t){const e=[],r=xz(e,`${t}`,0);if(r0&&r0&&IEe(n[n.length-1]))throw new Error("Did not expect successive traversals.")}function l(d){if(n.length>0&&n[n.length-1].type===ir.Descendant){n[n.length-1].type=d;return}c(),n.push({type:d})}function u(d,h){n.push({type:ir.Attribute,name:d,action:h,value:i(1),namespace:null,ignoreCase:"quirks"})}function f(){if(n.length&&n[n.length-1].type===ir.Descendant&&n.pop(),n.length===0)throw new Error("Empty sub-selector");t.push(n)}if(s(0),e.length===r)return r;e:for(;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Mr(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}var X2e=/(\u000D|\u000C|\u000D\u000A)/g,Z2e=/[\u0000\uD800-\uDFFF]/g,eEe=/(\/\*)[\s\S]*?(\*\/)/g,tEe=function(e,r){r===void 0&&(r=0),e=e.replace(X2e,` -`).replace(Z2e,"�"),e=e.replace(eEe,"");for(var n=[];r"})}else if(i===34){var o=T9(e,r);if(o===null)return null;var a=Mr(o,2),c=a[0],l=a[1];n.push({type:"",value:l}),r=c}else if(i===35){if(r+1=65&&u<=90||u>=97&&u<=122||u>=128||u>=48&&u<=57||u===92&&r+2",value:l.toLowerCase(),flag:f}),r=c;continue}}}n.push({type:"",value:i})}else if(i===39){var o=T9(e,r);if(o===null)return null;var h=Mr(o,2),c=h[0],l=h[1];n.push({type:"",value:l}),r=c}else if(i===40)n.push({type:"<(-token>"});else if(i===41)n.push({type:"<)-token>"});else if(i===43){var p=tv(e,r);if(p===null)n.push({type:"",value:i});else{var v=Mr(p,2),c=v[0],b=v[1];b[0]===""?n.push({type:"",value:b[1],unit:b[2].toLowerCase(),flag:"number"}):b[0]===""?n.push({type:b[0],value:b[1],flag:b[2]}):n.push({type:b[0],value:b[1],flag:"number"}),r=c}}else if(i===44)n.push({type:""});else if(i===45){var y=tv(e,r);if(y!==null){var m=Mr(y,2),c=m[0],b=m[1];b[0]===""?n.push({type:"",value:b[1],unit:b[2].toLowerCase(),flag:"number"}):b[0]===""?n.push({type:b[0],value:b[1],flag:b[2]}):n.push({type:b[0],value:b[1],flag:"number"}),r=c;continue}if(r+2"}),r+=2;continue}}var o=I9(e,r);if(o!==null){var S=Mr(o,3),c=S[0],l=S[1],P=S[2];n.push({type:P,value:l}),r=c;continue}n.push({type:"",value:i})}else if(i===46){var y=tv(e,r);if(y===null)n.push({type:"",value:i});else{var T=Mr(y,2),c=T[0],b=T[1];b[0]===""?n.push({type:"",value:b[1],unit:b[2].toLowerCase(),flag:"number"}):b[0]===""?n.push({type:b[0],value:b[1],flag:b[2]}):n.push({type:b[0],value:b[1],flag:"number"}),r=c;continue}}else if(i===58)n.push({type:""});else if(i===59)n.push({type:""});else if(i===60){if(r+3"}),r+=3;continue}}n.push({type:"",value:i})}else if(i===64){var o=Z8(e,r+1);if(o!==null){var I=Mr(o,2),c=I[0],l=I[1];n.push({type:"",value:l.toLowerCase()}),r=c;continue}n.push({type:"",value:i})}else if(i===91)n.push({type:"<[-token>"});else if(i===92){var o=tp(e,r);if(o===null)return null;var B=Mr(o,2),c=B[0],l=B[1];e=e.slice(0,r)+l+e.slice(c+1),r-=1}else if(i===93)n.push({type:"<]-token>"});else if(i===123)n.push({type:"<{-token>"});else if(i===125)n.push({type:"<}-token>"});else if(i>=48&&i<=57){var o=tv(e,r),j=Mr(o,2),c=j[0],b=j[1];b[0]===""?n.push({type:"",value:b[1],unit:b[2].toLowerCase(),flag:"number"}):b[0]===""?n.push({type:b[0],value:b[1],flag:b[2]}):n.push({type:b[0],value:b[1],flag:"number"}),r=c}else if(i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128){var o=I9(e,r);if(o===null)return null;var H=Mr(o,3),c=H[0],l=H[1],P=H[2];n.push({type:P,value:l}),r=c}else n.push({type:"",value:i})}return n.push({type:""}),n},T9=function(e,r){if(e.length<=r+1)return null;for(var n=e.charCodeAt(r),i=[],s=r+1;s=65&&i<=90||i>=97&&i<=122||i>=128)return!0;if(i===92){if(e.length<=r+2)return!1;var s=e.charCodeAt(r+2);return s!==10}else return!1}else{if(n===95||n>=65&&n<=90||n>=97&&n<=122||n>=128)return!0;if(n===92){if(e.length<=r+1)return!1;var i=e.charCodeAt(r+1);return i!==10}else return!1}},tp=function(e,r){if(e.length<=r+1||e.charCodeAt(r)!==92)return null;var n=e.charCodeAt(r+1);if(n===10)return null;if(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102){for(var i=[n],s=Math.min(r+7,e.length),o=r+2;o=48&&a<=57||a>=65&&a<=70||a>=97&&a<=102)i.push(a);else break}if(o",o,f]]}return s+1",o]]:[s,["",o,a]]},rEe=function(e,r){if(e.length<=r)return null;var n="integer",i=[],s=e.charCodeAt(r);for((s===43||s===45)&&(r+=1,s===45&&i.push(45));r=48&&o<=57)i.push(o),r+=1;else break}if(r+1=48&&c<=57)for(i.push(a,c),n="number",r+=2;r=48&&o<=57)i.push(o),r+=1;else break}}if(r+1=48&&c<=57;if(u||(c===43||c===45)&&l>=48&&l<=57)for(n="number",u?(i.push(69,c),r+=2):c===45?(i.push(69,45,l),r+=3):(i.push(69,l),r+=3);r=48&&o<=57)i.push(o),r+=1;else break}}}var f=String.fromCharCode.apply(null,i),d=n==="number"?parseFloat(f):parseInt(f);return d===-0&&(d=0),Number.isNaN(d)?null:[r-1,d,n]},nEe=function(e,r){if(e.length<=r)return null;for(var n=[],i=e.charCodeAt(r);r=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var s=tp(e,r);if(s!==null){var o=Mr(s,2),a=o[0],c=o[1];n.push(c),r=a;continue}}break}return r===0?null:[r-1,String.fromCharCode.apply(null,n)]},Z8=function(e,r){if(e.length<=r||!GU(e,r))return null;for(var n=[],i=e.charCodeAt(r);r=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var s=tp(e,r);if(s!==null){var o=Mr(s,2),a=o[0],c=o[1];n.push(c),r=a;continue}}break}return[r-1,String.fromCharCode.apply(null,n)]},iEe=function(e,r){for(var n=e.charCodeAt(r);n===9||n===32||n===10;)n=e.charCodeAt(++r);for(var i=[],s=!1;rs+1){var a=e.charCodeAt(s+1);if(a===40){for(var c=2;s+c"];if(l!==9&&l!==32&&l!==10){var u=iEe(e,s+c);if(u===null)return null;var f=Mr(u,2),d=f[0],h=f[1];return[d,h,""]}}return[s+1,o.toLowerCase(),""]}}}else if(e.length>s+1){var a=e.charCodeAt(s+1);if(a===40)return[s+1,o.toLowerCase(),""]}return[s,o.toLowerCase(),""]},sEe=function(e){for(var r=e.length-1;r>=0;r--)e[r]=oEe(e[r]);return e},oEe=function(e){if(e.mediaCondition===null)return e;var r=aEe(e.mediaCondition);return r.operator===null&&r.children.length===1&&"children"in r.children[0]&&(r=r.children[0]),{mediaPrefix:e.mediaPrefix,mediaType:e.mediaType,mediaCondition:r}},aEe=function t(e){for(var r=e.children.length-1;r>=0;r--){var n=e.children[r];if(!("context"in n)){var i=t(n);if(i.operator===null&&i.children.length===1)e.children[r]=i.children[0];else if(i.operator===e.operator&&(i.operator==="and"||i.operator==="or")){for(var s=[r,1],o=0;o"&&r[0].value==="media"){if(r[1].type!=="")throw Hn("Expected whitespace after media");n=2;for(var s=2;s"){i=s;break}else if(o.type==="")throw Hn("Expected '{' in media query but found ';'")}}return r=r.slice(n,i),fEe(r)},uEe=function(e){for(var r=[],n=!1,i=0;i"?(n=!0,r.length>0&&(r[r.length-1].wsAfter=!0)):(r.push(By(By({},e[i]),{wsBefore:n,wsAfter:!1})),n=!1);return r},fEe=function(e){for(var r,n,i=[[]],s=0;s"?i.push([]):i[i.length-1].push(o)}var a=i.map(uEe);if(a.length===1&&a[0].length===0)return[{mediaCondition:null,mediaPrefix:null,mediaType:"all"}];var c=a.map(function(h){return h.length===0?null:dEe(h)}),l=[];try{for(var u=J2e(c),f=u.next();!f.done;f=u.next()){var d=f.value;d!==null&&l.push(d)}}catch(h){r={error:h}}finally{try{f&&!f.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}if(l.length===0)throw Hn("No valid media queries");return l},dEe=function(e){var r=e[0];if(r.type==="<(-token>")try{return{mediaPrefix:null,mediaType:"all",mediaCondition:nE(e,!0)}}catch(f){throw Hn("Expected media condition after '('",f)}else if(r.type===""){var n=null,i=void 0,s=r.value;(s==="only"||s==="not")&&(n=s);var o=n===null?0:1;if(e.length<=o)throw Hn("Expected extra token in media query");var a=e[o];if(a.type===""){var c=a.value;if(c==="all")i="all";else if(c==="print"||c==="screen")i=c;else if(c==="tty"||c==="tv"||c==="projection"||c==="handheld"||c==="braille"||c==="embossed"||c==="aural"||c==="speech")n=n==="not"?null:"not",i="all";else throw Hn("Unknown ident '".concat(c,"' in media query"))}else if(n==="not"&&a.type==="<(-token>"){var l=[{type:"<(-token>",wsBefore:!1,wsAfter:!1}];l.push.apply(l,e),l.push({type:"<)-token>",wsBefore:!1,wsAfter:!1});try{return{mediaPrefix:null,mediaType:"all",mediaCondition:nE(l,!0)}}catch(f){throw Hn("Expected media condition after '('",f)}}else throw Hn("Invalid media query");if(o+1===e.length)return{mediaPrefix:n,mediaType:i,mediaCondition:null};if(o+4"&&u.value==="and")try{return{mediaPrefix:n,mediaType:i,mediaCondition:nE(e.slice(o+2),!1)}}catch(f){throw Hn("Expected media condition after 'and'",f)}else throw Hn("Expected 'and' after media prefix")}else throw Hn("Expected media condition after media prefix")}else throw Hn("Expected media condition or media prefix")},nE=function t(e,r,n){if(n===void 0&&(n=null),e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media condition");for(var i=e.length-1,s=0,o=0,a=0;a"?(o+=1,s=Math.max(s,o)):c.type==="<)-token>"&&(o-=1),o===0){i=a;break}}if(o!==0)throw new Error(`Mismatched parens -Invalid media condition`);var l,u=e.slice(0,i+1);if(s===1?l=hEe(u):u[1].type===""&&u[1].value==="not"?l=t(u.slice(2,-1),!0,"not"):l=t(u.slice(1,-1),!0),i===e.length-1)return{operator:n,children:[l]};var f=e[i+1];if(f.type!=="")throw new Error(`Invalid operator +***************************************************************************** */var Hy=function(){return Hy=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Nr(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}var NEe=/(\u000D|\u000C|\u000D\u000A)/g,DEe=/[\u0000\uD800-\uDFFF]/g,LEe=/(\/\*)[\s\S]*?(\*\/)/g,FEe=function(e,r){r===void 0&&(r=0),e=e.replace(NEe,` +`).replace(DEe,"�"),e=e.replace(LEe,"");for(var n=[];r"})}else if(i===34){var o=j9(e,r);if(o===null)return null;var a=Nr(o,2),c=a[0],l=a[1];n.push({type:"",value:l}),r=c}else if(i===35){if(r+1=65&&u<=90||u>=97&&u<=122||u>=128||u>=48&&u<=57||u===92&&r+2",value:l.toLowerCase(),flag:f}),r=c;continue}}}n.push({type:"",value:i})}else if(i===39){var o=j9(e,r);if(o===null)return null;var h=Nr(o,2),c=h[0],l=h[1];n.push({type:"",value:l}),r=c}else if(i===40)n.push({type:"<(-token>"});else if(i===41)n.push({type:"<)-token>"});else if(i===43){var p=ov(e,r);if(p===null)n.push({type:"",value:i});else{var v=Nr(p,2),c=v[0],b=v[1];b[0]===""?n.push({type:"",value:b[1],unit:b[2].toLowerCase(),flag:"number"}):b[0]===""?n.push({type:b[0],value:b[1],flag:b[2]}):n.push({type:b[0],value:b[1],flag:"number"}),r=c}}else if(i===44)n.push({type:""});else if(i===45){var y=ov(e,r);if(y!==null){var m=Nr(y,2),c=m[0],b=m[1];b[0]===""?n.push({type:"",value:b[1],unit:b[2].toLowerCase(),flag:"number"}):b[0]===""?n.push({type:b[0],value:b[1],flag:b[2]}):n.push({type:b[0],value:b[1],flag:"number"}),r=c;continue}if(r+2"}),r+=2;continue}}var o=U9(e,r);if(o!==null){var S=Nr(o,3),c=S[0],l=S[1],P=S[2];n.push({type:P,value:l}),r=c;continue}n.push({type:"",value:i})}else if(i===46){var y=ov(e,r);if(y===null)n.push({type:"",value:i});else{var T=Nr(y,2),c=T[0],b=T[1];b[0]===""?n.push({type:"",value:b[1],unit:b[2].toLowerCase(),flag:"number"}):b[0]===""?n.push({type:b[0],value:b[1],flag:b[2]}):n.push({type:b[0],value:b[1],flag:"number"}),r=c;continue}}else if(i===58)n.push({type:""});else if(i===59)n.push({type:""});else if(i===60){if(r+3"}),r+=3;continue}}n.push({type:"",value:i})}else if(i===64){var o=lk(e,r+1);if(o!==null){var I=Nr(o,2),c=I[0],l=I[1];n.push({type:"",value:l.toLowerCase()}),r=c;continue}n.push({type:"",value:i})}else if(i===91)n.push({type:"<[-token>"});else if(i===92){var o=op(e,r);if(o===null)return null;var F=Nr(o,2),c=F[0],l=F[1];e=e.slice(0,r)+l+e.slice(c+1),r-=1}else if(i===93)n.push({type:"<]-token>"});else if(i===123)n.push({type:"<{-token>"});else if(i===125)n.push({type:"<}-token>"});else if(i>=48&&i<=57){var o=ov(e,r),j=Nr(o,2),c=j[0],b=j[1];b[0]===""?n.push({type:"",value:b[1],unit:b[2].toLowerCase(),flag:"number"}):b[0]===""?n.push({type:b[0],value:b[1],flag:b[2]}):n.push({type:b[0],value:b[1],flag:"number"}),r=c}else if(i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128){var o=U9(e,r);if(o===null)return null;var H=Nr(o,3),c=H[0],l=H[1],P=H[2];n.push({type:P,value:l}),r=c}else n.push({type:"",value:i})}return n.push({type:""}),n},j9=function(e,r){if(e.length<=r+1)return null;for(var n=e.charCodeAt(r),i=[],s=r+1;s=65&&i<=90||i>=97&&i<=122||i>=128)return!0;if(i===92){if(e.length<=r+2)return!1;var s=e.charCodeAt(r+2);return s!==10}else return!1}else{if(n===95||n>=65&&n<=90||n>=97&&n<=122||n>=128)return!0;if(n===92){if(e.length<=r+1)return!1;var i=e.charCodeAt(r+1);return i!==10}else return!1}},op=function(e,r){if(e.length<=r+1||e.charCodeAt(r)!==92)return null;var n=e.charCodeAt(r+1);if(n===10)return null;if(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102){for(var i=[n],s=Math.min(r+7,e.length),o=r+2;o=48&&a<=57||a>=65&&a<=70||a>=97&&a<=102)i.push(a);else break}if(o",o,f]]}return s+1",o]]:[s,["",o,a]]},BEe=function(e,r){if(e.length<=r)return null;var n="integer",i=[],s=e.charCodeAt(r);for((s===43||s===45)&&(r+=1,s===45&&i.push(45));r=48&&o<=57)i.push(o),r+=1;else break}if(r+1=48&&c<=57)for(i.push(a,c),n="number",r+=2;r=48&&o<=57)i.push(o),r+=1;else break}}if(r+1=48&&c<=57;if(u||(c===43||c===45)&&l>=48&&l<=57)for(n="number",u?(i.push(69,c),r+=2):c===45?(i.push(69,45,l),r+=3):(i.push(69,l),r+=3);r=48&&o<=57)i.push(o),r+=1;else break}}}var f=String.fromCharCode.apply(null,i),d=n==="number"?parseFloat(f):parseInt(f);return d===-0&&(d=0),Number.isNaN(d)?null:[r-1,d,n]},jEe=function(e,r){if(e.length<=r)return null;for(var n=[],i=e.charCodeAt(r);r=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var s=op(e,r);if(s!==null){var o=Nr(s,2),a=o[0],c=o[1];n.push(c),r=a;continue}}break}return r===0?null:[r-1,String.fromCharCode.apply(null,n)]},lk=function(e,r){if(e.length<=r||!Cz(e,r))return null;for(var n=[],i=e.charCodeAt(r);r=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var s=op(e,r);if(s!==null){var o=Nr(s,2),a=o[0],c=o[1];n.push(c),r=a;continue}}break}return[r-1,String.fromCharCode.apply(null,n)]},UEe=function(e,r){for(var n=e.charCodeAt(r);n===9||n===32||n===10;)n=e.charCodeAt(++r);for(var i=[],s=!1;rs+1){var a=e.charCodeAt(s+1);if(a===40){for(var c=2;s+c"];if(l!==9&&l!==32&&l!==10){var u=UEe(e,s+c);if(u===null)return null;var f=Nr(u,2),d=f[0],h=f[1];return[d,h,""]}}return[s+1,o.toLowerCase(),""]}}}else if(e.length>s+1){var a=e.charCodeAt(s+1);if(a===40)return[s+1,o.toLowerCase(),""]}return[s,o.toLowerCase(),""]},zEe=function(e){for(var r=e.length-1;r>=0;r--)e[r]=WEe(e[r]);return e},WEe=function(e){if(e.mediaCondition===null)return e;var r=HEe(e.mediaCondition);return r.operator===null&&r.children.length===1&&"children"in r.children[0]&&(r=r.children[0]),{mediaPrefix:e.mediaPrefix,mediaType:e.mediaType,mediaCondition:r}},HEe=function t(e){for(var r=e.children.length-1;r>=0;r--){var n=e.children[r];if(!("context"in n)){var i=t(n);if(i.operator===null&&i.children.length===1)e.children[r]=i.children[0];else if(i.operator===e.operator&&(i.operator==="and"||i.operator==="or")){for(var s=[r,1],o=0;o"&&r[0].value==="media"){if(r[1].type!=="")throw qn("Expected whitespace after media");n=2;for(var s=2;s"){i=s;break}else if(o.type==="")throw qn("Expected '{' in media query but found ';'")}}return r=r.slice(n,i),KEe(r)},GEe=function(e){for(var r=[],n=!1,i=0;i"?(n=!0,r.length>0&&(r[r.length-1].wsAfter=!0)):(r.push(Hy(Hy({},e[i]),{wsBefore:n,wsAfter:!1})),n=!1);return r},KEe=function(e){for(var r,n,i=[[]],s=0;s"?i.push([]):i[i.length-1].push(o)}var a=i.map(GEe);if(a.length===1&&a[0].length===0)return[{mediaCondition:null,mediaPrefix:null,mediaType:"all"}];var c=a.map(function(h){return h.length===0?null:QEe(h)}),l=[];try{for(var u=MEe(c),f=u.next();!f.done;f=u.next()){var d=f.value;d!==null&&l.push(d)}}catch(h){r={error:h}}finally{try{f&&!f.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}if(l.length===0)throw qn("No valid media queries");return l},QEe=function(e){var r=e[0];if(r.type==="<(-token>")try{return{mediaPrefix:null,mediaType:"all",mediaCondition:uE(e,!0)}}catch(f){throw qn("Expected media condition after '('",f)}else if(r.type===""){var n=null,i=void 0,s=r.value;(s==="only"||s==="not")&&(n=s);var o=n===null?0:1;if(e.length<=o)throw qn("Expected extra token in media query");var a=e[o];if(a.type===""){var c=a.value;if(c==="all")i="all";else if(c==="print"||c==="screen")i=c;else if(c==="tty"||c==="tv"||c==="projection"||c==="handheld"||c==="braille"||c==="embossed"||c==="aural"||c==="speech")n=n==="not"?null:"not",i="all";else throw qn("Unknown ident '".concat(c,"' in media query"))}else if(n==="not"&&a.type==="<(-token>"){var l=[{type:"<(-token>",wsBefore:!1,wsAfter:!1}];l.push.apply(l,e),l.push({type:"<)-token>",wsBefore:!1,wsAfter:!1});try{return{mediaPrefix:null,mediaType:"all",mediaCondition:uE(l,!0)}}catch(f){throw qn("Expected media condition after '('",f)}}else throw qn("Invalid media query");if(o+1===e.length)return{mediaPrefix:n,mediaType:i,mediaCondition:null};if(o+4"&&u.value==="and")try{return{mediaPrefix:n,mediaType:i,mediaCondition:uE(e.slice(o+2),!1)}}catch(f){throw qn("Expected media condition after 'and'",f)}else throw qn("Expected 'and' after media prefix")}else throw qn("Expected media condition after media prefix")}else throw qn("Expected media condition or media prefix")},uE=function t(e,r,n){if(n===void 0&&(n=null),e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media condition");for(var i=e.length-1,s=0,o=0,a=0;a"?(o+=1,s=Math.max(s,o)):c.type==="<)-token>"&&(o-=1),o===0){i=a;break}}if(o!==0)throw new Error(`Mismatched parens +Invalid media condition`);var l,u=e.slice(0,i+1);if(s===1?l=YEe(u):u[1].type===""&&u[1].value==="not"?l=t(u.slice(2,-1),!0,"not"):l=t(u.slice(1,-1),!0),i===e.length-1)return{operator:n,children:[l]};var f=e[i+1];if(f.type!=="")throw new Error(`Invalid operator Invalid media condition`);if(n!==null&&n!==f.value)throw new Error("'".concat(f.value,"' and '").concat(n,`' must not be at same level Invalid media condition`));if(f.value==="or"&&!r)throw new Error(`Cannot use 'or' at top level of a media query Invalid media condition`);if(f.value!=="and"&&f.value!=="or")throw new Error("Invalid operator: '".concat(f.value,`' -Invalid media condition`));var d=t(e.slice(i+2),r,f.value);return{operator:f.value,children:[l].concat(d.children)}},hEe=function(e){if(e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media feature");for(var r=[e[0]],n=1;n"&&i.value>0&&s.type===""&&s.value===47&&o.type===""&&o.value>0){r.push({type:"",numerator:i.value,denominator:o.value,wsBefore:i.wsBefore,wsAfter:o.wsAfter}),n+=2;continue}}r.push(e[n])}var a=r[1];if(a.type===""&&r.length===3)return{context:"boolean",feature:a.value};if(r.length===5&&r[1].type===""&&r[2].type===""){var c=r[3];if(c.type===""||c.type===""||c.type===""||c.type===""){var l=r[1].value,u=null,f=l.slice(0,4);f==="min-"?(u="min",l=l.slice(4)):f==="max-"&&(u="max",l=l.slice(4)),c.wsBefore,c.wsAfter;var d=k5(c,["wsBefore","wsAfter"]);return{context:"value",prefix:u,feature:l,value:d}}}else if(r.length>=5)try{var h=pEe(r);return{context:"range",feature:h.featureName,range:h}}catch(p){throw Hn("Invalid media feature",p)}throw new Error("Invalid media feature")},pEe=function(e){var r,n,i,s;if(e.length<5||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid range");var o={leftToken:null,leftOp:null,featureName:"",rightOp:null,rightToken:null},a=e[1].type===""||e[1].type===""||e[1].type===""||e[1].type===""&&e[1].value==="infinite";if(e[2].type===""){if(e[2].value===60)e[3].type===""&&e[3].value===61&&!e[3].wsBefore?o[a?"leftOp":"rightOp"]="<=":o[a?"leftOp":"rightOp"]="<";else if(e[2].value===62)e[3].type===""&&e[3].value===61&&!e[3].wsBefore?o[a?"leftOp":"rightOp"]=">=":o[a?"leftOp":"rightOp"]=">";else if(e[2].value===61)o[a?"leftOp":"rightOp"]="=";else throw new Error("Invalid range");if(a)o.leftToken=e[1];else if(e[1].type==="")o.featureName=e[1].value;else throw new Error("Invalid range");var c=2+((n=(r=o[a?"leftOp":"rightOp"])===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0),l=e[c];if(a)if(l.type===""){if(o.featureName=l.value,e.length>=7){var u=e[c+1],f=e[c+2];if(u.type===""){var d=u.value;if(d===60)f.type===""&&f.value===61&&!f.wsBefore?o.rightOp="<=":o.rightOp="<";else if(d===62)f.type===""&&f.value===61&&!f.wsBefore?o.rightOp=">=":o.rightOp=">";else throw new Error("Invalid range");var h=e[c+1+((s=(i=o.rightOp)===null||i===void 0?void 0:i.length)!==null&&s!==void 0?s:0)];o.rightToken=h}else throw new Error("Invalid range")}else if(c+2!==e.length)throw new Error("Invalid range")}else throw new Error("Invalid range");else o.rightToken=l;var p=null,v=o.leftToken,b=o.leftOp,y=o.featureName,m=o.rightOp,g=o.rightToken,S=null;if(v!==null){if(v.type===""){var P=v.type,T=v.value;T==="infinite"&&(S={type:P,value:T})}else if(v.type===""||v.type===""||v.type===""){v.wsBefore,v.wsAfter;var w=k5(v,["wsBefore","wsAfter"]);S=w}}var I=null;if(g!==null){if(g.type===""){var P=g.type,T=g.value;T==="infinite"&&(I={type:P,value:T})}else if(g.type===""||g.type===""||g.type===""){g.wsBefore,g.wsAfter;var B=k5(g,["wsBefore","wsAfter"]);I=B}}if(S!==null&&I!==null)if((b==="<"||b==="<=")&&(m==="<"||m==="<="))p={leftToken:S,leftOp:b,featureName:y,rightOp:m,rightToken:I};else if((b===">"||b===">=")&&(m===">"||m===">="))p={leftToken:S,leftOp:b,featureName:y,rightOp:m,rightToken:I};else throw new Error("Invalid range");else S===null&&b===null&&m!==null&&I!==null?p={leftToken:S,leftOp:b,featureName:y,rightOp:m,rightToken:I}:S!==null&&b!==null&&m===null&&I===null&&(p={leftToken:S,leftOp:b,featureName:y,rightOp:m,rightToken:I});return p}else throw new Error("Invalid range")};function vEe(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mEe(t){var e=vEe(t,"string");return typeof e=="symbol"?e:String(e)}function yEe(t,e,r){return e=mEe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function O9(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Zh(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}function R9(t,e){if(t==null)return{};var r=gEe(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ih(t,e){for(var r in t)e(t[r],r)}function Eu(t,e){var r={};for(var n in t)e.indexOf(n)===-1&&(r[n]=t[n]);return r}function bEe(t,e){var r={};for(var n in t)r[e(t[n],n)]=t[n];return r}function A5(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n{var r=()=>{var i=new RegExp(".".concat(EEe(X8(e,{isIdentifier:!0}))),"g");return t.replace(i,"&")},n;try{n=Y2e(t)}catch{throw new Error("Invalid selector: ".concat(r()))}n.forEach(i=>{try{for(var s=i.length-1;s>=-1;s--){if(!i[s])throw new Error;var o=i[s];if(o.type==="child"||o.type==="parent"||o.type==="sibling"||o.type==="adjacent"||o.type==="descendant")throw new Error;if(o.type==="attribute"&&o.name==="class"&&o.value===e)return}}catch{throw new Error(zs(M9||(M9=Q8([` +Invalid media condition`));var d=t(e.slice(i+2),r,f.value);return{operator:f.value,children:[l].concat(d.children)}},YEe=function(e){if(e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media feature");for(var r=[e[0]],n=1;n"&&i.value>0&&s.type===""&&s.value===47&&o.type===""&&o.value>0){r.push({type:"",numerator:i.value,denominator:o.value,wsBefore:i.wsBefore,wsAfter:o.wsAfter}),n+=2;continue}}r.push(e[n])}var a=r[1];if(a.type===""&&r.length===3)return{context:"boolean",feature:a.value};if(r.length===5&&r[1].type===""&&r[2].type===""){var c=r[3];if(c.type===""||c.type===""||c.type===""||c.type===""){var l=r[1].value,u=null,f=l.slice(0,4);f==="min-"?(u="min",l=l.slice(4)):f==="max-"&&(u="max",l=l.slice(4)),c.wsBefore,c.wsAfter;var d=$5(c,["wsBefore","wsAfter"]);return{context:"value",prefix:u,feature:l,value:d}}}else if(r.length>=5)try{var h=JEe(r);return{context:"range",feature:h.featureName,range:h}}catch(p){throw qn("Invalid media feature",p)}throw new Error("Invalid media feature")},JEe=function(e){var r,n,i,s;if(e.length<5||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid range");var o={leftToken:null,leftOp:null,featureName:"",rightOp:null,rightToken:null},a=e[1].type===""||e[1].type===""||e[1].type===""||e[1].type===""&&e[1].value==="infinite";if(e[2].type===""){if(e[2].value===60)e[3].type===""&&e[3].value===61&&!e[3].wsBefore?o[a?"leftOp":"rightOp"]="<=":o[a?"leftOp":"rightOp"]="<";else if(e[2].value===62)e[3].type===""&&e[3].value===61&&!e[3].wsBefore?o[a?"leftOp":"rightOp"]=">=":o[a?"leftOp":"rightOp"]=">";else if(e[2].value===61)o[a?"leftOp":"rightOp"]="=";else throw new Error("Invalid range");if(a)o.leftToken=e[1];else if(e[1].type==="")o.featureName=e[1].value;else throw new Error("Invalid range");var c=2+((n=(r=o[a?"leftOp":"rightOp"])===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0),l=e[c];if(a)if(l.type===""){if(o.featureName=l.value,e.length>=7){var u=e[c+1],f=e[c+2];if(u.type===""){var d=u.value;if(d===60)f.type===""&&f.value===61&&!f.wsBefore?o.rightOp="<=":o.rightOp="<";else if(d===62)f.type===""&&f.value===61&&!f.wsBefore?o.rightOp=">=":o.rightOp=">";else throw new Error("Invalid range");var h=e[c+1+((s=(i=o.rightOp)===null||i===void 0?void 0:i.length)!==null&&s!==void 0?s:0)];o.rightToken=h}else throw new Error("Invalid range")}else if(c+2!==e.length)throw new Error("Invalid range")}else throw new Error("Invalid range");else o.rightToken=l;var p=null,v=o.leftToken,b=o.leftOp,y=o.featureName,m=o.rightOp,g=o.rightToken,S=null;if(v!==null){if(v.type===""){var P=v.type,T=v.value;T==="infinite"&&(S={type:P,value:T})}else if(v.type===""||v.type===""||v.type===""){v.wsBefore,v.wsAfter;var w=$5(v,["wsBefore","wsAfter"]);S=w}}var I=null;if(g!==null){if(g.type===""){var P=g.type,T=g.value;T==="infinite"&&(I={type:P,value:T})}else if(g.type===""||g.type===""||g.type===""){g.wsBefore,g.wsAfter;var F=$5(g,["wsBefore","wsAfter"]);I=F}}if(S!==null&&I!==null)if((b==="<"||b==="<=")&&(m==="<"||m==="<="))p={leftToken:S,leftOp:b,featureName:y,rightOp:m,rightToken:I};else if((b===">"||b===">=")&&(m===">"||m===">="))p={leftToken:S,leftOp:b,featureName:y,rightOp:m,rightToken:I};else throw new Error("Invalid range");else S===null&&b===null&&m!==null&&I!==null?p={leftToken:S,leftOp:b,featureName:y,rightOp:m,rightToken:I}:S!==null&&b!==null&&m===null&&I===null&&(p={leftToken:S,leftOp:b,featureName:y,rightOp:m,rightToken:I});return p}else throw new Error("Invalid range")};function XEe(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ZEe(t){var e=XEe(t,"string");return typeof e=="symbol"?e:String(e)}function exe(t,e,r){return e=ZEe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function z9(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function r0(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}function W9(t,e){if(t==null)return{};var r=txe(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ah(t,e){for(var r in t)e(t[r],r)}function xu(t,e){var r={};for(var n in t)e.indexOf(n)===-1&&(r[n]=t[n]);return r}function rxe(t,e){var r={};for(var n in t)r[e(t[n],n)]=t[n];return r}function M5(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n{var r=()=>{var i=new RegExp(".".concat(ixe(ck(e,{isIdentifier:!0}))),"g");return t.replace(i,"&")},n;try{n=$Ee(t)}catch{throw new Error("Invalid selector: ".concat(r()))}n.forEach(i=>{try{for(var s=i.length-1;s>=-1;s--){if(!i[s])throw new Error;var o=i[s];if(o.type==="child"||o.type==="parent"||o.type==="sibling"||o.type==="adjacent"||o.type==="descendant")throw new Error;if(o.type==="attribute"&&o.name==="class"&&o.value===e)return}}catch{throw new Error(Hs(H9||(H9=sk([` Invalid selector: `,` Style selectors must target the '&' character (along with any modifiers), e.g. `," or ",`. @@ -238,31 +238,31 @@ Invalid media condition`));var d=t(e.slice(i+2),r,f.value);return{operator:f.val If your selector is targeting another class, you should move it to the style definition for that class, e.g. given we have styles for 'parent' and 'child' elements, instead of adding a selector of `,") to 'parent', you should add ",` to 'child'). If your selector is targeting something global, use the 'globalStyle' function instead, e.g. if you wanted to write `,", you should instead write 'globalStyle(",`, { ... })' - `])),r(),"`${parent} &`","`${parent} &:hover`","`& ${child}`","`${parent} &`","`& h1`","`${parent} h1`"))}})};class Fy{constructor(){this.ruleset=new Map,this.precedenceLookup=new Map}findOrCreateCondition(e){var r=this.ruleset.get(e);return r||(r={query:e,rules:[],children:new Fy},this.ruleset.set(e,r)),r}getConditionalRulesetByPath(e){var r=this;for(var n of e){var i=r.findOrCreateCondition(n);r=i.children}return r}addRule(e,r,n){var i=this.getConditionalRulesetByPath(n),s=i.findOrCreateCondition(r);if(!s)throw new Error("Failed to add conditional rule");s.rules.push(e)}addConditionPrecedence(e,r){for(var n=this.getConditionalRulesetByPath(e),i=0;ia.has(u.query));l>-1?r.splice(l,0,c):r.push(c)};for(var[i,s]of this.precedenceLookup.entries())n(s);return r}renderToArray(){var e=[];for(var{query:r,rules:n,children:i}of this.getSortedRuleset()){var s={};for(var o of n)s[o.selector]=o.rule;Object.assign(s,...i.renderToArray()),e.push({[r]:s})}return e}}var KU={":-moz-any-link":!0,":-moz-full-screen":!0,":-moz-placeholder":!0,":-moz-read-only":!0,":-moz-read-write":!0,":-ms-fullscreen":!0,":-ms-input-placeholder":!0,":-webkit-any-link":!0,":-webkit-full-screen":!0,"::-moz-color-swatch":!0,"::-moz-list-bullet":!0,"::-moz-list-number":!0,"::-moz-page-sequence":!0,"::-moz-page":!0,"::-moz-placeholder":!0,"::-moz-progress-bar":!0,"::-moz-range-progress":!0,"::-moz-range-thumb":!0,"::-moz-range-track":!0,"::-moz-scrolled-page-sequence":!0,"::-moz-selection":!0,"::-ms-backdrop":!0,"::-ms-browse":!0,"::-ms-check":!0,"::-ms-clear":!0,"::-ms-fill-lower":!0,"::-ms-fill-upper":!0,"::-ms-fill":!0,"::-ms-reveal":!0,"::-ms-thumb":!0,"::-ms-ticks-after":!0,"::-ms-ticks-before":!0,"::-ms-tooltip":!0,"::-ms-track":!0,"::-ms-value":!0,"::-webkit-backdrop":!0,"::-webkit-inner-spin-button":!0,"::-webkit-input-placeholder":!0,"::-webkit-meter-bar":!0,"::-webkit-meter-even-less-good-value":!0,"::-webkit-meter-inner-element":!0,"::-webkit-meter-optimum-value":!0,"::-webkit-meter-suboptimum-value":!0,"::-webkit-outer-spin-button":!0,"::-webkit-progress-bar":!0,"::-webkit-progress-inner-element":!0,"::-webkit-progress-inner-value":!0,"::-webkit-progress-value":!0,"::-webkit-resizer":!0,"::-webkit-scrollbar-button":!0,"::-webkit-scrollbar-corner":!0,"::-webkit-scrollbar-thumb":!0,"::-webkit-scrollbar-track-piece":!0,"::-webkit-scrollbar-track":!0,"::-webkit-scrollbar":!0,"::-webkit-search-cancel-button":!0,"::-webkit-search-results-button":!0,"::-webkit-slider-runnable-track":!0,"::-webkit-slider-thumb":!0,"::after":!0,"::backdrop":!0,"::before":!0,"::cue":!0,"::file-selector-button":!0,"::first-letter":!0,"::first-line":!0,"::grammar-error":!0,"::marker":!0,"::placeholder":!0,"::selection":!0,"::spelling-error":!0,"::target-text":!0,"::view-transition-group":!0,"::view-transition-image-pair":!0,"::view-transition-new":!0,"::view-transition-old":!0,"::view-transition":!0,":active":!0,":after":!0,":any-link":!0,":before":!0,":blank":!0,":checked":!0,":default":!0,":defined":!0,":disabled":!0,":empty":!0,":enabled":!0,":first-child":!0,":first-letter":!0,":first-line":!0,":first-of-type":!0,":first":!0,":focus-visible":!0,":focus-within":!0,":focus":!0,":fullscreen":!0,":hover":!0,":in-range":!0,":indeterminate":!0,":invalid":!0,":last-child":!0,":last-of-type":!0,":left":!0,":link":!0,":only-child":!0,":only-of-type":!0,":optional":!0,":out-of-range":!0,":placeholder-shown":!0,":read-only":!0,":read-write":!0,":required":!0,":right":!0,":root":!0,":scope":!0,":target":!0,":valid":!0,":visited":!0},CEe=Object.keys(KU),SEe=KU,$9,N9=(t,e)=>new Error(zs($9||($9=Q8([` + `])),r(),"`${parent} &`","`${parent} &:hover`","`& ${child}`","`${parent} &`","`& h1`","`${parent} h1`"))}})};class qy{constructor(){this.ruleset=new Map,this.precedenceLookup=new Map}findOrCreateCondition(e){var r=this.ruleset.get(e);return r||(r={query:e,rules:[],children:new qy},this.ruleset.set(e,r)),r}getConditionalRulesetByPath(e){var r=this;for(var n of e){var i=r.findOrCreateCondition(n);r=i.children}return r}addRule(e,r,n){var i=this.getConditionalRulesetByPath(n),s=i.findOrCreateCondition(r);if(!s)throw new Error("Failed to add conditional rule");s.rules.push(e)}addConditionPrecedence(e,r){for(var n=this.getConditionalRulesetByPath(e),i=0;ia.has(u.query));l>-1?r.splice(l,0,c):r.push(c)};for(var[i,s]of this.precedenceLookup.entries())n(s);return r}renderToArray(){var e=[];for(var{query:r,rules:n,children:i}of this.getSortedRuleset()){var s={};for(var o of n)s[o.selector]=o.rule;Object.assign(s,...i.renderToArray()),e.push({[r]:s})}return e}}var Sz={":-moz-any-link":!0,":-moz-full-screen":!0,":-moz-placeholder":!0,":-moz-read-only":!0,":-moz-read-write":!0,":-ms-fullscreen":!0,":-ms-input-placeholder":!0,":-webkit-any-link":!0,":-webkit-full-screen":!0,"::-moz-color-swatch":!0,"::-moz-list-bullet":!0,"::-moz-list-number":!0,"::-moz-page-sequence":!0,"::-moz-page":!0,"::-moz-placeholder":!0,"::-moz-progress-bar":!0,"::-moz-range-progress":!0,"::-moz-range-thumb":!0,"::-moz-range-track":!0,"::-moz-scrolled-page-sequence":!0,"::-moz-selection":!0,"::-ms-backdrop":!0,"::-ms-browse":!0,"::-ms-check":!0,"::-ms-clear":!0,"::-ms-fill-lower":!0,"::-ms-fill-upper":!0,"::-ms-fill":!0,"::-ms-reveal":!0,"::-ms-thumb":!0,"::-ms-ticks-after":!0,"::-ms-ticks-before":!0,"::-ms-tooltip":!0,"::-ms-track":!0,"::-ms-value":!0,"::-webkit-backdrop":!0,"::-webkit-inner-spin-button":!0,"::-webkit-input-placeholder":!0,"::-webkit-meter-bar":!0,"::-webkit-meter-even-less-good-value":!0,"::-webkit-meter-inner-element":!0,"::-webkit-meter-optimum-value":!0,"::-webkit-meter-suboptimum-value":!0,"::-webkit-outer-spin-button":!0,"::-webkit-progress-bar":!0,"::-webkit-progress-inner-element":!0,"::-webkit-progress-inner-value":!0,"::-webkit-progress-value":!0,"::-webkit-resizer":!0,"::-webkit-scrollbar-button":!0,"::-webkit-scrollbar-corner":!0,"::-webkit-scrollbar-thumb":!0,"::-webkit-scrollbar-track-piece":!0,"::-webkit-scrollbar-track":!0,"::-webkit-scrollbar":!0,"::-webkit-search-cancel-button":!0,"::-webkit-search-results-button":!0,"::-webkit-slider-runnable-track":!0,"::-webkit-slider-thumb":!0,"::after":!0,"::backdrop":!0,"::before":!0,"::cue":!0,"::file-selector-button":!0,"::first-letter":!0,"::first-line":!0,"::grammar-error":!0,"::marker":!0,"::placeholder":!0,"::selection":!0,"::spelling-error":!0,"::target-text":!0,"::view-transition-group":!0,"::view-transition-image-pair":!0,"::view-transition-new":!0,"::view-transition-old":!0,"::view-transition":!0,":active":!0,":after":!0,":any-link":!0,":before":!0,":blank":!0,":checked":!0,":default":!0,":defined":!0,":disabled":!0,":empty":!0,":enabled":!0,":first-child":!0,":first-letter":!0,":first-line":!0,":first-of-type":!0,":first":!0,":focus-visible":!0,":focus-within":!0,":focus":!0,":fullscreen":!0,":hover":!0,":in-range":!0,":indeterminate":!0,":invalid":!0,":last-child":!0,":last-of-type":!0,":left":!0,":link":!0,":only-child":!0,":only-of-type":!0,":optional":!0,":out-of-range":!0,":placeholder-shown":!0,":read-only":!0,":read-write":!0,":required":!0,":right":!0,":root":!0,":scope":!0,":target":!0,":valid":!0,":visited":!0},oxe=Object.keys(Sz),axe=Sz,q9,V9=(t,e)=>new Error(Hs(q9||(q9=sk([` Invalid media query: "`,`" `,` Read more on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries - `])),t,e)),kEe=t=>{if(t==="@media ")throw N9(t,"Query is empty");try{cEe(t)}catch(e){throw N9(t,e.message)}},AEe=["vars"],_Ee=["content"],QU="__DECLARATION",PEe={animationIterationCount:!0,borderImage:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,initialLetter:!0,lineClamp:!0,lineHeight:!0,maxLines:!0,opacity:!0,order:!0,orphans:!0,scale:!0,tabSize:!0,WebkitLineClamp:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,maskBorder:!0,maskBorderOutset:!0,maskBorderSlice:!0,maskBorderWidth:!0,shapeImageThreshold:!0,stopOpacity:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function TEe(t){return t.replace(/([A-Z])/g,"-$1").replace(/^ms-/,"-ms-").toLowerCase()}function IEe(t,e,r,n){var i=t.slice(0,e),s=t.slice(r);return"".concat(i).concat(n).concat(s)}var OEe=" ",xu=[...CEe,"@layer","@media","@supports","@container","selectors"];class REe{constructor(e,r){this.rules=[],this.conditionalRulesets=[new Fy],this.fontFaceRules=[],this.keyframesRules=[],this.localClassNamesMap=new Map(e.map(n=>[n,n])),this.localClassNamesSearch=new W2e(e),this.layers=new Map,this.composedClassLists=r.map(n=>{var{identifier:i,classList:s}=n;return{identifier:i,regex:RegExp("(".concat(s,")"),"g")}}).reverse()}processCssObj(e){if(e.type==="fontFace"){this.fontFaceRules.push(e.rule);return}if(e.type==="keyframes"){e.rule=Object.fromEntries(Object.entries(e.rule).map(s=>{var[o,a]=s;return[o,this.transformProperties(a)]})),this.keyframesRules.push(e);return}if(this.currConditionalRuleset=new Fy,e.type==="layer"){var r="@layer ".concat(e.name);this.addLayer([r])}else{var n=Eu(e.rule,xu);this.addRule({selector:e.selector,rule:n}),this.transformLayer(e,e.rule["@layer"]),this.transformMedia(e,e.rule["@media"]),this.transformSupports(e,e.rule["@supports"]),this.transformContainer(e,e.rule["@container"]),this.transformSimplePseudos(e,e.rule),this.transformSelectors(e,e.rule)}var i=this.conditionalRulesets[this.conditionalRulesets.length-1];i.mergeIfCompatible(this.currConditionalRuleset)||this.conditionalRulesets.push(this.currConditionalRuleset)}addConditionalRule(e,r){var n=this.transformVars(this.transformProperties(e.rule)),i=this.transformSelector(e.selector);if(!this.currConditionalRuleset)throw new Error("Couldn't add conditional rule");var s=r[r.length-1],o=r.slice(0,r.length-1);this.currConditionalRuleset.addRule({selector:i,rule:n},s,o)}addRule(e){var r=this.transformVars(this.transformProperties(e.rule)),n=this.transformSelector(e.selector);this.rules.push({selector:n,rule:r})}addLayer(e){var r=e.join(" - ");this.layers.set(r,e)}transformProperties(e){return this.transformContent(this.pixelifyProperties(e))}pixelifyProperties(e){return ih(e,(r,n)=>{typeof r=="number"&&r!==0&&!PEe[n]&&(e[n]="".concat(r,"px"))}),e}transformVars(e){var{vars:r}=e,n=R9(e,AEe);return r?Zh(Zh({},bEe(r,(i,s)=>N2e(s))),n):n}transformContent(e){var{content:r}=e,n=R9(e,_Ee);if(typeof r>"u")return n;var i=Array.isArray(r)?r:[r];return Zh({content:i.map(s=>s&&(s.includes('"')||s.includes("'")||/^([A-Za-z\-]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)(\s|$)/.test(s))?s:'"'.concat(s,'"'))},n)}transformClassname(e){return".".concat(X8(e,{isIdentifier:!0}))}transformSelector(e){var r=e,n=function(h){r=r.replace(s,()=>(qU(h),h))};for(var{identifier:i,regex:s}of this.composedClassLists)n(i);if(this.localClassNamesMap.has(r))return this.transformClassname(r);for(var o=this.localClassNamesSearch.search(r),a=r.length,c=o.length-1;c>=0;c--){var[l,[u]]=o[c],f=l-u.length+1;f>=a||(a=f,r[f-1]!=="."&&(r=IEe(r,f,l+1,this.transformClassname(u))))}return r}transformSelectors(e,r,n){ih(r.selectors,(i,s)=>{if(e.type!=="local")throw new Error("Selectors are not allowed within ".concat(e.type==="global"?'"globalStyle"':'"selectors"'));var o=this.transformSelector(s.replace(RegExp("&","g"),e.selector));xEe(o,e.selector);var a={selector:o,rule:Eu(i,xu)};n?this.addConditionalRule(a,n):this.addRule(a);var c={type:"selector",selector:o,rule:i};this.transformLayer(c,i["@layer"],n),this.transformSupports(c,i["@supports"],n),this.transformMedia(c,i["@media"],n)})}transformMedia(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(l=>"@media ".concat(l)));for(var[s,o]of Object.entries(r)){var a="@media ".concat(s);kEe(a);var c=[...n,a];this.addConditionalRule({selector:e.selector,rule:Eu(o,xu)},c),e.type==="local"&&(this.transformSimplePseudos(e,o,c),this.transformSelectors(e,o,c)),this.transformLayer(e,o["@layer"],c),this.transformSupports(e,o["@supports"],c),this.transformContainer(e,o["@container"],c)}}}transformContainer(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@container ".concat(s))),ih(r,(s,o)=>{var a="@container ".concat(o),c=[...n,a];this.addConditionalRule({selector:e.selector,rule:Eu(s,xu)},c),e.type==="local"&&(this.transformSimplePseudos(e,s,c),this.transformSelectors(e,s,c)),this.transformLayer(e,s["@layer"],c),this.transformSupports(e,s["@supports"],c),this.transformMedia(e,s["@media"],c)})}}transformLayer(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@layer ".concat(s))),ih(r,(s,o)=>{var a=[...n,"@layer ".concat(o)];this.addLayer(a),this.addConditionalRule({selector:e.selector,rule:Eu(s,xu)},a),e.type==="local"&&(this.transformSimplePseudos(e,s,a),this.transformSelectors(e,s,a)),this.transformMedia(e,s["@media"],a),this.transformSupports(e,s["@supports"],a),this.transformContainer(e,s["@container"],a)})}}transformSupports(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@supports ".concat(s))),ih(r,(s,o)=>{var a=[...n,"@supports ".concat(o)];this.addConditionalRule({selector:e.selector,rule:Eu(s,xu)},a),e.type==="local"&&(this.transformSimplePseudos(e,s,a),this.transformSelectors(e,s,a)),this.transformLayer(e,s["@layer"],a),this.transformMedia(e,s["@media"],a),this.transformContainer(e,s["@container"],a)})}}transformSimplePseudos(e,r,n){for(var i of Object.keys(r))if(SEe[i]){if(e.type!=="local")throw new Error("Simple pseudos are not valid in ".concat(e.type==="global"?'"globalStyle"':'"selectors"'));n?this.addConditionalRule({selector:"".concat(e.selector).concat(i),rule:r[i]},n):this.addRule({conditions:n,selector:"".concat(e.selector).concat(i),rule:r[i]})}}toCss(){var e=[];for(var r of this.fontFaceRules)e.push(cl({"@font-face":r}));for(var n of this.keyframesRules)e.push(cl({["@keyframes ".concat(n.name)]:n.rule}));for(var i of this.layers.values()){var[s,...o]=i.reverse(),a={[s]:QU};for(var c of o)a={[c]:a};e.push(cl(a))}for(var l of this.rules)e.push(cl({[l.selector]:l.rule}));for(var u of this.conditionalRulesets)for(var f of u.renderToArray())e.push(cl(f));return e.filter(Boolean)}}function cl(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=[],n=function(o){var a=t[o];if(a&&Array.isArray(a))r.push(...a.map(l=>cl({[o]:l},e)));else if(a&&typeof a=="object"){var c=Object.keys(a).length===0;c||r.push("".concat(e).concat(o,` { -`).concat(cl(a,e+OEe),` -`).concat(e,"}"))}else a===QU?r.push("".concat(e).concat(o,";")):r.push("".concat(e).concat(o.startsWith("--")?o:TEe(o),": ").concat(a,";"))};for(var i of Object.keys(t))n(i);return r.join(` -`)}function MEe(t){var{localClassNames:e,cssObjs:r,composedClassLists:n}=t,i=new REe(e,n);for(var s of r)i.processCssObj(s);return i.toCss()}function YU(t){for(var e=0,r,n=0,i=t.length;i>=4;++n,i-=4)r=t.charCodeAt(n)&255|(t.charCodeAt(++n)&255)<<8|(t.charCodeAt(++n)&255)<<16|(t.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,e=(r&65535)*1540483477+((r>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(n+2)&255)<<16;case 2:e^=(t.charCodeAt(n+1)&255)<<8;case 1:e^=t.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var ek={exports:{}},iE,D9;function $Ee(){return D9||(D9=1,iE={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),iE}var sE,L9;function JU(){if(L9)return sE;L9=1;const t=$Ee(),e={};for(const i of Object.keys(t))e[t[i]]=i;const r={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};sE=r;for(const i of Object.keys(r)){if(!("channels"in r[i]))throw new Error("missing channels property: "+i);if(!("labels"in r[i]))throw new Error("missing channel labels property: "+i);if(r[i].labels.length!==r[i].channels)throw new Error("channel and label counts mismatch: "+i);const{channels:s,labels:o}=r[i];delete r[i].channels,delete r[i].labels,Object.defineProperty(r[i],"channels",{value:s}),Object.defineProperty(r[i],"labels",{value:o})}r.rgb.hsl=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.min(s,o,a),l=Math.max(s,o,a),u=l-c;let f,d;l===c?f=0:s===l?f=(o-a)/u:o===l?f=2+(a-s)/u:a===l&&(f=4+(s-o)/u),f=Math.min(f*60,360),f<0&&(f+=360);const h=(c+l)/2;return l===c?d=0:h<=.5?d=u/(l+c):d=u/(2-l-c),[f,d*100,h*100]},r.rgb.hsv=function(i){let s,o,a,c,l;const u=i[0]/255,f=i[1]/255,d=i[2]/255,h=Math.max(u,f,d),p=h-Math.min(u,f,d),v=function(b){return(h-b)/6/p+1/2};return p===0?(c=0,l=0):(l=p/h,s=v(u),o=v(f),a=v(d),u===h?c=a-o:f===h?c=1/3+s-a:d===h&&(c=2/3+o-s),c<0?c+=1:c>1&&(c-=1)),[c*360,l*100,h*100]},r.rgb.hwb=function(i){const s=i[0],o=i[1];let a=i[2];const c=r.rgb.hsl(i)[0],l=1/255*Math.min(s,Math.min(o,a));return a=1-1/255*Math.max(s,Math.max(o,a)),[c,l*100,a*100]},r.rgb.cmyk=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.min(1-s,1-o,1-a),l=(1-s-c)/(1-c)||0,u=(1-o-c)/(1-c)||0,f=(1-a-c)/(1-c)||0;return[l*100,u*100,f*100,c*100]};function n(i,s){return(i[0]-s[0])**2+(i[1]-s[1])**2+(i[2]-s[2])**2}return r.rgb.keyword=function(i){const s=e[i];if(s)return s;let o=1/0,a;for(const c of Object.keys(t)){const l=t[c],u=n(i,l);u.04045?((s+.055)/1.055)**2.4:s/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92;const c=s*.4124+o*.3576+a*.1805,l=s*.2126+o*.7152+a*.0722,u=s*.0193+o*.1192+a*.9505;return[c*100,l*100,u*100]},r.rgb.lab=function(i){const s=r.rgb.xyz(i);let o=s[0],a=s[1],c=s[2];o/=95.047,a/=100,c/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;const l=116*a-16,u=500*(o-a),f=200*(a-c);return[l,u,f]},r.hsl.rgb=function(i){const s=i[0]/360,o=i[1]/100,a=i[2]/100;let c,l,u;if(o===0)return u=a*255,[u,u,u];a<.5?c=a*(1+o):c=a+o-a*o;const f=2*a-c,d=[0,0,0];for(let h=0;h<3;h++)l=s+1/3*-(h-1),l<0&&l++,l>1&&l--,6*l<1?u=f+(c-f)*6*l:2*l<1?u=c:3*l<2?u=f+(c-f)*(2/3-l)*6:u=f,d[h]=u*255;return d},r.hsl.hsv=function(i){const s=i[0];let o=i[1]/100,a=i[2]/100,c=o;const l=Math.max(a,.01);a*=2,o*=a<=1?a:2-a,c*=l<=1?l:2-l;const u=(a+o)/2,f=a===0?2*c/(l+c):2*o/(a+o);return[s,f*100,u*100]},r.hsv.rgb=function(i){const s=i[0]/60,o=i[1]/100;let a=i[2]/100;const c=Math.floor(s)%6,l=s-Math.floor(s),u=255*a*(1-o),f=255*a*(1-o*l),d=255*a*(1-o*(1-l));switch(a*=255,c){case 0:return[a,d,u];case 1:return[f,a,u];case 2:return[u,a,d];case 3:return[u,f,a];case 4:return[d,u,a];case 5:return[a,u,f]}},r.hsv.hsl=function(i){const s=i[0],o=i[1]/100,a=i[2]/100,c=Math.max(a,.01);let l,u;u=(2-o)*a;const f=(2-o)*c;return l=o*c,l/=f<=1?f:2-f,l=l||0,u/=2,[s,l*100,u*100]},r.hwb.rgb=function(i){const s=i[0]/360;let o=i[1]/100,a=i[2]/100;const c=o+a;let l;c>1&&(o/=c,a/=c);const u=Math.floor(6*s),f=1-a;l=6*s-u,u&1&&(l=1-l);const d=o+l*(f-o);let h,p,v;switch(u){default:case 6:case 0:h=f,p=d,v=o;break;case 1:h=d,p=f,v=o;break;case 2:h=o,p=f,v=d;break;case 3:h=o,p=d,v=f;break;case 4:h=d,p=o,v=f;break;case 5:h=f,p=o,v=d;break}return[h*255,p*255,v*255]},r.cmyk.rgb=function(i){const s=i[0]/100,o=i[1]/100,a=i[2]/100,c=i[3]/100,l=1-Math.min(1,s*(1-c)+c),u=1-Math.min(1,o*(1-c)+c),f=1-Math.min(1,a*(1-c)+c);return[l*255,u*255,f*255]},r.xyz.rgb=function(i){const s=i[0]/100,o=i[1]/100,a=i[2]/100;let c,l,u;return c=s*3.2406+o*-1.5372+a*-.4986,l=s*-.9689+o*1.8758+a*.0415,u=s*.0557+o*-.204+a*1.057,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,c=Math.min(Math.max(0,c),1),l=Math.min(Math.max(0,l),1),u=Math.min(Math.max(0,u),1),[c*255,l*255,u*255]},r.xyz.lab=function(i){let s=i[0],o=i[1],a=i[2];s/=95.047,o/=100,a/=108.883,s=s>.008856?s**(1/3):7.787*s+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;const c=116*o-16,l=500*(s-o),u=200*(o-a);return[c,l,u]},r.lab.xyz=function(i){const s=i[0],o=i[1],a=i[2];let c,l,u;l=(s+16)/116,c=o/500+l,u=l-a/200;const f=l**3,d=c**3,h=u**3;return l=f>.008856?f:(l-16/116)/7.787,c=d>.008856?d:(c-16/116)/7.787,u=h>.008856?h:(u-16/116)/7.787,c*=95.047,l*=100,u*=108.883,[c,l,u]},r.lab.lch=function(i){const s=i[0],o=i[1],a=i[2];let c;c=Math.atan2(a,o)*360/2/Math.PI,c<0&&(c+=360);const u=Math.sqrt(o*o+a*a);return[s,u,c]},r.lch.lab=function(i){const s=i[0],o=i[1],c=i[2]/360*2*Math.PI,l=o*Math.cos(c),u=o*Math.sin(c);return[s,l,u]},r.rgb.ansi16=function(i,s=null){const[o,a,c]=i;let l=s===null?r.rgb.hsv(i)[2]:s;if(l=Math.round(l/50),l===0)return 30;let u=30+(Math.round(c/255)<<2|Math.round(a/255)<<1|Math.round(o/255));return l===2&&(u+=60),u},r.hsv.ansi16=function(i){return r.rgb.ansi16(r.hsv.rgb(i),i[2])},r.rgb.ansi256=function(i){const s=i[0],o=i[1],a=i[2];return s===o&&o===a?s<8?16:s>248?231:Math.round((s-8)/247*24)+232:16+36*Math.round(s/255*5)+6*Math.round(o/255*5)+Math.round(a/255*5)},r.ansi16.rgb=function(i){let s=i%10;if(s===0||s===7)return i>50&&(s+=3.5),s=s/10.5*255,[s,s,s];const o=(~~(i>50)+1)*.5,a=(s&1)*o*255,c=(s>>1&1)*o*255,l=(s>>2&1)*o*255;return[a,c,l]},r.ansi256.rgb=function(i){if(i>=232){const l=(i-232)*10+8;return[l,l,l]}i-=16;let s;const o=Math.floor(i/36)/5*255,a=Math.floor((s=i%36)/6)/5*255,c=s%6/5*255;return[o,a,c]},r.rgb.hex=function(i){const o=(((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255)).toString(16).toUpperCase();return"000000".substring(o.length)+o},r.hex.rgb=function(i){const s=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!s)return[0,0,0];let o=s[0];s[0].length===3&&(o=o.split("").map(f=>f+f).join(""));const a=parseInt(o,16),c=a>>16&255,l=a>>8&255,u=a&255;return[c,l,u]},r.rgb.hcg=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.max(Math.max(s,o),a),l=Math.min(Math.min(s,o),a),u=c-l;let f,d;return u<1?f=l/(1-u):f=0,u<=0?d=0:c===s?d=(o-a)/u%6:c===o?d=2+(a-s)/u:d=4+(s-o)/u,d/=6,d%=1,[d*360,u*100,f*100]},r.hsl.hcg=function(i){const s=i[1]/100,o=i[2]/100,a=o<.5?2*s*o:2*s*(1-o);let c=0;return a<1&&(c=(o-.5*a)/(1-a)),[i[0],a*100,c*100]},r.hsv.hcg=function(i){const s=i[1]/100,o=i[2]/100,a=s*o;let c=0;return a<1&&(c=(o-a)/(1-a)),[i[0],a*100,c*100]},r.hcg.rgb=function(i){const s=i[0]/360,o=i[1]/100,a=i[2]/100;if(o===0)return[a*255,a*255,a*255];const c=[0,0,0],l=s%1*6,u=l%1,f=1-u;let d=0;switch(Math.floor(l)){case 0:c[0]=1,c[1]=u,c[2]=0;break;case 1:c[0]=f,c[1]=1,c[2]=0;break;case 2:c[0]=0,c[1]=1,c[2]=u;break;case 3:c[0]=0,c[1]=f,c[2]=1;break;case 4:c[0]=u,c[1]=0,c[2]=1;break;default:c[0]=1,c[1]=0,c[2]=f}return d=(1-o)*a,[(o*c[0]+d)*255,(o*c[1]+d)*255,(o*c[2]+d)*255]},r.hcg.hsv=function(i){const s=i[1]/100,o=i[2]/100,a=s+o*(1-s);let c=0;return a>0&&(c=s/a),[i[0],c*100,a*100]},r.hcg.hsl=function(i){const s=i[1]/100,a=i[2]/100*(1-s)+.5*s;let c=0;return a>0&&a<.5?c=s/(2*a):a>=.5&&a<1&&(c=s/(2*(1-a))),[i[0],c*100,a*100]},r.hcg.hwb=function(i){const s=i[1]/100,o=i[2]/100,a=s+o*(1-s);return[i[0],(a-s)*100,(1-a)*100]},r.hwb.hcg=function(i){const s=i[1]/100,a=1-i[2]/100,c=a-s;let l=0;return c<1&&(l=(a-c)/(1-c)),[i[0],c*100,l*100]},r.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]},r.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]},r.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]},r.gray.hsl=function(i){return[0,0,i[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(i){return[0,100,i[0]]},r.gray.cmyk=function(i){return[0,0,0,i[0]]},r.gray.lab=function(i){return[i[0],0,0]},r.gray.hex=function(i){const s=Math.round(i[0]/100*255)&255,a=((s<<16)+(s<<8)+s).toString(16).toUpperCase();return"000000".substring(a.length)+a},r.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]},sE}var oE,B9;function NEe(){if(B9)return oE;B9=1;const t=JU();function e(){const s={},o=Object.keys(t);for(let a=o.length,c=0;c1&&(c=l),o(c))};return"conversion"in o&&(a.conversion=o.conversion),a}function s(o){const a=function(...c){const l=c[0];if(l==null)return l;l.length>1&&(c=l);const u=o(c);if(typeof u=="object")for(let f=u.length,d=0;d{r[o]={},Object.defineProperty(r[o],"channels",{value:t[o].channels}),Object.defineProperty(r[o],"labels",{value:t[o].labels});const a=e(o);Object.keys(a).forEach(l=>{const u=a[l];r[o][l]=s(u),r[o][l].raw=i(u)})}),aE=r,aE}ek.exports;(function(t){const e=(u,f)=>(...d)=>`\x1B[${u(...d)+f}m`,r=(u,f)=>(...d)=>{const h=u(...d);return`\x1B[${38+f};5;${h}m`},n=(u,f)=>(...d)=>{const h=u(...d);return`\x1B[${38+f};2;${h[0]};${h[1]};${h[2]}m`},i=u=>u,s=(u,f,d)=>[u,f,d],o=(u,f,d)=>{Object.defineProperty(u,f,{get:()=>{const h=d();return Object.defineProperty(u,f,{value:h,enumerable:!0,configurable:!0}),h},enumerable:!0,configurable:!0})};let a;const c=(u,f,d,h)=>{a===void 0&&(a=DEe());const p=h?10:0,v={};for(const[b,y]of Object.entries(a)){const m=b==="ansi16"?"ansi":b;b===f?v[m]=u(d,p):typeof y=="object"&&(v[m]=u(y[f],p))}return v};function l(){const u=new Map,f={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};f.color.gray=f.color.blackBright,f.bgColor.bgGray=f.bgColor.bgBlackBright,f.color.grey=f.color.blackBright,f.bgColor.bgGrey=f.bgColor.bgBlackBright;for(const[d,h]of Object.entries(f)){for(const[p,v]of Object.entries(h))f[p]={open:`\x1B[${v[0]}m`,close:`\x1B[${v[1]}m`},h[p]=f[p],u.set(v[0],v[1]);Object.defineProperty(f,d,{value:h,enumerable:!1})}return Object.defineProperty(f,"codes",{value:u,enumerable:!1}),f.color.close="\x1B[39m",f.bgColor.close="\x1B[49m",o(f.color,"ansi",()=>c(e,"ansi16",i,!1)),o(f.color,"ansi256",()=>c(r,"ansi256",i,!1)),o(f.color,"ansi16m",()=>c(n,"rgb",s,!1)),o(f.bgColor,"ansi",()=>c(e,"ansi16",i,!0)),o(f.bgColor,"ansi256",()=>c(r,"ansi256",i,!0)),o(f.bgColor,"ansi16m",()=>c(n,"rgb",s,!0)),f}Object.defineProperty(t,"exports",{enumerable:!0,get:l})})(ek);var LEe=ek.exports,BEe={stdout:!1,stderr:!1};const FEe=(t,e,r)=>{let n=t.indexOf(e);if(n===-1)return t;const i=e.length;let s=0,o="";do o+=t.substr(s,n-s)+e+r,s=n+i,n=t.indexOf(e,s);while(n!==-1);return o+=t.substr(s),o},jEe=(t,e,r,n)=>{let i=0,s="";do{const o=t[n-1]==="\r";s+=t.substr(i,(o?n-1:n)-i)+e+(o?`\r + `])),t,e)),cxe=t=>{if(t==="@media ")throw V9(t,"Query is empty");try{qEe(t)}catch(e){throw V9(t,e.message)}},lxe=["vars"],uxe=["content"],kz="__DECLARATION",fxe={animationIterationCount:!0,borderImage:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,initialLetter:!0,lineClamp:!0,lineHeight:!0,maxLines:!0,opacity:!0,order:!0,orphans:!0,scale:!0,tabSize:!0,WebkitLineClamp:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,maskBorder:!0,maskBorderOutset:!0,maskBorderSlice:!0,maskBorderWidth:!0,shapeImageThreshold:!0,stopOpacity:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function dxe(t){return t.replace(/([A-Z])/g,"-$1").replace(/^ms-/,"-ms-").toLowerCase()}function hxe(t,e,r,n){var i=t.slice(0,e),s=t.slice(r);return"".concat(i).concat(n).concat(s)}var pxe=" ",Cu=[...oxe,"@layer","@media","@supports","@container","selectors"];class vxe{constructor(e,r){this.rules=[],this.conditionalRulesets=[new qy],this.fontFaceRules=[],this.keyframesRules=[],this.localClassNamesMap=new Map(e.map(n=>[n,n])),this.localClassNamesSearch=new AEe(e),this.layers=new Map,this.composedClassLists=r.map(n=>{var{identifier:i,classList:s}=n;return{identifier:i,regex:RegExp("(".concat(s,")"),"g")}}).reverse()}processCssObj(e){if(e.type==="fontFace"){this.fontFaceRules.push(e.rule);return}if(e.type==="keyframes"){e.rule=Object.fromEntries(Object.entries(e.rule).map(s=>{var[o,a]=s;return[o,this.transformProperties(a)]})),this.keyframesRules.push(e);return}if(this.currConditionalRuleset=new qy,e.type==="layer"){var r="@layer ".concat(e.name);this.addLayer([r])}else{var n=xu(e.rule,Cu);this.addRule({selector:e.selector,rule:n}),this.transformLayer(e,e.rule["@layer"]),this.transformMedia(e,e.rule["@media"]),this.transformSupports(e,e.rule["@supports"]),this.transformContainer(e,e.rule["@container"]),this.transformSimplePseudos(e,e.rule),this.transformSelectors(e,e.rule)}var i=this.conditionalRulesets[this.conditionalRulesets.length-1];i.mergeIfCompatible(this.currConditionalRuleset)||this.conditionalRulesets.push(this.currConditionalRuleset)}addConditionalRule(e,r){var n=this.transformVars(this.transformProperties(e.rule)),i=this.transformSelector(e.selector);if(!this.currConditionalRuleset)throw new Error("Couldn't add conditional rule");var s=r[r.length-1],o=r.slice(0,r.length-1);this.currConditionalRuleset.addRule({selector:i,rule:n},s,o)}addRule(e){var r=this.transformVars(this.transformProperties(e.rule)),n=this.transformSelector(e.selector);this.rules.push({selector:n,rule:r})}addLayer(e){var r=e.join(" - ");this.layers.set(r,e)}transformProperties(e){return this.transformContent(this.pixelifyProperties(e))}pixelifyProperties(e){return ah(e,(r,n)=>{typeof r=="number"&&r!==0&&!fxe[n]&&(e[n]="".concat(r,"px"))}),e}transformVars(e){var{vars:r}=e,n=W9(e,lxe);return r?r0(r0({},rxe(r,(i,s)=>gEe(s))),n):n}transformContent(e){var{content:r}=e,n=W9(e,uxe);if(typeof r>"u")return n;var i=Array.isArray(r)?r:[r];return r0({content:i.map(s=>s&&(s.includes('"')||s.includes("'")||/^([A-Za-z\-]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)(\s|$)/.test(s))?s:'"'.concat(s,'"'))},n)}transformClassname(e){return".".concat(ck(e,{isIdentifier:!0}))}transformSelector(e){var r=e,n=function(h){r=r.replace(s,()=>(Ez(h),h))};for(var{identifier:i,regex:s}of this.composedClassLists)n(i);if(this.localClassNamesMap.has(r))return this.transformClassname(r);for(var o=this.localClassNamesSearch.search(r),a=r.length,c=o.length-1;c>=0;c--){var[l,[u]]=o[c],f=l-u.length+1;f>=a||(a=f,r[f-1]!=="."&&(r=hxe(r,f,l+1,this.transformClassname(u))))}return r}transformSelectors(e,r,n){ah(r.selectors,(i,s)=>{if(e.type!=="local")throw new Error("Selectors are not allowed within ".concat(e.type==="global"?'"globalStyle"':'"selectors"'));var o=this.transformSelector(s.replace(RegExp("&","g"),e.selector));sxe(o,e.selector);var a={selector:o,rule:xu(i,Cu)};n?this.addConditionalRule(a,n):this.addRule(a);var c={type:"selector",selector:o,rule:i};this.transformLayer(c,i["@layer"],n),this.transformSupports(c,i["@supports"],n),this.transformMedia(c,i["@media"],n)})}transformMedia(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(l=>"@media ".concat(l)));for(var[s,o]of Object.entries(r)){var a="@media ".concat(s);cxe(a);var c=[...n,a];this.addConditionalRule({selector:e.selector,rule:xu(o,Cu)},c),e.type==="local"&&(this.transformSimplePseudos(e,o,c),this.transformSelectors(e,o,c)),this.transformLayer(e,o["@layer"],c),this.transformSupports(e,o["@supports"],c),this.transformContainer(e,o["@container"],c)}}}transformContainer(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@container ".concat(s))),ah(r,(s,o)=>{var a="@container ".concat(o),c=[...n,a];this.addConditionalRule({selector:e.selector,rule:xu(s,Cu)},c),e.type==="local"&&(this.transformSimplePseudos(e,s,c),this.transformSelectors(e,s,c)),this.transformLayer(e,s["@layer"],c),this.transformSupports(e,s["@supports"],c),this.transformMedia(e,s["@media"],c)})}}transformLayer(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@layer ".concat(s))),ah(r,(s,o)=>{var a=[...n,"@layer ".concat(o)];this.addLayer(a),this.addConditionalRule({selector:e.selector,rule:xu(s,Cu)},a),e.type==="local"&&(this.transformSimplePseudos(e,s,a),this.transformSelectors(e,s,a)),this.transformMedia(e,s["@media"],a),this.transformSupports(e,s["@supports"],a),this.transformContainer(e,s["@container"],a)})}}transformSupports(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@supports ".concat(s))),ah(r,(s,o)=>{var a=[...n,"@supports ".concat(o)];this.addConditionalRule({selector:e.selector,rule:xu(s,Cu)},a),e.type==="local"&&(this.transformSimplePseudos(e,s,a),this.transformSelectors(e,s,a)),this.transformLayer(e,s["@layer"],a),this.transformMedia(e,s["@media"],a),this.transformContainer(e,s["@container"],a)})}}transformSimplePseudos(e,r,n){for(var i of Object.keys(r))if(axe[i]){if(e.type!=="local")throw new Error("Simple pseudos are not valid in ".concat(e.type==="global"?'"globalStyle"':'"selectors"'));n?this.addConditionalRule({selector:"".concat(e.selector).concat(i),rule:r[i]},n):this.addRule({conditions:n,selector:"".concat(e.selector).concat(i),rule:r[i]})}}toCss(){var e=[];for(var r of this.fontFaceRules)e.push(cl({"@font-face":r}));for(var n of this.keyframesRules)e.push(cl({["@keyframes ".concat(n.name)]:n.rule}));for(var i of this.layers.values()){var[s,...o]=i.reverse(),a={[s]:kz};for(var c of o)a={[c]:a};e.push(cl(a))}for(var l of this.rules)e.push(cl({[l.selector]:l.rule}));for(var u of this.conditionalRulesets)for(var f of u.renderToArray())e.push(cl(f));return e.filter(Boolean)}}function cl(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=[],n=function(o){var a=t[o];if(a&&Array.isArray(a))r.push(...a.map(l=>cl({[o]:l},e)));else if(a&&typeof a=="object"){var c=Object.keys(a).length===0;c||r.push("".concat(e).concat(o,` { +`).concat(cl(a,e+pxe),` +`).concat(e,"}"))}else a===kz?r.push("".concat(e).concat(o,";")):r.push("".concat(e).concat(o.startsWith("--")?o:dxe(o),": ").concat(a,";"))};for(var i of Object.keys(t))n(i);return r.join(` +`)}function mxe(t){var{localClassNames:e,cssObjs:r,composedClassLists:n}=t,i=new vxe(e,n);for(var s of r)i.processCssObj(s);return i.toCss()}function Az(t){for(var e=0,r,n=0,i=t.length;i>=4;++n,i-=4)r=t.charCodeAt(n)&255|(t.charCodeAt(++n)&255)<<8|(t.charCodeAt(++n)&255)<<16|(t.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,e=(r&65535)*1540483477+((r>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(n+2)&255)<<16;case 2:e^=(t.charCodeAt(n+1)&255)<<8;case 1:e^=t.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var uk={exports:{}},fE,G9;function yxe(){return G9||(G9=1,fE={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),fE}var dE,K9;function _z(){if(K9)return dE;K9=1;const t=yxe(),e={};for(const i of Object.keys(t))e[t[i]]=i;const r={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};dE=r;for(const i of Object.keys(r)){if(!("channels"in r[i]))throw new Error("missing channels property: "+i);if(!("labels"in r[i]))throw new Error("missing channel labels property: "+i);if(r[i].labels.length!==r[i].channels)throw new Error("channel and label counts mismatch: "+i);const{channels:s,labels:o}=r[i];delete r[i].channels,delete r[i].labels,Object.defineProperty(r[i],"channels",{value:s}),Object.defineProperty(r[i],"labels",{value:o})}r.rgb.hsl=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.min(s,o,a),l=Math.max(s,o,a),u=l-c;let f,d;l===c?f=0:s===l?f=(o-a)/u:o===l?f=2+(a-s)/u:a===l&&(f=4+(s-o)/u),f=Math.min(f*60,360),f<0&&(f+=360);const h=(c+l)/2;return l===c?d=0:h<=.5?d=u/(l+c):d=u/(2-l-c),[f,d*100,h*100]},r.rgb.hsv=function(i){let s,o,a,c,l;const u=i[0]/255,f=i[1]/255,d=i[2]/255,h=Math.max(u,f,d),p=h-Math.min(u,f,d),v=function(b){return(h-b)/6/p+1/2};return p===0?(c=0,l=0):(l=p/h,s=v(u),o=v(f),a=v(d),u===h?c=a-o:f===h?c=1/3+s-a:d===h&&(c=2/3+o-s),c<0?c+=1:c>1&&(c-=1)),[c*360,l*100,h*100]},r.rgb.hwb=function(i){const s=i[0],o=i[1];let a=i[2];const c=r.rgb.hsl(i)[0],l=1/255*Math.min(s,Math.min(o,a));return a=1-1/255*Math.max(s,Math.max(o,a)),[c,l*100,a*100]},r.rgb.cmyk=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.min(1-s,1-o,1-a),l=(1-s-c)/(1-c)||0,u=(1-o-c)/(1-c)||0,f=(1-a-c)/(1-c)||0;return[l*100,u*100,f*100,c*100]};function n(i,s){return(i[0]-s[0])**2+(i[1]-s[1])**2+(i[2]-s[2])**2}return r.rgb.keyword=function(i){const s=e[i];if(s)return s;let o=1/0,a;for(const c of Object.keys(t)){const l=t[c],u=n(i,l);u.04045?((s+.055)/1.055)**2.4:s/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92;const c=s*.4124+o*.3576+a*.1805,l=s*.2126+o*.7152+a*.0722,u=s*.0193+o*.1192+a*.9505;return[c*100,l*100,u*100]},r.rgb.lab=function(i){const s=r.rgb.xyz(i);let o=s[0],a=s[1],c=s[2];o/=95.047,a/=100,c/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;const l=116*a-16,u=500*(o-a),f=200*(a-c);return[l,u,f]},r.hsl.rgb=function(i){const s=i[0]/360,o=i[1]/100,a=i[2]/100;let c,l,u;if(o===0)return u=a*255,[u,u,u];a<.5?c=a*(1+o):c=a+o-a*o;const f=2*a-c,d=[0,0,0];for(let h=0;h<3;h++)l=s+1/3*-(h-1),l<0&&l++,l>1&&l--,6*l<1?u=f+(c-f)*6*l:2*l<1?u=c:3*l<2?u=f+(c-f)*(2/3-l)*6:u=f,d[h]=u*255;return d},r.hsl.hsv=function(i){const s=i[0];let o=i[1]/100,a=i[2]/100,c=o;const l=Math.max(a,.01);a*=2,o*=a<=1?a:2-a,c*=l<=1?l:2-l;const u=(a+o)/2,f=a===0?2*c/(l+c):2*o/(a+o);return[s,f*100,u*100]},r.hsv.rgb=function(i){const s=i[0]/60,o=i[1]/100;let a=i[2]/100;const c=Math.floor(s)%6,l=s-Math.floor(s),u=255*a*(1-o),f=255*a*(1-o*l),d=255*a*(1-o*(1-l));switch(a*=255,c){case 0:return[a,d,u];case 1:return[f,a,u];case 2:return[u,a,d];case 3:return[u,f,a];case 4:return[d,u,a];case 5:return[a,u,f]}},r.hsv.hsl=function(i){const s=i[0],o=i[1]/100,a=i[2]/100,c=Math.max(a,.01);let l,u;u=(2-o)*a;const f=(2-o)*c;return l=o*c,l/=f<=1?f:2-f,l=l||0,u/=2,[s,l*100,u*100]},r.hwb.rgb=function(i){const s=i[0]/360;let o=i[1]/100,a=i[2]/100;const c=o+a;let l;c>1&&(o/=c,a/=c);const u=Math.floor(6*s),f=1-a;l=6*s-u,u&1&&(l=1-l);const d=o+l*(f-o);let h,p,v;switch(u){default:case 6:case 0:h=f,p=d,v=o;break;case 1:h=d,p=f,v=o;break;case 2:h=o,p=f,v=d;break;case 3:h=o,p=d,v=f;break;case 4:h=d,p=o,v=f;break;case 5:h=f,p=o,v=d;break}return[h*255,p*255,v*255]},r.cmyk.rgb=function(i){const s=i[0]/100,o=i[1]/100,a=i[2]/100,c=i[3]/100,l=1-Math.min(1,s*(1-c)+c),u=1-Math.min(1,o*(1-c)+c),f=1-Math.min(1,a*(1-c)+c);return[l*255,u*255,f*255]},r.xyz.rgb=function(i){const s=i[0]/100,o=i[1]/100,a=i[2]/100;let c,l,u;return c=s*3.2406+o*-1.5372+a*-.4986,l=s*-.9689+o*1.8758+a*.0415,u=s*.0557+o*-.204+a*1.057,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,c=Math.min(Math.max(0,c),1),l=Math.min(Math.max(0,l),1),u=Math.min(Math.max(0,u),1),[c*255,l*255,u*255]},r.xyz.lab=function(i){let s=i[0],o=i[1],a=i[2];s/=95.047,o/=100,a/=108.883,s=s>.008856?s**(1/3):7.787*s+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;const c=116*o-16,l=500*(s-o),u=200*(o-a);return[c,l,u]},r.lab.xyz=function(i){const s=i[0],o=i[1],a=i[2];let c,l,u;l=(s+16)/116,c=o/500+l,u=l-a/200;const f=l**3,d=c**3,h=u**3;return l=f>.008856?f:(l-16/116)/7.787,c=d>.008856?d:(c-16/116)/7.787,u=h>.008856?h:(u-16/116)/7.787,c*=95.047,l*=100,u*=108.883,[c,l,u]},r.lab.lch=function(i){const s=i[0],o=i[1],a=i[2];let c;c=Math.atan2(a,o)*360/2/Math.PI,c<0&&(c+=360);const u=Math.sqrt(o*o+a*a);return[s,u,c]},r.lch.lab=function(i){const s=i[0],o=i[1],c=i[2]/360*2*Math.PI,l=o*Math.cos(c),u=o*Math.sin(c);return[s,l,u]},r.rgb.ansi16=function(i,s=null){const[o,a,c]=i;let l=s===null?r.rgb.hsv(i)[2]:s;if(l=Math.round(l/50),l===0)return 30;let u=30+(Math.round(c/255)<<2|Math.round(a/255)<<1|Math.round(o/255));return l===2&&(u+=60),u},r.hsv.ansi16=function(i){return r.rgb.ansi16(r.hsv.rgb(i),i[2])},r.rgb.ansi256=function(i){const s=i[0],o=i[1],a=i[2];return s===o&&o===a?s<8?16:s>248?231:Math.round((s-8)/247*24)+232:16+36*Math.round(s/255*5)+6*Math.round(o/255*5)+Math.round(a/255*5)},r.ansi16.rgb=function(i){let s=i%10;if(s===0||s===7)return i>50&&(s+=3.5),s=s/10.5*255,[s,s,s];const o=(~~(i>50)+1)*.5,a=(s&1)*o*255,c=(s>>1&1)*o*255,l=(s>>2&1)*o*255;return[a,c,l]},r.ansi256.rgb=function(i){if(i>=232){const l=(i-232)*10+8;return[l,l,l]}i-=16;let s;const o=Math.floor(i/36)/5*255,a=Math.floor((s=i%36)/6)/5*255,c=s%6/5*255;return[o,a,c]},r.rgb.hex=function(i){const o=(((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255)).toString(16).toUpperCase();return"000000".substring(o.length)+o},r.hex.rgb=function(i){const s=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!s)return[0,0,0];let o=s[0];s[0].length===3&&(o=o.split("").map(f=>f+f).join(""));const a=parseInt(o,16),c=a>>16&255,l=a>>8&255,u=a&255;return[c,l,u]},r.rgb.hcg=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.max(Math.max(s,o),a),l=Math.min(Math.min(s,o),a),u=c-l;let f,d;return u<1?f=l/(1-u):f=0,u<=0?d=0:c===s?d=(o-a)/u%6:c===o?d=2+(a-s)/u:d=4+(s-o)/u,d/=6,d%=1,[d*360,u*100,f*100]},r.hsl.hcg=function(i){const s=i[1]/100,o=i[2]/100,a=o<.5?2*s*o:2*s*(1-o);let c=0;return a<1&&(c=(o-.5*a)/(1-a)),[i[0],a*100,c*100]},r.hsv.hcg=function(i){const s=i[1]/100,o=i[2]/100,a=s*o;let c=0;return a<1&&(c=(o-a)/(1-a)),[i[0],a*100,c*100]},r.hcg.rgb=function(i){const s=i[0]/360,o=i[1]/100,a=i[2]/100;if(o===0)return[a*255,a*255,a*255];const c=[0,0,0],l=s%1*6,u=l%1,f=1-u;let d=0;switch(Math.floor(l)){case 0:c[0]=1,c[1]=u,c[2]=0;break;case 1:c[0]=f,c[1]=1,c[2]=0;break;case 2:c[0]=0,c[1]=1,c[2]=u;break;case 3:c[0]=0,c[1]=f,c[2]=1;break;case 4:c[0]=u,c[1]=0,c[2]=1;break;default:c[0]=1,c[1]=0,c[2]=f}return d=(1-o)*a,[(o*c[0]+d)*255,(o*c[1]+d)*255,(o*c[2]+d)*255]},r.hcg.hsv=function(i){const s=i[1]/100,o=i[2]/100,a=s+o*(1-s);let c=0;return a>0&&(c=s/a),[i[0],c*100,a*100]},r.hcg.hsl=function(i){const s=i[1]/100,a=i[2]/100*(1-s)+.5*s;let c=0;return a>0&&a<.5?c=s/(2*a):a>=.5&&a<1&&(c=s/(2*(1-a))),[i[0],c*100,a*100]},r.hcg.hwb=function(i){const s=i[1]/100,o=i[2]/100,a=s+o*(1-s);return[i[0],(a-s)*100,(1-a)*100]},r.hwb.hcg=function(i){const s=i[1]/100,a=1-i[2]/100,c=a-s;let l=0;return c<1&&(l=(a-c)/(1-c)),[i[0],c*100,l*100]},r.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]},r.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]},r.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]},r.gray.hsl=function(i){return[0,0,i[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(i){return[0,100,i[0]]},r.gray.cmyk=function(i){return[0,0,0,i[0]]},r.gray.lab=function(i){return[i[0],0,0]},r.gray.hex=function(i){const s=Math.round(i[0]/100*255)&255,a=((s<<16)+(s<<8)+s).toString(16).toUpperCase();return"000000".substring(a.length)+a},r.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]},dE}var hE,Q9;function gxe(){if(Q9)return hE;Q9=1;const t=_z();function e(){const s={},o=Object.keys(t);for(let a=o.length,c=0;c1&&(c=l),o(c))};return"conversion"in o&&(a.conversion=o.conversion),a}function s(o){const a=function(...c){const l=c[0];if(l==null)return l;l.length>1&&(c=l);const u=o(c);if(typeof u=="object")for(let f=u.length,d=0;d{r[o]={},Object.defineProperty(r[o],"channels",{value:t[o].channels}),Object.defineProperty(r[o],"labels",{value:t[o].labels});const a=e(o);Object.keys(a).forEach(l=>{const u=a[l];r[o][l]=s(u),r[o][l].raw=i(u)})}),pE=r,pE}uk.exports;(function(t){const e=(u,f)=>(...d)=>`\x1B[${u(...d)+f}m`,r=(u,f)=>(...d)=>{const h=u(...d);return`\x1B[${38+f};5;${h}m`},n=(u,f)=>(...d)=>{const h=u(...d);return`\x1B[${38+f};2;${h[0]};${h[1]};${h[2]}m`},i=u=>u,s=(u,f,d)=>[u,f,d],o=(u,f,d)=>{Object.defineProperty(u,f,{get:()=>{const h=d();return Object.defineProperty(u,f,{value:h,enumerable:!0,configurable:!0}),h},enumerable:!0,configurable:!0})};let a;const c=(u,f,d,h)=>{a===void 0&&(a=bxe());const p=h?10:0,v={};for(const[b,y]of Object.entries(a)){const m=b==="ansi16"?"ansi":b;b===f?v[m]=u(d,p):typeof y=="object"&&(v[m]=u(y[f],p))}return v};function l(){const u=new Map,f={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};f.color.gray=f.color.blackBright,f.bgColor.bgGray=f.bgColor.bgBlackBright,f.color.grey=f.color.blackBright,f.bgColor.bgGrey=f.bgColor.bgBlackBright;for(const[d,h]of Object.entries(f)){for(const[p,v]of Object.entries(h))f[p]={open:`\x1B[${v[0]}m`,close:`\x1B[${v[1]}m`},h[p]=f[p],u.set(v[0],v[1]);Object.defineProperty(f,d,{value:h,enumerable:!1})}return Object.defineProperty(f,"codes",{value:u,enumerable:!1}),f.color.close="\x1B[39m",f.bgColor.close="\x1B[49m",o(f.color,"ansi",()=>c(e,"ansi16",i,!1)),o(f.color,"ansi256",()=>c(r,"ansi256",i,!1)),o(f.color,"ansi16m",()=>c(n,"rgb",s,!1)),o(f.bgColor,"ansi",()=>c(e,"ansi16",i,!0)),o(f.bgColor,"ansi256",()=>c(r,"ansi256",i,!0)),o(f.bgColor,"ansi16m",()=>c(n,"rgb",s,!0)),f}Object.defineProperty(t,"exports",{enumerable:!0,get:l})})(uk);var wxe=uk.exports,Exe={stdout:!1,stderr:!1};const xxe=(t,e,r)=>{let n=t.indexOf(e);if(n===-1)return t;const i=e.length;let s=0,o="";do o+=t.substr(s,n-s)+e+r,s=n+i,n=t.indexOf(e,s);while(n!==-1);return o+=t.substr(s),o},Cxe=(t,e,r,n)=>{let i=0,s="";do{const o=t[n-1]==="\r";s+=t.substr(i,(o?n-1:n)-i)+e+(o?`\r `:` `)+r,i=n+1,n=t.indexOf(` -`,i)}while(n!==-1);return s+=t.substr(i),s};var UEe={stringReplaceAll:FEe,stringEncaseCRLFWithFirstIndex:jEe},cE,j9;function zEe(){if(j9)return cE;j9=1;const t=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,e=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,n=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,i=new Map([["n",` -`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function s(l){const u=l[0]==="u",f=l[1]==="{";return u&&!f&&l.length===5||l[0]==="x"&&l.length===3?String.fromCharCode(parseInt(l.slice(1),16)):u&&f?String.fromCodePoint(parseInt(l.slice(2,-1),16)):i.get(l)||l}function o(l,u){const f=[],d=u.trim().split(/\s*,\s*/g);let h;for(const p of d){const v=Number(p);if(!Number.isNaN(v))f.push(v);else if(h=p.match(r))f.push(h[2].replace(n,(b,y,m)=>y?s(y):m));else throw new Error(`Invalid Chalk template style argument: ${p} (in style '${l}')`)}return f}function a(l){e.lastIndex=0;const u=[];let f;for(;(f=e.exec(l))!==null;){const d=f[1];if(f[2]){const h=o(d,f[2]);u.push([d].concat(h))}else u.push([d])}return u}function c(l,u){const f={};for(const h of u)for(const p of h.styles)f[p[0]]=h.inverse?null:p.slice(1);let d=l;for(const[h,p]of Object.entries(f))if(Array.isArray(p)){if(!(h in d))throw new Error(`Unknown Chalk style: ${h}`);d=p.length>0?d[h](...p):d[h]}return d}return cE=(l,u)=>{const f=[],d=[];let h=[];if(u.replace(t,(p,v,b,y,m,g)=>{if(v)h.push(s(v));else if(y){const S=h.join("");h=[],d.push(f.length===0?S:c(l,f)(S)),f.push({inverse:b,styles:a(y)})}else if(m){if(f.length===0)throw new Error("Found extraneous } in Chalk template literal");d.push(c(l,f)(h.join(""))),h=[],f.pop()}else h.push(g)}),d.push(h.join("")),f.length>0){const p=`Chalk template literal is missing ${f.length} closing bracket${f.length===1?"":"s"} (\`}\`)`;throw new Error(p)}return d.join("")},cE}const c1=LEe,{stdout:_5,stderr:P5}=BEe,{stringReplaceAll:WEe,stringEncaseCRLFWithFirstIndex:HEe}=UEe,{isArray:jy}=Array,XU=["ansi","ansi","ansi256","ansi16m"],Td=Object.create(null),qEe=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=_5?_5.level:0;t.level=e.level===void 0?r:e.level};class VEe{constructor(e){return ZU(e)}}const ZU=t=>{const e={};return qEe(e,t),e.template=(...r)=>tz(e.template,...r),Object.setPrototypeOf(e,Gb.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=VEe,e.template};function Gb(t){return ZU(t)}for(const[t,e]of Object.entries(c1))Td[t]={get(){const r=Kb(this,tk(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};Td.visible={get(){const t=Kb(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};const ez=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const t of ez)Td[t]={get(){const{level:e}=this;return function(...r){const n=tk(c1.color[XU[e]][t](...r),c1.color.close,this._styler);return Kb(this,n,this._isEmpty)}}};for(const t of ez){const e="bg"+t[0].toUpperCase()+t.slice(1);Td[e]={get(){const{level:r}=this;return function(...n){const i=tk(c1.bgColor[XU[r]][t](...n),c1.bgColor.close,this._styler);return Kb(this,i,this._isEmpty)}}}}const GEe=Object.defineProperties(()=>{},{...Td,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),tk=(t,e,r)=>{let n,i;return r===void 0?(n=t,i=e):(n=r.openAll+t,i=e+r.closeAll),{open:t,close:e,openAll:n,closeAll:i,parent:r}},Kb=(t,e,r)=>{const n=(...i)=>jy(i[0])&&jy(i[0].raw)?U9(n,tz(n,...i)):U9(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,GEe),n._generator=t,n._styler=e,n._isEmpty=r,n},U9=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;const{openAll:n,closeAll:i}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=WEe(e,r.close,r.open),r=r.parent;const s=e.indexOf(` -`);return s!==-1&&(e=HEe(e,i,n,s)),n+e+i};let lE;const tz=(t,...e)=>{const[r]=e;if(!jy(r)||!jy(r.raw))return e.join(" ");const n=e.slice(1),i=[r.raw[0]];for(let s=1;s{uE.push(t)},registerClassName:t=>{W9.add(t)},registerComposition:t=>{H9.push(t)},markCompositionUsed:()=>{},onEndFileScope:t=>{var e=MEe({localClassNames:Array.from(W9),composedClassLists:H9,cssObjs:uE}).join(` -`);$2e({fileScope:t,css:e}),uE=[]},getIdentOption:()=>"short"};_2e(lxe);function Uy(t,e){return Uy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Uy(t,e)}function uxe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Uy(t,e)}function T5(){T5=function(i,s){return new r(i,void 0,s)};var t=RegExp.prototype,e=new WeakMap;function r(i,s,o){var a=new RegExp(i,s);return e.set(a,o||e.get(i)),Uy(a,r.prototype)}function n(i,s){var o=e.get(s);return Object.keys(o).reduce(function(a,c){var l=o[c];if(typeof l=="number")a[c]=i[l];else{for(var u=0;i[l[u]]===void 0&&u+1]+)>/g,function(c,l){var u=o[l];return"$"+(Array.isArray(u)?u.join("$"):u)}))}if(typeof s=="function"){var a=this;return t[Symbol.replace].call(this,i,function(){var c=arguments;return typeof c[c.length-1]!="object"&&(c=[].slice.call(c)).push(n(c,a)),s.apply(this,c)})}return t[Symbol.replace].call(this,i,s)},T5.apply(this,arguments)}function fxe(t){var{debugId:e,debugFileName:r}=t,n=e?[e.replace(/\s/g,"_")]:[];if(r){var{filePath:i}=so(),s=i.match(T5(/([^\/\\]*)?[\/\\]?([^\/\\]*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/,{dir:1,file:2}));if(s&&s.groups){var{dir:o,file:a}=s.groups;n.unshift(a&&a!=="index"?a:o)}}return n.join("_")}function q9(t){return t.match(/^[0-9]/)?"_".concat(t):t}function nk(t){var e=R2e(),{debugId:r,debugFileName:n=!0}=Zh(Zh({},typeof t=="string"?{debugId:t}:null),typeof t=="object"?t:null),i=M2e().toString(36),{filePath:s,packageName:o}=so(),a=YU(o?"".concat(o).concat(s):s),c="".concat(a).concat(i);if(e==="debug"){var l=fxe({debugId:r,debugFileName:n});return l&&(c="".concat(l,"__").concat(c)),q9(c)}if(typeof e=="function"){if(c=e({hash:c,debugId:r,filePath:s,packageName:o}),!c.match(/^[A-Z_][0-9A-Z_]+$/i))throw new Error('Identifier function returned invalid indentifier: "'.concat(c,'"'));return c}return q9(c)}function dxe(t,e){var r=nk(e);HU(r,so());var n=[],i=[];for(var s of t)typeof s=="string"?n.push(s):i.push(s);var o=r;if(n.length>0&&(o="".concat(r," ").concat(wEe(n)),T2e({identifier:r,classList:o},so()),i.length>0&&qU(r)),i.length>0){var a=cxe.all(i,{arrayMerge:(c,l)=>l});Vb({type:"local",selector:r,rule:a},so())}return o}function ki(t,e){if(Array.isArray(t))return dxe(t,e);var r=nk(e);return HU(r,so()),Vb({type:"local",selector:r,rule:t},so()),r}function Ts(t,e){Vb({type:"global",selector:t,rule:e},so())}function nz(t,e){var r=X8(nk(e),{isIdentifier:!0});return Vb({type:"keyframes",name:r,rule:t},so()),r}function Ec(){return Ec=Object.assign?Object.assign.bind():function(t){for(var e=1;e svg`,{width:"20px",height:"20px"});cu();const pxe=({onConnect:t,connectors:e})=>{const{theme:r}=$1(),{isLoading:n}=NB();return x.createElement(z,{flexDirection:"column",gap:"2",marginTop:"5"},e.map(i=>{const s=r==="dark"?i._wallet.logoDark:i._wallet.logoLight,o=i._wallet.name;return x.createElement(z,{key:i.id,as:"button",flexDirection:"row",alignItems:"center",justifyContent:"space-between",background:"backgroundSecondary",color:"text100",borderRadius:"md",padding:"4",style:{height:"60px"},className:hxe,onClick:()=>t(i)},x.createElement(ne,{variant:"medium",color:"text100"},o,n),x.createElement(z,{justifyContent:"center",alignItems:"center",style:{backgroundColor:i._wallet.iconBackground},borderRadius:"md",className:iz},x.createElement(s,null)))}))},vxe=({config:t={}})=>{const{signIn:e={}}=t,{logoUrl:r}=e;return x.createElement(x.Fragment,null,r&&x.createElement(z,{marginTop:"5",justifyContent:"center",alignItems:"center"},x.createElement(mr,{src:r,style:{height:"110px"}})))};let gn=function(t){return t.Settings="@kit.settings",t.Theme="@kit.theme",t.EthAuthProof="@kit.ethAuthProof",t.EthAuthSettings="@kit.ethAuthSettings",t.ProjectAccessKey="@kit.projectAccessKey",t}({});const fE={showEmailInput:!0,walletAuthOptions:["sequence","metamask","wallet-connect"],socialAuthOptions:["google","facebook","twitch","apple"]},sz=60*60*24*7;function mxe(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s=0)&&(r[i]=t[i]);return r}const yxe=["createConnector"],oz=t=>{const e=[],r=t.find(i=>i.id==="injected");return t.filter(i=>!r||!r.hideConnectorId?!0:i.id!==r.hideConnectorId).forEach(i=>{const s=mxe(i,yxe),o=i.createConnector(),a=Ec({},s),l=((u,f)=>{const d=u;return d._wallet=Ec({},f),d})(o,a);e.push(l)}),e},gxe=t=>/^\S+@\S+\.\S{2,}$/.test(t),O5={1:{name:"Ethereum",symbol:"ETH",logoURI:"https://assets.coingecko.com/coins/images/279/thumb/ethereum.png",decimals:18,blockExplorerName:"Etherscan",blockExplorerUrl:"https://etherscan.io"},5:{name:"Goerli",symbol:"ETH",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/279/thumb/ethereum.png",blockExplorerName:"Etherscan (Goerli)",blockExplorerUrl:"https://goerli.etherscan.io"},10:{name:"Optimism",symbol:"OP",logoURI:"https://assets.coingecko.com/coins/images/25244/small/Optimism.png",decimals:18,blockExplorerName:"Etherscan (Optimism)",blockExplorerUrl:"https://optimistic.etherscan.io"},56:{name:"BNB",symbol:"BNB",logoURI:"https://assets.coingecko.com/coins/images/825/thumb/bnb-icon2_2x.png",decimals:18,blockExplorerName:"BscScan",blockExplorerUrl:"https://bscscan.com"},100:{name:"Gnosis",symbol:"GNO",logoURI:"https://assets.coingecko.com/coins/images/662/small/logo_square_simple_300px.png",decimals:18,blockExplorerUrl:"https://gnosisscan.io",blockExplorerName:"Gnosis Scan"},137:{name:"Polygon",symbol:"MATIC",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"Polyscan",blockExplorerUrl:"https://polygonscan.com"},1101:{name:"Polygon zkEVM",symbol:"ETH",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"PolygonScan",blockExplorerUrl:"https://zkevm.polygonscan.com"},42161:{name:"Arbitrum",symbol:"ARB",logoURI:"https://assets.coingecko.com/asset_platforms/images/33/small/arbitrum-one.png",decimals:18,blockExplorerName:"Arbiscan",blockExplorerUrl:"https://arbiscan.io"},43114:{name:"Avalanche",symbol:"AVAX",logoURI:"https://assets.coingecko.com/coins/images/12559/small/Avalanche_Circle_RedWhite_Trans.png",decimals:18,blockExplorerName:"Snowtrace",blockExplorerUrl:"https://snowtrace.io"},80001:{name:"Mumbai",symbol:"MATIC",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"Polyscan (Mumbai)",blockExplorerUrl:"https://mumbai.polygonscan.com"}},bxe=(t,e)=>{const r=e.find(s=>s.id===t);if(r){var n,i;return{name:r.name,symbol:r.nativeCurrency.symbol,decimals:r.nativeCurrency.decimals,logoURI:O5[1].logoURI,blockExplorerName:(n=r.blockExplorers)==null?void 0:n.default.name,blockExplorerUrl:(i=r.blockExplorers)==null?void 0:i.default.url}}},Pr=(t,e)=>O5[t]||bxe(t,e)||O5[1],lu=()=>{const t=x.createContext(void 0);return[()=>{const r=x.useContext(t);if(!r)throw new Error("useGenericContext must be used within a Provider");return r},t.Provider]},sk=t=>{switch(t){case"top-right":return{top:"0px",right:"0px"};case"top-left":return{top:"0px",left:"0px"};case"top-center":return{top:"0px"};case"bottom-right":return{bottom:"0px",right:"0px"};case"bottom-left":return{bottom:"0px",left:"0px"};case"bottom-center":return{bottom:"0px"};case"middle-right":return{right:"0px"};case"middle-left":return{left:"0px"};case"center":default:return{}}},wxe=(t,e="light")=>{switch(t){case 1:return"#abf";case 137:return"#c7a6ff";case 42161:return"#52A7E6";case 10:return"#DB3132";case 56:return e==="light"?"#CB9C1D":"#EEB445";case 43114:return"#E84142";case 100:return e==="light"?"#00193C":"#D8E8FF";case 5:return e==="light"?"#A77A00":"#FFA700";case 80001:return e==="light"?"#D68828":"#FFA700";default:return"#abf"}},Exe=(t,e="light")=>{switch(t){case 1:return"#132362";case 137:return"#350881";case 42161:return e==="light"?"#EDF7FF":"#0C3754";case 10:return e==="light"?"#FFEAE9":"#390B0C";case 56:return e==="light"?"#FFE8AB":"#554018";case 43114:return e==="light"?"#FBDFDF":"#390B0C";case 100:return e==="light"?"#D8E8FF":"#00193C";case 5:return e==="light"?"#FFD871":"#554018";case 80001:return e==="light"?"#FFE8CD":"#554018";default:return"#132362"}};function xxe(t){var e;const{account:r,chain:n,transport:i}=t,s={chainId:n.id,name:n.name,ensAddress:(e=n.contracts)==null||(e=e.ensRegistry)==null?void 0:e.address};return new HM(i,s).getSigner(r.address)}function Cxe(t){var e;const{chain:r,transport:n}=t,i={chainId:r.id,name:r.name,ensAddress:(e=r.contracts)==null||(e=e.ensRegistry)==null?void 0:e.address};return n.type==="fallback"?new SJ(n.transports.map(({value:s})=>new Ko(s==null?void 0:s.url,i))):new Ko(n.url,i)}const Sxe=async t=>{const e=localStorage.getItem(gn.EthAuthProof);if(e)return JSON.parse(e);const r=localStorage.getItem(gn.EthAuthSettings);if(!r)throw new Error("No ETHAuth settings found");const n=JSON.parse(r),i=t.account.address,s=new Sb;s.address=i,s.claims.app=n.app||"app",s.claims.ogn=n.origin,s.claims.n=n.nonce,s.setExpiryIn(n.expiry?Math.max(n.expiry,200):sz);const o=s.messageTypedData();o.domain.verifyingContract;const c=await xxe(t)._signTypedData(o.domain,o.types,o.message);s.signature=c;const u=await new t1().encodeProof(s,!0);return{typedData:o,proofString:u}},kxe=async(t,e,r)=>{const n=t.account.address,s=await new t1().decodeProof(r.proofString,!0),o=Cxe(e);return await sU.utils.isValidTypedDataSignature(n,r.typedData,s.signature,o)},ln=t=>{const e=Ut[t];if(!e)throw"invalid network";const r=localStorage.getItem(gn.ProjectAccessKey)||void 0,n=new S8("https://metadata.sequence.app",r),i=new C8(t8(e.name),r),s=new Uh("https://api.sequence.app",r);return{network:e,metadataClient:n,indexerClient:i,apiClient:s}},Axe=t=>{const{isConnected:e}=kn(),{theme:r}=$1(),{config:n={}}=t,{signIn:i={}}=n,{showEmailInput:s=fE.showEmailInput,socialAuthOptions:o=fE.socialAuthOptions,walletAuthOptions:a=fE.walletAuthOptions}=i,{openConnectModal:c,setOpenConnectModal:l}=t,[u,f]=C.useState(""),{connectors:d,connect:h,isLoading:p}=NB(),v=d,[b,y]=C.useState(!1),m=v.find(B=>B.id==="mock"),g=v.find(B=>B._wallet.id==="email"),S=v.filter(B=>!!a.find(H=>H===B._wallet.id)),P=v.filter(B=>!!o.find(H=>H===B._wallet.id));S.length>4;const T=B=>{f(B.target.value)};C.useEffect(()=>{e&&c&&l(!1)},[e,c]);const w=B=>{if(i.useMock&&m){h({connector:m});return}if(B._wallet.id==="email"){const j=prompt("Auto-email login, please specify the email address:");localStorage.setItem(C5,j||"")}h({connector:B})},I=B=>{if(i.useMock&&m){h({connector:m});return}B.preventDefault(),localStorage.setItem(C5,u),h({connector:g})};return b?x.createElement(x.Fragment,null,x.createElement(z,{as:"button",position:"absolute",style:{top:"20px"},onClick:()=>y(!1),className:Yv},x.createElement(Bg,null)),x.createElement(pxe,{connectors:S,onConnect:w})):x.createElement(x.Fragment,null,x.createElement(vxe,{config:n}),x.createElement(z,{marginTop:"5"},g&&s&&x.createElement(x.Fragment,null,x.createElement("form",{onSubmit:I},x.createElement(Mc,{onChange:T,value:u,name:"email",placeholder:"Enter email","data-1p-ignore":!0}),x.createElement(tt,{type:"submit",disabled:!gxe(u),marginTop:"4",width:"full",label:"Continue",rightIcon:Lo}))),P.length>0&&x.createElement(x.Fragment,null,g&&s&&x.createElement(x.Fragment,null,x.createElement(z,{style:{marginBottom:"-4px"}},x.createElement(R0,{color:"backgroundSecondary"})),x.createElement(z,{justifyContent:"center",alignItems:"center"},x.createElement(ne,{variant:"small",color:"text50"},"or sign in via"))),x.createElement(z,{marginTop:"3",gap:"2",flexDirection:"row",justifyContent:"flex-start",alignItems:"center",flexWrap:"wrap"},P.map(B=>{const j=r==="dark"?B._wallet.monochromeLogoDark:B._wallet.monochromeLogoLight;return x.createElement(ho,{key:B._wallet.id,className:Yv,justifyContent:"center",alignItems:"center",onClick:()=>w(B),aspectRatio:"1/1",style:{width:`calc(25% - ${ve.space[2]})`}},x.createElement(z,{className:I5,flexDirection:"column",alignItems:"center",justifyContent:"center"},x.createElement(j,null)))}))),S.length>0&&x.createElement(x.Fragment,null,(g&&s||P.length>0)&&x.createElement(x.Fragment,null,x.createElement(z,{style:{marginBottom:"-4px"}},x.createElement(R0,{color:"backgroundSecondary"})),x.createElement(z,{justifyContent:"center",alignItems:"center"},x.createElement(ne,{variant:"small",color:"text50"},"or select a wallet"))),x.createElement(z,{marginTop:"3",gap:"2",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},S.map(B=>{const j=r==="dark"?B._wallet.logoDark||B._wallet.logoDark:B._wallet.logoLight||B._wallet.logoLight;return x.createElement(ho,{key:B._wallet.id,className:Yv,justifyContent:"center",alignItems:"center",onClick:()=>w(B),aspectRatio:"1/1",style:{width:`calc(25% - ${ve.space[2]})`}},x.createElement(z,{className:I5,flexDirection:"column",alignItems:"center",justifyContent:"center"},x.createElement(j,null)))})))))};function _xe(t){if(t==null)throw new TypeError("Cannot destructure "+t)}const Pxe=t=>{let e=Ec({},(_xe(t),t));return x.createElement(x.Fragment,null,x.createElement("svg",Ec({xmlns:"http://www.w3.org/2000/svg",style:{fill:"none"},id:"svg1316",version:"1.1",viewBox:"0 0 396 396"},e),x.createElement("g",{transform:"translate(0,38)",id:"g1256",clipPath:"url(#clip0_5_131)"},x.createElement("g",{id:"g1254",clipPath:"url(#clip1_5_131)"},x.createElement("path",{style:{fill:"#111111"},id:"path1232",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),x.createElement("path",{style:{fill:"url(#paint0_linear_5_13"},id:"path1234",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),x.createElement("path",{style:{fill:"url(#paint1_linear_5_131"},id:"path1236",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),x.createElement("path",{style:{fill:"url(#paint2_linear_5_131)"},id:"path1238",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),x.createElement("path",{style:{fill:"url(#paint3_linear_5_131)"},id:"path1240",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),x.createElement("path",{style:{fill:"url(#paint4_linear_5_131)"},id:"path1242",d:"m 98.9999,238.126 c 0,-10.965 -8.8648,-19.854 -19.8,-19.854 -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.966 8.8648,19.855 19.8,19.855 10.9352,0 19.8,-8.889 19.8,-19.855 z"}),x.createElement("path",{style:{fill:"url(#paint5_linear_5_131)"},id:"path1244",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),x.createElement("path",{style:{fill:"url(#paint6_linear_5_131)"},id:"path1246",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),x.createElement("path",{style:{fill:"url(#paint7_linear_5_131)"},id:"path1248",d:"M 316.8,59.5632 H 158.4 c -10.935,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.865,19.8544 19.8,19.8544 h 158.4 c 10.935,0 19.8,-8.8892 19.8,-19.8544 0,-10.9653 -8.865,-19.8544 -19.8,-19.8544 z"}),x.createElement("path",{style:{fill:"url(#paint8_linear_5_131)"},id:"path1250",d:"M 316.8,218.272 H 158.4 c -10.935,0 -19.8,8.889 -19.8,19.854 0,10.966 8.865,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.889 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}),x.createElement("path",{style:{fill:"url(#paint9_linear_5_131)"},id:"path1252",d:"M 237.6,138.981 H 79.2 c -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.965 8.8648,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.89 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}))),x.createElement("defs",{id:"defs1314"},x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"318",x2:"198",y1:"4.0585401e-05",x1:"198",id:"paint0_linear_5_131"},x.createElement("stop",{id:"stop1258",stopColor:"#1D273D"}),x.createElement("stop",{id:"stop1260",stopColor:"#0D0F13",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"63",x2:"92.5",y1:"99",x1:"65.5",id:"paint1_linear_5_131"},x.createElement("stop",{id:"stop1263",stopColor:"#4462FE"}),x.createElement("stop",{id:"stop1265",stopColor:"#7D69FA",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint2_linear_5_131"},x.createElement("stop",{id:"stop1268",stopColor:"#3757FD"}),x.createElement("stop",{id:"stop1270",stopColor:"#6980FA",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint3_linear_5_131"},x.createElement("stop",{id:"stop1273",stopColor:"#2447FF"}),x.createElement("stop",{id:"stop1275",stopColor:"#6980FA",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"223.5",x2:"91.5",y1:"251.5",x1:"65",id:"paint4_linear_5_131"},x.createElement("stop",{id:"stop1278",stopColor:"#BC3EE6"}),x.createElement("stop",{id:"stop1280",stopColor:"#D972F1",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"146",x2:"329.5",y1:"172",x1:"305",id:"paint5_linear_5_131"},x.createElement("stop",{id:"stop1283",stopColor:"#29BDFF"}),x.createElement("stop",{id:"stop1285",stopColor:"#96E7FB",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"176.772",x2:"334.56699",y1:"178.418",x1:"300.17999",id:"paint6_linear_5_131"},x.createElement("stop",{id:"stop1288",stopColor:"#23BBFF"}),x.createElement("stop",{id:"stop1290",stopColor:"#85E7FF",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"60",x2:"317.5",y1:"99",x1:"154.5",id:"paint7_linear_5_131"},x.createElement("stop",{id:"stop1293",stopColor:"#23BBFF"}),x.createElement("stop",{id:"stop1295",stopColor:"#85E7FF",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"218",x2:"312.5",y1:"258",x1:"156",id:"paint8_linear_5_131"},x.createElement("stop",{id:"stop1298",stopColor:"#2447FF"}),x.createElement("stop",{id:"stop1300",stopColor:"#6980FA",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"139",x2:"235.5",y1:"179",x1:"86.000099",id:"paint9_linear_5_131"},x.createElement("stop",{id:"stop1303",stopColor:"#6634FF"}),x.createElement("stop",{id:"stop1305",stopColor:"#9C6DFF",offset:"1"})),x.createElement("clipPath",{id:"clip0_5_131"},x.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1308",height:"317.67001",width:"396"})),x.createElement("clipPath",{id:"clip1_5_131"},x.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1311",height:"317.67001",width:"396"})))))},[Txe,Ixe]=lu(),[Oxe,Rxe]=lu(),[Mxe,$xe]=lu(),Nxe={dark:"dark",light:"light"},Dxe=t=>{const{config:e={},children:r}=t,{projectAccessKey:n,defaultTheme:i="dark",signIn:s={},position:o="center",displayedAssets:a=[],ethAuth:c={}}=e,l=s.projectName||"app",{expiry:u=sz,app:f=l,origin:d=location.origin,nonce:h}=c,{projectName:p}=s,[v,b]=C.useState(!1),[y,m]=C.useState(i||Nxe.dark),[g,S]=C.useState(o),[P,T]=C.useState(a),w=()=>{window.open("https://sequence.xyz")};return C.useEffect(()=>{n?localStorage.setItem(gn.ProjectAccessKey,n):localStorage.removeItem(gn.ProjectAccessKey)},[n]),C.useEffect(()=>{y!==i&&m(i)},[i]),C.useEffect(()=>{g!==o&&S(o)},[o]),C.useEffect(()=>{typeof y=="object"||localStorage.setItem(gn.Theme,y),localStorage.setItem(gn.EthAuthSettings,JSON.stringify({expiry:u,app:f,origin:d,nonce:h}))},[y,c]),C.useEffect(()=>{T(P)},[a]),x.createElement(Rxe,{value:{theme:y,setTheme:m,position:g,setPosition:S}},x.createElement(Ixe,{value:{setOpenConnectModal:b,openConnectModalState:v}},x.createElement($xe,{value:{setDisplayedAssets:T,displayedAssets:P}},x.createElement("div",{id:"kit-provider"},x.createElement(Kg,{root:"#kit-provider",scope:"kit",theme:y},x.createElement(Ng,null,v&&x.createElement(rS,{scroll:!1,backdropColor:"backgroundBackdrop",size:"sm",contentProps:{style:Ec({maxWidth:"364px"},sk(o))},onClose:()=>b(!1)},x.createElement(z,{padding:"4",className:ik},x.createElement(z,{justifyContent:"center",color:"text100",alignItems:"center",fontWeight:"medium",style:{marginTop:"4px"}},x.createElement(ne,null,"Sign in ",p?`to ${p}`:"")),x.createElement(Axe,Ec({openConnectModal:v,setOpenConnectModal:b},t)),x.createElement(z,{onClick:w,className:Yv,gap:"1",marginTop:"2",flexDirection:"row",alignItems:"center",justifyContent:"center"},x.createElement(ne,{fontSize:"small",color:"text100"},"Powered by Sequence"),x.createElement(z,{height:"5",width:"5"},x.createElement(Pxe,null)))))))),r)))},Lxe=()=>{const{setOpenConnectModal:t,openConnectModalState:e}=Txe();return{setOpenConnectModal:t,openConnectModalState:e}},rp=()=>{const{setTheme:t,theme:e,position:r,setPosition:n}=Oxe();return{setTheme:t,theme:e,position:r,setPosition:n}},Bxe=()=>{const{setDisplayedAssets:t,displayedAssets:e}=Mxe();return{displayedAssets:e,setDisplayedAssets:t}};function Fxe(t,e,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),e!==void 0&&(t=t>=e?t:e)),t}var az=Fxe;function jxe(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r-1&&t%1==0&&t-1&&t%1==0&&t<=WCe}var mz=HCe,qCe=Qb,VCe=mz,GCe=Yb,KCe="[object Arguments]",QCe="[object Array]",YCe="[object Boolean]",JCe="[object Date]",XCe="[object Error]",ZCe="[object Function]",e5e="[object Map]",t5e="[object Number]",r5e="[object Object]",n5e="[object RegExp]",i5e="[object Set]",s5e="[object String]",o5e="[object WeakMap]",a5e="[object ArrayBuffer]",c5e="[object DataView]",l5e="[object Float32Array]",u5e="[object Float64Array]",f5e="[object Int8Array]",d5e="[object Int16Array]",h5e="[object Int32Array]",p5e="[object Uint8Array]",v5e="[object Uint8ClampedArray]",m5e="[object Uint16Array]",y5e="[object Uint32Array]",zt={};zt[l5e]=zt[u5e]=zt[f5e]=zt[d5e]=zt[h5e]=zt[p5e]=zt[v5e]=zt[m5e]=zt[y5e]=!0;zt[KCe]=zt[QCe]=zt[a5e]=zt[YCe]=zt[c5e]=zt[JCe]=zt[XCe]=zt[ZCe]=zt[e5e]=zt[t5e]=zt[r5e]=zt[n5e]=zt[i5e]=zt[s5e]=zt[o5e]=!1;function g5e(t){return GCe(t)&&VCe(t.length)&&!!zt[qCe(t)]}var b5e=g5e;function w5e(t){return function(e){return t(e)}}var E5e=w5e,Wy={exports:{}};Wy.exports;(function(t,e){var r=lz,n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===n,o=s&&r.process,a=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();t.exports=a})(Wy,Wy.exports);var x5e=Wy.exports,C5e=b5e,S5e=E5e,Y9=x5e,J9=Y9&&Y9.isTypedArray,k5e=J9?S5e(J9):C5e,A5e=k5e,_5e=sCe,P5e=NCe,T5e=pz,I5e=FCe,O5e=vz,R5e=A5e,M5e=Object.prototype,$5e=M5e.hasOwnProperty;function N5e(t,e){var r=T5e(t),n=!r&&P5e(t),i=!r&&!n&&I5e(t),s=!r&&!n&&!i&&R5e(t),o=r||n||i||s,a=o?_5e(t.length,String):[],c=a.length;for(var l in t)(e||$5e.call(t,l))&&!(o&&(l=="length"||i&&(l=="offset"||l=="parent")||s&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||O5e(l,c)))&&a.push(l);return a}var D5e=N5e,L5e=Object.prototype;function B5e(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||L5e;return t===r}var F5e=B5e;function j5e(t,e){return function(r){return t(e(r))}}var U5e=j5e,z5e=U5e,W5e=z5e(Object.keys,Object),H5e=W5e,q5e=F5e,V5e=H5e,G5e=Object.prototype,K5e=G5e.hasOwnProperty;function Q5e(t){if(!q5e(t))return V5e(t);var e=[];for(var r in Object(t))K5e.call(t,r)&&r!="constructor"&&e.push(r);return e}var Y5e=Q5e;function J5e(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var ok=J5e,X5e=Qb,Z5e=ok,e6e="[object AsyncFunction]",t6e="[object Function]",r6e="[object GeneratorFunction]",n6e="[object Proxy]";function i6e(t){if(!Z5e(t))return!1;var e=X5e(t);return e==t6e||e==r6e||e==e6e||e==n6e}var s6e=i6e,o6e=s6e,a6e=mz;function c6e(t){return t!=null&&a6e(t.length)&&!o6e(t)}var yz=c6e,l6e=D5e,u6e=Y5e,f6e=yz;function d6e(t){return f6e(t)?l6e(t):u6e(t)}var h6e=d6e,p6e=nCe,v6e=h6e;function m6e(t){return t==null?[]:p6e(t,v6e(t))}var y6e=m6e,g6e=az,b6e=cz,w6e=y6e;function E6e(t,e){var r=w6e(t);return b6e(r,g6e(e,0,r.length))}var x6e=E6e;function C6e(t,e){return t===e||t!==t&&e!==e}var S6e=C6e,k6e=S6e,A6e=yz,_6e=vz,P6e=ok;function T6e(t,e,r){if(!P6e(r))return!1;var n=typeof e;return(n=="number"?A6e(r)&&_6e(e,r.length):n=="string"&&e in r)?k6e(r[e],t):!1}var I6e=T6e,O6e=/\s/;function R6e(t){for(var e=t.length;e--&&O6e.test(t.charAt(e)););return e}var M6e=R6e,$6e=M6e,N6e=/^\s+/;function D6e(t){return t&&t.slice(0,$6e(t)+1).replace(N6e,"")}var L6e=D6e,B6e=Qb,F6e=Yb,j6e="[object Symbol]";function U6e(t){return typeof t=="symbol"||F6e(t)&&B6e(t)==j6e}var z6e=U6e,W6e=L6e,X9=ok,H6e=z6e,Z9=0/0,q6e=/^[-+]0x[0-9a-f]+$/i,V6e=/^0b[01]+$/i,G6e=/^0o[0-7]+$/i,K6e=parseInt;function Q6e(t){if(typeof t=="number")return t;if(H6e(t))return Z9;if(X9(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=X9(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=W6e(t);var r=V6e.test(t);return r||G6e.test(t)?K6e(t.slice(2),r?2:8):q6e.test(t)?Z9:+t}var Y6e=Q6e,J6e=Y6e,eI=1/0,X6e=17976931348623157e292;function Z6e(t){if(!t)return t===0?t:0;if(t=J6e(t),t===eI||t===-eI){var e=t<0?-1:1;return e*X6e}return t===t?t:0}var e3e=Z6e,t3e=e3e;function r3e(t){var e=t3e(t),r=e%1;return e===e?r?e-r:e:0}var n3e=r3e,i3e=Xxe,s3e=x6e,o3e=pz,a3e=I6e,c3e=n3e;function l3e(t,e,r){(r?a3e(t,e,r):e===void 0)?e=1:e=c3e(e);var n=o3e(t)?i3e:s3e;return n(t,e)}var u3e=l3e;const f3e=ks(u3e);var Jb={},d3e=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,r=[],n=0;n"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var f=tI[e.format]||tI.default;window.clipboardData.setData(f,t)}else u.clipboardData.clearData(),u.clipboardData.setData(e.format,t);e.onCopy&&(u.preventDefault(),e.onCopy(u.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");c=!0}catch(u){r&&console.error("unable to copy using execCommand: ",u),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),c=!0}catch(f){r&&console.error("unable to copy using clipboardData: ",f),r&&console.error("falling back to prompt"),n=v3e("message"in e?e.message:p3e),window.prompt(n,t)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),i()}return c}var y3e=m3e;function R5(t){"@babel/helpers - typeof";return R5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R5(t)}Object.defineProperty(Jb,"__esModule",{value:!0});Jb.CopyToClipboard=void 0;var rv=gz(C),g3e=gz(y3e),b3e=["text","onCopy","options","children"];function gz(t){return t&&t.__esModule?t:{default:t}}function rI(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function nI(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function E3e(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s=0)&&(r[i]=t[i]);return r}function x3e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function iI(t,e){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Hy(t){return Hy=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Hy(t)}function ak(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var wz=function(t){S3e(r,t);var e=k3e(r);function r(){var n;x3e(this,r);for(var i=arguments.length,s=new Array(i),o=0;oe in t?T3e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,u1=(t,e)=>{for(var r in e||(e={}))xz.call(e,r)&&sI(t,r,e[r]);if(qy)for(var r of qy(e))Cz.call(e,r)&&sI(t,r,e[r]);return t},ck=(t,e)=>{var r={};for(var n in t)xz.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&qy)for(var n of qy(t))e.indexOf(n)<0&&Cz.call(t,n)&&(r[n]=t[n]);return r};/** +`,i)}while(n!==-1);return s+=t.substr(i),s};var Sxe={stringReplaceAll:xxe,stringEncaseCRLFWithFirstIndex:Cxe},vE,J9;function kxe(){if(J9)return vE;J9=1;const t=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,e=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,n=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,i=new Map([["n",` +`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function s(l){const u=l[0]==="u",f=l[1]==="{";return u&&!f&&l.length===5||l[0]==="x"&&l.length===3?String.fromCharCode(parseInt(l.slice(1),16)):u&&f?String.fromCodePoint(parseInt(l.slice(2,-1),16)):i.get(l)||l}function o(l,u){const f=[],d=u.trim().split(/\s*,\s*/g);let h;for(const p of d){const v=Number(p);if(!Number.isNaN(v))f.push(v);else if(h=p.match(r))f.push(h[2].replace(n,(b,y,m)=>y?s(y):m));else throw new Error(`Invalid Chalk template style argument: ${p} (in style '${l}')`)}return f}function a(l){e.lastIndex=0;const u=[];let f;for(;(f=e.exec(l))!==null;){const d=f[1];if(f[2]){const h=o(d,f[2]);u.push([d].concat(h))}else u.push([d])}return u}function c(l,u){const f={};for(const h of u)for(const p of h.styles)f[p[0]]=h.inverse?null:p.slice(1);let d=l;for(const[h,p]of Object.entries(f))if(Array.isArray(p)){if(!(h in d))throw new Error(`Unknown Chalk style: ${h}`);d=p.length>0?d[h](...p):d[h]}return d}return vE=(l,u)=>{const f=[],d=[];let h=[];if(u.replace(t,(p,v,b,y,m,g)=>{if(v)h.push(s(v));else if(y){const S=h.join("");h=[],d.push(f.length===0?S:c(l,f)(S)),f.push({inverse:b,styles:a(y)})}else if(m){if(f.length===0)throw new Error("Found extraneous } in Chalk template literal");d.push(c(l,f)(h.join(""))),h=[],f.pop()}else h.push(g)}),d.push(h.join("")),f.length>0){const p=`Chalk template literal is missing ${f.length} closing bracket${f.length===1?"":"s"} (\`}\`)`;throw new Error(p)}return d.join("")},vE}const f1=wxe,{stdout:N5,stderr:D5}=Exe,{stringReplaceAll:Axe,stringEncaseCRLFWithFirstIndex:_xe}=Sxe,{isArray:Vy}=Array,Pz=["ansi","ansi","ansi256","ansi16m"],Rd=Object.create(null),Pxe=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=N5?N5.level:0;t.level=e.level===void 0?r:e.level};class Txe{constructor(e){return Tz(e)}}const Tz=t=>{const e={};return Pxe(e,t),e.template=(...r)=>Oz(e.template,...r),Object.setPrototypeOf(e,ew.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=Txe,e.template};function ew(t){return Tz(t)}for(const[t,e]of Object.entries(f1))Rd[t]={get(){const r=tw(this,fk(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};Rd.visible={get(){const t=tw(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};const Iz=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const t of Iz)Rd[t]={get(){const{level:e}=this;return function(...r){const n=fk(f1.color[Pz[e]][t](...r),f1.color.close,this._styler);return tw(this,n,this._isEmpty)}}};for(const t of Iz){const e="bg"+t[0].toUpperCase()+t.slice(1);Rd[e]={get(){const{level:r}=this;return function(...n){const i=fk(f1.bgColor[Pz[r]][t](...n),f1.bgColor.close,this._styler);return tw(this,i,this._isEmpty)}}}}const Ixe=Object.defineProperties(()=>{},{...Rd,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),fk=(t,e,r)=>{let n,i;return r===void 0?(n=t,i=e):(n=r.openAll+t,i=e+r.closeAll),{open:t,close:e,openAll:n,closeAll:i,parent:r}},tw=(t,e,r)=>{const n=(...i)=>Vy(i[0])&&Vy(i[0].raw)?X9(n,Oz(n,...i)):X9(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,Ixe),n._generator=t,n._styler=e,n._isEmpty=r,n},X9=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;const{openAll:n,closeAll:i}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=Axe(e,r.close,r.open),r=r.parent;const s=e.indexOf(` +`);return s!==-1&&(e=_xe(e,i,n,s)),n+e+i};let mE;const Oz=(t,...e)=>{const[r]=e;if(!Vy(r)||!Vy(r.raw))return e.join(" ");const n=e.slice(1),i=[r.raw[0]];for(let s=1;s{yE.push(t)},registerClassName:t=>{eI.add(t)},registerComposition:t=>{tI.push(t)},markCompositionUsed:()=>{},onEndFileScope:t=>{var e=mxe({localClassNames:Array.from(eI),composedClassLists:tI,cssObjs:yE}).join(` +`);yEe({fileScope:t,css:e}),yE=[]},getIdentOption:()=>"short"};uEe(Vxe);function Gy(t,e){return Gy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Gy(t,e)}function Gxe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Gy(t,e)}function L5(){L5=function(i,s){return new r(i,void 0,s)};var t=RegExp.prototype,e=new WeakMap;function r(i,s,o){var a=new RegExp(i,s);return e.set(a,o||e.get(i)),Gy(a,r.prototype)}function n(i,s){var o=e.get(s);return Object.keys(o).reduce(function(a,c){var l=o[c];if(typeof l=="number")a[c]=i[l];else{for(var u=0;i[l[u]]===void 0&&u+1]+)>/g,function(c,l){var u=o[l];return"$"+(Array.isArray(u)?u.join("$"):u)}))}if(typeof s=="function"){var a=this;return t[Symbol.replace].call(this,i,function(){var c=arguments;return typeof c[c.length-1]!="object"&&(c=[].slice.call(c)).push(n(c,a)),s.apply(this,c)})}return t[Symbol.replace].call(this,i,s)},L5.apply(this,arguments)}function Kxe(t){var{debugId:e,debugFileName:r}=t,n=e?[e.replace(/\s/g,"_")]:[];if(r){var{filePath:i}=oo(),s=i.match(L5(/([^\/\\]*)?[\/\\]?([^\/\\]*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/,{dir:1,file:2}));if(s&&s.groups){var{dir:o,file:a}=s.groups;n.unshift(a&&a!=="index"?a:o)}}return n.join("_")}function rI(t){return t.match(/^[0-9]/)?"_".concat(t):t}function hk(t){var e=vEe(),{debugId:r,debugFileName:n=!0}=r0(r0({},typeof t=="string"?{debugId:t}:null),typeof t=="object"?t:null),i=mEe().toString(36),{filePath:s,packageName:o}=oo(),a=Az(o?"".concat(o).concat(s):s),c="".concat(a).concat(i);if(e==="debug"){var l=Kxe({debugId:r,debugFileName:n});return l&&(c="".concat(l,"__").concat(c)),rI(c)}if(typeof e=="function"){if(c=e({hash:c,debugId:r,filePath:s,packageName:o}),!c.match(/^[A-Z_][0-9A-Z_]+$/i))throw new Error('Identifier function returned invalid indentifier: "'.concat(c,'"'));return c}return rI(c)}function Qxe(t,e){var r=hk(e);wz(r,oo());var n=[],i=[];for(var s of t)typeof s=="string"?n.push(s):i.push(s);var o=r;if(n.length>0&&(o="".concat(r," ").concat(nxe(n)),dEe({identifier:r,classList:o},oo()),i.length>0&&Ez(r)),i.length>0){var a=qxe.all(i,{arrayMerge:(c,l)=>l});Zb({type:"local",selector:r,rule:a},oo())}return o}function Ai(t,e){if(Array.isArray(t))return Qxe(t,e);var r=hk(e);return wz(r,oo()),Zb({type:"local",selector:r,rule:t},oo()),r}function Os(t,e){Zb({type:"global",selector:t,rule:e},oo())}function $z(t,e){var r=ck(hk(e),{isIdentifier:!0});return Zb({type:"keyframes",name:r,rule:t},oo()),r}function Ec(){return Ec=Object.assign?Object.assign.bind():function(t){for(var e=1;e svg`,{width:"20px",height:"20px"});lu();const Jxe=({onConnect:t,connectors:e})=>{const{theme:r}=L1(),{isLoading:n}=fB();return x.createElement(z,{flexDirection:"column",gap:"2",marginTop:"5"},e.map(i=>{const s=r==="dark"?i._wallet.logoDark:i._wallet.logoLight,o=i._wallet.name;return x.createElement(z,{key:i.id,as:"button",flexDirection:"row",alignItems:"center",justifyContent:"space-between",background:"backgroundSecondary",color:"text100",borderRadius:"md",padding:"4",style:{height:"60px"},className:Yxe,onClick:()=>t(i)},x.createElement(ne,{variant:"medium",color:"text100"},o,n),x.createElement(z,{justifyContent:"center",alignItems:"center",style:{backgroundColor:i._wallet.iconBackground},borderRadius:"md",className:Mz},x.createElement(s,null)))}))},Xxe=({config:t={}})=>{const{signIn:e={}}=t,{logoUrl:r}=e;return x.createElement(x.Fragment,null,r&&x.createElement(z,{marginTop:"5",justifyContent:"center",alignItems:"center"},x.createElement(mr,{src:r,style:{height:"110px"}})))};let gn=function(t){return t.Settings="@kit.settings",t.Theme="@kit.theme",t.EthAuthProof="@kit.ethAuthProof",t.EthAuthSettings="@kit.ethAuthSettings",t.ProjectAccessKey="@kit.projectAccessKey",t}({});const gE={showEmailInput:!0,walletAuthOptions:["sequence","metamask","wallet-connect","coinbase-wallet"],socialAuthOptions:["google","facebook","twitch","apple"]},Nz=60*60*24*7;function Zxe(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s=0)&&(r[i]=t[i]);return r}const eCe=["createConnector"],Dz=t=>{const e=[],r=t.find(i=>i.id==="injected");return t.filter(i=>!r||!r.hideConnectorId?!0:i.id!==r.hideConnectorId).forEach(i=>{const s=Zxe(i,eCe),o=i.createConnector(),a=Ec({},s),l=((u,f)=>{const d=u;return d._wallet=Ec({},f),d})(o,a);e.push(l)}),e},tCe=t=>/^\S+@\S+\.\S{2,}$/.test(t),B5={1:{name:"Ethereum",symbol:"ETH",logoURI:"https://assets.coingecko.com/coins/images/279/thumb/ethereum.png",decimals:18,blockExplorerName:"Etherscan",blockExplorerUrl:"https://etherscan.io"},5:{name:"Goerli",symbol:"ETH",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/279/thumb/ethereum.png",blockExplorerName:"Etherscan (Goerli)",blockExplorerUrl:"https://goerli.etherscan.io"},10:{name:"Optimism",symbol:"OP",logoURI:"https://assets.coingecko.com/coins/images/25244/small/Optimism.png",decimals:18,blockExplorerName:"Etherscan (Optimism)",blockExplorerUrl:"https://optimistic.etherscan.io"},56:{name:"BNB",symbol:"BNB",logoURI:"https://assets.coingecko.com/coins/images/825/thumb/bnb-icon2_2x.png",decimals:18,blockExplorerName:"BscScan",blockExplorerUrl:"https://bscscan.com"},100:{name:"Gnosis",symbol:"GNO",logoURI:"https://assets.coingecko.com/coins/images/662/small/logo_square_simple_300px.png",decimals:18,blockExplorerUrl:"https://gnosisscan.io",blockExplorerName:"Gnosis Scan"},137:{name:"Polygon",symbol:"MATIC",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"Polyscan",blockExplorerUrl:"https://polygonscan.com"},1101:{name:"Polygon zkEVM",symbol:"ETH",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"PolygonScan",blockExplorerUrl:"https://zkevm.polygonscan.com"},42161:{name:"Arbitrum",symbol:"ARB",logoURI:"https://assets.coingecko.com/asset_platforms/images/33/small/arbitrum-one.png",decimals:18,blockExplorerName:"Arbiscan",blockExplorerUrl:"https://arbiscan.io"},43114:{name:"Avalanche",symbol:"AVAX",logoURI:"https://assets.coingecko.com/coins/images/12559/small/Avalanche_Circle_RedWhite_Trans.png",decimals:18,blockExplorerName:"Snowtrace",blockExplorerUrl:"https://snowtrace.io"},80001:{name:"Mumbai",symbol:"MATIC",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"Polyscan (Mumbai)",blockExplorerUrl:"https://mumbai.polygonscan.com"}},rCe=(t,e)=>{const r=e.find(s=>s.id===t);if(r){var n,i;return{name:r.name,symbol:r.nativeCurrency.symbol,decimals:r.nativeCurrency.decimals,logoURI:B5[1].logoURI,blockExplorerName:(n=r.blockExplorers)==null?void 0:n.default.name,blockExplorerUrl:(i=r.blockExplorers)==null?void 0:i.default.url}}},Tr=(t,e)=>B5[t]||rCe(t,e)||B5[1],uu=()=>{const t=x.createContext(void 0);return[()=>{const r=x.useContext(t);if(!r)throw new Error("useGenericContext must be used within a Provider");return r},t.Provider]},vk=t=>{switch(t){case"top-right":return{top:"0px",right:"0px"};case"top-left":return{top:"0px",left:"0px"};case"top-center":return{top:"0px"};case"bottom-right":return{bottom:"0px",right:"0px"};case"bottom-left":return{bottom:"0px",left:"0px"};case"bottom-center":return{bottom:"0px"};case"middle-right":return{right:"0px"};case"middle-left":return{left:"0px"};case"center":default:return{}}},nCe=(t,e="light")=>{switch(t){case 1:return"#abf";case 137:return"#c7a6ff";case 42161:return"#52A7E6";case 10:return"#DB3132";case 56:return e==="light"?"#CB9C1D":"#EEB445";case 43114:return"#E84142";case 100:return e==="light"?"#00193C":"#D8E8FF";case 5:return e==="light"?"#A77A00":"#FFA700";case 80001:return e==="light"?"#D68828":"#FFA700";default:return"#abf"}},iCe=(t,e="light")=>{switch(t){case 1:return"#132362";case 137:return"#350881";case 42161:return e==="light"?"#EDF7FF":"#0C3754";case 10:return e==="light"?"#FFEAE9":"#390B0C";case 56:return e==="light"?"#FFE8AB":"#554018";case 43114:return e==="light"?"#FBDFDF":"#390B0C";case 100:return e==="light"?"#D8E8FF":"#00193C";case 5:return e==="light"?"#FFD871":"#554018";case 80001:return e==="light"?"#FFE8CD":"#554018";default:return"#132362"}};function sCe(t){var e;const{account:r,chain:n,transport:i}=t,s={chainId:n.id,name:n.name,ensAddress:(e=n.contracts)==null||(e=e.ensRegistry)==null?void 0:e.address};return new tM(i,s).getSigner(r.address)}function oCe(t){var e;const{chain:r,transport:n}=t,i={chainId:r.id,name:r.name,ensAddress:(e=r.contracts)==null||(e=e.ensRegistry)==null?void 0:e.address};return n.type==="fallback"?new eX(n.transports.map(({value:s})=>new Ko(s==null?void 0:s.url,i))):new Ko(n.url,i)}const aCe=async t=>{const e=localStorage.getItem(gn.EthAuthProof);if(e)return JSON.parse(e);const r=localStorage.getItem(gn.EthAuthSettings);if(!r)throw new Error("No ETHAuth settings found");const n=JSON.parse(r),i=t.account.address,s=new Ob;s.address=i,s.claims.app=n.app||"app",s.claims.ogn=n.origin,s.claims.n=n.nonce,s.setExpiryIn(n.expiry?Math.max(n.expiry,200):Nz);const o=s.messageTypedData();o.domain.verifyingContract;const c=await sCe(t)._signTypedData(o.domain,o.types,o.message);s.signature=c;const u=await new i1().encodeProof(s,!0);return{typedData:o,proofString:u}},cCe=async(t,e,r)=>{const n=t.account.address,s=await new i1().decodeProof(r.proofString,!0),o=oCe(e);return await NU.utils.isValidTypedDataSignature(n,r.typedData,s.signature,o)},ln=t=>{const e=Ut[t];if(!e)throw"invalid network";const r=localStorage.getItem(gn.ProjectAccessKey)||void 0,n=new M8("https://metadata.sequence.app",r),i=new $8(f8(e.name),r),s=new Hh("https://api.sequence.app",r);return{network:e,metadataClient:n,indexerClient:i,apiClient:s}},lCe=t=>{const{isConnected:e}=kn(),{theme:r}=L1(),{config:n={}}=t,{signIn:i={}}=n,{showEmailInput:s=gE.showEmailInput,socialAuthOptions:o=gE.socialAuthOptions,walletAuthOptions:a=gE.walletAuthOptions}=i,{openConnectModal:c,setOpenConnectModal:l}=t,[u,f]=C.useState(""),{connectors:d,connect:h,isLoading:p}=fB(),v=d,[b,y]=C.useState(!1),m=v.find(F=>F.id==="mock"),g=v.find(F=>F._wallet.id==="email"),S=v.filter(F=>!!a.find(H=>H===F._wallet.id)).sort((F,j)=>a.indexOf(F._wallet.id)-a.indexOf(j._wallet.id)),P=v.filter(F=>!!o.find(H=>H===F._wallet.id)).sort((F,j)=>o.indexOf(F._wallet.id)-o.indexOf(j._wallet.id));S.length>4;const T=F=>{f(F.target.value)};C.useEffect(()=>{e&&c&&l(!1)},[e,c]);const w=F=>{if(i.useMock&&m){h({connector:m});return}if(F._wallet.id==="email"){const j=prompt("Auto-email login, please specify the email address:");localStorage.setItem(O5,j||"")}h({connector:F})},I=F=>{if(i.useMock&&m){h({connector:m});return}F.preventDefault(),localStorage.setItem(O5,u),h({connector:g})};return b?x.createElement(x.Fragment,null,x.createElement(z,{as:"button",position:"absolute",style:{top:"20px"},onClick:()=>y(!1),className:tm},x.createElement(Vg,null)),x.createElement(Jxe,{connectors:S,onConnect:w})):x.createElement(x.Fragment,null,x.createElement(Xxe,{config:n}),x.createElement(z,{marginTop:"5"},g&&s&&x.createElement(x.Fragment,null,x.createElement("form",{onSubmit:I},x.createElement($c,{onChange:T,value:u,name:"email",placeholder:"Enter email","data-1p-ignore":!0}),x.createElement(rt,{type:"submit",disabled:!tCe(u),marginTop:"4",width:"full",label:"Continue",rightIcon:Lo}))),P.length>0&&x.createElement(x.Fragment,null,g&&s&&x.createElement(x.Fragment,null,x.createElement(z,{style:{marginBottom:"-4px"}},x.createElement(N0,{color:"backgroundSecondary"})),x.createElement(z,{justifyContent:"center",alignItems:"center"},x.createElement(ne,{variant:"small",color:"text50"},"or sign in via"))),x.createElement(z,{marginTop:"3",gap:"2",flexDirection:"row",justifyContent:"flex-start",alignItems:"center",flexWrap:"wrap"},P.map(F=>{const j=r==="dark"?F._wallet.monochromeLogoDark:F._wallet.monochromeLogoLight;return x.createElement(po,{key:F._wallet.id,className:tm,justifyContent:"center",alignItems:"center",onClick:()=>w(F),aspectRatio:"1/1",style:{width:`calc(25% - ${ve.space[2]})`}},x.createElement(z,{className:F5,flexDirection:"column",alignItems:"center",justifyContent:"center"},x.createElement(j,null)))}))),S.length>0&&x.createElement(x.Fragment,null,(g&&s||P.length>0)&&x.createElement(x.Fragment,null,x.createElement(z,{style:{marginBottom:"-4px"}},x.createElement(N0,{color:"backgroundSecondary"})),x.createElement(z,{justifyContent:"center",alignItems:"center"},x.createElement(ne,{variant:"small",color:"text50"},"or select a wallet"))),x.createElement(z,{marginTop:"3",gap:"2",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},S.map(F=>{const j=r==="dark"?F._wallet.logoDark||F._wallet.logoDark:F._wallet.logoLight||F._wallet.logoLight;return x.createElement(po,{key:F._wallet.id,className:tm,justifyContent:"center",alignItems:"center",onClick:()=>w(F),aspectRatio:"1/1",style:{width:`calc(25% - ${ve.space[2]})`}},x.createElement(z,{className:F5,flexDirection:"column",alignItems:"center",justifyContent:"center"},x.createElement(j,null)))})))))};function uCe(t){if(t==null)throw new TypeError("Cannot destructure "+t)}const fCe=t=>{let e=Ec({},(uCe(t),t));return x.createElement(x.Fragment,null,x.createElement("svg",Ec({xmlns:"http://www.w3.org/2000/svg",style:{fill:"none"},id:"svg1316",version:"1.1",viewBox:"0 0 396 396"},e),x.createElement("g",{transform:"translate(0,38)",id:"g1256",clipPath:"url(#clip0_5_131)"},x.createElement("g",{id:"g1254",clipPath:"url(#clip1_5_131)"},x.createElement("path",{style:{fill:"#111111"},id:"path1232",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),x.createElement("path",{style:{fill:"url(#paint0_linear_5_13"},id:"path1234",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),x.createElement("path",{style:{fill:"url(#paint1_linear_5_131"},id:"path1236",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),x.createElement("path",{style:{fill:"url(#paint2_linear_5_131)"},id:"path1238",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),x.createElement("path",{style:{fill:"url(#paint3_linear_5_131)"},id:"path1240",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),x.createElement("path",{style:{fill:"url(#paint4_linear_5_131)"},id:"path1242",d:"m 98.9999,238.126 c 0,-10.965 -8.8648,-19.854 -19.8,-19.854 -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.966 8.8648,19.855 19.8,19.855 10.9352,0 19.8,-8.889 19.8,-19.855 z"}),x.createElement("path",{style:{fill:"url(#paint5_linear_5_131)"},id:"path1244",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),x.createElement("path",{style:{fill:"url(#paint6_linear_5_131)"},id:"path1246",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),x.createElement("path",{style:{fill:"url(#paint7_linear_5_131)"},id:"path1248",d:"M 316.8,59.5632 H 158.4 c -10.935,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.865,19.8544 19.8,19.8544 h 158.4 c 10.935,0 19.8,-8.8892 19.8,-19.8544 0,-10.9653 -8.865,-19.8544 -19.8,-19.8544 z"}),x.createElement("path",{style:{fill:"url(#paint8_linear_5_131)"},id:"path1250",d:"M 316.8,218.272 H 158.4 c -10.935,0 -19.8,8.889 -19.8,19.854 0,10.966 8.865,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.889 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}),x.createElement("path",{style:{fill:"url(#paint9_linear_5_131)"},id:"path1252",d:"M 237.6,138.981 H 79.2 c -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.965 8.8648,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.89 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}))),x.createElement("defs",{id:"defs1314"},x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"318",x2:"198",y1:"4.0585401e-05",x1:"198",id:"paint0_linear_5_131"},x.createElement("stop",{id:"stop1258",stopColor:"#1D273D"}),x.createElement("stop",{id:"stop1260",stopColor:"#0D0F13",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"63",x2:"92.5",y1:"99",x1:"65.5",id:"paint1_linear_5_131"},x.createElement("stop",{id:"stop1263",stopColor:"#4462FE"}),x.createElement("stop",{id:"stop1265",stopColor:"#7D69FA",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint2_linear_5_131"},x.createElement("stop",{id:"stop1268",stopColor:"#3757FD"}),x.createElement("stop",{id:"stop1270",stopColor:"#6980FA",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint3_linear_5_131"},x.createElement("stop",{id:"stop1273",stopColor:"#2447FF"}),x.createElement("stop",{id:"stop1275",stopColor:"#6980FA",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"223.5",x2:"91.5",y1:"251.5",x1:"65",id:"paint4_linear_5_131"},x.createElement("stop",{id:"stop1278",stopColor:"#BC3EE6"}),x.createElement("stop",{id:"stop1280",stopColor:"#D972F1",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"146",x2:"329.5",y1:"172",x1:"305",id:"paint5_linear_5_131"},x.createElement("stop",{id:"stop1283",stopColor:"#29BDFF"}),x.createElement("stop",{id:"stop1285",stopColor:"#96E7FB",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"176.772",x2:"334.56699",y1:"178.418",x1:"300.17999",id:"paint6_linear_5_131"},x.createElement("stop",{id:"stop1288",stopColor:"#23BBFF"}),x.createElement("stop",{id:"stop1290",stopColor:"#85E7FF",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"60",x2:"317.5",y1:"99",x1:"154.5",id:"paint7_linear_5_131"},x.createElement("stop",{id:"stop1293",stopColor:"#23BBFF"}),x.createElement("stop",{id:"stop1295",stopColor:"#85E7FF",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"218",x2:"312.5",y1:"258",x1:"156",id:"paint8_linear_5_131"},x.createElement("stop",{id:"stop1298",stopColor:"#2447FF"}),x.createElement("stop",{id:"stop1300",stopColor:"#6980FA",offset:"1"})),x.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"139",x2:"235.5",y1:"179",x1:"86.000099",id:"paint9_linear_5_131"},x.createElement("stop",{id:"stop1303",stopColor:"#6634FF"}),x.createElement("stop",{id:"stop1305",stopColor:"#9C6DFF",offset:"1"})),x.createElement("clipPath",{id:"clip0_5_131"},x.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1308",height:"317.67001",width:"396"})),x.createElement("clipPath",{id:"clip1_5_131"},x.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1311",height:"317.67001",width:"396"})))))},[dCe,hCe]=uu(),[pCe,vCe]=uu(),[mCe,yCe]=uu(),gCe={dark:"dark",light:"light"},bCe=t=>{const{config:e={},children:r}=t,{projectAccessKey:n,defaultTheme:i="dark",signIn:s={},position:o="center",displayedAssets:a=[],ethAuth:c={}}=e,l=s.projectName||"app",{expiry:u=Nz,app:f=l,origin:d=location.origin,nonce:h}=c,{projectName:p}=s,[v,b]=C.useState(!1),[y,m]=C.useState(i||gCe.dark),[g,S]=C.useState(o),[P,T]=C.useState(a),w=()=>{window.open("https://sequence.xyz")};return C.useEffect(()=>{n?localStorage.setItem(gn.ProjectAccessKey,n):localStorage.removeItem(gn.ProjectAccessKey)},[n]),C.useEffect(()=>{y!==i&&m(i)},[i]),C.useEffect(()=>{g!==o&&S(o)},[o]),C.useEffect(()=>{typeof y=="object"||localStorage.setItem(gn.Theme,y),localStorage.setItem(gn.EthAuthSettings,JSON.stringify({expiry:u,app:f,origin:d,nonce:h}))},[y,c]),C.useEffect(()=>{T(P)},[a]),x.createElement(vCe,{value:{theme:y,setTheme:m,position:g,setPosition:S}},x.createElement(hCe,{value:{setOpenConnectModal:b,openConnectModalState:v}},x.createElement(yCe,{value:{setDisplayedAssets:T,displayedAssets:P}},x.createElement("div",{id:"kit-provider"},x.createElement(rb,{root:"#kit-provider",scope:"kit",theme:y},x.createElement(Ug,null,v&&x.createElement(dS,{scroll:!1,backdropColor:"backgroundBackdrop",size:"sm",contentProps:{style:Ec({maxWidth:"364px"},vk(o))},onClose:()=>b(!1)},x.createElement(z,{padding:"4",className:pk},x.createElement(z,{justifyContent:"center",color:"text100",alignItems:"center",fontWeight:"medium",style:{marginTop:"4px"}},x.createElement(ne,null,"Sign in ",p?`to ${p}`:"")),x.createElement(lCe,Ec({openConnectModal:v,setOpenConnectModal:b},t)),x.createElement(z,{onClick:w,className:tm,gap:"1",marginTop:"2",flexDirection:"row",alignItems:"center",justifyContent:"center"},x.createElement(ne,{fontSize:"small",color:"text100"},"Powered by Sequence"),x.createElement(z,{height:"5",width:"5"},x.createElement(fCe,null)))))))),r)))},wCe=()=>{const{setOpenConnectModal:t,openConnectModalState:e}=dCe();return{setOpenConnectModal:t,openConnectModalState:e}},ap=()=>{const{setTheme:t,theme:e,position:r,setPosition:n}=pCe();return{setTheme:t,theme:e,position:r,setPosition:n}},ECe=()=>{const{setDisplayedAssets:t,displayedAssets:e}=mCe();return{displayedAssets:e,setDisplayedAssets:t}};function xCe(t,e,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),e!==void 0&&(t=t>=e?t:e)),t}var Lz=xCe;function CCe(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r-1&&t%1==0&&t-1&&t%1==0&&t<=A5e}var Vz=_5e,P5e=rw,T5e=Vz,I5e=nw,O5e="[object Arguments]",R5e="[object Array]",$5e="[object Boolean]",M5e="[object Date]",N5e="[object Error]",D5e="[object Function]",L5e="[object Map]",F5e="[object Number]",B5e="[object Object]",j5e="[object RegExp]",U5e="[object Set]",z5e="[object String]",W5e="[object WeakMap]",H5e="[object ArrayBuffer]",q5e="[object DataView]",V5e="[object Float32Array]",G5e="[object Float64Array]",K5e="[object Int8Array]",Q5e="[object Int16Array]",Y5e="[object Int32Array]",J5e="[object Uint8Array]",X5e="[object Uint8ClampedArray]",Z5e="[object Uint16Array]",e6e="[object Uint32Array]",zt={};zt[V5e]=zt[G5e]=zt[K5e]=zt[Q5e]=zt[Y5e]=zt[J5e]=zt[X5e]=zt[Z5e]=zt[e6e]=!0;zt[O5e]=zt[R5e]=zt[H5e]=zt[$5e]=zt[q5e]=zt[M5e]=zt[N5e]=zt[D5e]=zt[L5e]=zt[F5e]=zt[B5e]=zt[j5e]=zt[U5e]=zt[z5e]=zt[W5e]=!1;function t6e(t){return I5e(t)&&T5e(t.length)&&!!zt[P5e(t)]}var r6e=t6e;function n6e(t){return function(e){return t(e)}}var i6e=n6e,Qy={exports:{}};Qy.exports;(function(t,e){var r=Bz,n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===n,o=s&&r.process,a=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();t.exports=a})(Qy,Qy.exports);var s6e=Qy.exports,o6e=r6e,a6e=i6e,aI=s6e,cI=aI&&aI.isTypedArray,c6e=cI?a6e(cI):o6e,l6e=c6e,u6e=zCe,f6e=g5e,d6e=Hz,h6e=x5e,p6e=qz,v6e=l6e,m6e=Object.prototype,y6e=m6e.hasOwnProperty;function g6e(t,e){var r=d6e(t),n=!r&&f6e(t),i=!r&&!n&&h6e(t),s=!r&&!n&&!i&&v6e(t),o=r||n||i||s,a=o?u6e(t.length,String):[],c=a.length;for(var l in t)(e||y6e.call(t,l))&&!(o&&(l=="length"||i&&(l=="offset"||l=="parent")||s&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||p6e(l,c)))&&a.push(l);return a}var b6e=g6e,w6e=Object.prototype;function E6e(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||w6e;return t===r}var x6e=E6e;function C6e(t,e){return function(r){return t(e(r))}}var S6e=C6e,k6e=S6e,A6e=k6e(Object.keys,Object),_6e=A6e,P6e=x6e,T6e=_6e,I6e=Object.prototype,O6e=I6e.hasOwnProperty;function R6e(t){if(!P6e(t))return T6e(t);var e=[];for(var r in Object(t))O6e.call(t,r)&&r!="constructor"&&e.push(r);return e}var $6e=R6e;function M6e(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var mk=M6e,N6e=rw,D6e=mk,L6e="[object AsyncFunction]",F6e="[object Function]",B6e="[object GeneratorFunction]",j6e="[object Proxy]";function U6e(t){if(!D6e(t))return!1;var e=N6e(t);return e==F6e||e==B6e||e==L6e||e==j6e}var z6e=U6e,W6e=z6e,H6e=Vz;function q6e(t){return t!=null&&H6e(t.length)&&!W6e(t)}var Gz=q6e,V6e=b6e,G6e=$6e,K6e=Gz;function Q6e(t){return K6e(t)?V6e(t):G6e(t)}var Y6e=Q6e,J6e=jCe,X6e=Y6e;function Z6e(t){return t==null?[]:J6e(t,X6e(t))}var e3e=Z6e,t3e=Lz,r3e=Fz,n3e=e3e;function i3e(t,e){var r=n3e(t);return r3e(r,t3e(e,0,r.length))}var s3e=i3e;function o3e(t,e){return t===e||t!==t&&e!==e}var a3e=o3e,c3e=a3e,l3e=Gz,u3e=qz,f3e=mk;function d3e(t,e,r){if(!f3e(r))return!1;var n=typeof e;return(n=="number"?l3e(r)&&u3e(e,r.length):n=="string"&&e in r)?c3e(r[e],t):!1}var h3e=d3e,p3e=/\s/;function v3e(t){for(var e=t.length;e--&&p3e.test(t.charAt(e)););return e}var m3e=v3e,y3e=m3e,g3e=/^\s+/;function b3e(t){return t&&t.slice(0,y3e(t)+1).replace(g3e,"")}var w3e=b3e,E3e=rw,x3e=nw,C3e="[object Symbol]";function S3e(t){return typeof t=="symbol"||x3e(t)&&E3e(t)==C3e}var k3e=S3e,A3e=w3e,lI=mk,_3e=k3e,uI=0/0,P3e=/^[-+]0x[0-9a-f]+$/i,T3e=/^0b[01]+$/i,I3e=/^0o[0-7]+$/i,O3e=parseInt;function R3e(t){if(typeof t=="number")return t;if(_3e(t))return uI;if(lI(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=lI(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=A3e(t);var r=T3e.test(t);return r||I3e.test(t)?O3e(t.slice(2),r?2:8):P3e.test(t)?uI:+t}var $3e=R3e,M3e=$3e,fI=1/0,N3e=17976931348623157e292;function D3e(t){if(!t)return t===0?t:0;if(t=M3e(t),t===fI||t===-fI){var e=t<0?-1:1;return e*N3e}return t===t?t:0}var L3e=D3e,F3e=L3e;function B3e(t){var e=F3e(t),r=e%1;return e===e?r?e-r:e:0}var j3e=B3e,U3e=NCe,z3e=s3e,W3e=Hz,H3e=h3e,q3e=j3e;function V3e(t,e,r){(r?H3e(t,e,r):e===void 0)?e=1:e=q3e(e);var n=W3e(t)?U3e:z3e;return n(t,e)}var G3e=V3e;const K3e=Ps(G3e);var iw={},Q3e=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,r=[],n=0;n"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var f=dI[e.format]||dI.default;window.clipboardData.setData(f,t)}else u.clipboardData.clearData(),u.clipboardData.setData(e.format,t);e.onCopy&&(u.preventDefault(),e.onCopy(u.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");c=!0}catch(u){r&&console.error("unable to copy using execCommand: ",u),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),c=!0}catch(f){r&&console.error("unable to copy using clipboardData: ",f),r&&console.error("falling back to prompt"),n=X3e("message"in e?e.message:J3e),window.prompt(n,t)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),i()}return c}var eSe=Z3e;function j5(t){"@babel/helpers - typeof";return j5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j5(t)}Object.defineProperty(iw,"__esModule",{value:!0});iw.CopyToClipboard=void 0;var av=Kz(C),tSe=Kz(eSe),rSe=["text","onCopy","options","children"];function Kz(t){return t&&t.__esModule?t:{default:t}}function hI(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function pI(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function iSe(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s=0)&&(r[i]=t[i]);return r}function sSe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vI(t,e){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Yy(t){return Yy=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Yy(t)}function yk(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Yz=function(t){aSe(r,t);var e=cSe(r);function r(){var n;sSe(this,r);for(var i=arguments.length,s=new Array(i),o=0;oe in t?dSe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,h1=(t,e)=>{for(var r in e||(e={}))Xz.call(e,r)&&mI(t,r,e[r]);if(Jy)for(var r of Jy(e))Zz.call(e,r)&&mI(t,r,e[r]);return t},gk=(t,e)=>{var r={};for(var n in t)Xz.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Jy)for(var n of Jy(t))e.indexOf(n)<0&&Zz.call(t,n)&&(r[n]=t[n]);return r};/** * @license QR Code generator library (TypeScript) * Copyright (c) Project Nayuki. * SPDX-License-Identifier: MIT - */var ql;(t=>{const e=class{constructor(c,l,u,f){if(this.version=c,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],ce.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let d=[];for(let p=0;p7)throw new RangeError("Invalid value");let p,v;for(p=u;;p++){const g=e.getNumDataCodewords(p,l)*8,S=a.getTotalBits(c,p);if(S<=g){v=S;break}if(p>=f)throw new RangeError("Data too long")}for(const g of[e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])h&&v<=e.getNumDataCodewords(p,g)*8&&(l=g);let b=[];for(const g of c){n(g.mode.modeBits,4,b),n(g.numChars,g.mode.numCharCountBits(p),b);for(const S of g.getData())b.push(S)}s(b.length==v);const y=e.getNumDataCodewords(p,l)*8;s(b.length<=y),n(0,Math.min(4,y-b.length),b),n(0,(8-b.length%8)%8,b),s(b.length%8==0);for(let g=236;b.lengthm[S>>>3]|=g<<7-(S&7)),new e(p,l,m,d)}getModule(c,l){return 0<=c&&c>>9)*1335;const f=(l<<10|u)^21522;s(f>>>15==0);for(let d=0;d<=5;d++)this.setFunctionModule(8,d,i(f,d));this.setFunctionModule(8,7,i(f,6)),this.setFunctionModule(8,8,i(f,7)),this.setFunctionModule(7,8,i(f,8));for(let d=9;d<15;d++)this.setFunctionModule(14-d,8,i(f,d));for(let d=0;d<8;d++)this.setFunctionModule(this.size-1-d,8,i(f,d));for(let d=8;d<15;d++)this.setFunctionModule(8,this.size-15+d,i(f,d));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let c=this.version;for(let u=0;u<12;u++)c=c<<1^(c>>>11)*7973;const l=this.version<<12|c;s(l>>>18==0);for(let u=0;u<18;u++){const f=i(l,u),d=this.size-11+u%3,h=Math.floor(u/3);this.setFunctionModule(d,h,f),this.setFunctionModule(h,d,f)}}drawFinderPattern(c,l){for(let u=-4;u<=4;u++)for(let f=-4;f<=4;f++){const d=Math.max(Math.abs(f),Math.abs(u)),h=c+f,p=l+u;0<=h&&h{(g!=v-d||P>=p)&&m.push(S[g])});return s(m.length==h),m}drawCodewords(c){if(c.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let f=0;f>>3],7-(l&7)),l++)}}s(l==c.length*8)}applyMask(c){if(c<0||c>7)throw new RangeError("Mask value out of range");for(let l=0;l5&&c++):(this.finderPenaltyAddHistory(p,v),h||(c+=this.finderPenaltyCountPatterns(v)*e.PENALTY_N3),h=this.modules[d][b],p=1);c+=this.finderPenaltyTerminateAndCount(h,p,v)*e.PENALTY_N3}for(let d=0;d5&&c++):(this.finderPenaltyAddHistory(p,v),h||(c+=this.finderPenaltyCountPatterns(v)*e.PENALTY_N3),h=this.modules[b][d],p=1);c+=this.finderPenaltyTerminateAndCount(h,p,v)*e.PENALTY_N3}for(let d=0;dh+(p?1:0),l);const u=this.size*this.size,f=Math.ceil(Math.abs(l*20-u*10)/u)-1;return s(0<=f&&f<=9),c+=f*e.PENALTY_N4,s(0<=c&&c<=2568888),c}getAlignmentPatternPositions(){if(this.version==1)return[];{const c=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(c*2-2))*2;let u=[6];for(let f=this.size-7;u.lengthe.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*c+128)*c+64;if(c>=2){const u=Math.floor(c/7)+2;l-=(25*u-10)*u-55,c>=7&&(l-=36)}return s(208<=l&&l<=29648),l}static getNumDataCodewords(c,l){return Math.floor(e.getNumRawDataModules(c)/8)-e.ECC_CODEWORDS_PER_BLOCK[l.ordinal][c]*e.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][c]}static reedSolomonComputeDivisor(c){if(c<1||c>255)throw new RangeError("Degree out of range");let l=[];for(let f=0;f0);for(const f of c){const d=f^u.shift();u.push(0),l.forEach((h,p)=>u[p]^=e.reedSolomonMultiply(h,d))}return u}static reedSolomonMultiply(c,l){if(c>>>8||l>>>8)throw new RangeError("Byte out of range");let u=0;for(let f=7;f>=0;f--)u=u<<1^(u>>>7)*285,u^=(l>>>f&1)*c;return s(u>>>8==0),u}finderPenaltyCountPatterns(c){const l=c[1];s(l<=this.size*3);const u=l>0&&c[2]==l&&c[3]==l*3&&c[4]==l&&c[5]==l;return(u&&c[0]>=l*4&&c[6]>=l?1:0)+(u&&c[6]>=l*4&&c[0]>=l?1:0)}finderPenaltyTerminateAndCount(c,l,u){return c&&(this.finderPenaltyAddHistory(l,u),l=0),l+=this.size,this.finderPenaltyAddHistory(l,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(c,l){l[0]==0&&(c+=this.size),l.pop(),l.unshift(c)}};let r=e;r.MIN_VERSION=1,r.MAX_VERSION=40,r.PENALTY_N1=3,r.PENALTY_N2=3,r.PENALTY_N3=40,r.PENALTY_N4=10,r.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],r.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],t.QrCode=r;function n(c,l,u){if(l<0||l>31||c>>>l)throw new RangeError("Value out of range");for(let f=l-1;f>=0;f--)u.push(c>>>f&1)}function i(c,l){return(c>>>l&1)!=0}function s(c){if(!c)throw new Error("Assertion error")}const o=class{constructor(c,l,u){if(this.mode=c,this.numChars=l,this.bitData=u,l<0)throw new RangeError("Invalid argument");this.bitData=u.slice()}static makeBytes(c){let l=[];for(const u of c)n(u,8,l);return new o(o.Mode.BYTE,c.length,l)}static makeNumeric(c){if(!o.isNumeric(c))throw new RangeError("String contains non-numeric characters");let l=[];for(let u=0;u=1<{(e=>{const r=class{constructor(i,s){this.ordinal=i,this.formatBits=s}};let n=r;n.LOW=new r(0,1),n.MEDIUM=new r(1,0),n.QUARTILE=new r(2,3),n.HIGH=new r(3,2),e.Ecc=n})(t.QrCode||(t.QrCode={}))})(ql||(ql={}));(t=>{(e=>{const r=class{constructor(i,s){this.modeBits=i,this.numBitsCharCount=s}numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}};let n=r;n.NUMERIC=new r(1,[10,12,14]),n.ALPHANUMERIC=new r(2,[9,11,13]),n.BYTE=new r(4,[8,16,16]),n.KANJI=new r(8,[8,10,12]),n.ECI=new r(7,[0,0,0]),e.Mode=n})(t.QrSegment||(t.QrSegment={}))})(ql||(ql={}));var Zu=ql;/** + */var Vl;(t=>{const e=class{constructor(c,l,u,f){if(this.version=c,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],ce.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let d=[];for(let p=0;p7)throw new RangeError("Invalid value");let p,v;for(p=u;;p++){const g=e.getNumDataCodewords(p,l)*8,S=a.getTotalBits(c,p);if(S<=g){v=S;break}if(p>=f)throw new RangeError("Data too long")}for(const g of[e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])h&&v<=e.getNumDataCodewords(p,g)*8&&(l=g);let b=[];for(const g of c){n(g.mode.modeBits,4,b),n(g.numChars,g.mode.numCharCountBits(p),b);for(const S of g.getData())b.push(S)}s(b.length==v);const y=e.getNumDataCodewords(p,l)*8;s(b.length<=y),n(0,Math.min(4,y-b.length),b),n(0,(8-b.length%8)%8,b),s(b.length%8==0);for(let g=236;b.lengthm[S>>>3]|=g<<7-(S&7)),new e(p,l,m,d)}getModule(c,l){return 0<=c&&c>>9)*1335;const f=(l<<10|u)^21522;s(f>>>15==0);for(let d=0;d<=5;d++)this.setFunctionModule(8,d,i(f,d));this.setFunctionModule(8,7,i(f,6)),this.setFunctionModule(8,8,i(f,7)),this.setFunctionModule(7,8,i(f,8));for(let d=9;d<15;d++)this.setFunctionModule(14-d,8,i(f,d));for(let d=0;d<8;d++)this.setFunctionModule(this.size-1-d,8,i(f,d));for(let d=8;d<15;d++)this.setFunctionModule(8,this.size-15+d,i(f,d));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let c=this.version;for(let u=0;u<12;u++)c=c<<1^(c>>>11)*7973;const l=this.version<<12|c;s(l>>>18==0);for(let u=0;u<18;u++){const f=i(l,u),d=this.size-11+u%3,h=Math.floor(u/3);this.setFunctionModule(d,h,f),this.setFunctionModule(h,d,f)}}drawFinderPattern(c,l){for(let u=-4;u<=4;u++)for(let f=-4;f<=4;f++){const d=Math.max(Math.abs(f),Math.abs(u)),h=c+f,p=l+u;0<=h&&h{(g!=v-d||P>=p)&&m.push(S[g])});return s(m.length==h),m}drawCodewords(c){if(c.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let f=0;f>>3],7-(l&7)),l++)}}s(l==c.length*8)}applyMask(c){if(c<0||c>7)throw new RangeError("Mask value out of range");for(let l=0;l5&&c++):(this.finderPenaltyAddHistory(p,v),h||(c+=this.finderPenaltyCountPatterns(v)*e.PENALTY_N3),h=this.modules[d][b],p=1);c+=this.finderPenaltyTerminateAndCount(h,p,v)*e.PENALTY_N3}for(let d=0;d5&&c++):(this.finderPenaltyAddHistory(p,v),h||(c+=this.finderPenaltyCountPatterns(v)*e.PENALTY_N3),h=this.modules[b][d],p=1);c+=this.finderPenaltyTerminateAndCount(h,p,v)*e.PENALTY_N3}for(let d=0;dh+(p?1:0),l);const u=this.size*this.size,f=Math.ceil(Math.abs(l*20-u*10)/u)-1;return s(0<=f&&f<=9),c+=f*e.PENALTY_N4,s(0<=c&&c<=2568888),c}getAlignmentPatternPositions(){if(this.version==1)return[];{const c=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(c*2-2))*2;let u=[6];for(let f=this.size-7;u.lengthe.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*c+128)*c+64;if(c>=2){const u=Math.floor(c/7)+2;l-=(25*u-10)*u-55,c>=7&&(l-=36)}return s(208<=l&&l<=29648),l}static getNumDataCodewords(c,l){return Math.floor(e.getNumRawDataModules(c)/8)-e.ECC_CODEWORDS_PER_BLOCK[l.ordinal][c]*e.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][c]}static reedSolomonComputeDivisor(c){if(c<1||c>255)throw new RangeError("Degree out of range");let l=[];for(let f=0;f0);for(const f of c){const d=f^u.shift();u.push(0),l.forEach((h,p)=>u[p]^=e.reedSolomonMultiply(h,d))}return u}static reedSolomonMultiply(c,l){if(c>>>8||l>>>8)throw new RangeError("Byte out of range");let u=0;for(let f=7;f>=0;f--)u=u<<1^(u>>>7)*285,u^=(l>>>f&1)*c;return s(u>>>8==0),u}finderPenaltyCountPatterns(c){const l=c[1];s(l<=this.size*3);const u=l>0&&c[2]==l&&c[3]==l*3&&c[4]==l&&c[5]==l;return(u&&c[0]>=l*4&&c[6]>=l?1:0)+(u&&c[6]>=l*4&&c[0]>=l?1:0)}finderPenaltyTerminateAndCount(c,l,u){return c&&(this.finderPenaltyAddHistory(l,u),l=0),l+=this.size,this.finderPenaltyAddHistory(l,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(c,l){l[0]==0&&(c+=this.size),l.pop(),l.unshift(c)}};let r=e;r.MIN_VERSION=1,r.MAX_VERSION=40,r.PENALTY_N1=3,r.PENALTY_N2=3,r.PENALTY_N3=40,r.PENALTY_N4=10,r.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],r.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],t.QrCode=r;function n(c,l,u){if(l<0||l>31||c>>>l)throw new RangeError("Value out of range");for(let f=l-1;f>=0;f--)u.push(c>>>f&1)}function i(c,l){return(c>>>l&1)!=0}function s(c){if(!c)throw new Error("Assertion error")}const o=class{constructor(c,l,u){if(this.mode=c,this.numChars=l,this.bitData=u,l<0)throw new RangeError("Invalid argument");this.bitData=u.slice()}static makeBytes(c){let l=[];for(const u of c)n(u,8,l);return new o(o.Mode.BYTE,c.length,l)}static makeNumeric(c){if(!o.isNumeric(c))throw new RangeError("String contains non-numeric characters");let l=[];for(let u=0;u=1<{(e=>{const r=class{constructor(i,s){this.ordinal=i,this.formatBits=s}};let n=r;n.LOW=new r(0,1),n.MEDIUM=new r(1,0),n.QUARTILE=new r(2,3),n.HIGH=new r(3,2),e.Ecc=n})(t.QrCode||(t.QrCode={}))})(Vl||(Vl={}));(t=>{(e=>{const r=class{constructor(i,s){this.modeBits=i,this.numBitsCharCount=s}numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}};let n=r;n.NUMERIC=new r(1,[10,12,14]),n.ALPHANUMERIC=new r(2,[9,11,13]),n.BYTE=new r(4,[8,16,16]),n.KANJI=new r(8,[8,10,12]),n.ECI=new r(7,[0,0,0]),e.Mode=n})(t.QrSegment||(t.QrSegment={}))})(Vl||(Vl={}));var tf=Vl;/** * @license qrcode.react * Copyright (c) Paul O'Shannessy * SPDX-License-Identifier: ISC - */var Sz={L:Zu.QrCode.Ecc.LOW,M:Zu.QrCode.Ecc.MEDIUM,Q:Zu.QrCode.Ecc.QUARTILE,H:Zu.QrCode.Ecc.HIGH},kz=128,Az="L",_z="#FFFFFF",Pz="#000000",Tz=!1,lk=4,I3e=.1;function Iz(t,e=0){const r=[];return t.forEach(function(n,i){let s=null;n.forEach(function(o,a){if(!o&&s!==null){r.push(`M${s+e} ${i+e}h${a-s}v1H${s+e}z`),s=null;return}if(a===n.length-1){if(!o)return;s===null?r.push(`M${a+e},${i+e} h1v1H${a+e}z`):r.push(`M${s+e},${i+e} h${a+1-s}v1H${s+e}z`);return}o&&s===null&&(s=a)})}),r.join("")}function Oz(t,e){return t.slice().map((r,n)=>n=e.y+e.h?r:r.map((i,s)=>s=e.x+e.w?i:!1))}function Rz(t,e,r,n){if(n==null)return null;const i=r?lk:0,s=t.length+i*2,o=Math.floor(e*I3e),a=s/e,c=(n.width||o)*a,l=(n.height||o)*a,u=n.x==null?t.length/2-c/2:n.x*a,f=n.y==null?t.length/2-l/2:n.y*a;let d=null;if(n.excavate){let h=Math.floor(u),p=Math.floor(f),v=Math.ceil(c+u-h),b=Math.ceil(l+f-p);d={x:h,y:p,w:v,h:b}}return{x:u,y:f,h:l,w:c,excavation:d}}var O3e=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function R3e(t){const e=t,{value:r,size:n=kz,level:i=Az,bgColor:s=_z,fgColor:o=Pz,includeMargin:a=Tz,style:c,imageSettings:l}=e,u=ck(e,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),f=l==null?void 0:l.src,d=C.useRef(null),h=C.useRef(null),[p,v]=C.useState(!1);C.useEffect(()=>{if(d.current!=null){const m=d.current,g=m.getContext("2d");if(!g)return;let S=Zu.QrCode.encodeText(r,Sz[i]).getModules();const P=a?lk:0,T=S.length+P*2,w=Rz(S,n,a,l),I=h.current,B=w!=null&&I!==null&&I.complete&&I.naturalHeight!==0&&I.naturalWidth!==0;B&&w.excavation!=null&&(S=Oz(S,w.excavation));const j=window.devicePixelRatio||1;m.height=m.width=n*j;const H=n/T*j;g.scale(H,H),g.fillStyle=s,g.fillRect(0,0,T,T),g.fillStyle=o,O3e?g.fill(new Path2D(Iz(S,P))):S.forEach(function(K,F){K.forEach(function(E,_){E&&g.fillRect(_+P,F+P,1,1)})}),B&&g.drawImage(I,w.x+P,w.y+P,w.w,w.h)}}),C.useEffect(()=>{v(!1)},[f]);const b=u1({height:n,width:n},c);let y=null;return f!=null&&(y=x.createElement("img",{src:f,key:f,style:{display:"none"},onLoad:()=>{v(!0)},ref:h})),x.createElement(x.Fragment,null,x.createElement("canvas",u1({style:b,height:n,width:n,ref:d},u)),y)}function M3e(t){const e=t,{value:r,size:n=kz,level:i=Az,bgColor:s=_z,fgColor:o=Pz,includeMargin:a=Tz,imageSettings:c}=e,l=ck(e,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let u=Zu.QrCode.encodeText(r,Sz[i]).getModules();const f=a?lk:0,d=u.length+f*2,h=Rz(u,n,a,c);let p=null;c!=null&&h!=null&&(h.excavation!=null&&(u=Oz(u,h.excavation)),p=x.createElement("image",{xlinkHref:c.src,height:h.h,width:h.w,x:h.x+f,y:h.y+f,preserveAspectRatio:"none"}));const v=Iz(u,f);return x.createElement("svg",u1({height:n,width:n,viewBox:`0 0 ${d} ${d}`},l),x.createElement("path",{fill:s,d:`M0,0 h${d}v${d}H0z`,shapeRendering:"crispEdges"}),x.createElement("path",{fill:o,d:v,shapeRendering:"crispEdges"}),p)}var $3e=t=>{const e=t,{renderAs:r}=e,n=ck(e,["renderAs"]);return r==="svg"?x.createElement(M3e,u1({},n)):x.createElement(R3e,u1({},n))},Mz={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(ul,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",l="day",u="week",f="month",d="quarter",h="year",p="date",v="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(E){var _=["th","st","nd","rd"],O=E%100;return"["+E+(_[(O-20)%10]||_[O]||_[0])+"]"}},g=function(E,_,O){var N=String(E);return!N||N.length>=_?E:""+Array(_+1-N.length).join(O)+E},S={s:g,z:function(E){var _=-E.utcOffset(),O=Math.abs(_),N=Math.floor(O/60),k=O%60;return(_<=0?"+":"-")+g(N,2,"0")+":"+g(k,2,"0")},m:function E(_,O){if(_.date()1)return E(L[0])}else{var $=_.name;T[$]=_,k=$}return!N&&k&&(P=k),k||!N&&P},j=function(E,_){if(I(E))return E.clone();var O=typeof _=="object"?_:{};return O.date=E,O.args=arguments,new K(O)},H=S;H.l=B,H.i=I,H.w=function(E,_){return j(E,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var K=function(){function E(O){this.$L=B(O.locale,null,!0),this.parse(O),this.$x=this.$x||O.x||{},this[w]=!0}var _=E.prototype;return _.parse=function(O){this.$d=function(N){var k=N.date,M=N.utc;if(k===null)return new Date(NaN);if(H.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var L=k.match(b);if(L){var $=L[2]-1||0,A=(L[7]||"0").substring(0,3);return M?new Date(Date.UTC(L[1],$,L[3]||1,L[4]||0,L[5]||0,L[6]||0,A)):new Date(L[1],$,L[3]||1,L[4]||0,L[5]||0,L[6]||0,A)}}return new Date(k)}(O),this.init()},_.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},_.$utils=function(){return H},_.isValid=function(){return this.$d.toString()!==v},_.isSame=function(O,N){var k=j(O);return this.startOf(N)<=k&&k<=this.endOf(N)},_.isAfter=function(O,N){return j(O)`Invalid value for key ${t}`,W3e=t=>`Pattern length exceeds max of ${t}.`,H3e=t=>`Missing ${t} property in key`,q3e=t=>`Property 'weight' in key '${t}' must be a positive integer`,oI=Object.prototype.hasOwnProperty;class V3e{constructor(e){this._keys=[],this._keyMap={};let r=0;e.forEach(n=>{let i=Bz(n);r+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,r+=i.weight}),this._keys.forEach(n=>{n.weight/=r})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Bz(t){let e=null,r=null,n=null,i=1,s=null;if(Js(t)||ea(t))n=t,e=aI(t),r=N5(t);else{if(!oI.call(t,"name"))throw new Error(H3e("name"));const o=t.name;if(n=o,oI.call(t,"weight")&&(i=t.weight,i<=0))throw new Error(q3e(o));e=aI(o),r=N5(o),s=t.getFn}return{path:e,id:r,weight:i,src:n,getFn:s}}function aI(t){return ea(t)?t:t.split(".")}function N5(t){return ea(t)?t.join("."):t}function G3e(t,e){let r=[],n=!1;const i=(s,o,a)=>{if(fi(s))if(!o[a])r.push(s);else{let c=o[a];const l=s[c];if(!fi(l))return;if(a===o.length-1&&(Js(l)||Nz(l)||F3e(l)))r.push(B3e(l));else if(ea(l)){n=!0;for(let u=0,f=l.length;ut.score===e.score?t.idx{this._keysMap[r.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Js(this.docs[0])?this.docs.forEach((e,r)=>{this._addString(e,r)}):this.docs.forEach((e,r)=>{this._addObject(e,r)}),this.norm.clear())}add(e){const r=this.size();Js(e)?this._addString(e,r):this._addObject(e,r)}removeAt(e){this.records.splice(e,1);for(let r=e,n=this.size();r{let o=i.getFn?i.getFn(e):this.getFn(e,i.path);if(fi(o)){if(ea(o)){let a=[];const c=[{nestedArrIndex:-1,value:o}];for(;c.length;){const{nestedArrIndex:l,value:u}=c.pop();if(fi(u))if(Js(u)&&!dE(u)){let f={v:u,i:l,n:this.norm.get(u)};a.push(f)}else ea(u)&&u.forEach((f,d)=>{c.push({nestedArrIndex:d,value:f})})}n.$[s]=a}else if(Js(o)&&!dE(o)){let a={v:o,n:this.norm.get(o)};n.$[s]=a}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function Fz(t,e,{getFn:r=Ce.getFn,fieldNormWeight:n=Ce.fieldNormWeight}={}){const i=new uk({getFn:r,fieldNormWeight:n});return i.setKeys(t.map(Bz)),i.setSources(e),i.create(),i}function eSe(t,{getFn:e=Ce.getFn,fieldNormWeight:r=Ce.fieldNormWeight}={}){const{keys:n,records:i}=t,s=new uk({getFn:e,fieldNormWeight:r});return s.setKeys(n),s.setIndexRecords(i),s}function nv(t,{errors:e=0,currentLocation:r=0,expectedLocation:n=0,distance:i=Ce.distance,ignoreLocation:s=Ce.ignoreLocation}={}){const o=e/t.length;if(s)return o;const a=Math.abs(n-r);return i?o+a/i:a?1:o}function tSe(t=[],e=Ce.minMatchCharLength){let r=[],n=-1,i=-1,s=0;for(let o=t.length;s=e&&r.push([n,i]),n=-1)}return t[s-1]&&s-n>=e&&r.push([n,s-1]),r}const ll=32;function rSe(t,e,r,{location:n=Ce.location,distance:i=Ce.distance,threshold:s=Ce.threshold,findAllMatches:o=Ce.findAllMatches,minMatchCharLength:a=Ce.minMatchCharLength,includeMatches:c=Ce.includeMatches,ignoreLocation:l=Ce.ignoreLocation}={}){if(e.length>ll)throw new Error(W3e(ll));const u=e.length,f=t.length,d=Math.max(0,Math.min(n,f));let h=s,p=d;const v=a>1||c,b=v?Array(f):[];let y;for(;(y=t.indexOf(e,p))>-1;){let w=nv(e,{currentLocation:y,expectedLocation:d,distance:i,ignoreLocation:l});if(h=Math.min(w,h),p=y+u,v){let I=0;for(;I=j;E-=1){let _=E-1,O=r[t.charAt(_)];if(v&&(b[_]=+!!O),K[E]=(K[E+1]<<1|1)&O,w&&(K[E]|=(m[E+1]|m[E])<<1|1|m[E+1]),K[E]&P&&(g=nv(e,{errors:w,currentLocation:_,expectedLocation:d,distance:i,ignoreLocation:l}),g<=h)){if(h=g,p=_,p<=d)break;j=Math.max(1,2*d-p)}}if(nv(e,{errors:w+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:l})>h)break;m=K}const T={isMatch:p>=0,score:Math.max(.001,g)};if(v){const w=tSe(b,a);w.length?c&&(T.indices=w):T.isMatch=!1}return T}function nSe(t){let e={};for(let r=0,n=t.length;r{this.chunks.push({pattern:d,alphabet:nSe(d),startIndex:h})},f=this.pattern.length;if(f>ll){let d=0;const h=f%ll,p=f-h;for(;d{const{isMatch:y,score:m,indices:g}=rSe(e,p,v,{location:i+b,distance:s,threshold:o,findAllMatches:a,minMatchCharLength:c,includeMatches:n,ignoreLocation:l});y&&(d=!0),f+=m,y&&g&&(u=[...u,...g])});let h={isMatch:d,score:d?f/this.chunks.length:1};return d&&n&&(h.indices=u),h}}class Bc{constructor(e){this.pattern=e}static isMultiMatch(e){return cI(e,this.multiRegex)}static isSingleMatch(e){return cI(e,this.singleRegex)}search(){}}function cI(t,e){const r=t.match(e);return r?r[1]:null}class iSe extends Bc{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const r=e===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class sSe extends Bc{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class oSe extends Bc{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const r=e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class aSe extends Bc{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const r=!e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class cSe extends Bc{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const r=e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class lSe extends Bc{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const r=!e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class Uz extends Bc{constructor(e,{location:r=Ce.location,threshold:n=Ce.threshold,distance:i=Ce.distance,includeMatches:s=Ce.includeMatches,findAllMatches:o=Ce.findAllMatches,minMatchCharLength:a=Ce.minMatchCharLength,isCaseSensitive:c=Ce.isCaseSensitive,ignoreLocation:l=Ce.ignoreLocation}={}){super(e),this._bitapSearch=new jz(e,{location:r,threshold:n,distance:i,includeMatches:s,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:c,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class zz extends Bc{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let r=0,n;const i=[],s=this.pattern.length;for(;(n=e.indexOf(this.pattern,r))>-1;)r=n+s,i.push([n,r-1]);const o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}}const D5=[iSe,zz,oSe,aSe,lSe,cSe,sSe,Uz],lI=D5.length,uSe=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,fSe="|";function dSe(t,e={}){return t.split(fSe).map(r=>{let n=r.trim().split(uSe).filter(s=>s&&!!s.trim()),i=[];for(let s=0,o=n.length;s!!(t[Vy.AND]||t[Vy.OR]),mSe=t=>!!t[F5.PATH],ySe=t=>!ea(t)&&Dz(t)&&!j5(t),uI=t=>({[Vy.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function Wz(t,e,{auto:r=!0}={}){const n=i=>{let s=Object.keys(i);const o=mSe(i);if(!o&&s.length>1&&!j5(i))return n(uI(i));if(ySe(i)){const c=o?i[F5.PATH]:s[0],l=o?i[F5.PATTERN]:i[c];if(!Js(l))throw new Error(z3e(c));const u={keyId:N5(c),pattern:l};return r&&(u.searcher=B5(l,e)),u}let a={children:[],operator:s[0]};return s.forEach(c=>{const l=i[c];ea(l)&&l.forEach(u=>{a.children.push(n(u))})}),a};return j5(t)||(t=uI(t)),n(t)}function gSe(t,{ignoreFieldNorm:e=Ce.ignoreFieldNorm}){t.forEach(r=>{let n=1;r.matches.forEach(({key:i,norm:s,score:o})=>{const a=i?i.weight:null;n*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:s))}),r.score=n})}function bSe(t,e){const r=t.matches;e.matches=[],fi(r)&&r.forEach(n=>{if(!fi(n.indices)||!n.indices.length)return;const{indices:i,value:s}=n;let o={indices:i,value:s};n.key&&(o.key=n.key.src),n.idx>-1&&(o.refIndex=n.idx),e.matches.push(o)})}function wSe(t,e){e.score=t.score}function ESe(t,e,{includeMatches:r=Ce.includeMatches,includeScore:n=Ce.includeScore}={}){const i=[];return r&&i.push(bSe),n&&i.push(wSe),t.map(s=>{const{idx:o}=s,a={item:e[o],refIndex:o};return i.length&&i.forEach(c=>{c(s,a)}),a})}class ta{constructor(e,r={},n){this.options={...Ce,...r},this.options.useExtendedSearch,this._keyStore=new V3e(this.options.keys),this.setCollection(e,n)}setCollection(e,r){if(this._docs=e,r&&!(r instanceof uk))throw new Error(U3e);this._myIndex=r||Fz(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){fi(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const r=[];for(let n=0,i=this._docs.length;n-1&&(c=c.slice(0,r)),ESe(c,this._docs,{includeMatches:n,includeScore:i})}_searchStringList(e){const r=B5(e,this.options),{records:n}=this._myIndex,i=[];return n.forEach(({v:s,i:o,n:a})=>{if(!fi(s))return;const{isMatch:c,score:l,indices:u}=r.searchIn(s);c&&i.push({item:s,idx:o,matches:[{score:l,value:s,norm:a,indices:u}]})}),i}_searchLogical(e){const r=Wz(e,this.options),n=(a,c,l)=>{if(!a.children){const{keyId:f,searcher:d}=a,h=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(c,f),searcher:d});return h&&h.length?[{idx:l,item:c,matches:h}]:[]}const u=[];for(let f=0,d=a.children.length;f{if(fi(a)){let l=n(r,a,c);l.length&&(s[c]||(s[c]={idx:c,item:a,matches:[]},o.push(s[c])),l.forEach(({matches:u})=>{s[c].matches.push(...u)}))}}),o}_searchObjectList(e){const r=B5(e,this.options),{keys:n,records:i}=this._myIndex,s=[];return i.forEach(({$:o,i:a})=>{if(!fi(o))return;let c=[];n.forEach((l,u)=>{c.push(...this._findMatches({key:l,value:o[u],searcher:r}))}),c.length&&s.push({idx:a,item:o,matches:c})}),s}_findMatches({key:e,value:r,searcher:n}){if(!fi(r))return[];let i=[];if(ea(r))r.forEach(({v:s,i:o,n:a})=>{if(!fi(s))return;const{isMatch:c,score:l,indices:u}=n.searchIn(s);c&&i.push({score:l,key:e,value:s,idx:o,norm:a,indices:u})});else{const{v:s,n:o}=r,{isMatch:a,score:c,indices:l}=n.searchIn(s);a&&i.push({score:c,key:e,value:s,norm:o,indices:l})}return i}}ta.version="6.6.2";ta.createIndex=Fz;ta.parseIndex=eSe;ta.config=Ce;ta.parseQuery=Wz;vSe(pSe);function Hz(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;et.forEach(r=>CSe(r,e))}function uu(...t){return C.useCallback(qz(...t),t)}function Vz(t,e=[]){let r=[];function n(s,o){const a=C.createContext(o),c=r.length;r=[...r,o];function l(f){const{scope:d,children:h,...p}=f,v=(d==null?void 0:d[t][c])||a,b=C.useMemo(()=>p,Object.values(p));return C.createElement(v.Provider,{value:b},h)}function u(f,d){const h=(d==null?void 0:d[t][c])||a,p=C.useContext(h);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,u]}const i=()=>{const s=r.map(o=>C.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return C.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[n,SSe(i,...e)]}function SSe(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const f=c(s)[`__scope${l}`];return{...a,...f}},{});return C.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}const fk=C.forwardRef((t,e)=>{const{children:r,...n}=t,i=C.Children.toArray(r),s=i.find(ASe);if(s){const o=s.props.children,a=i.map(c=>c===s?C.Children.count(o)>1?C.Children.only(null):C.isValidElement(o)?o.props.children:null:c);return C.createElement(U5,sn({},n,{ref:e}),C.isValidElement(o)?C.cloneElement(o,void 0,a):null)}return C.createElement(U5,sn({},n,{ref:e}),r)});fk.displayName="Slot";const U5=C.forwardRef((t,e)=>{const{children:r,...n}=t;return C.isValidElement(r)?C.cloneElement(r,{..._Se(n,r.props),ref:e?qz(e,r.ref):r.ref}):C.Children.count(r)>1?C.Children.only(null):null});U5.displayName="SlotClone";const kSe=({children:t})=>C.createElement(C.Fragment,null,t);function ASe(t){return C.isValidElement(t)&&t.type===kSe}function _Se(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}const PSe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],np=PSe.reduce((t,e)=>{const r=C.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?fk:e;return C.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),C.createElement(a,sn({},o,{ref:i}))});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function TSe(t,e){t&&As.flushSync(()=>t.dispatchEvent(e))}function xc(t){const e=C.useRef(t);return C.useEffect(()=>{e.current=t}),C.useMemo(()=>(...r)=>{var n;return(n=e.current)===null||n===void 0?void 0:n.call(e,...r)},[])}function ISe(t,e=globalThis==null?void 0:globalThis.document){const r=xc(t);C.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[r,e])}const z5="dismissableLayer.update",OSe="dismissableLayer.pointerDownOutside",RSe="dismissableLayer.focusOutside";let fI;const MSe=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$Se=C.forwardRef((t,e)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...l}=t,u=C.useContext(MSe),[f,d]=C.useState(null),h=(r=f==null?void 0:f.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,p]=C.useState({}),v=uu(e,I=>d(I)),b=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=b.indexOf(y),g=f?b.indexOf(f):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,P=g>=m,T=NSe(I=>{const B=I.target,j=[...u.branches].some(H=>H.contains(B));!P||j||(s==null||s(I),a==null||a(I),I.defaultPrevented||c==null||c())},h),w=DSe(I=>{const B=I.target;[...u.branches].some(H=>H.contains(B))||(o==null||o(I),a==null||a(I),I.defaultPrevented||c==null||c())},h);return ISe(I=>{g===u.layers.size-1&&(i==null||i(I),!I.defaultPrevented&&c&&(I.preventDefault(),c()))},h),C.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(fI=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),dI(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=fI)}},[f,h,n,u]),C.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),dI())},[f,u]),C.useEffect(()=>{const I=()=>p({});return document.addEventListener(z5,I),()=>document.removeEventListener(z5,I)},[]),C.createElement(np.div,sn({},l,{ref:v,style:{pointerEvents:S?P?"auto":"none":void 0,...t.style},onFocusCapture:_l(t.onFocusCapture,w.onFocusCapture),onBlurCapture:_l(t.onBlurCapture,w.onBlurCapture),onPointerDownCapture:_l(t.onPointerDownCapture,T.onPointerDownCapture)}))});function NSe(t,e=globalThis==null?void 0:globalThis.document){const r=xc(t),n=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let l=function(){Gz(OSe,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function DSe(t,e=globalThis==null?void 0:globalThis.document){const r=xc(t),n=C.useRef(!1);return C.useEffect(()=>{const i=s=>{s.target&&!n.current&&Gz(RSe,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function dI(){const t=new CustomEvent(z5);document.dispatchEvent(t)}function Gz(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?TSe(i,s):i.dispatchEvent(s)}let hE=0;function LSe(){C.useEffect(()=>{var t,e;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=r[0])!==null&&t!==void 0?t:hI()),document.body.insertAdjacentElement("beforeend",(e=r[1])!==null&&e!==void 0?e:hI()),hE++,()=>{hE===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),hE--}},[])}function hI(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const pE="focusScope.autoFocusOnMount",vE="focusScope.autoFocusOnUnmount",pI={bubbles:!1,cancelable:!0},BSe=C.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=C.useState(null),l=xc(i),u=xc(s),f=C.useRef(null),d=uu(e,v=>c(v)),h=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(n){let v=function(g){if(h.paused||!a)return;const S=g.target;a.contains(S)?f.current=S:Aa(f.current,{select:!0})},b=function(g){if(h.paused||!a)return;const S=g.relatedTarget;S!==null&&(a.contains(S)||Aa(f.current,{select:!0}))},y=function(g){if(document.activeElement===document.body)for(const P of g)P.removedNodes.length>0&&Aa(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const m=new MutationObserver(y);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),m.disconnect()}}},[n,a,h.paused]),C.useEffect(()=>{if(a){mI.add(h);const v=document.activeElement;if(!a.contains(v)){const y=new CustomEvent(pE,pI);a.addEventListener(pE,l),a.dispatchEvent(y),y.defaultPrevented||(FSe(HSe(Kz(a)),{select:!0}),document.activeElement===v&&Aa(a))}return()=>{a.removeEventListener(pE,l),setTimeout(()=>{const y=new CustomEvent(vE,pI);a.addEventListener(vE,u),a.dispatchEvent(y),y.defaultPrevented||Aa(v??document.body,{select:!0}),a.removeEventListener(vE,u),mI.remove(h)},0)}}},[a,l,u,h]);const p=C.useCallback(v=>{if(!r&&!n||h.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(b&&y){const m=v.currentTarget,[g,S]=jSe(m);g&&S?!v.shiftKey&&y===S?(v.preventDefault(),r&&Aa(g,{select:!0})):v.shiftKey&&y===g&&(v.preventDefault(),r&&Aa(S,{select:!0})):y===m&&v.preventDefault()}},[r,n,h.paused]);return C.createElement(np.div,sn({tabIndex:-1},o,{ref:d,onKeyDown:p}))});function FSe(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(Aa(n,{select:e}),document.activeElement!==r)return}function jSe(t){const e=Kz(t),r=vI(e,t),n=vI(e.reverse(),t);return[r,n]}function Kz(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function vI(t,e){for(const r of t)if(!USe(r,{upTo:e}))return r}function USe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function zSe(t){return t instanceof HTMLInputElement&&"select"in t}function Aa(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&zSe(t)&&e&&t.select()}}const mI=WSe();function WSe(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=yI(t,e),t.unshift(e)},remove(e){var r;t=yI(t,e),(r=t[0])===null||r===void 0||r.resume()}}}function yI(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function HSe(t){return t.filter(e=>e.tagName!=="A")}const Qf=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},qSe=l7["useId".toString()]||(()=>{});let VSe=0;function GSe(t){const[e,r]=C.useState(qSe());return Qf(()=>{t||r(n=>n??String(VSe++))},[t]),t||(e?`radix-${e}`:"")}const KSe=["top","right","bottom","left"],Cc=Math.min,di=Math.max,Gy=Math.round,iv=Math.floor,Sc=t=>({x:t,y:t}),QSe={left:"right",right:"left",bottom:"top",top:"bottom"},YSe={start:"end",end:"start"};function W5(t,e,r){return di(t,Cc(e,r))}function ra(t,e){return typeof t=="function"?t(e):t}function na(t){return t.split("-")[0]}function Id(t){return t.split("-")[1]}function dk(t){return t==="x"?"y":"x"}function hk(t){return t==="y"?"height":"width"}function Od(t){return["top","bottom"].includes(na(t))?"y":"x"}function pk(t){return dk(Od(t))}function JSe(t,e,r){r===void 0&&(r=!1);const n=Id(t),i=pk(t),s=hk(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Ky(o)),[o,Ky(o)]}function XSe(t){const e=Ky(t);return[H5(t),e,H5(e)]}function H5(t){return t.replace(/start|end/g,e=>YSe[e])}function ZSe(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function e8e(t,e,r,n){const i=Id(t);let s=ZSe(na(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(H5)))),s}function Ky(t){return t.replace(/left|right|bottom|top/g,e=>QSe[e])}function t8e(t){return{top:0,right:0,bottom:0,left:0,...t}}function Qz(t){return typeof t!="number"?t8e(t):{top:t,right:t,bottom:t,left:t}}function Qy(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function gI(t,e,r){let{reference:n,floating:i}=t;const s=Od(e),o=pk(e),a=hk(o),c=na(e),l=s==="y",u=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let h;switch(c){case"top":h={x:u,y:n.y-i.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-i.width,y:f};break;default:h={x:n.x,y:n.y}}switch(Id(e)){case"start":h[o]-=d*(r&&l?-1:1);break;case"end":h[o]+=d*(r&&l?-1:1);break}return h}const r8e=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=gI(l,n,c),d=n,h={},p=0;for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:u=0}=ra(t,e)||{};if(l==null)return{};const f=Qz(u),d={x:r,y:n},h=pk(i),p=hk(h),v=await o.getDimensions(l),b=h==="y",y=b?"top":"left",m=b?"bottom":"right",g=b?"clientHeight":"clientWidth",S=s.reference[p]+s.reference[h]-d[h]-s.floating[p],P=d[h]-s.reference[h],T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let w=T?T[g]:0;(!w||!await(o.isElement==null?void 0:o.isElement(T)))&&(w=a.floating[g]||s.floating[p]);const I=S/2-P/2,B=w/2-v[p]/2-1,j=Cc(f[y],B),H=Cc(f[m],B),K=j,F=w-v[p]-H,E=w/2-v[p]/2+I,_=W5(K,E,F),O=!c.arrow&&Id(i)!=null&&E!=_&&s.reference[p]/2-(EK<=0)){var B,j;const K=(((B=s.flip)==null?void 0:B.index)||0)+1,F=P[K];if(F)return{data:{index:K,overflows:I},reset:{placement:F}};let E=(j=I.filter(_=>_.overflows[0]<=0).sort((_,O)=>_.overflows[1]-O.overflows[1])[0])==null?void 0:j.placement;if(!E)switch(h){case"bestFit":{var H;const _=(H=I.map(O=>[O.placement,O.overflows.filter(N=>N>0).reduce((N,k)=>N+k,0)]).sort((O,N)=>O[1]-N[1])[0])==null?void 0:H[0];_&&(E=_);break}case"initialPlacement":E=a;break}if(i!==E)return{reset:{placement:E}}}return{}}}};function wI(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function EI(t){return KSe.some(e=>t[e]>=0)}const i8e=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=ra(t,e);switch(n){case"referenceHidden":{const s=await f1(e,{...i,elementContext:"reference"}),o=wI(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:EI(o)}}}case"escaped":{const s=await f1(e,{...i,altBoundary:!0}),o=wI(s,r.floating);return{data:{escapedOffsets:o,escaped:EI(o)}}}default:return{}}}}};async function s8e(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=na(r),a=Id(r),c=Od(r)==="y",l=["left","top"].includes(o)?-1:1,u=s&&c?-1:1,f=ra(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),c?{x:h*u,y:d*l}:{x:d*l,y:h*u}}const o8e=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:r,y:n}=e,i=await s8e(e,t);return{x:r+i.x,y:n+i.y,data:i}}}},a8e=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:b=>{let{x:y,y:m}=b;return{x:y,y:m}}},...c}=ra(t,e),l={x:r,y:n},u=await f1(e,c),f=Od(na(i)),d=dk(f);let h=l[d],p=l[f];if(s){const b=d==="y"?"top":"left",y=d==="y"?"bottom":"right",m=h+u[b],g=h-u[y];h=W5(m,h,g)}if(o){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",m=p+u[b],g=p-u[y];p=W5(m,p,g)}const v=a.fn({...e,[d]:h,[f]:p});return{...v,data:{x:v.x-r,y:v.y-n}}}}},c8e=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=ra(t,e),u={x:r,y:n},f=Od(i),d=dk(f);let h=u[d],p=u[f];const v=ra(a,e),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const g=d==="y"?"height":"width",S=s.reference[d]-s.floating[g]+b.mainAxis,P=s.reference[d]+s.reference[g]-b.mainAxis;hP&&(h=P)}if(l){var y,m;const g=d==="y"?"width":"height",S=["top","left"].includes(na(i)),P=s.reference[f]-s.floating[g]+(S&&((y=o.offset)==null?void 0:y[f])||0)+(S?0:b.crossAxis),T=s.reference[f]+s.reference[g]+(S?0:((m=o.offset)==null?void 0:m[f])||0)-(S?b.crossAxis:0);pT&&(p=T)}return{[d]:h,[f]:p}}}},l8e=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=ra(t,e),c=await f1(e,a),l=na(r),u=Id(r),f=Od(r)==="y",{width:d,height:h}=n.floating;let p,v;l==="top"||l==="bottom"?(p=l,v=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=l,p=u==="end"?"top":"bottom");const b=h-c[p],y=d-c[v],m=!e.middlewareData.shift;let g=b,S=y;if(f){const T=d-c.left-c.right;S=u||m?Cc(y,T):T}else{const T=h-c.top-c.bottom;g=u||m?Cc(b,T):T}if(m&&!u){const T=di(c.left,0),w=di(c.right,0),I=di(c.top,0),B=di(c.bottom,0);f?S=d-2*(T!==0||w!==0?T+w:di(c.left,c.right)):g=h-2*(I!==0||B!==0?I+B:di(c.top,c.bottom))}await o({...e,availableWidth:S,availableHeight:g});const P=await i.getDimensions(s.floating);return d!==P.width||h!==P.height?{reset:{rects:!0}}:{}}}};function kc(t){return Yz(t)?(t.nodeName||"").toLowerCase():"#document"}function yi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function va(t){var e;return(e=(Yz(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Yz(t){return t instanceof Node||t instanceof yi(t).Node}function ia(t){return t instanceof Element||t instanceof yi(t).Element}function mo(t){return t instanceof HTMLElement||t instanceof yi(t).HTMLElement}function xI(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof yi(t).ShadowRoot}function ip(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=Vi(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function u8e(t){return["table","td","th"].includes(kc(t))}function vk(t){const e=mk(),r=Vi(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function f8e(t){let e=Yf(t);for(;mo(e)&&!Xb(e);){if(vk(e))return e;e=Yf(e)}return null}function mk(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Xb(t){return["html","body","#document"].includes(kc(t))}function Vi(t){return yi(t).getComputedStyle(t)}function Zb(t){return ia(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Yf(t){if(kc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||xI(t)&&t.host||va(t);return xI(e)?e.host:e}function Jz(t){const e=Yf(t);return Xb(e)?t.ownerDocument?t.ownerDocument.body:t.body:mo(e)&&ip(e)?e:Jz(e)}function d1(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=Jz(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=yi(i);return s?e.concat(o,o.visualViewport||[],ip(i)?i:[],o.frameElement&&r?d1(o.frameElement):[]):e.concat(i,d1(i,[],r))}function Xz(t){const e=Vi(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=mo(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=Gy(r)!==s||Gy(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function yk(t){return ia(t)?t:t.contextElement}function wf(t){const e=yk(t);if(!mo(e))return Sc(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=Xz(e);let o=(s?Gy(r.width):r.width)/n,a=(s?Gy(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const d8e=Sc(0);function Zz(t){const e=yi(t);return!mk()||!e.visualViewport?d8e:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function h8e(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==yi(t)?!1:e}function Vl(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=yk(t);let o=Sc(1);e&&(n?ia(n)&&(o=wf(n)):o=wf(t));const a=h8e(s,r,n)?Zz(s):Sc(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(s){const d=yi(s),h=n&&ia(n)?yi(n):n;let p=d.frameElement;for(;p&&n&&h!==d;){const v=wf(p),b=p.getBoundingClientRect(),y=Vi(p),m=b.left+(p.clientLeft+parseFloat(y.paddingLeft))*v.x,g=b.top+(p.clientTop+parseFloat(y.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=m,l+=g,p=yi(p).frameElement}}return Qy({width:u,height:f,x:c,y:l})}function p8e(t){let{rect:e,offsetParent:r,strategy:n}=t;const i=mo(r),s=va(r);if(r===s)return e;let o={scrollLeft:0,scrollTop:0},a=Sc(1);const c=Sc(0);if((i||!i&&n!=="fixed")&&((kc(r)!=="body"||ip(s))&&(o=Zb(r)),mo(r))){const l=Vl(r);a=wf(r),c.x=l.x+r.clientLeft,c.y=l.y+r.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-o.scrollLeft*a.x+c.x,y:e.y*a.y-o.scrollTop*a.y+c.y}}function v8e(t){return Array.from(t.getClientRects())}function eW(t){return Vl(va(t)).left+Zb(t).scrollLeft}function m8e(t){const e=va(t),r=Zb(t),n=t.ownerDocument.body,i=di(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=di(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+eW(t);const a=-r.scrollTop;return Vi(n).direction==="rtl"&&(o+=di(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function y8e(t,e){const r=yi(t),n=va(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=mk();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function g8e(t,e){const r=Vl(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=mo(t)?wf(t):Sc(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function CI(t,e,r){let n;if(e==="viewport")n=y8e(t,r);else if(e==="document")n=m8e(va(t));else if(ia(e))n=g8e(e,r);else{const i=Zz(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return Qy(n)}function tW(t,e){const r=Yf(t);return r===e||!ia(r)||Xb(r)?!1:Vi(r).position==="fixed"||tW(r,e)}function b8e(t,e){const r=e.get(t);if(r)return r;let n=d1(t,[],!1).filter(a=>ia(a)&&kc(a)!=="body"),i=null;const s=Vi(t).position==="fixed";let o=s?Yf(t):t;for(;ia(o)&&!Xb(o);){const a=Vi(o),c=vk(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ip(o)&&!c&&tW(t,o))?n=n.filter(u=>u!==o):i=a,o=Yf(o)}return e.set(t,n),n}function w8e(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?b8e(e,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,u)=>{const f=CI(e,u,i);return l.top=di(f.top,l.top),l.right=Cc(f.right,l.right),l.bottom=Cc(f.bottom,l.bottom),l.left=di(f.left,l.left),l},CI(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function E8e(t){return Xz(t)}function x8e(t,e,r){const n=mo(e),i=va(e),s=r==="fixed",o=Vl(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=Sc(0);if(n||!n&&!s)if((kc(e)!=="body"||ip(i))&&(a=Zb(e)),n){const l=Vl(e,!0,s,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else i&&(c.x=eW(i));return{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function SI(t,e){return!mo(t)||Vi(t).position==="fixed"?null:e?e(t):t.offsetParent}function rW(t,e){const r=yi(t);if(!mo(t))return r;let n=SI(t,e);for(;n&&u8e(n)&&Vi(n).position==="static";)n=SI(n,e);return n&&(kc(n)==="html"||kc(n)==="body"&&Vi(n).position==="static"&&!vk(n))?r:n||f8e(t)||r}const C8e=async function(t){let{reference:e,floating:r,strategy:n}=t;const i=this.getOffsetParent||rW,s=this.getDimensions;return{reference:x8e(e,await i(r),n),floating:{x:0,y:0,...await s(r)}}};function S8e(t){return Vi(t).direction==="rtl"}const k8e={convertOffsetParentRelativeRectToViewportRelativeRect:p8e,getDocumentElement:va,getClippingRect:w8e,getOffsetParent:rW,getElementRects:C8e,getClientRects:v8e,getDimensions:E8e,getScale:wf,isElement:ia,isRTL:S8e};function A8e(t,e){let r=null,n;const i=va(t);function s(){clearTimeout(n),r&&r.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:u,width:f,height:d}=t.getBoundingClientRect();if(a||e(),!f||!d)return;const h=iv(u),p=iv(i.clientWidth-(l+f)),v=iv(i.clientHeight-(u+d)),b=iv(l),m={rootMargin:-h+"px "+-p+"px "+-v+"px "+-b+"px",threshold:di(0,Cc(1,c))||1};let g=!0;function S(P){const T=P[0].intersectionRatio;if(T!==c){if(!g)return o();T?o(!1,T):n=setTimeout(()=>{o(!1,1e-7)},100)}g=!1}try{r=new IntersectionObserver(S,{...m,root:i.ownerDocument})}catch{r=new IntersectionObserver(S,m)}r.observe(t)}return o(!0),s}function _8e(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=yk(t),u=i||s?[...l?d1(l):[],...d1(e)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",r,{passive:!0}),s&&y.addEventListener("resize",r)});const f=l&&a?A8e(l,r):null;let d=-1,h=null;o&&(h=new ResizeObserver(y=>{let[m]=y;m&&m.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{h&&h.observe(e)})),r()}),l&&!c&&h.observe(l),h.observe(e));let p,v=c?Vl(t):null;c&&b();function b(){const y=Vl(t);v&&(y.x!==v.x||y.y!==v.y||y.width!==v.width||y.height!==v.height)&&r(),v=y,p=requestAnimationFrame(b)}return r(),()=>{u.forEach(y=>{i&&y.removeEventListener("scroll",r),s&&y.removeEventListener("resize",r)}),f&&f(),h&&h.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const P8e=(t,e,r)=>{const n=new Map,i={platform:k8e,...r},s={...i.platform,_c:n};return r8e(t,e,{...i,platform:s})},T8e=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?bI({element:n.current,padding:i}).fn(r):{}:n?bI({element:n,padding:i}).fn(r):{}}}};var Jv=typeof document<"u"?C.useLayoutEffect:C.useEffect;function Yy(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!Yy(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!Yy(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function nW(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function kI(t,e){const r=nW(t);return Math.round(e*r)/r}function AI(t){const e=C.useRef(t);return Jv(()=>{e.current=t}),e}function I8e(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,f]=C.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,h]=C.useState(n);Yy(d,n)||h(n);const[p,v]=C.useState(null),[b,y]=C.useState(null),m=C.useCallback(O=>{O!=T.current&&(T.current=O,v(O))},[v]),g=C.useCallback(O=>{O!==w.current&&(w.current=O,y(O))},[y]),S=s||p,P=o||b,T=C.useRef(null),w=C.useRef(null),I=C.useRef(u),B=AI(c),j=AI(i),H=C.useCallback(()=>{if(!T.current||!w.current)return;const O={placement:e,strategy:r,middleware:d};j.current&&(O.platform=j.current),P8e(T.current,w.current,O).then(N=>{const k={...N,isPositioned:!0};K.current&&!Yy(I.current,k)&&(I.current=k,As.flushSync(()=>{f(k)}))})},[d,e,r,j]);Jv(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(O=>({...O,isPositioned:!1})))},[l]);const K=C.useRef(!1);Jv(()=>(K.current=!0,()=>{K.current=!1}),[]),Jv(()=>{if(S&&(T.current=S),P&&(w.current=P),S&&P){if(B.current)return B.current(S,P,H);H()}},[S,P,H,B]);const F=C.useMemo(()=>({reference:T,floating:w,setReference:m,setFloating:g}),[m,g]),E=C.useMemo(()=>({reference:S,floating:P}),[S,P]),_=C.useMemo(()=>{const O={position:r,left:0,top:0};if(!E.floating)return O;const N=kI(E.floating,u.x),k=kI(E.floating,u.y);return a?{...O,transform:"translate("+N+"px, "+k+"px)",...nW(E.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:N,top:k}},[r,a,E.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:H,refs:F,elements:E,floatingStyles:_}),[u,H,F,E,_])}function O8e(t){const[e,r]=C.useState(void 0);return Qf(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}const iW="Popper",[sW,oW]=Vz(iW),[R8e,aW]=sW(iW),M8e=t=>{const{__scopePopper:e,children:r}=t,[n,i]=C.useState(null);return C.createElement(R8e,{scope:e,anchor:n,onAnchorChange:i},r)},$8e="PopperAnchor",N8e=C.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=aW($8e,r),o=C.useRef(null),a=uu(e,o);return C.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:C.createElement(np.div,sn({},i,{ref:a}))}),cW="PopperContent",[D8e,ITe]=sW(cW),L8e=C.forwardRef((t,e)=>{var r,n,i,s,o,a,c,l;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:h="center",alignOffset:p=0,arrowPadding:v=0,avoidCollisions:b=!0,collisionBoundary:y=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:S=!1,updatePositionStrategy:P="optimized",onPlaced:T,...w}=t,I=aW(cW,u),[B,j]=C.useState(null),H=uu(e,ue=>j(ue)),[K,F]=C.useState(null),E=O8e(K),_=(r=E==null?void 0:E.width)!==null&&r!==void 0?r:0,O=(n=E==null?void 0:E.height)!==null&&n!==void 0?n:0,N=f+(h!=="center"?"-"+h:""),k=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},M=Array.isArray(y)?y:[y],L=M.length>0,$={padding:k,boundary:M.filter(B8e),altBoundary:L},{refs:A,floatingStyles:D,placement:V,isPositioned:R,middlewareData:U}=I8e({strategy:"fixed",placement:N,whileElementsMounted:(...ue)=>_8e(...ue,{animationFrame:P==="always"}),elements:{reference:I.anchor},middleware:[o8e({mainAxis:d+O,alignmentAxis:p}),b&&a8e({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?c8e():void 0,...$}),b&&n8e({...$}),l8e({...$,apply:({elements:ue,rects:ot,availableWidth:Pe,availableHeight:Ae})=>{const{width:at,height:xe}=ot.reference,be=ue.floating.style;be.setProperty("--radix-popper-available-width",`${Pe}px`),be.setProperty("--radix-popper-available-height",`${Ae}px`),be.setProperty("--radix-popper-anchor-width",`${at}px`),be.setProperty("--radix-popper-anchor-height",`${xe}px`)}}),K&&T8e({element:K,padding:v}),F8e({arrowWidth:_,arrowHeight:O}),S&&i8e({strategy:"referenceHidden",...$})]}),[W,q]=lW(V),Y=xc(T);Qf(()=>{R&&(Y==null||Y())},[R,Y]);const X=(i=U.arrow)===null||i===void 0?void 0:i.x,Q=(s=U.arrow)===null||s===void 0?void 0:s.y,Z=((o=U.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[ae,se]=C.useState();return Qf(()=>{B&&se(window.getComputedStyle(B).zIndex)},[B]),C.createElement("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:R?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[(a=U.transformOrigin)===null||a===void 0?void 0:a.x,(c=U.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:t.dir},C.createElement(D8e,{scope:u,placedSide:W,onArrowChange:F,arrowX:X,arrowY:Q,shouldHideArrow:Z},C.createElement(np.div,sn({"data-side":W,"data-align":q},w,{ref:H,style:{...w.style,animation:R?void 0:"none",opacity:(l=U.hide)!==null&&l!==void 0&&l.referenceHidden?0:void 0}}))))});function B8e(t){return t!==null}const F8e=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i,s,o;const{placement:a,rects:c,middlewareData:l}=e,f=((r=l.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:t.arrowWidth,h=f?0:t.arrowHeight,[p,v]=lW(a),b={start:"0%",center:"50%",end:"100%"}[v],y=((n=(i=l.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,m=((s=(o=l.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+h/2;let g="",S="";return p==="bottom"?(g=f?b:`${y}px`,S=`${-h}px`):p==="top"?(g=f?b:`${y}px`,S=`${c.floating.height+h}px`):p==="right"?(g=`${-h}px`,S=f?b:`${m}px`):p==="left"&&(g=`${c.floating.width+h}px`,S=f?b:`${m}px`),{data:{x:g,y:S}}}});function lW(t){const[e,r="center"]=t.split("-");return[e,r]}const j8e=M8e,uW=N8e,U8e=L8e;function z8e(t,e){return C.useReducer((r,n)=>{const i=e[r][n];return i??r},t)}const fW=t=>{const{present:e,children:r}=t,n=W8e(e),i=typeof r=="function"?r({present:n.isPresent}):C.Children.only(r),s=uu(n.ref,i.ref);return typeof r=="function"||n.isPresent?C.cloneElement(i,{ref:s}):null};fW.displayName="Presence";function W8e(t){const[e,r]=C.useState(),n=C.useRef({}),i=C.useRef(t),s=C.useRef("none"),o=t?"mounted":"unmounted",[a,c]=z8e(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const l=sv(n.current);s.current=a==="mounted"?l:"none"},[a]),Qf(()=>{const l=n.current,u=i.current;if(u!==t){const d=s.current,h=sv(l);t?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),Qf(()=>{if(e){const l=f=>{const h=sv(n.current).includes(f.animationName);f.target===e&&h&&As.flushSync(()=>c("ANIMATION_END"))},u=f=>{f.target===e&&(s.current=sv(n.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function sv(t){return(t==null?void 0:t.animationName)||"none"}function H8e({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=q8e({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=xc(r),c=C.useCallback(l=>{if(s){const f=typeof l=="function"?l(t):l;f!==t&&a(f)}else i(l)},[s,t,i,a]);return[o,c]}function q8e({defaultProp:t,onChange:e}){const r=C.useState(t),[n]=r,i=C.useRef(n),s=xc(e);return C.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}var V8e=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Cu=new WeakMap,ov=new WeakMap,av={},mE=0,dW=function(t){return t&&(t.host||dW(t.parentNode))},G8e=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=dW(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},K8e=function(t,e,r,n){var i=G8e(e,Array.isArray(t)?t:[t]);av[r]||(av[r]=new WeakMap);var s=av[r],o=[],a=new Set,c=new Set(i),l=function(f){!f||a.has(f)||(a.add(f),l(f.parentNode))};i.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))u(d);else{var h=d.getAttribute(n),p=h!==null&&h!=="false",v=(Cu.get(d)||0)+1,b=(s.get(d)||0)+1;Cu.set(d,v),s.set(d,b),o.push(d),v===1&&p&&ov.set(d,!0),b===1&&d.setAttribute(r,"true"),p||d.setAttribute(n,"true")}})};return u(e),a.clear(),mE++,function(){o.forEach(function(f){var d=Cu.get(f)-1,h=s.get(f)-1;Cu.set(f,d),s.set(f,h),d||(ov.has(f)||f.removeAttribute(n),ov.delete(f)),h||f.removeAttribute(r)}),mE--,mE||(Cu=new WeakMap,Cu=new WeakMap,ov=new WeakMap,av={})}},Q8e=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=e||V8e(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),K8e(n,i,r,"aria-hidden")):function(){return null}},Xv="right-scroll-bar-position",Zv="width-before-scroll-bar",Y8e="with-scroll-bars-hidden",J8e="--removed-body-scroll-bar-size";function X8e(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Z8e(t,e){var r=C.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=e,r.facade}function eke(t,e){return Z8e(e||null,function(r){return t.forEach(function(n){return X8e(n,r)})})}function tke(t){return t}function rke(t,e){e===void 0&&(e=tke);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(s){var o=e(s,n);return r.push(o),function(){r=r.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(n=!0;r.length;){var o=r;r=[],o.forEach(s)}r={push:function(a){return s(a)},filter:function(){return r}}},assignMedium:function(s){n=!0;var o=[];if(r.length){var a=r;r=[],a.forEach(s),o=r}var c=function(){var u=o;o=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),r={push:function(u){o.push(u),l()},filter:function(u){return o=o.filter(u),r}}}};return i}function nke(t){t===void 0&&(t={});var e=rke(null);return e.options=Gs({async:!0,ssr:!1},t),e}var hW=function(t){var e=t.sideCar,r=yN(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return C.createElement(n,Gs({},r))};hW.isSideCarExport=!0;function ike(t,e){return t.useMedium(e),hW}var pW=nke(),yE=function(){},ew=C.forwardRef(function(t,e){var r=C.useRef(null),n=C.useState({onScrollCapture:yE,onWheelCapture:yE,onTouchMoveCapture:yE}),i=n[0],s=n[1],o=t.forwardProps,a=t.children,c=t.className,l=t.removeScrollBar,u=t.enabled,f=t.shards,d=t.sideCar,h=t.noIsolation,p=t.inert,v=t.allowPinchZoom,b=t.as,y=b===void 0?"div":b,m=yN(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),g=d,S=eke([r,e]),P=Gs(Gs({},m),i);return C.createElement(C.Fragment,null,u&&C.createElement(g,{sideCar:pW,removeScrollBar:l,shards:f,noIsolation:h,inert:p,setCallbacks:s,allowPinchZoom:!!v,lockRef:r}),o?C.cloneElement(C.Children.only(a),Gs(Gs({},P),{ref:S})):C.createElement(y,Gs({},P,{className:c,ref:S}),a))});ew.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ew.classNames={fullWidth:Zv,zeroRight:Xv};var _I,ske=function(){if(_I)return _I;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function oke(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=ske();return e&&t.setAttribute("nonce",e),t}function ake(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function cke(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var lke=function(){var t=0,e=null;return{add:function(r){t==0&&(e=oke())&&(ake(e,r),cke(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},uke=function(){var t=lke();return function(e,r){C.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},vW=function(){var t=uke(),e=function(r){var n=r.styles,i=r.dynamic;return t(n,i),null};return e},fke={left:0,top:0,right:0,gap:0},gE=function(t){return parseInt(t||"",10)||0},dke=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[gE(r),gE(n),gE(i)]},hke=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return fke;var e=dke(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},pke=vW(),vke=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` - .`.concat(Y8e,` { + */var eW={L:tf.QrCode.Ecc.LOW,M:tf.QrCode.Ecc.MEDIUM,Q:tf.QrCode.Ecc.QUARTILE,H:tf.QrCode.Ecc.HIGH},tW=128,rW="L",nW="#FFFFFF",iW="#000000",sW=!1,bk=4,hSe=.1;function oW(t,e=0){const r=[];return t.forEach(function(n,i){let s=null;n.forEach(function(o,a){if(!o&&s!==null){r.push(`M${s+e} ${i+e}h${a-s}v1H${s+e}z`),s=null;return}if(a===n.length-1){if(!o)return;s===null?r.push(`M${a+e},${i+e} h1v1H${a+e}z`):r.push(`M${s+e},${i+e} h${a+1-s}v1H${s+e}z`);return}o&&s===null&&(s=a)})}),r.join("")}function aW(t,e){return t.slice().map((r,n)=>n=e.y+e.h?r:r.map((i,s)=>s=e.x+e.w?i:!1))}function cW(t,e,r,n){if(n==null)return null;const i=r?bk:0,s=t.length+i*2,o=Math.floor(e*hSe),a=s/e,c=(n.width||o)*a,l=(n.height||o)*a,u=n.x==null?t.length/2-c/2:n.x*a,f=n.y==null?t.length/2-l/2:n.y*a;let d=null;if(n.excavate){let h=Math.floor(u),p=Math.floor(f),v=Math.ceil(c+u-h),b=Math.ceil(l+f-p);d={x:h,y:p,w:v,h:b}}return{x:u,y:f,h:l,w:c,excavation:d}}var pSe=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function vSe(t){const e=t,{value:r,size:n=tW,level:i=rW,bgColor:s=nW,fgColor:o=iW,includeMargin:a=sW,style:c,imageSettings:l}=e,u=gk(e,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),f=l==null?void 0:l.src,d=C.useRef(null),h=C.useRef(null),[p,v]=C.useState(!1);C.useEffect(()=>{if(d.current!=null){const m=d.current,g=m.getContext("2d");if(!g)return;let S=tf.QrCode.encodeText(r,eW[i]).getModules();const P=a?bk:0,T=S.length+P*2,w=cW(S,n,a,l),I=h.current,F=w!=null&&I!==null&&I.complete&&I.naturalHeight!==0&&I.naturalWidth!==0;F&&w.excavation!=null&&(S=aW(S,w.excavation));const j=window.devicePixelRatio||1;m.height=m.width=n*j;const H=n/T*j;g.scale(H,H),g.fillStyle=s,g.fillRect(0,0,T,T),g.fillStyle=o,pSe?g.fill(new Path2D(oW(S,P))):S.forEach(function(K,B){K.forEach(function(E,_){E&&g.fillRect(_+P,B+P,1,1)})}),F&&g.drawImage(I,w.x+P,w.y+P,w.w,w.h)}}),C.useEffect(()=>{v(!1)},[f]);const b=h1({height:n,width:n},c);let y=null;return f!=null&&(y=x.createElement("img",{src:f,key:f,style:{display:"none"},onLoad:()=>{v(!0)},ref:h})),x.createElement(x.Fragment,null,x.createElement("canvas",h1({style:b,height:n,width:n,ref:d},u)),y)}function mSe(t){const e=t,{value:r,size:n=tW,level:i=rW,bgColor:s=nW,fgColor:o=iW,includeMargin:a=sW,imageSettings:c}=e,l=gk(e,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let u=tf.QrCode.encodeText(r,eW[i]).getModules();const f=a?bk:0,d=u.length+f*2,h=cW(u,n,a,c);let p=null;c!=null&&h!=null&&(h.excavation!=null&&(u=aW(u,h.excavation)),p=x.createElement("image",{xlinkHref:c.src,height:h.h,width:h.w,x:h.x+f,y:h.y+f,preserveAspectRatio:"none"}));const v=oW(u,f);return x.createElement("svg",h1({height:n,width:n,viewBox:`0 0 ${d} ${d}`},l),x.createElement("path",{fill:s,d:`M0,0 h${d}v${d}H0z`,shapeRendering:"crispEdges"}),x.createElement("path",{fill:o,d:v,shapeRendering:"crispEdges"}),p)}var ySe=t=>{const e=t,{renderAs:r}=e,n=gk(e,["renderAs"]);return r==="svg"?x.createElement(mSe,h1({},n)):x.createElement(vSe,h1({},n))},lW={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(ul,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",l="day",u="week",f="month",d="quarter",h="year",p="date",v="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(E){var _=["th","st","nd","rd"],O=E%100;return"["+E+(_[(O-20)%10]||_[O]||_[0])+"]"}},g=function(E,_,O){var N=String(E);return!N||N.length>=_?E:""+Array(_+1-N.length).join(O)+E},S={s:g,z:function(E){var _=-E.utcOffset(),O=Math.abs(_),N=Math.floor(O/60),k=O%60;return(_<=0?"+":"-")+g(N,2,"0")+":"+g(k,2,"0")},m:function E(_,O){if(_.date()1)return E(L[0])}else{var M=_.name;T[M]=_,k=M}return!N&&k&&(P=k),k||!N&&P},j=function(E,_){if(I(E))return E.clone();var O=typeof _=="object"?_:{};return O.date=E,O.args=arguments,new K(O)},H=S;H.l=F,H.i=I,H.w=function(E,_){return j(E,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var K=function(){function E(O){this.$L=F(O.locale,null,!0),this.parse(O),this.$x=this.$x||O.x||{},this[w]=!0}var _=E.prototype;return _.parse=function(O){this.$d=function(N){var k=N.date,$=N.utc;if(k===null)return new Date(NaN);if(H.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var L=k.match(b);if(L){var M=L[2]-1||0,A=(L[7]||"0").substring(0,3);return $?new Date(Date.UTC(L[1],M,L[3]||1,L[4]||0,L[5]||0,L[6]||0,A)):new Date(L[1],M,L[3]||1,L[4]||0,L[5]||0,L[6]||0,A)}}return new Date(k)}(O),this.init()},_.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},_.$utils=function(){return H},_.isValid=function(){return this.$d.toString()!==v},_.isSame=function(O,N){var k=j(O);return this.startOf(N)<=k&&k<=this.endOf(N)},_.isAfter=function(O,N){return j(O)`Invalid value for key ${t}`,ASe=t=>`Pattern length exceeds max of ${t}.`,_Se=t=>`Missing ${t} property in key`,PSe=t=>`Property 'weight' in key '${t}' must be a positive integer`,yI=Object.prototype.hasOwnProperty;class TSe{constructor(e){this._keys=[],this._keyMap={};let r=0;e.forEach(n=>{let i=pW(n);r+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,r+=i.weight}),this._keys.forEach(n=>{n.weight/=r})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function pW(t){let e=null,r=null,n=null,i=1,s=null;if(Xs(t)||ta(t))n=t,e=gI(t),r=W5(t);else{if(!yI.call(t,"name"))throw new Error(_Se("name"));const o=t.name;if(n=o,yI.call(t,"weight")&&(i=t.weight,i<=0))throw new Error(PSe(o));e=gI(o),r=W5(o),s=t.getFn}return{path:e,id:r,weight:i,src:n,getFn:s}}function gI(t){return ta(t)?t:t.split(".")}function W5(t){return ta(t)?t.join("."):t}function ISe(t,e){let r=[],n=!1;const i=(s,o,a)=>{if(di(s))if(!o[a])r.push(s);else{let c=o[a];const l=s[c];if(!di(l))return;if(a===o.length-1&&(Xs(l)||fW(l)||xSe(l)))r.push(ESe(l));else if(ta(l)){n=!0;for(let u=0,f=l.length;ut.score===e.score?t.idx{this._keysMap[r.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Xs(this.docs[0])?this.docs.forEach((e,r)=>{this._addString(e,r)}):this.docs.forEach((e,r)=>{this._addObject(e,r)}),this.norm.clear())}add(e){const r=this.size();Xs(e)?this._addString(e,r):this._addObject(e,r)}removeAt(e){this.records.splice(e,1);for(let r=e,n=this.size();r{let o=i.getFn?i.getFn(e):this.getFn(e,i.path);if(di(o)){if(ta(o)){let a=[];const c=[{nestedArrIndex:-1,value:o}];for(;c.length;){const{nestedArrIndex:l,value:u}=c.pop();if(di(u))if(Xs(u)&&!bE(u)){let f={v:u,i:l,n:this.norm.get(u)};a.push(f)}else ta(u)&&u.forEach((f,d)=>{c.push({nestedArrIndex:d,value:f})})}n.$[s]=a}else if(Xs(o)&&!bE(o)){let a={v:o,n:this.norm.get(o)};n.$[s]=a}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function vW(t,e,{getFn:r=Ce.getFn,fieldNormWeight:n=Ce.fieldNormWeight}={}){const i=new wk({getFn:r,fieldNormWeight:n});return i.setKeys(t.map(pW)),i.setSources(e),i.create(),i}function LSe(t,{getFn:e=Ce.getFn,fieldNormWeight:r=Ce.fieldNormWeight}={}){const{keys:n,records:i}=t,s=new wk({getFn:e,fieldNormWeight:r});return s.setKeys(n),s.setIndexRecords(i),s}function cv(t,{errors:e=0,currentLocation:r=0,expectedLocation:n=0,distance:i=Ce.distance,ignoreLocation:s=Ce.ignoreLocation}={}){const o=e/t.length;if(s)return o;const a=Math.abs(n-r);return i?o+a/i:a?1:o}function FSe(t=[],e=Ce.minMatchCharLength){let r=[],n=-1,i=-1,s=0;for(let o=t.length;s=e&&r.push([n,i]),n=-1)}return t[s-1]&&s-n>=e&&r.push([n,s-1]),r}const ll=32;function BSe(t,e,r,{location:n=Ce.location,distance:i=Ce.distance,threshold:s=Ce.threshold,findAllMatches:o=Ce.findAllMatches,minMatchCharLength:a=Ce.minMatchCharLength,includeMatches:c=Ce.includeMatches,ignoreLocation:l=Ce.ignoreLocation}={}){if(e.length>ll)throw new Error(ASe(ll));const u=e.length,f=t.length,d=Math.max(0,Math.min(n,f));let h=s,p=d;const v=a>1||c,b=v?Array(f):[];let y;for(;(y=t.indexOf(e,p))>-1;){let w=cv(e,{currentLocation:y,expectedLocation:d,distance:i,ignoreLocation:l});if(h=Math.min(w,h),p=y+u,v){let I=0;for(;I=j;E-=1){let _=E-1,O=r[t.charAt(_)];if(v&&(b[_]=+!!O),K[E]=(K[E+1]<<1|1)&O,w&&(K[E]|=(m[E+1]|m[E])<<1|1|m[E+1]),K[E]&P&&(g=cv(e,{errors:w,currentLocation:_,expectedLocation:d,distance:i,ignoreLocation:l}),g<=h)){if(h=g,p=_,p<=d)break;j=Math.max(1,2*d-p)}}if(cv(e,{errors:w+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:l})>h)break;m=K}const T={isMatch:p>=0,score:Math.max(.001,g)};if(v){const w=FSe(b,a);w.length?c&&(T.indices=w):T.isMatch=!1}return T}function jSe(t){let e={};for(let r=0,n=t.length;r{this.chunks.push({pattern:d,alphabet:jSe(d),startIndex:h})},f=this.pattern.length;if(f>ll){let d=0;const h=f%ll,p=f-h;for(;d{const{isMatch:y,score:m,indices:g}=BSe(e,p,v,{location:i+b,distance:s,threshold:o,findAllMatches:a,minMatchCharLength:c,includeMatches:n,ignoreLocation:l});y&&(d=!0),f+=m,y&&g&&(u=[...u,...g])});let h={isMatch:d,score:d?f/this.chunks.length:1};return d&&n&&(h.indices=u),h}}class Fc{constructor(e){this.pattern=e}static isMultiMatch(e){return bI(e,this.multiRegex)}static isSingleMatch(e){return bI(e,this.singleRegex)}search(){}}function bI(t,e){const r=t.match(e);return r?r[1]:null}class USe extends Fc{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const r=e===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class zSe extends Fc{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class WSe extends Fc{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const r=e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class HSe extends Fc{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const r=!e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class qSe extends Fc{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const r=e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class VSe extends Fc{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const r=!e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class yW extends Fc{constructor(e,{location:r=Ce.location,threshold:n=Ce.threshold,distance:i=Ce.distance,includeMatches:s=Ce.includeMatches,findAllMatches:o=Ce.findAllMatches,minMatchCharLength:a=Ce.minMatchCharLength,isCaseSensitive:c=Ce.isCaseSensitive,ignoreLocation:l=Ce.ignoreLocation}={}){super(e),this._bitapSearch=new mW(e,{location:r,threshold:n,distance:i,includeMatches:s,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:c,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class gW extends Fc{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let r=0,n;const i=[],s=this.pattern.length;for(;(n=e.indexOf(this.pattern,r))>-1;)r=n+s,i.push([n,r-1]);const o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}}const H5=[USe,gW,WSe,HSe,VSe,qSe,zSe,yW],wI=H5.length,GSe=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,KSe="|";function QSe(t,e={}){return t.split(KSe).map(r=>{let n=r.trim().split(GSe).filter(s=>s&&!!s.trim()),i=[];for(let s=0,o=n.length;s!!(t[Xy.AND]||t[Xy.OR]),ZSe=t=>!!t[G5.PATH],e8e=t=>!ta(t)&&dW(t)&&!K5(t),EI=t=>({[Xy.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function bW(t,e,{auto:r=!0}={}){const n=i=>{let s=Object.keys(i);const o=ZSe(i);if(!o&&s.length>1&&!K5(i))return n(EI(i));if(e8e(i)){const c=o?i[G5.PATH]:s[0],l=o?i[G5.PATTERN]:i[c];if(!Xs(l))throw new Error(kSe(c));const u={keyId:W5(c),pattern:l};return r&&(u.searcher=V5(l,e)),u}let a={children:[],operator:s[0]};return s.forEach(c=>{const l=i[c];ta(l)&&l.forEach(u=>{a.children.push(n(u))})}),a};return K5(t)||(t=EI(t)),n(t)}function t8e(t,{ignoreFieldNorm:e=Ce.ignoreFieldNorm}){t.forEach(r=>{let n=1;r.matches.forEach(({key:i,norm:s,score:o})=>{const a=i?i.weight:null;n*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:s))}),r.score=n})}function r8e(t,e){const r=t.matches;e.matches=[],di(r)&&r.forEach(n=>{if(!di(n.indices)||!n.indices.length)return;const{indices:i,value:s}=n;let o={indices:i,value:s};n.key&&(o.key=n.key.src),n.idx>-1&&(o.refIndex=n.idx),e.matches.push(o)})}function n8e(t,e){e.score=t.score}function i8e(t,e,{includeMatches:r=Ce.includeMatches,includeScore:n=Ce.includeScore}={}){const i=[];return r&&i.push(r8e),n&&i.push(n8e),t.map(s=>{const{idx:o}=s,a={item:e[o],refIndex:o};return i.length&&i.forEach(c=>{c(s,a)}),a})}class ra{constructor(e,r={},n){this.options={...Ce,...r},this.options.useExtendedSearch,this._keyStore=new TSe(this.options.keys),this.setCollection(e,n)}setCollection(e,r){if(this._docs=e,r&&!(r instanceof wk))throw new Error(SSe);this._myIndex=r||vW(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){di(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const r=[];for(let n=0,i=this._docs.length;n-1&&(c=c.slice(0,r)),i8e(c,this._docs,{includeMatches:n,includeScore:i})}_searchStringList(e){const r=V5(e,this.options),{records:n}=this._myIndex,i=[];return n.forEach(({v:s,i:o,n:a})=>{if(!di(s))return;const{isMatch:c,score:l,indices:u}=r.searchIn(s);c&&i.push({item:s,idx:o,matches:[{score:l,value:s,norm:a,indices:u}]})}),i}_searchLogical(e){const r=bW(e,this.options),n=(a,c,l)=>{if(!a.children){const{keyId:f,searcher:d}=a,h=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(c,f),searcher:d});return h&&h.length?[{idx:l,item:c,matches:h}]:[]}const u=[];for(let f=0,d=a.children.length;f{if(di(a)){let l=n(r,a,c);l.length&&(s[c]||(s[c]={idx:c,item:a,matches:[]},o.push(s[c])),l.forEach(({matches:u})=>{s[c].matches.push(...u)}))}}),o}_searchObjectList(e){const r=V5(e,this.options),{keys:n,records:i}=this._myIndex,s=[];return i.forEach(({$:o,i:a})=>{if(!di(o))return;let c=[];n.forEach((l,u)=>{c.push(...this._findMatches({key:l,value:o[u],searcher:r}))}),c.length&&s.push({idx:a,item:o,matches:c})}),s}_findMatches({key:e,value:r,searcher:n}){if(!di(r))return[];let i=[];if(ta(r))r.forEach(({v:s,i:o,n:a})=>{if(!di(s))return;const{isMatch:c,score:l,indices:u}=n.searchIn(s);c&&i.push({score:l,key:e,value:s,idx:o,norm:a,indices:u})});else{const{v:s,n:o}=r,{isMatch:a,score:c,indices:l}=n.searchIn(s);a&&i.push({score:c,key:e,value:s,norm:o,indices:l})}return i}}ra.version="6.6.2";ra.createIndex=vW;ra.parseIndex=LSe;ra.config=Ce;ra.parseQuery=bW;XSe(JSe);function wW(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;et.forEach(r=>o8e(r,e))}function fu(...t){return C.useCallback(EW(...t),t)}function xW(t,e=[]){let r=[];function n(s,o){const a=C.createContext(o),c=r.length;r=[...r,o];function l(f){const{scope:d,children:h,...p}=f,v=(d==null?void 0:d[t][c])||a,b=C.useMemo(()=>p,Object.values(p));return C.createElement(v.Provider,{value:b},h)}function u(f,d){const h=(d==null?void 0:d[t][c])||a,p=C.useContext(h);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,u]}const i=()=>{const s=r.map(o=>C.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return C.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[n,a8e(i,...e)]}function a8e(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const f=c(s)[`__scope${l}`];return{...a,...f}},{});return C.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}const Ek=C.forwardRef((t,e)=>{const{children:r,...n}=t,i=C.Children.toArray(r),s=i.find(l8e);if(s){const o=s.props.children,a=i.map(c=>c===s?C.Children.count(o)>1?C.Children.only(null):C.isValidElement(o)?o.props.children:null:c);return C.createElement(Q5,sn({},n,{ref:e}),C.isValidElement(o)?C.cloneElement(o,void 0,a):null)}return C.createElement(Q5,sn({},n,{ref:e}),r)});Ek.displayName="Slot";const Q5=C.forwardRef((t,e)=>{const{children:r,...n}=t;return C.isValidElement(r)?C.cloneElement(r,{...u8e(n,r.props),ref:e?EW(e,r.ref):r.ref}):C.Children.count(r)>1?C.Children.only(null):null});Q5.displayName="SlotClone";const c8e=({children:t})=>C.createElement(C.Fragment,null,t);function l8e(t){return C.isValidElement(t)&&t.type===c8e}function u8e(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}const f8e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],cp=f8e.reduce((t,e)=>{const r=C.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?Ek:e;return C.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),C.createElement(a,sn({},o,{ref:i}))});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function d8e(t,e){t&&Ts.flushSync(()=>t.dispatchEvent(e))}function xc(t){const e=C.useRef(t);return C.useEffect(()=>{e.current=t}),C.useMemo(()=>(...r)=>{var n;return(n=e.current)===null||n===void 0?void 0:n.call(e,...r)},[])}function h8e(t,e=globalThis==null?void 0:globalThis.document){const r=xc(t);C.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[r,e])}const Y5="dismissableLayer.update",p8e="dismissableLayer.pointerDownOutside",v8e="dismissableLayer.focusOutside";let xI;const m8e=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),y8e=C.forwardRef((t,e)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...l}=t,u=C.useContext(m8e),[f,d]=C.useState(null),h=(r=f==null?void 0:f.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,p]=C.useState({}),v=fu(e,I=>d(I)),b=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=b.indexOf(y),g=f?b.indexOf(f):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,P=g>=m,T=g8e(I=>{const F=I.target,j=[...u.branches].some(H=>H.contains(F));!P||j||(s==null||s(I),a==null||a(I),I.defaultPrevented||c==null||c())},h),w=b8e(I=>{const F=I.target;[...u.branches].some(H=>H.contains(F))||(o==null||o(I),a==null||a(I),I.defaultPrevented||c==null||c())},h);return h8e(I=>{g===u.layers.size-1&&(i==null||i(I),!I.defaultPrevented&&c&&(I.preventDefault(),c()))},h),C.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(xI=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),CI(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=xI)}},[f,h,n,u]),C.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),CI())},[f,u]),C.useEffect(()=>{const I=()=>p({});return document.addEventListener(Y5,I),()=>document.removeEventListener(Y5,I)},[]),C.createElement(cp.div,sn({},l,{ref:v,style:{pointerEvents:S?P?"auto":"none":void 0,...t.style},onFocusCapture:Pl(t.onFocusCapture,w.onFocusCapture),onBlurCapture:Pl(t.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Pl(t.onPointerDownCapture,T.onPointerDownCapture)}))});function g8e(t,e=globalThis==null?void 0:globalThis.document){const r=xc(t),n=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let l=function(){CW(p8e,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function b8e(t,e=globalThis==null?void 0:globalThis.document){const r=xc(t),n=C.useRef(!1);return C.useEffect(()=>{const i=s=>{s.target&&!n.current&&CW(v8e,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function CI(){const t=new CustomEvent(Y5);document.dispatchEvent(t)}function CW(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?d8e(i,s):i.dispatchEvent(s)}let wE=0;function w8e(){C.useEffect(()=>{var t,e;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=r[0])!==null&&t!==void 0?t:SI()),document.body.insertAdjacentElement("beforeend",(e=r[1])!==null&&e!==void 0?e:SI()),wE++,()=>{wE===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),wE--}},[])}function SI(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const EE="focusScope.autoFocusOnMount",xE="focusScope.autoFocusOnUnmount",kI={bubbles:!1,cancelable:!0},E8e=C.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=C.useState(null),l=xc(i),u=xc(s),f=C.useRef(null),d=fu(e,v=>c(v)),h=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(n){let v=function(g){if(h.paused||!a)return;const S=g.target;a.contains(S)?f.current=S:_a(f.current,{select:!0})},b=function(g){if(h.paused||!a)return;const S=g.relatedTarget;S!==null&&(a.contains(S)||_a(f.current,{select:!0}))},y=function(g){if(document.activeElement===document.body)for(const P of g)P.removedNodes.length>0&&_a(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const m=new MutationObserver(y);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),m.disconnect()}}},[n,a,h.paused]),C.useEffect(()=>{if(a){_I.add(h);const v=document.activeElement;if(!a.contains(v)){const y=new CustomEvent(EE,kI);a.addEventListener(EE,l),a.dispatchEvent(y),y.defaultPrevented||(x8e(_8e(SW(a)),{select:!0}),document.activeElement===v&&_a(a))}return()=>{a.removeEventListener(EE,l),setTimeout(()=>{const y=new CustomEvent(xE,kI);a.addEventListener(xE,u),a.dispatchEvent(y),y.defaultPrevented||_a(v??document.body,{select:!0}),a.removeEventListener(xE,u),_I.remove(h)},0)}}},[a,l,u,h]);const p=C.useCallback(v=>{if(!r&&!n||h.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(b&&y){const m=v.currentTarget,[g,S]=C8e(m);g&&S?!v.shiftKey&&y===S?(v.preventDefault(),r&&_a(g,{select:!0})):v.shiftKey&&y===g&&(v.preventDefault(),r&&_a(S,{select:!0})):y===m&&v.preventDefault()}},[r,n,h.paused]);return C.createElement(cp.div,sn({tabIndex:-1},o,{ref:d,onKeyDown:p}))});function x8e(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(_a(n,{select:e}),document.activeElement!==r)return}function C8e(t){const e=SW(t),r=AI(e,t),n=AI(e.reverse(),t);return[r,n]}function SW(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function AI(t,e){for(const r of t)if(!S8e(r,{upTo:e}))return r}function S8e(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function k8e(t){return t instanceof HTMLInputElement&&"select"in t}function _a(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&k8e(t)&&e&&t.select()}}const _I=A8e();function A8e(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=PI(t,e),t.unshift(e)},remove(e){var r;t=PI(t,e),(r=t[0])===null||r===void 0||r.resume()}}}function PI(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function _8e(t){return t.filter(e=>e.tagName!=="A")}const Xf=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},P8e=w7["useId".toString()]||(()=>{});let T8e=0;function I8e(t){const[e,r]=C.useState(P8e());return Xf(()=>{t||r(n=>n??String(T8e++))},[t]),t||(e?`radix-${e}`:"")}const O8e=["top","right","bottom","left"],Cc=Math.min,hi=Math.max,Zy=Math.round,lv=Math.floor,Sc=t=>({x:t,y:t}),R8e={left:"right",right:"left",bottom:"top",top:"bottom"},$8e={start:"end",end:"start"};function J5(t,e,r){return hi(t,Cc(e,r))}function na(t,e){return typeof t=="function"?t(e):t}function ia(t){return t.split("-")[0]}function $d(t){return t.split("-")[1]}function xk(t){return t==="x"?"y":"x"}function Ck(t){return t==="y"?"height":"width"}function Md(t){return["top","bottom"].includes(ia(t))?"y":"x"}function Sk(t){return xk(Md(t))}function M8e(t,e,r){r===void 0&&(r=!1);const n=$d(t),i=Sk(t),s=Ck(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=eg(o)),[o,eg(o)]}function N8e(t){const e=eg(t);return[X5(t),e,X5(e)]}function X5(t){return t.replace(/start|end/g,e=>$8e[e])}function D8e(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function L8e(t,e,r,n){const i=$d(t);let s=D8e(ia(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(X5)))),s}function eg(t){return t.replace(/left|right|bottom|top/g,e=>R8e[e])}function F8e(t){return{top:0,right:0,bottom:0,left:0,...t}}function kW(t){return typeof t!="number"?F8e(t):{top:t,right:t,bottom:t,left:t}}function tg(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function TI(t,e,r){let{reference:n,floating:i}=t;const s=Md(e),o=Sk(e),a=Ck(o),c=ia(e),l=s==="y",u=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let h;switch(c){case"top":h={x:u,y:n.y-i.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-i.width,y:f};break;default:h={x:n.x,y:n.y}}switch($d(e)){case"start":h[o]-=d*(r&&l?-1:1);break;case"end":h[o]+=d*(r&&l?-1:1);break}return h}const B8e=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=TI(l,n,c),d=n,h={},p=0;for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:u=0}=na(t,e)||{};if(l==null)return{};const f=kW(u),d={x:r,y:n},h=Sk(i),p=Ck(h),v=await o.getDimensions(l),b=h==="y",y=b?"top":"left",m=b?"bottom":"right",g=b?"clientHeight":"clientWidth",S=s.reference[p]+s.reference[h]-d[h]-s.floating[p],P=d[h]-s.reference[h],T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let w=T?T[g]:0;(!w||!await(o.isElement==null?void 0:o.isElement(T)))&&(w=a.floating[g]||s.floating[p]);const I=S/2-P/2,F=w/2-v[p]/2-1,j=Cc(f[y],F),H=Cc(f[m],F),K=j,B=w-v[p]-H,E=w/2-v[p]/2+I,_=J5(K,E,B),O=!c.arrow&&$d(i)!=null&&E!=_&&s.reference[p]/2-(EK<=0)){var F,j;const K=(((F=s.flip)==null?void 0:F.index)||0)+1,B=P[K];if(B)return{data:{index:K,overflows:I},reset:{placement:B}};let E=(j=I.filter(_=>_.overflows[0]<=0).sort((_,O)=>_.overflows[1]-O.overflows[1])[0])==null?void 0:j.placement;if(!E)switch(h){case"bestFit":{var H;const _=(H=I.map(O=>[O.placement,O.overflows.filter(N=>N>0).reduce((N,k)=>N+k,0)]).sort((O,N)=>O[1]-N[1])[0])==null?void 0:H[0];_&&(E=_);break}case"initialPlacement":E=a;break}if(i!==E)return{reset:{placement:E}}}return{}}}};function OI(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function RI(t){return O8e.some(e=>t[e]>=0)}const U8e=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=na(t,e);switch(n){case"referenceHidden":{const s=await p1(e,{...i,elementContext:"reference"}),o=OI(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:RI(o)}}}case"escaped":{const s=await p1(e,{...i,altBoundary:!0}),o=OI(s,r.floating);return{data:{escapedOffsets:o,escaped:RI(o)}}}default:return{}}}}};async function z8e(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=ia(r),a=$d(r),c=Md(r)==="y",l=["left","top"].includes(o)?-1:1,u=s&&c?-1:1,f=na(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),c?{x:h*u,y:d*l}:{x:d*l,y:h*u}}const W8e=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:r,y:n}=e,i=await z8e(e,t);return{x:r+i.x,y:n+i.y,data:i}}}},H8e=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:b=>{let{x:y,y:m}=b;return{x:y,y:m}}},...c}=na(t,e),l={x:r,y:n},u=await p1(e,c),f=Md(ia(i)),d=xk(f);let h=l[d],p=l[f];if(s){const b=d==="y"?"top":"left",y=d==="y"?"bottom":"right",m=h+u[b],g=h-u[y];h=J5(m,h,g)}if(o){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",m=p+u[b],g=p-u[y];p=J5(m,p,g)}const v=a.fn({...e,[d]:h,[f]:p});return{...v,data:{x:v.x-r,y:v.y-n}}}}},q8e=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=na(t,e),u={x:r,y:n},f=Md(i),d=xk(f);let h=u[d],p=u[f];const v=na(a,e),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const g=d==="y"?"height":"width",S=s.reference[d]-s.floating[g]+b.mainAxis,P=s.reference[d]+s.reference[g]-b.mainAxis;hP&&(h=P)}if(l){var y,m;const g=d==="y"?"width":"height",S=["top","left"].includes(ia(i)),P=s.reference[f]-s.floating[g]+(S&&((y=o.offset)==null?void 0:y[f])||0)+(S?0:b.crossAxis),T=s.reference[f]+s.reference[g]+(S?0:((m=o.offset)==null?void 0:m[f])||0)-(S?b.crossAxis:0);pT&&(p=T)}return{[d]:h,[f]:p}}}},V8e=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=na(t,e),c=await p1(e,a),l=ia(r),u=$d(r),f=Md(r)==="y",{width:d,height:h}=n.floating;let p,v;l==="top"||l==="bottom"?(p=l,v=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=l,p=u==="end"?"top":"bottom");const b=h-c[p],y=d-c[v],m=!e.middlewareData.shift;let g=b,S=y;if(f){const T=d-c.left-c.right;S=u||m?Cc(y,T):T}else{const T=h-c.top-c.bottom;g=u||m?Cc(b,T):T}if(m&&!u){const T=hi(c.left,0),w=hi(c.right,0),I=hi(c.top,0),F=hi(c.bottom,0);f?S=d-2*(T!==0||w!==0?T+w:hi(c.left,c.right)):g=h-2*(I!==0||F!==0?I+F:hi(c.top,c.bottom))}await o({...e,availableWidth:S,availableHeight:g});const P=await i.getDimensions(s.floating);return d!==P.width||h!==P.height?{reset:{rects:!0}}:{}}}};function kc(t){return AW(t)?(t.nodeName||"").toLowerCase():"#document"}function gi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ma(t){var e;return(e=(AW(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function AW(t){return t instanceof Node||t instanceof gi(t).Node}function sa(t){return t instanceof Element||t instanceof gi(t).Element}function yo(t){return t instanceof HTMLElement||t instanceof gi(t).HTMLElement}function $I(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof gi(t).ShadowRoot}function lp(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=Gi(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function G8e(t){return["table","td","th"].includes(kc(t))}function kk(t){const e=Ak(),r=Gi(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function K8e(t){let e=Zf(t);for(;yo(e)&&!sw(e);){if(kk(e))return e;e=Zf(e)}return null}function Ak(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function sw(t){return["html","body","#document"].includes(kc(t))}function Gi(t){return gi(t).getComputedStyle(t)}function ow(t){return sa(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Zf(t){if(kc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||$I(t)&&t.host||ma(t);return $I(e)?e.host:e}function _W(t){const e=Zf(t);return sw(e)?t.ownerDocument?t.ownerDocument.body:t.body:yo(e)&&lp(e)?e:_W(e)}function v1(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=_W(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=gi(i);return s?e.concat(o,o.visualViewport||[],lp(i)?i:[],o.frameElement&&r?v1(o.frameElement):[]):e.concat(i,v1(i,[],r))}function PW(t){const e=Gi(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=yo(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=Zy(r)!==s||Zy(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function _k(t){return sa(t)?t:t.contextElement}function xf(t){const e=_k(t);if(!yo(e))return Sc(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=PW(e);let o=(s?Zy(r.width):r.width)/n,a=(s?Zy(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Q8e=Sc(0);function TW(t){const e=gi(t);return!Ak()||!e.visualViewport?Q8e:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Y8e(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==gi(t)?!1:e}function Gl(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=_k(t);let o=Sc(1);e&&(n?sa(n)&&(o=xf(n)):o=xf(t));const a=Y8e(s,r,n)?TW(s):Sc(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(s){const d=gi(s),h=n&&sa(n)?gi(n):n;let p=d.frameElement;for(;p&&n&&h!==d;){const v=xf(p),b=p.getBoundingClientRect(),y=Gi(p),m=b.left+(p.clientLeft+parseFloat(y.paddingLeft))*v.x,g=b.top+(p.clientTop+parseFloat(y.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=m,l+=g,p=gi(p).frameElement}}return tg({width:u,height:f,x:c,y:l})}function J8e(t){let{rect:e,offsetParent:r,strategy:n}=t;const i=yo(r),s=ma(r);if(r===s)return e;let o={scrollLeft:0,scrollTop:0},a=Sc(1);const c=Sc(0);if((i||!i&&n!=="fixed")&&((kc(r)!=="body"||lp(s))&&(o=ow(r)),yo(r))){const l=Gl(r);a=xf(r),c.x=l.x+r.clientLeft,c.y=l.y+r.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-o.scrollLeft*a.x+c.x,y:e.y*a.y-o.scrollTop*a.y+c.y}}function X8e(t){return Array.from(t.getClientRects())}function IW(t){return Gl(ma(t)).left+ow(t).scrollLeft}function Z8e(t){const e=ma(t),r=ow(t),n=t.ownerDocument.body,i=hi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=hi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+IW(t);const a=-r.scrollTop;return Gi(n).direction==="rtl"&&(o+=hi(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function eke(t,e){const r=gi(t),n=ma(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=Ak();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function tke(t,e){const r=Gl(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=yo(t)?xf(t):Sc(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function MI(t,e,r){let n;if(e==="viewport")n=eke(t,r);else if(e==="document")n=Z8e(ma(t));else if(sa(e))n=tke(e,r);else{const i=TW(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return tg(n)}function OW(t,e){const r=Zf(t);return r===e||!sa(r)||sw(r)?!1:Gi(r).position==="fixed"||OW(r,e)}function rke(t,e){const r=e.get(t);if(r)return r;let n=v1(t,[],!1).filter(a=>sa(a)&&kc(a)!=="body"),i=null;const s=Gi(t).position==="fixed";let o=s?Zf(t):t;for(;sa(o)&&!sw(o);){const a=Gi(o),c=kk(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||lp(o)&&!c&&OW(t,o))?n=n.filter(u=>u!==o):i=a,o=Zf(o)}return e.set(t,n),n}function nke(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?rke(e,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,u)=>{const f=MI(e,u,i);return l.top=hi(f.top,l.top),l.right=Cc(f.right,l.right),l.bottom=Cc(f.bottom,l.bottom),l.left=hi(f.left,l.left),l},MI(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ike(t){return PW(t)}function ske(t,e,r){const n=yo(e),i=ma(e),s=r==="fixed",o=Gl(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=Sc(0);if(n||!n&&!s)if((kc(e)!=="body"||lp(i))&&(a=ow(e)),n){const l=Gl(e,!0,s,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else i&&(c.x=IW(i));return{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function NI(t,e){return!yo(t)||Gi(t).position==="fixed"?null:e?e(t):t.offsetParent}function RW(t,e){const r=gi(t);if(!yo(t))return r;let n=NI(t,e);for(;n&&G8e(n)&&Gi(n).position==="static";)n=NI(n,e);return n&&(kc(n)==="html"||kc(n)==="body"&&Gi(n).position==="static"&&!kk(n))?r:n||K8e(t)||r}const oke=async function(t){let{reference:e,floating:r,strategy:n}=t;const i=this.getOffsetParent||RW,s=this.getDimensions;return{reference:ske(e,await i(r),n),floating:{x:0,y:0,...await s(r)}}};function ake(t){return Gi(t).direction==="rtl"}const cke={convertOffsetParentRelativeRectToViewportRelativeRect:J8e,getDocumentElement:ma,getClippingRect:nke,getOffsetParent:RW,getElementRects:oke,getClientRects:X8e,getDimensions:ike,getScale:xf,isElement:sa,isRTL:ake};function lke(t,e){let r=null,n;const i=ma(t);function s(){clearTimeout(n),r&&r.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:u,width:f,height:d}=t.getBoundingClientRect();if(a||e(),!f||!d)return;const h=lv(u),p=lv(i.clientWidth-(l+f)),v=lv(i.clientHeight-(u+d)),b=lv(l),m={rootMargin:-h+"px "+-p+"px "+-v+"px "+-b+"px",threshold:hi(0,Cc(1,c))||1};let g=!0;function S(P){const T=P[0].intersectionRatio;if(T!==c){if(!g)return o();T?o(!1,T):n=setTimeout(()=>{o(!1,1e-7)},100)}g=!1}try{r=new IntersectionObserver(S,{...m,root:i.ownerDocument})}catch{r=new IntersectionObserver(S,m)}r.observe(t)}return o(!0),s}function uke(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=_k(t),u=i||s?[...l?v1(l):[],...v1(e)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",r,{passive:!0}),s&&y.addEventListener("resize",r)});const f=l&&a?lke(l,r):null;let d=-1,h=null;o&&(h=new ResizeObserver(y=>{let[m]=y;m&&m.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{h&&h.observe(e)})),r()}),l&&!c&&h.observe(l),h.observe(e));let p,v=c?Gl(t):null;c&&b();function b(){const y=Gl(t);v&&(y.x!==v.x||y.y!==v.y||y.width!==v.width||y.height!==v.height)&&r(),v=y,p=requestAnimationFrame(b)}return r(),()=>{u.forEach(y=>{i&&y.removeEventListener("scroll",r),s&&y.removeEventListener("resize",r)}),f&&f(),h&&h.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const fke=(t,e,r)=>{const n=new Map,i={platform:cke,...r},s={...i.platform,_c:n};return B8e(t,e,{...i,platform:s})},dke=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?II({element:n.current,padding:i}).fn(r):{}:n?II({element:n,padding:i}).fn(r):{}}}};var rm=typeof document<"u"?C.useLayoutEffect:C.useEffect;function rg(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!rg(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!rg(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function $W(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function DI(t,e){const r=$W(t);return Math.round(e*r)/r}function LI(t){const e=C.useRef(t);return rm(()=>{e.current=t}),e}function hke(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,f]=C.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,h]=C.useState(n);rg(d,n)||h(n);const[p,v]=C.useState(null),[b,y]=C.useState(null),m=C.useCallback(O=>{O!=T.current&&(T.current=O,v(O))},[v]),g=C.useCallback(O=>{O!==w.current&&(w.current=O,y(O))},[y]),S=s||p,P=o||b,T=C.useRef(null),w=C.useRef(null),I=C.useRef(u),F=LI(c),j=LI(i),H=C.useCallback(()=>{if(!T.current||!w.current)return;const O={placement:e,strategy:r,middleware:d};j.current&&(O.platform=j.current),fke(T.current,w.current,O).then(N=>{const k={...N,isPositioned:!0};K.current&&!rg(I.current,k)&&(I.current=k,Ts.flushSync(()=>{f(k)}))})},[d,e,r,j]);rm(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(O=>({...O,isPositioned:!1})))},[l]);const K=C.useRef(!1);rm(()=>(K.current=!0,()=>{K.current=!1}),[]),rm(()=>{if(S&&(T.current=S),P&&(w.current=P),S&&P){if(F.current)return F.current(S,P,H);H()}},[S,P,H,F]);const B=C.useMemo(()=>({reference:T,floating:w,setReference:m,setFloating:g}),[m,g]),E=C.useMemo(()=>({reference:S,floating:P}),[S,P]),_=C.useMemo(()=>{const O={position:r,left:0,top:0};if(!E.floating)return O;const N=DI(E.floating,u.x),k=DI(E.floating,u.y);return a?{...O,transform:"translate("+N+"px, "+k+"px)",...$W(E.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:N,top:k}},[r,a,E.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:H,refs:B,elements:E,floatingStyles:_}),[u,H,B,E,_])}function pke(t){const[e,r]=C.useState(void 0);return Xf(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}const MW="Popper",[NW,DW]=xW(MW),[vke,LW]=NW(MW),mke=t=>{const{__scopePopper:e,children:r}=t,[n,i]=C.useState(null);return C.createElement(vke,{scope:e,anchor:n,onAnchorChange:i},r)},yke="PopperAnchor",gke=C.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=LW(yke,r),o=C.useRef(null),a=fu(e,o);return C.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:C.createElement(cp.div,sn({},i,{ref:a}))}),FW="PopperContent",[bke,p9e]=NW(FW),wke=C.forwardRef((t,e)=>{var r,n,i,s,o,a,c,l;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:h="center",alignOffset:p=0,arrowPadding:v=0,avoidCollisions:b=!0,collisionBoundary:y=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:S=!1,updatePositionStrategy:P="optimized",onPlaced:T,...w}=t,I=LW(FW,u),[F,j]=C.useState(null),H=fu(e,ue=>j(ue)),[K,B]=C.useState(null),E=pke(K),_=(r=E==null?void 0:E.width)!==null&&r!==void 0?r:0,O=(n=E==null?void 0:E.height)!==null&&n!==void 0?n:0,N=f+(h!=="center"?"-"+h:""),k=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},$=Array.isArray(y)?y:[y],L=$.length>0,M={padding:k,boundary:$.filter(Eke),altBoundary:L},{refs:A,floatingStyles:D,placement:V,isPositioned:R,middlewareData:U}=hke({strategy:"fixed",placement:N,whileElementsMounted:(...ue)=>uke(...ue,{animationFrame:P==="always"}),elements:{reference:I.anchor},middleware:[W8e({mainAxis:d+O,alignmentAxis:p}),b&&H8e({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?q8e():void 0,...M}),b&&j8e({...M}),V8e({...M,apply:({elements:ue,rects:ot,availableWidth:Te,availableHeight:_e})=>{const{width:at,height:xe}=ot.reference,be=ue.floating.style;be.setProperty("--radix-popper-available-width",`${Te}px`),be.setProperty("--radix-popper-available-height",`${_e}px`),be.setProperty("--radix-popper-anchor-width",`${at}px`),be.setProperty("--radix-popper-anchor-height",`${xe}px`)}}),K&&dke({element:K,padding:v}),xke({arrowWidth:_,arrowHeight:O}),S&&U8e({strategy:"referenceHidden",...M})]}),[W,q]=BW(V),Y=xc(T);Xf(()=>{R&&(Y==null||Y())},[R,Y]);const X=(i=U.arrow)===null||i===void 0?void 0:i.x,Q=(s=U.arrow)===null||s===void 0?void 0:s.y,Z=((o=U.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[ae,se]=C.useState();return Xf(()=>{F&&se(window.getComputedStyle(F).zIndex)},[F]),C.createElement("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:R?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[(a=U.transformOrigin)===null||a===void 0?void 0:a.x,(c=U.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:t.dir},C.createElement(bke,{scope:u,placedSide:W,onArrowChange:B,arrowX:X,arrowY:Q,shouldHideArrow:Z},C.createElement(cp.div,sn({"data-side":W,"data-align":q},w,{ref:H,style:{...w.style,animation:R?void 0:"none",opacity:(l=U.hide)!==null&&l!==void 0&&l.referenceHidden?0:void 0}}))))});function Eke(t){return t!==null}const xke=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i,s,o;const{placement:a,rects:c,middlewareData:l}=e,f=((r=l.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:t.arrowWidth,h=f?0:t.arrowHeight,[p,v]=BW(a),b={start:"0%",center:"50%",end:"100%"}[v],y=((n=(i=l.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,m=((s=(o=l.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+h/2;let g="",S="";return p==="bottom"?(g=f?b:`${y}px`,S=`${-h}px`):p==="top"?(g=f?b:`${y}px`,S=`${c.floating.height+h}px`):p==="right"?(g=`${-h}px`,S=f?b:`${m}px`):p==="left"&&(g=`${c.floating.width+h}px`,S=f?b:`${m}px`),{data:{x:g,y:S}}}});function BW(t){const[e,r="center"]=t.split("-");return[e,r]}const Cke=mke,jW=gke,Ske=wke;function kke(t,e){return C.useReducer((r,n)=>{const i=e[r][n];return i??r},t)}const UW=t=>{const{present:e,children:r}=t,n=Ake(e),i=typeof r=="function"?r({present:n.isPresent}):C.Children.only(r),s=fu(n.ref,i.ref);return typeof r=="function"||n.isPresent?C.cloneElement(i,{ref:s}):null};UW.displayName="Presence";function Ake(t){const[e,r]=C.useState(),n=C.useRef({}),i=C.useRef(t),s=C.useRef("none"),o=t?"mounted":"unmounted",[a,c]=kke(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const l=uv(n.current);s.current=a==="mounted"?l:"none"},[a]),Xf(()=>{const l=n.current,u=i.current;if(u!==t){const d=s.current,h=uv(l);t?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),Xf(()=>{if(e){const l=f=>{const h=uv(n.current).includes(f.animationName);f.target===e&&h&&Ts.flushSync(()=>c("ANIMATION_END"))},u=f=>{f.target===e&&(s.current=uv(n.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function uv(t){return(t==null?void 0:t.animationName)||"none"}function _ke({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=Pke({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=xc(r),c=C.useCallback(l=>{if(s){const f=typeof l=="function"?l(t):l;f!==t&&a(f)}else i(l)},[s,t,i,a]);return[o,c]}function Pke({defaultProp:t,onChange:e}){const r=C.useState(t),[n]=r,i=C.useRef(n),s=xc(e);return C.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}var Tke=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Su=new WeakMap,fv=new WeakMap,dv={},CE=0,zW=function(t){return t&&(t.host||zW(t.parentNode))},Ike=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=zW(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},Oke=function(t,e,r,n){var i=Ike(e,Array.isArray(t)?t:[t]);dv[r]||(dv[r]=new WeakMap);var s=dv[r],o=[],a=new Set,c=new Set(i),l=function(f){!f||a.has(f)||(a.add(f),l(f.parentNode))};i.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))u(d);else{var h=d.getAttribute(n),p=h!==null&&h!=="false",v=(Su.get(d)||0)+1,b=(s.get(d)||0)+1;Su.set(d,v),s.set(d,b),o.push(d),v===1&&p&&fv.set(d,!0),b===1&&d.setAttribute(r,"true"),p||d.setAttribute(n,"true")}})};return u(e),a.clear(),CE++,function(){o.forEach(function(f){var d=Su.get(f)-1,h=s.get(f)-1;Su.set(f,d),s.set(f,h),d||(fv.has(f)||f.removeAttribute(n),fv.delete(f)),h||f.removeAttribute(r)}),CE--,CE||(Su=new WeakMap,Su=new WeakMap,fv=new WeakMap,dv={})}},Rke=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=e||Tke(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),Oke(n,i,r,"aria-hidden")):function(){return null}},nm="right-scroll-bar-position",im="width-before-scroll-bar",$ke="with-scroll-bars-hidden",Mke="--removed-body-scroll-bar-size";function Nke(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Dke(t,e){var r=C.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=e,r.facade}function Lke(t,e){return Dke(e||null,function(r){return t.forEach(function(n){return Nke(n,r)})})}function Fke(t){return t}function Bke(t,e){e===void 0&&(e=Fke);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(s){var o=e(s,n);return r.push(o),function(){r=r.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(n=!0;r.length;){var o=r;r=[],o.forEach(s)}r={push:function(a){return s(a)},filter:function(){return r}}},assignMedium:function(s){n=!0;var o=[];if(r.length){var a=r;r=[],a.forEach(s),o=r}var c=function(){var u=o;o=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),r={push:function(u){o.push(u),l()},filter:function(u){return o=o.filter(u),r}}}};return i}function jke(t){t===void 0&&(t={});var e=Bke(null);return e.options=Di({async:!0,ssr:!1},t),e}var WW=function(t){var e=t.sideCar,r=zg(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return C.createElement(n,Di({},r))};WW.isSideCarExport=!0;function Uke(t,e){return t.useMedium(e),WW}var HW=jke(),SE=function(){},aw=C.forwardRef(function(t,e){var r=C.useRef(null),n=C.useState({onScrollCapture:SE,onWheelCapture:SE,onTouchMoveCapture:SE}),i=n[0],s=n[1],o=t.forwardProps,a=t.children,c=t.className,l=t.removeScrollBar,u=t.enabled,f=t.shards,d=t.sideCar,h=t.noIsolation,p=t.inert,v=t.allowPinchZoom,b=t.as,y=b===void 0?"div":b,m=zg(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),g=d,S=Lke([r,e]),P=Di(Di({},m),i);return C.createElement(C.Fragment,null,u&&C.createElement(g,{sideCar:HW,removeScrollBar:l,shards:f,noIsolation:h,inert:p,setCallbacks:s,allowPinchZoom:!!v,lockRef:r}),o?C.cloneElement(C.Children.only(a),Di(Di({},P),{ref:S})):C.createElement(y,Di({},P,{className:c,ref:S}),a))});aw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};aw.classNames={fullWidth:im,zeroRight:nm};var FI,zke=function(){if(FI)return FI;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Wke(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=zke();return e&&t.setAttribute("nonce",e),t}function Hke(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function qke(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Vke=function(){var t=0,e=null;return{add:function(r){t==0&&(e=Wke())&&(Hke(e,r),qke(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Gke=function(){var t=Vke();return function(e,r){C.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},qW=function(){var t=Gke(),e=function(r){var n=r.styles,i=r.dynamic;return t(n,i),null};return e},Kke={left:0,top:0,right:0,gap:0},kE=function(t){return parseInt(t||"",10)||0},Qke=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[kE(r),kE(n),kE(i)]},Yke=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Kke;var e=Qke(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},Jke=qW(),Xke=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` + .`.concat($ke,` { overflow: hidden `).concat(n,`; padding-right: `).concat(a,"px ").concat(n,`; } @@ -279,29 +279,29 @@ Invalid media condition`));var d=t(e.slice(i+2),r,f.value);return{operator:f.val `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),` } - .`).concat(Xv,` { + .`).concat(nm,` { right: `).concat(a,"px ").concat(n,`; } - .`).concat(Zv,` { + .`).concat(im,` { margin-right: `).concat(a,"px ").concat(n,`; } - .`).concat(Xv," .").concat(Xv,` { + .`).concat(nm," .").concat(nm,` { right: 0 `).concat(n,`; } - .`).concat(Zv," .").concat(Zv,` { + .`).concat(im," .").concat(im,` { margin-right: 0 `).concat(n,`; } body { - `).concat(J8e,": ").concat(a,`px; + `).concat(Mke,": ").concat(a,`px; } -`)},mke=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n,s=C.useMemo(function(){return hke(i)},[i]);return C.createElement(pke,{styles:vke(s,!e,i,r?"":"!important")})},q5=!1;if(typeof window<"u")try{var cv=Object.defineProperty({},"passive",{get:function(){return q5=!0,!0}});window.addEventListener("test",cv,cv),window.removeEventListener("test",cv,cv)}catch{q5=!1}var Su=q5?{passive:!1}:!1,yke=function(t){return t.tagName==="TEXTAREA"},mW=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!yke(t)&&r[e]==="visible")},gke=function(t){return mW(t,"overflowY")},bke=function(t){return mW(t,"overflowX")},PI=function(t,e){var r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=yW(t,r);if(n){var i=gW(t,r),s=i[1],o=i[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},wke=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},Eke=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},yW=function(t,e){return t==="v"?gke(e):bke(e)},gW=function(t,e){return t==="v"?wke(e):Eke(e)},xke=function(t,e){return t==="h"&&e==="rtl"?-1:1},Cke=function(t,e,r,n,i){var s=xke(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,c=e.contains(a),l=!1,u=o>0,f=0,d=0;do{var h=gW(t,a),p=h[0],v=h[1],b=h[2],y=v-b-s*p;(p||y)&&yW(t,a)&&(f+=y,d+=p),a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(u&&(i&&f===0||!i&&o>f)||!u&&(i&&d===0||!i&&-o>d))&&(l=!0),l},lv=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},TI=function(t){return[t.deltaX,t.deltaY]},II=function(t){return t&&"current"in t?t.current:t},Ske=function(t,e){return t[0]===e[0]&&t[1]===e[1]},kke=function(t){return` +`)},Zke=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n,s=C.useMemo(function(){return Yke(i)},[i]);return C.createElement(Jke,{styles:Xke(s,!e,i,r?"":"!important")})},Z5=!1;if(typeof window<"u")try{var hv=Object.defineProperty({},"passive",{get:function(){return Z5=!0,!0}});window.addEventListener("test",hv,hv),window.removeEventListener("test",hv,hv)}catch{Z5=!1}var ku=Z5?{passive:!1}:!1,eAe=function(t){return t.tagName==="TEXTAREA"},VW=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!eAe(t)&&r[e]==="visible")},tAe=function(t){return VW(t,"overflowY")},rAe=function(t){return VW(t,"overflowX")},BI=function(t,e){var r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=GW(t,r);if(n){var i=KW(t,r),s=i[1],o=i[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},nAe=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},iAe=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},GW=function(t,e){return t==="v"?tAe(e):rAe(e)},KW=function(t,e){return t==="v"?nAe(e):iAe(e)},sAe=function(t,e){return t==="h"&&e==="rtl"?-1:1},oAe=function(t,e,r,n,i){var s=sAe(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,c=e.contains(a),l=!1,u=o>0,f=0,d=0;do{var h=KW(t,a),p=h[0],v=h[1],b=h[2],y=v-b-s*p;(p||y)&&GW(t,a)&&(f+=y,d+=p),a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(u&&(i&&f===0||!i&&o>f)||!u&&(i&&d===0||!i&&-o>d))&&(l=!0),l},pv=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},jI=function(t){return[t.deltaX,t.deltaY]},UI=function(t){return t&&"current"in t?t.current:t},aAe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},cAe=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},Ake=0,ku=[];function _ke(t){var e=C.useRef([]),r=C.useRef([0,0]),n=C.useRef(),i=C.useState(Ake++)[0],s=C.useState(function(){return vW()})[0],o=C.useRef(t);C.useEffect(function(){o.current=t},[t]),C.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var v=ire([t.lockRef.current],(t.shards||[]).map(II),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=C.useCallback(function(v,b){if("touches"in v&&v.touches.length===2)return!o.current.allowPinchZoom;var y=lv(v),m=r.current,g="deltaX"in v?v.deltaX:m[0]-y[0],S="deltaY"in v?v.deltaY:m[1]-y[1],P,T=v.target,w=Math.abs(g)>Math.abs(S)?"h":"v";if("touches"in v&&w==="h"&&T.type==="range")return!1;var I=PI(w,T);if(!I)return!0;if(I?P=w:(P=w==="v"?"h":"v",I=PI(w,T)),!I)return!1;if(!n.current&&"changedTouches"in v&&(g||S)&&(n.current=P),!P)return!0;var B=n.current||P;return Cke(B,b,v,B==="h"?g:S,!0)},[]),c=C.useCallback(function(v){var b=v;if(!(!ku.length||ku[ku.length-1]!==s)){var y="deltaY"in b?TI(b):lv(b),m=e.current.filter(function(P){return P.name===b.type&&P.target===b.target&&Ske(P.delta,y)})[0];if(m&&m.should){b.cancelable&&b.preventDefault();return}if(!m){var g=(o.current.shards||[]).map(II).filter(Boolean).filter(function(P){return P.contains(b.target)}),S=g.length>0?a(b,g[0]):!o.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),l=C.useCallback(function(v,b,y,m){var g={name:v,delta:b,target:y,should:m};e.current.push(g),setTimeout(function(){e.current=e.current.filter(function(S){return S!==g})},1)},[]),u=C.useCallback(function(v){r.current=lv(v),n.current=void 0},[]),f=C.useCallback(function(v){l(v.type,TI(v),v.target,a(v,t.lockRef.current))},[]),d=C.useCallback(function(v){l(v.type,lv(v),v.target,a(v,t.lockRef.current))},[]);C.useEffect(function(){return ku.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",c,Su),document.addEventListener("touchmove",c,Su),document.addEventListener("touchstart",u,Su),function(){ku=ku.filter(function(v){return v!==s}),document.removeEventListener("wheel",c,Su),document.removeEventListener("touchmove",c,Su),document.removeEventListener("touchstart",u,Su)}},[]);var h=t.removeScrollBar,p=t.inert;return C.createElement(C.Fragment,null,p?C.createElement(s,{styles:kke(i)}):null,h?C.createElement(mke,{gapMode:"margin"}):null)}const Pke=ike(pW,_ke);var bW=C.forwardRef(function(t,e){return C.createElement(ew,Gs({},t,{ref:e,sideCar:Pke}))});bW.classNames=ew.classNames;const Tke=bW,wW="Popover",[EW,OTe]=Vz(wW,[oW]),tw=oW(),[Ike,Rd]=EW(wW),Oke=t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=tw(e),c=C.useRef(null),[l,u]=C.useState(!1),[f=!1,d]=H8e({prop:n,defaultProp:i,onChange:s});return C.createElement(j8e,a,C.createElement(Ike,{scope:e,contentId:GSe(),triggerRef:c,open:f,onOpenChange:d,onOpenToggle:C.useCallback(()=>d(h=>!h),[d]),hasCustomAnchor:l,onCustomAnchorAdd:C.useCallback(()=>u(!0),[]),onCustomAnchorRemove:C.useCallback(()=>u(!1),[]),modal:o},r))},Rke="PopoverAnchor",Mke=C.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=Rd(Rke,r),s=tw(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return C.useEffect(()=>(o(),()=>a()),[o,a]),C.createElement(uW,sn({},s,n,{ref:e}))}),$ke="PopoverTrigger",Nke=C.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=Rd($ke,r),s=tw(r),o=uu(e,i.triggerRef),a=C.createElement(np.button,sn({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":CW(i.open)},n,{ref:o,onClick:_l(t.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:C.createElement(uW,sn({asChild:!0},s),a)}),Dke="PopoverPortal",[RTe,Lke]=EW(Dke,{forceMount:void 0}),h1="PopoverContent",Bke=C.forwardRef((t,e)=>{const r=Lke(h1,t.__scopePopover),{forceMount:n=r.forceMount,...i}=t,s=Rd(h1,t.__scopePopover);return C.createElement(fW,{present:n||s.open},s.modal?C.createElement(Fke,sn({},i,{ref:e})):C.createElement(jke,sn({},i,{ref:e})))}),Fke=C.forwardRef((t,e)=>{const r=Rd(h1,t.__scopePopover),n=C.useRef(null),i=uu(e,n),s=C.useRef(!1);return C.useEffect(()=>{const o=n.current;if(o)return Q8e(o)},[]),C.createElement(Tke,{as:fk,allowPinchZoom:!0},C.createElement(xW,sn({},t,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_l(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=r.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:_l(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:_l(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})))}),jke=C.forwardRef((t,e)=>{const r=Rd(h1,t.__scopePopover),n=C.useRef(!1),i=C.useRef(!1);return C.createElement(xW,sn({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,s),!s.defaultPrevented){var a;n.current||(a=r.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)===null||o===void 0||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=s.target;((a=r.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),xW=C.forwardRef((t,e)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...f}=t,d=Rd(h1,r),h=tw(r);return LSe(),C.createElement(BSe,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s},C.createElement($Se,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>d.onOpenChange(!1)},C.createElement(U8e,sn({"data-state":CW(d.open),role:"dialog",id:d.contentId},h,f,{ref:e,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function CW(t){return t?"open":"closed"}const Uke=Oke,zke=Mke,Wke=Nke,Hke=Bke,[qke,Vke]=lu(),sp=()=>{const{setOpenWalletModal:t,openWalletModalState:e}=qke();return{setOpenWalletModal:t,openWalletModalState:e}};function bn(){return bn=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}const ar=(t,e)=>t.toLowerCase()===e.toLowerCase(),gk=(t,e)=>{let r=t;return t.length>=e&&(r=t.slice(0,e/2)+"..."+t.slice(t.length-e/2,t.length)),r},SW=t=>`0x${gk((t==null?void 0:t.substring(2))||"",8)}`;var _a=function(t){return t[t.VERY_LARGE=0]="VERY_LARGE",t[t.FRACTION=1]="FRACTION",t[t.VERY_TINY=2]="VERY_TINY",t[t.MIXED=3]="MIXED",t}(_a||{});const sa=t=>{if(isNaN(Number(t)))return console.error(`display format error ${t} is not a number`),"NaN";const e=Number(t);if(e===0)return"0";let r;e>1e8?r=_a.VERY_LARGE:e<1e-10?r=_a.VERY_TINY:e<1?r=_a.FRACTION:r=_a.MIXED;let n,i;switch(r){case _a.VERY_LARGE:n="compact",i={maximumFractionDigits:4};break;case _a.VERY_TINY:n="scientific",i={maximumFractionDigits:4};break;case _a.FRACTION:n="standard",i={maximumSignificantDigits:4};break;default:n="standard",i={maximumFractionDigits:2}}return Intl.NumberFormat("en-US",bn({notation:n},i)).format(e)},Gke=t=>t.charAt(0).toUpperCase()+t.slice(1),kW=(t,e)=>{const r=t.split(".");return r.length===1?t:`${r[0]}.${r[1].slice(0,e)}`},Jy=t=>/0x[a-fA-F0-9]{40}/.test(t),Kke=t=>t>0?ve.colors.positive:t<0?ve.colors.negative:ve.colors.text50,OI=(t,e)=>{var r;const n=e.find(s=>ar(s.token.contractAddress,t.contractAddress));return n&&(n==null||(r=n.price24hChange)==null?void 0:r.value)||0},yo=({balance:t,prices:e,decimals:r,conversionRate:n})=>{var i;let s=0;const o=e.find(f=>ar(f.token.contractAddress,t.contractAddress));if(!o)return"0.00";const a=((i=o.price)==null?void 0:i.value)||0,c=xr(t.balance,r),l=parseFloat(c)*a;return s+=l,`${(s*n).toFixed(2)}`},AW=t=>{const e=[],r=[],n=[];return t.forEach(i=>{i.contractAddress===lr?e.push(i):i.contractType==="ERC20"?r.push(i):(i.contractType==="ERC721"||i.contractType==="ERC1155")&&n.push(i)}),{nativeTokens:e,erc20Tokens:r,collectibles:n}},_W=t=>{const e=[];return t==null||t.pages.forEach(r=>{e.push(...r.transactions)}),e},Xy=async({accountAddress:t,chainId:e})=>{try{const{indexerClient:r}=await ln(e),n=await r.getEtherBalance({accountAddress:t});return[{chainId:e,contractAddress:lr,accountAddress:t,balance:(n==null?void 0:n.balance.balanceWei)||"0",contractType:x8.UNKNOWN,blockHash:"",blockNumber:0,tokenID:""}]}catch(r){return console.error(r),[]}},bk=async({tokens:t})=>{try{if(t.length===0)return[];const e=t[0].chainId,{apiClient:r}=await ln(e),n=await r.getCoinPrices({tokens:t});return(n==null?void 0:n.tokenPrices)||[]}catch(e){console.error(e);return}},Zy=async({accountAddress:t,chainId:e,contractAddress:r},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:s=!0})=>{try{const{indexerClient:o}=await ln(e),a=await o.getTokenBalances(bn({accountAddress:t,includeMetadata:s},r?{contractAddress:r}:{}));let c=(a==null?void 0:a.balances)||[];if(n&&c.length>0){const l=await bk({tokens:c.map(u=>({chainId:u.chainId,contractAddress:u.contractAddress,tokenId:u.tokenID}))});c=c.filter(u=>{const f=l==null?void 0:l.find(d=>ar(d.token.contractAddress,u.contractAddress)&&d.token.chainId===u.chainId);return u.contractType!=="ERC20"||!!f&&f.price!==null})}return i&&c.length>0&&(c=c.filter(l=>l.contractType!=="ERC721"&&l.contractType!=="ERC1155")),c}catch(o){return console.error(o),[]}},Qke=async({accountAddress:t,chainId:e},{hideUnlistedTokens:r,hideCollectibles:n})=>{try{return(await Promise.all([Xy({accountAddress:t,chainId:e}),Zy({accountAddress:t,chainId:e},{hideUnlistedTokens:r,hideCollectibles:n})])).flat()}catch(i){return console.error(i),[]}},PW=async({accountAddress:t,chainId:e,collectionAddress:r,includeMetadata:n=!0})=>{try{const{indexerClient:i}=await ln(e),s=await i.getTokenBalances({accountAddress:t,includeMetadata:n,contractAddress:r});return(s==null?void 0:s.balances)||[]}catch(i){return console.error(i),[]}},Yke=async({accountAddress:t,chainIds:e,displayAssets:r},{hideUnlistedTokens:n,hideCollectibles:i})=>{let o=[];const a=r.length>0;try{if(a){const S=r.filter(I=>ar(I.contractAddress,lr)),P=r.filter(I=>!ar(I.contractAddress,lr)),T={},w={};S.forEach(I=>{T[I.chainId]||(T[I.chainId]=[]),T[I.chainId].push(I)}),P.forEach(I=>{w[I.chainId]||(w[I.chainId]=[]),w[I.chainId].push(I)}),o=(await Promise.all([...Object.keys(T).map(I=>Xy({accountAddress:t,chainId:Number(I)})),...Object.keys(w).map(I=>w[Number(I)].map(B=>Zy({accountAddress:t,chainId:Number(I),contractAddress:B.contractAddress},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:!1}))).flat()])).flat()}else o=(await Promise.all([...e.map(S=>Xy({accountAddress:t,chainId:S})),...e.map(S=>Zy({accountAddress:t,chainId:S},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:!1}))])).flat();const{nativeTokens:c,erc20Tokens:l,collectibles:u}=AW(o),f=new Promise(async(S,P)=>{if(l.length>0){const T=l.map(I=>({chainId:I.chainId,contractAddress:I.contractAddress})),w=await bk({tokens:T})||[];S(w)}else S([])}),d=u.map(async S=>a?S:await PW({accountAddress:t,chainId:S.chainId,collectionAddress:S.contractAddress,includeMetadata:!1})),h=async()=>{const S={},P={};l.forEach(w=>{P[w.chainId]?P[w.chainId].push(w):P[w.chainId]=[w]});const T=Object.keys(P).map(async w=>{const{metadataClient:I}=ln(w),j=P[Number(w)].map(K=>K.contractAddress),H=await I.getContractInfoBatch({chainID:String(w),contractAddresses:j});S[Number(w)]=H});return await Promise.all([...T]),S},[p,v,...b]=await Promise.all([f,h(),...d]),y=l.sort((S,P)=>{var T,w;const I=p.find(k=>ar(k.token.contractAddress,S.contractAddress)),B=p.find(k=>ar(k.token.contractAddress,P.contractAddress)),j=I!=null&&I.price?I.price.value:0,H=B!=null&&B.price?B.price.value:0,K=(T=v[S.chainId].contractInfoMap[S.contractAddress])==null?void 0:T.decimals,F=(w=v[P.chainId].contractInfoMap[P.contractAddress])==null?void 0:w.decimals,E=K===void 0?0:Number(xr(S.balance,K)),_=F===void 0?0:Number(xr(P.balance,F)),O=E*j;return _*H-O}),m=f3e(b.flat(),10).sort((S,P)=>S.contractAddress.localeCompare(P.contractAddress));return i?[...c.length>0?[c[0]]:[],...y.length>0?y.slice(0,11):[]]:[...c.length>0?[c[0]]:[],...y.length>0?[y[0]]:[],...m.length>0?[...m]:[]]}catch(c){return console.error(c),[]}},Jke=async({accountAddress:t,chainId:e,collectionAddress:r,tokenId:n})=>{const{indexerClient:i}=await ln(e);return(await i.getTokenBalances({accountAddress:t,includeMetadata:!0,contractAddress:r,tokenID:n})).balances[0]},Xke=async({tokens:t})=>{try{if(t.length===0)return[];const e=t[0].chainId,{apiClient:r}=await ln(e),n=await r.getCollectiblePrices({tokens:t});return(n==null?void 0:n.tokenPrices)||[]}catch(e){console.error(e);return}},TW=async({chainId:t,contractAddress:e,accountAddress:r,tokenId:n,page:i})=>{const{indexerClient:s}=ln(t);return s.getTransactionHistory({includeMetadata:!0,page:i,filter:{accountAddress:r,contractAddress:e,tokenID:n}})},Zke=async({chainIds:t,accountAddress:e})=>(await Promise.all([...t.map(s=>TW({chainId:s,accountAddress:e,page:{page:1}}))])).map(s=>s.transactions).flat().sort((s,o)=>{const a=new Date(s.timestamp).getTime();return new Date(o.timestamp).getTime()-a}),eAe=async({toCurrency:t})=>{if(t==="USD")return 1;const{apiClient:e}=ln(137);return(await e.getExchangeRate({toCurrency:t})).exchangeRate.value},tAe=async({tokens:t})=>{const{metadataClient:e}=ln(t.chainId);return(await e.getTokenMetadata({chainID:t.chainId.toString(),contractAddress:t.contractAddress,tokenIDs:t.tokenIds})).tokenMetadata},rAe=async t=>{const{metadataClient:e}=ln(Number(t.chainID));return(await e.getContractInfo(t)).contractInfo},nAe=["chainIds"],iAe=["disabled"],Ji={oneSecond:1*1e3,oneMinute:60*1e3,oneHour:60*60*1e3},wk=(t,e)=>si({queryKey:["balances",t,e],queryFn:async()=>{const{chainIds:r}=t,n=rw(t,nAe);return(await Promise.all(r.map(s=>Qke(bn({},n,{chainId:s}),e)))).flat()},retry:!0,staleTime:10*Ji.oneMinute,enabled:t.chainIds.length>0&&!!t.accountAddress}),sAe=t=>si({queryKey:["collectionBalance",t],queryFn:()=>PW(t),retry:!0,staleTime:10*Ji.oneMinute,enabled:!!t.chainId&&!!t.accountAddress&&!!t.collectionAddress}),fu=t=>{let{disabled:e}=t,r=rw(t,iAe);return si({queryKey:["coinPrices",r],queryFn:()=>bk(r),retry:!0,staleTime:1*Ji.oneMinute,enabled:r.tokens.length>0&&!e})},oAe=(t,e)=>si({queryKey:["balancesAssetsSummary",t,e],queryFn:()=>Yke(t,e),retry:!0,staleTime:10*Ji.oneMinute,enabled:t.chainIds.length>0&&!!t.accountAddress}),aAe=(t,e)=>si({queryKey:["coinBalance",t,e],queryFn:()=>ar((t==null?void 0:t.contractAddress)||"",lr)?Xy({accountAddress:t.accountAddress,chainId:t.chainId}).then(i=>i[0]):Zy(t,e).then(n=>n[0]),retry:!0,staleTime:1*Ji.oneMinute,enabled:!!t.chainId&&!!t.accountAddress}),IW=t=>si({queryKey:["collectibleBalance",t],queryFn:()=>Jke(t),retry:!0,staleTime:5*Ji.oneMinute,enabled:!!t.chainId&&!!t.accountAddress&&!!t.collectionAddress&&!!t.tokenId}),OW=t=>si({queryKey:["useCollectiblePrices",t],queryFn:()=>Xke(t),retry:!0,staleTime:5*Ji.oneMinute,enabled:t.tokens.length>0}),RW=t=>Jle({queryKey:["transactionHistory",t],queryFn:({pageParam:e})=>TW(bn({},t,e?{page:{page:e}}:{page:{page:1}})),getNextPageParam:({page:e})=>{if(e.more)return(e==null?void 0:e.page)||1},retry:!0,staleTime:10*Ji.oneMinute,enabled:!!t.chainId&&!t.disabled&&!!t.accountAddress}),cAe=t=>si({queryKey:["transactionHistorySummary",t],queryFn:()=>Zke(t),retry:!0,staleTime:10*Ji.oneMinute,enabled:t.chainIds.length>0&&!!t.accountAddress}),Fc=t=>si({queryKey:["useConversionRate",t],queryFn:()=>eAe(t),retry:!0,staleTime:60*Ji.oneMinute}),lAe=t=>si({queryKey:["useTokenMetadata",t],queryFn:()=>tAe(t),retry:!0,staleTime:60*Ji.oneMinute,enabled:!!t.tokens.chainId&&!!t.tokens.contractAddress}),uAe=t=>si({queryKey:["useContractInfo",t],queryFn:()=>rAe(t),retry:!0,staleTime:60*Ji.oneMinute,enabled:!!t.chainID&&!!t.contractAddress}),[fAe,dAe]=lu(),Is=()=>{const{setHistory:t,history:e}=fAe();return{setNavigation:i=>{const s=document.getElementById("sequence-kit-wallet-content"),o=s==null?void 0:s.parentElement;o==null||o.scrollTo(0,0);const a=[...e,i];t(a)},history:e,setHistory:t,goBack:()=>{const i=[...e];i.pop(),t(i)}}},hAe=[{inputs:[{internalType:"address",name:"_from",type:"address"},{internalType:"address",name:"_to",type:"address"},{internalType:"uint256[]",name:"_ids",type:"uint256[]"},{internalType:"uint256[]",name:"_amounts",type:"uint256[]"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],pAe=[{constant:!1,inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],vAe=[{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"}],MW=[{symbol:"USD",sign:"$",name:{message:"US Dollar"},decimals:2},{symbol:"CAD",sign:"$",name:{message:"Canadian Dollar"},decimals:2},{symbol:"GBP",sign:"£",name:{message:"British Pound Sterling"},decimals:2},{symbol:"EUR",sign:"€",name:{message:"Euro"},decimals:2},{symbol:"CNY",sign:"¥",name:{message:"Chinese Yuan"},decimals:2},{symbol:"JPY",sign:"¥",name:{message:"Japanese Yen"},decimals:2},{symbol:"KRW",sign:"₩",name:{message:"South Korean Won"},decimals:2},{symbol:"SGD",sign:"$",name:{message:"Singapore Dollar"},decimals:2},{symbol:"CHF",sign:"CHF ",name:{message:"Swiss Franc"},decimals:2},{symbol:"AUD",sign:"$",name:{message:"Australian Dollar"},decimals:2},{symbol:"NZD",sign:"$",name:{message:"New Zealand Dollar"},decimals:2},{symbol:"SEK",sign:"kr ",name:{message:"Swedish Krona"},decimals:2},{symbol:"NOK",sign:"kr ",name:{message:"Norwegian Krone"},decimals:2},{symbol:"MXN",sign:"$",name:{message:"Mexican Peso"},decimals:2},{symbol:"INR",sign:"₹",name:{message:"Indian Rupee"},decimals:2},{symbol:"ZAR",sign:"R ",name:{message:"South African Rand"},decimals:2},{symbol:"TRY",sign:"₺",name:{message:"Turkish Lira"},decimals:2},{symbol:"BRL",sign:"R$",name:{message:"Brazilian Real"},decimals:2},{symbol:"DKK",sign:"kr ",name:{message:"Danish Krone"},decimals:2},{symbol:"PLN",sign:"zł ",name:{message:"Polish Zloty"},decimals:2},{symbol:"THB",sign:"฿",name:{message:"Thai Baht"},decimals:2},{symbol:"IDR",sign:"Rp",name:{message:"Indonesian Rupiah"},decimals:2}],mAe=MW[0],Ai="54px",Os=navigator.userAgent.match(/chrome|chromium|crios/i)?"13px":"0px",Un=()=>{const{chains:t}=an(),e=()=>{let l=!0,u=!1,f=mAe,d=t.map(h=>h.id);try{const h=localStorage.getItem(gn.Settings),p=JSON.parse(h||"{}");if((p==null?void 0:p.hideUnlistedTokens)!==void 0&&(l=p==null?void 0:p.hideUnlistedTokens),(p==null?void 0:p.hideCollectibles)!==void 0&&(u=p==null?void 0:p.hideCollectibles),(p==null?void 0:p.fiatCurrency)!==void 0&&(f=p==null?void 0:p.fiatCurrency),(p==null?void 0:p.selectedNetworks)!==void 0){let v=!0;p.selectedNetworks.forEach(b=>{t.find(y=>y.id===b)===void 0&&(v=!1)}),v&&(d=p==null?void 0:p.selectedNetworks)}}catch(h){console.error(h,"Failed to fetch settings")}return{hideUnlistedTokens:l,hideCollectibles:u,fiatCurrency:f,selectedNetworks:d}},r=e(),[n,i]=C.useState(r);return bn({},n,{setFiatCurrency:l=>{const u=e(),f=bn({},u,{fiatCurrency:l});localStorage.setItem(gn.Settings,JSON.stringify(f)),i(f)},setHideCollectibles:l=>{const u=e(),f=bn({},u,{hideCollectibles:l});localStorage.setItem(gn.Settings,JSON.stringify(f)),i(f)},setHideUnlistedTokens:l=>{const u=e(),f=bn({},u,{hideUnlistedTokens:l});localStorage.setItem(gn.Settings,JSON.stringify(f)),i(f)},setSelectedNetworks:l=>{const u=e(),f=bn({},u,{selectedNetworks:l});localStorage.setItem(gn.Settings,JSON.stringify(f)),i(f)}})},yAe=({size:t=30})=>x.createElement(z,{alignItems:"center",justifyContent:"center",borderRadius:"circle",background:"backgroundInverse",flexShrink:"0",style:{width:`${t}px`,height:`${t}px`}},x.createElement(ne,{variant:"large",color:"textInverse100"},"?")),Gl=({imageUrl:t,size:e=30})=>t?x.createElement(mr,{src:t,borderRadius:"circle",style:{width:`${e}px`,height:`${e}px`}}):x.createElement(yAe,{size:e}),RI=({networkLogoUrl:t,logoUrl:e,tokenName:r,balance:n,balanceFiat:i,priceChangePercentage:s,symbol:o})=>{const{fiatCurrency:a}=Un(),c=s>0?"+":"";return x.createElement(z,{background:"backgroundSecondary",width:"full",height:"full",borderRadius:"md",padding:"4",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"1"},x.createElement(z,{marginBottom:"1"},x.createElement(Gl,{size:36,imageUrl:e})),x.createElement(z,{marginBottom:"3"},x.createElement(z,{flexDirection:"row",gap:"1",justifyContent:"flex-start",alignItems:"center"},x.createElement(ne,{fontWeight:"bold",whiteSpace:"nowrap",color:"text100",style:{maxWidth:"130px",textOverflow:"ellipsis",overflow:"hidden"}},r),x.createElement(Gl,{size:12,imageUrl:t})),x.createElement(ne,{color:"text50",whiteSpace:"nowrap",style:{display:"block",maxWidth:"150px",textOverflow:"ellipsis",overflow:"hidden"}},`${n} ${o}`)),x.createElement(z,null,x.createElement(z,null,x.createElement(ne,{fontWeight:"bold",color:"text100"},`${a.sign}${i}`)),x.createElement(ne,{style:{color:Kke(s)}},`${c}${s.toFixed(2)}%`)))},MI=({balance:t})=>{var e;const{chains:r=[]}=an(),{fiatCurrency:n}=Un(),i=ar(t.contractAddress,lr),s=Pr(t.chainId,r),{data:o=[],isLoading:a}=fu({tokens:[{chainId:t.chainId,contractAddress:t.contractAddress}]}),{data:c=1,isLoading:l}=Fc({toCurrency:n.symbol}),{data:u,isLoading:f}=uAe({chainID:String(t.chainId),contractAddress:t.contractAddress});if(a||l||f)return x.createElement(z,{background:"backgroundSecondary",width:"full",height:"full",borderRadius:"md"});if(i){const P=yo({balance:t,prices:o,conversionRate:c,decimals:s.decimals}),T=OI(t,o),w=xr(t.balance,s.decimals),I=sa(w);return x.createElement(RI,{networkLogoUrl:s.logoURI,logoUrl:s.logoURI,tokenName:s.name,balance:I,balanceFiat:P,priceChangePercentage:T,symbol:s.symbol})}const h=(e=u==null?void 0:u.decimals)!=null?e:18,p=yo({balance:t,prices:o,conversionRate:c,decimals:h}),v=OI(t,o),b=xr(t.balance,h),y=sa(b),m=(u==null?void 0:u.name)||"Unknown",g=(u==null?void 0:u.name)||"TOKEN",S=u==null?void 0:u.logoURI;return x.createElement(RI,{networkLogoUrl:s.logoURI,logoUrl:S,tokenName:m,balance:y,balanceFiat:p,priceChangePercentage:v,symbol:g})},Ek=({imageUrl:t})=>x.createElement(ho,{padding:"0",aspectRatio:"1/1",justifyContent:"center",alignItems:"center",overflow:"hidden",borderRadius:"md",background:"backgroundSecondary"},x.createElement(mr,{style:{height:"100%"},src:t})),gAe=({balance:t})=>{var e;const{data:r}=lAe({tokens:{chainId:t.chainId,contractAddress:t.contractAddress,tokenIds:[t.tokenID]}}),n=r==null||(e=r[0])==null?void 0:e.image;return x.createElement(Ek,{imageUrl:n})};au("packages/wallet/src/shared/Skeleton/styles.css.ts","kit");const bAe=nz({"0%":{opacity:.25},"50%":{opacity:.1},"100%":{opacity:.25}},"PulseSimple"),wAe=ki({height:"76px",backgroundColor:"#909090",animation:`${bAe} 2s ease-in-out infinite`},"skeleton");cu();const bt=({width:t="100%",height:e="100%",borderRadius:r="md",aspectRatio:n})=>x.createElement(z,{className:wAe,borderRadius:r,aspectRatio:n,style:{width:t,height:e}}),EAe=()=>x.createElement(z,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${ve.space[1]}) calc(50% - ${ve.space[1]})`,gap:ve.space[2]}},Array(12).fill(null).map((t,e)=>x.createElement(z,{key:e},x.createElement(bt,{height:"100%",width:"100%",aspectRatio:"1/1"}))));au("packages/wallet/src/shared/styles.css.ts","kit");const oo=ki({":hover":{cursor:"pointer",opacity:"0.8",userSelect:"none"}},"clickable"),xk=ki({"> div":{overflowY:"scroll"}},"scrollbar");Ts(`html:not(.is-apple) ${xk} > div::-webkit-scrollbar-thumb`,{background:"none",backgroundClip:"content-box",transition:"background 0.5s linear"});Ts(`html:not(.is-apple) ${xk} > div:hover::-webkit-scrollbar-thumb`,{background:ve.colors.text50,backgroundClip:"content-box"});const Ck=ki({},"walletContent");Ts(`${Ck} + button`,{backgroundColor:"transparent"});Ts(`${Ck} + button > svg`,{width:"20px",height:"20px"});cu();const xAe=()=>{const{address:t}=kn(),{setNavigation:e}=Is(),{displayedAssets:r}=Bxe(),{hideUnlistedTokens:n,hideCollectibles:i,selectedNetworks:s}=Un(),{data:o=[],isLoading:a}=oAe({accountAddress:t||"",chainIds:s,displayAssets:r},{hideUnlistedTokens:n,hideCollectibles:i});if(a)return x.createElement(EAe,null);const{nativeTokens:c,erc20Tokens:l,collectibles:u}=AW(o),f=d=>{d.contractType==="ERC1155"||d.contractType==="ERC721"?e&&e({location:"collectible-details",params:{contractAddress:d.contractAddress,chainId:d.chainId,tokenId:d.tokenID}}):d.contractType==="ERC20"?e&&e({location:"coin-details",params:{contractAddress:d.contractAddress,chainId:d.chainId}}):e&&e({location:"coin-details",params:{contractAddress:d.contractAddress,chainId:d.chainId}})};return x.createElement(z,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${ve.space[1]}) calc(50% - ${ve.space[1]})`,gap:ve.space[2]}},c.map(d=>x.createElement(z,{key:d.contractAddress,className:oo,aspectRatio:"1/1",onClick:()=>f(d)},x.createElement(MI,{balance:d}))),l.map(d=>x.createElement(z,{className:oo,key:d.contractAddress,aspectRatio:"1/1",onClick:()=>f(d)},x.createElement(MI,{balance:d}))),u.map(d=>x.createElement(z,{className:oo,aspectRatio:"1/1",key:`${d.contractAddress}-${d.tokenID}}`,onClick:()=>f(d)},x.createElement(gAe,{balance:d}))))},CAe=()=>x.createElement(z,{paddingLeft:"5",paddingBottom:"5",gap:"4",flexDirection:"column",style:{paddingRight:`calc(${ve.space[5]} - ${Os})`}},x.createElement(xAe,null)),SAe=()=>{const{address:t}=kn(),{chain:e,chains:r=[]}=an(),[n,i]=C.useState(!1),s=Pr((e==null?void 0:e.id)||1,r);C.useEffect(()=>{n&&setTimeout(()=>{i(!1)},4e3)},[n]);const o=()=>{i(!0)},a=()=>{window.open(`https://twitter.com/intent/tweet?text=Here%20is%20my%20address%20${t}`)};return x.createElement(z,{style:{paddingTop:Ai}},x.createElement(z,{padding:"5",paddingTop:"3",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"4"},x.createElement(z,{marginTop:"1",width:"fit",background:"white",borderRadius:"md",alignItems:"center",justifyContent:"center",padding:"4"},x.createElement($3e,{value:t||"",size:200,bgColor:"white",fgColor:"black","data-id":"receiveQR"})),x.createElement(z,null,x.createElement(z,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},x.createElement(ne,{variant:"medium",color:"text100",textAlign:"center",lineHeight:"inherit",style:{fontWeight:"700"}},"My Wallet"),x.createElement(mr,{width:"5",src:s.logoURI,alt:"icon"})),x.createElement(z,{marginTop:"2",style:{maxWidth:"180px",textAlign:"center"}},x.createElement(ne,{textAlign:"center",color:"text50",style:{fontSize:"14px",maxWidth:"180px",overflowWrap:"anywhere"}},t))),x.createElement(z,{gap:"3"},x.createElement(Ez.CopyToClipboard,{text:t||""},x.createElement(tt,{onClick:o,leftIcon:Fg,label:n?"Copied!":"Copy"})),x.createElement(tt,{onClick:a,leftIcon:pne,label:"Share"})),x.createElement(z,{justifyContent:"center",alignItems:"center",style:{maxWidth:"260px",textAlign:"center"}},x.createElement(ne,{color:"text100",variant:"small",style:{maxWidth:"260px",overflowWrap:"anywhere"}},`This is a ${s.name} address. Please only send assets on the ${s.name} network.`))))},$W=({imageUrl:t,name:e,decimals:r,balance:n,symbol:i,fiatValue:s,chainId:o,showSquareImage:a})=>{const{chains:c=[]}=an(),{fiatCurrency:l}=Un(),u=xr(n,r),f=sa(u),d=Pr(o,c);return x.createElement(z,{alignItems:"flex-end",justifyContent:"space-between"},x.createElement(z,{justifyContent:"space-between",alignItems:"center",gap:"2"},a?x.createElement(z,{style:{width:"40px"}},x.createElement(Ek,{imageUrl:t})):x.createElement(Gl,{imageUrl:t,size:40}),x.createElement(z,{flexDirection:"column",alignItems:"flex-start"},x.createElement(z,{flexDirection:"row",alignItems:"center",gap:"1"},x.createElement(ne,{variant:"medium",color:"text100"},e),x.createElement(Gl,{imageUrl:d.logoURI,size:12})),x.createElement(ne,{color:"text50",variant:"normal"}," ",`${f} ${i} available`))),x.createElement(z,{flexDirection:"column",alignItems:"flex-end",justifyContent:"flex-end"},s&&x.createElement(ne,{variant:"normal",color:"text100"},`${l.sign}${s}`)))},kAe=({chainId:t,contractAddress:e})=>{var r,n,i,s,o;const{chains:a=[]}=an(),c=Cb(),{address:l="",connector:u}=kn(),f=!!(u!=null&&(r=u._wallet)!=null&&r.isSequenceBased),d=c===t,h=!d&&!f,{switchNetwork:p}=GS(),v=C.useRef(null),{setOpenWalletModal:b}=sp(),{fiatCurrency:y}=Un(),[m,g]=C.useState("0"),[S,P]=C.useState(""),{data:T}=VS(),{data:w=[],isLoading:I}=wk({accountAddress:l,chainIds:[t],contractAddress:e},{hideUnlistedTokens:!1}),B=Pr(t,a),j=w.find(Q=>Q.contractAddress===e),{data:H=[],isLoading:K}=fu({tokens:[{chainId:t,contractAddress:e}]}),{data:F=1,isLoading:E}=Fc({toCurrency:y.symbol});if(I||K||E)return null;const O=ar(e,lr),N=O?B.decimals:(j==null||(n=j.contractInfo)==null?void 0:n.decimals)||18,k=O?B.name:(j==null||(i=j.contractInfo)==null?void 0:i.name)||"",M=O?B.logoURI:j==null||(s=j.contractInfo)==null?void 0:s.logoURI,L=O?B.symbol:(j==null||(o=j.contractInfo)==null?void 0:o.symbol)||"",$=m===""?"0":m,A=$f($,N),D=yo({balance:bn({},j,{balance:A.toString()}),prices:H,conversionRate:F,decimals:N}),V=A.gt((j==null?void 0:j.balance)||"0"),R=A.gt(0),U=Q=>{const{value:Z}=Q.target,ae=kW(Z,N);g(ae)},W=()=>{var Q;(Q=v.current)==null||Q.focus();const Z=xr((j==null?void 0:j.balance)||0,N).toString();g(Z)},q=async()=>{const Q=await navigator.clipboard.readText();P(Q)},Y=()=>{P("")},X=async Q=>{!d&&f&&p&&p(t),Q.preventDefault();const Z=$f($,N);O?T==null||T.sendTransaction({to:S,value:BigInt(Z.toString())}).catch(ae=>console.error("User rejected transaction",ae)):T==null||T.sendTransaction({to:j==null?void 0:j.contractAddress,data:new Br(pAe).encodeFunctionData("transfer",[S,Z.toHexString()])}).catch(ae=>console.error("User rejected transaction",ae)),b(!1)};return x.createElement(z,{padding:"5",paddingTop:"3",style:{marginTop:Ai},gap:"2",flexDirection:"column",as:"form",onSubmit:X},x.createElement(z,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},x.createElement($W,{imageUrl:M,decimals:N,name:k,symbol:L,balance:(j==null?void 0:j.balance)||"0",fiatValue:yo({balance:j,prices:H,conversionRate:F,decimals:N}),chainId:t}),x.createElement(PD,{ref:v,style:{fontSize:ve.fontSizes.xlarge,fontWeight:ve.fontWeights.bold},name:"amount",value:m,onChange:U,controls:x.createElement(x.Fragment,null,x.createElement(ne,{variant:"small",color:"text50",whiteSpace:"nowrap"},`~${y.sign}${D}`),x.createElement(tt,{size:"xs",shape:"square",label:"Max",onClick:W,"data-id":"maxCoin",flexShrink:"0"}),x.createElement(ne,{fontSize:"xlarge",fontWeight:"bold",color:"text100"},L))}),V&&x.createElement(ne,{as:"div",variant:"normal",color:"negative",marginTop:"2"},"Insufficient Funds")),x.createElement(z,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},x.createElement(ne,{fontSize:"normal",color:"text50"},"To"),Jy(S)?x.createElement(z,{borderRadius:"md",background:"backgroundSecondary",width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4",className:oo,onClick:Y,style:{height:"52px"}},x.createElement(z,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"2"},x.createElement(M1,{address:S,style:{width:"20px"}}),x.createElement(ne,{color:"text100"},`0x${gk(S.substring(2),8)}`)),x.createElement(ru,{size:"xs"})):x.createElement(Mc,{value:S,onChange:Q=>P(Q.target.value),placeholder:`${B.name} Address (0x...)`,name:"to-address","data-1p-ignore":!0,controls:x.createElement(tt,{size:"xs",shape:"square",label:"Paste",onClick:q,"data-id":"to-address",flexShrink:"0",leftIcon:Fg})})),h&&x.createElement(z,{marginTop:"3"},x.createElement(ne,{color:"negative"},"The wallet is connected to the wrong network. Please switch network before proceeding"),x.createElement(tt,{marginTop:"2",width:"full",variant:"primary",type:"button",label:"Switch Network",onClick:()=>p&&p(t),disabled:d,style:{height:"52px",borderRadius:ve.radii.md}})),x.createElement(tt,{color:"text100",marginTop:"3",width:"full",variant:"primary",type:"submit",disabled:!R||!Jy(S)||V||!d&&!f,label:"Send",rightIcon:Lo,style:{height:"52px",borderRadius:ve.radii.md}}))},AAe=({chainId:t,contractAddress:e,tokenId:r})=>{var n,i,s,o,a;const{chains:c=[]}=an(),l=Cb(),{address:u="",connector:f}=kn(),d=!!(f!=null&&(n=f._wallet)!=null&&n.isSequenceBased),h=l===t,p=!h&&!d,{switchNetwork:v}=GS(),b=C.useRef(null),{setOpenWalletModal:y}=sp(),[m,g]=C.useState("0"),[S,P]=C.useState(""),{data:T}=VS(),{data:w,isLoading:I}=IW({accountAddress:u,chainId:t,collectionAddress:e,tokenId:r}),B=Pr(t,c);if(I)return null;const H=(w==null||(i=w.tokenMetadata)==null?void 0:i.decimals)||0,K=(w==null||(s=w.tokenMetadata)==null?void 0:s.name)||"Unknown",F=(w==null||(o=w.tokenMetadata)==null?void 0:o.image)||(w==null||(a=w.contractInfo)==null?void 0:a.logoURI)||"",E=m===""?"0":m,_=$f(E,H),O=_.gt((w==null?void 0:w.balance)||"0"),N=_.gt(0),k=q=>{const{value:Y}=q.target,X=kW(Y,H);g(X)},M=()=>{var q;(q=b.current)==null||q.focus();const Y=Number(m)-1,X=Math.max(Y,0).toString();g(X)},L=()=>{var q;(q=b.current)==null||q.focus();const Y=Number(m)+1,X=Number(xr((w==null?void 0:w.balance)||0,H)),Q=Math.min(Y,X).toString();g(Q)},$=()=>{var q;(q=b.current)==null||q.focus();const Y=xr((w==null?void 0:w.balance)||0,H).toString();g(Y)},A=async()=>{const q=await navigator.clipboard.readText();P(q)},D=()=>{P("")},V=async q=>{q.preventDefault(),!h&&d&&v&&v(t);const Y=$f(E,H),{contractType:X}=w;switch(X){case"ERC721":T==null||T.sendTransaction({to:w.contractAddress,data:new Br(vAe).encodeFunctionData("safeTransferFrom",[u,S,r])}).catch(Q=>console.error("User rejected transaction",Q));break;case"ERC1155":default:T==null||T.sendTransaction({to:w.contractAddress,data:new Br(hAe).encodeFunctionData("safeBatchTransferFrom",[u,S,[r],[Y.toHexString()],[]])}).catch(Q=>console.error("User rejected transaction",Q))}y(!1)},R=xr((w==null?void 0:w.balance)||0,H).toString(),U=Number(m)===0,W=Number(m)>=Number(R);return x.createElement(z,{padding:"5",paddingTop:"3",style:{marginTop:Ai},gap:"2",flexDirection:"column",as:"form",onSubmit:V},x.createElement(z,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},x.createElement($W,{imageUrl:F,showSquareImage:!0,decimals:H,name:K,symbol:"",balance:(w==null?void 0:w.balance)||"0",chainId:t}),x.createElement(PD,{ref:b,style:{fontSize:ve.fontSizes.xlarge,fontWeight:ve.fontWeights.bold},name:"amount",value:m,onChange:k,controls:x.createElement(z,{gap:"2"},x.createElement(tt,{disabled:U,size:"xs",onClick:M,leftIcon:yne}),x.createElement(tt,{disabled:W,size:"xs",onClick:L,leftIcon:Hre}),x.createElement(tt,{size:"xs",shape:"square",label:"Max",onClick:$,"data-id":"maxCoin",flexShrink:"0"}))}),O&&x.createElement(ne,{as:"div",variant:"normal",color:"negative",marginTop:"2"},"Insufficient Balance")),x.createElement(z,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},x.createElement(ne,{fontSize:"normal",color:"text50"},"To"),Jy(S)?x.createElement(z,{borderRadius:"md",background:"backgroundSecondary",width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4",className:oo,onClick:D,style:{height:"52px"}},x.createElement(z,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"2"},x.createElement(M1,{address:S,style:{width:"20px"}}),x.createElement(ne,{color:"text100"},`0x${gk(S.substring(2),8)}`)),x.createElement(ru,{size:"xs"})):x.createElement(Mc,{value:S,onChange:q=>P(q.target.value),placeholder:`${B.name} Address (0x...)`,name:"to-address","data-1p-ignore":!0,controls:x.createElement(tt,{size:"xs",shape:"square",label:"Paste",onClick:A,"data-id":"to-address",flexShrink:"0",leftIcon:Fg})})),p&&x.createElement(z,{marginTop:"3"},x.createElement(ne,{color:"negative"},"The wallet is connected to the wrong network. Please switch network before proceeding"),x.createElement(tt,{marginTop:"2",width:"full",variant:"primary",type:"button",label:"Switch Network",onClick:()=>v&&v(t),disabled:h,style:{height:"52px",borderRadius:ve.radii.md}})),x.createElement(tt,{color:"text100",marginTop:"3",width:"full",variant:"primary",type:"submit",disabled:!N||!Jy(S)||O||!h&&!d,label:"Send",rightIcon:Lo,style:{height:"52px",borderRadius:ve.radii.md}}))},_Ae=({transaction:t})=>{var e;const{chains:r=[]}=an(),{fiatCurrency:n}=Un(),{setNavigation:i}=Is(),s=()=>{i({location:"transaction-details",params:{transaction:t}})};let o=[];(e=t.transfers)==null||e.forEach(m=>{const g=m.contractAddress;o.includes(g)||o.push(g)});const{data:a=[],isLoading:c}=fu({tokens:o.map(m=>({contractAddress:m,chainId:t.chainId}))}),{data:l=1,isLoading:u}=Fc({toCurrency:n.symbol}),f=c||u,{transfers:d}=t,h=Pr(t.chainId,r),p=m=>{switch(m){case os.SEND:return x.createElement(Jx,{style:{transform:"rotate(270deg)",width:"16px"}});case os.RECEIVE:return x.createElement(Jx,{style:{transform:"rotate(90deg)",width:"16px"}});case os.UNKNOWN:default:return x.createElement(PN,{style:{width:"14px"}})}},v=m=>{switch(m){case os.SEND:return"Sent";case os.RECEIVE:return"Received";case os.UNKNOWN:default:return"Transacted"}},b=(m,g,S)=>{let P="";S===os.SEND?P="-":S===os.RECEIVE&&(P="+");let T="text50";return S===os.SEND?T=ve.colors.negative:S===os.RECEIVE&&(T=ve.colors.positive),x.createElement(ne,{fontWeight:"bold",fontSize:"normal",style:{color:T}},`${P}${m} ${g}`)},y=({transfer:m,isFirstItem:g})=>{const{amounts:S}=m,P=$z(t.timestamp).format("MMM DD, YYYY");return x.createElement(z,{gap:"2",width:"full",flexDirection:"column",justifyContent:"space-between"},x.createElement(z,{flexDirection:"row",justifyContent:"space-between"},x.createElement(z,{color:"text50",gap:"1",flexDirection:"row",justifyContent:"center",alignItems:"center"},p(m.transferType),x.createElement(ne,{fontWeight:"medium",fontSize:"normal",color:"text100"},v(m.transferType)),x.createElement(mr,{src:h.logoURI,width:"3"})),g&&x.createElement(z,null,x.createElement(ne,{fontWeight:"medium",fontSize:"normal",color:"text50"},P))),S.map((T,w)=>{var I,B,j,H,K,F;const E=Pr(t.chainId,r),_=ar(m.contractAddress,lr),O=((I=m.contractInfo)==null?void 0:I.type)==="ERC721"||((B=m.contractInfo)==null?void 0:B.type)==="ERC1155";let N;const k=(j=m.tokenIds)==null?void 0:j[w];if(O&&k){var M;N=((M=m.tokenMetadata)==null||(M=M[k])==null?void 0:M.decimals)||0}else{var L;N=_?E.decimals:(L=m.contractInfo)==null?void 0:L.decimals}const $=xr(T,N),A=_?E.symbol:((H=m.contractInfo)==null?void 0:H.symbol)||"",D=_?E.logoURI:(K=m.contractInfo)==null?void 0:K.logoURI,V=(F=a.find(R=>ar(R.token.contractAddress,m.contractAddress)))==null||(F=F.price)==null?void 0:F.value;return x.createElement(z,{key:w,flexDirection:"row",justifyContent:"space-between"},x.createElement(z,{flexDirection:"row",gap:"2",justifyContent:"center",alignItems:"center"},D&&x.createElement(mr,{src:D,width:"5",alt:"token logo"}),b(sa($),A,m.transferType)),f&&x.createElement(bt,{width:"35px",height:"20px"}),V&&x.createElement(ne,{fontWeight:"medium",fontSize:"normal",color:"text50"},`${n.sign}${(Number($)*V*l).toFixed(2)}`))}))};return x.createElement(z,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column",className:oo,onClick:()=>s()},d==null?void 0:d.map((m,g)=>x.createElement(z,{key:`${t.txnHash}-${g}`,width:"full"},y({transfer:m,isFirstItem:g===0}))))},Sk=()=>{const t=()=>x.createElement(z,{flexDirection:"column",gap:"2",width:"full",justifyContent:"space-between"},x.createElement(z,{flexDirection:"row",justifyContent:"space-between"},x.createElement(bt,{width:"65px",height:"20px"}),x.createElement(bt,{width:"75px",height:"17px"})),x.createElement(z,{flexDirection:"row",justifyContent:"space-between"},x.createElement(bt,{width:"120px",height:"20px"}),x.createElement(bt,{width:"35px",height:"17px"})));return x.createElement(z,{flexDirection:"column",gap:"3"},x.createElement(bt,{width:"70px",height:"17px"}),x.createElement(z,{flexDirection:"column",gap:"2"},Array(8).fill(null).map((e,r)=>x.createElement(z,{borderRadius:"md",padding:"4",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column",background:"backgroundSecondary",key:r},t()))))},kk=({transactions:t,isLoading:e,isFetchingNextPage:r})=>{const n=[{id:"today",label:"Today"},{id:"yesterday",label:"Yesterday"},{id:"week",label:"Last Week"},{id:"month",label:"Last Month"},{id:"year",label:"Last Year"},{id:"years",label:"Past Years"}],i=C.useMemo(()=>{const a=new Date(new Date().setHours(0,0,0,0)).getTime(),c=new Date(new Date().setDate(new Date(a).getDate()-1)).getTime(),l=new Date(new Date().setDate(new Date().getDate()-7)).getTime(),u=new Date(new Date().setDate(new Date().getDate()-30)).getTime(),f=new Date(new Date().setDate(new Date().getDate()-365)).getTime(),d={today:[],yesterday:[],week:[],month:[],year:[],years:[]};return t.forEach(h=>{const p=new Date(h.timestamp).getTime();p>a?d.today.push(h):p>c?d.yesterday.push(h):p>l?d.week.push(h):p>u?d.month.push(h):p>f?d.year.push(h):d.years.push(h)}),d},[t]);if(e)return x.createElement(z,{flexDirection:"column",gap:"2"},x.createElement(Sk,null));const s=({label:a})=>x.createElement(z,null,x.createElement(ne,{color:"text50",fontWeight:"medium",fontSize:"normal"},a)),o=({transactions:a})=>x.createElement(z,{flexDirection:"column",gap:"2"},a.map((c,l)=>x.createElement(z,{key:`${c.txnHash}-${l}`,flexDirection:"column",gap:"2"},x.createElement(_Ae,{transaction:c}))));return x.createElement(z,{flexDirection:"column",gap:"5"},n.map(a=>{const c=i[a.id];return c.length===0?null:x.createElement(z,{key:a.id,flexDirection:"column",gap:"3"},x.createElement(s,{label:a.label}),x.createElement(o,{transactions:c}))}),t.length===0&&x.createElement(z,{flexDirection:"column",gap:"3"},x.createElement(s,{label:"History"}),x.createElement(ne,{color:"text100"},"No Recent Transaction History Found")),r&&x.createElement(z,{margin:"4",alignItems:"center",justifyContent:"center"},x.createElement(sS,null)))},PAe=()=>{const{selectedNetworks:t}=Un(),{address:e}=kn(),{data:r=[],isLoading:n}=cAe({accountAddress:e||"",chainIds:t});return x.createElement(z,null,x.createElement(z,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",style:{paddingRight:`calc(${ve.space[5]} - ${Os})`}},x.createElement(kk,{transactions:r,isLoading:n,isFetchingNextPage:!1})))},eg=({balance:t})=>{var e,r;const{chains:n=[]}=an(),{setNavigation:i}=Is(),s=ar(t.contractAddress,lr),o=Pr(t.chainId,n),a=s?o.logoURI:t==null||(e=t.contractInfo)==null?void 0:e.logoURI,c=s?o.name:(t==null||(r=t.contractInfo)==null?void 0:r.name)||"Unknown",l=()=>{var f,d;if(t.contractType==="ERC721"||t.contractType==="ERC1155")return t.balance;const h=s?o.decimals:t==null||(f=t.contractInfo)==null?void 0:f.decimals,p=xr(t.balance,h||0),v=sa(p),b=s?o.symbol:t==null||(d=t.contractInfo)==null?void 0:d.symbol;return`${v} ${b}`},u=()=>{const f=t.contractType==="ERC721"||t.contractType==="ERC1155";i(f?{location:"collection-details",params:{contractAddress:t.contractAddress,chainId:t.chainId}}:{location:"coin-details",params:{contractAddress:t.contractAddress,chainId:t.chainId}})};return x.createElement(z,{key:t.contractAddress,onClick:u,width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",className:oo},x.createElement(z,{gap:"3",flexDirection:"row",alignItems:"center",justifyContent:"center"},x.createElement(Gl,{imageUrl:a,size:30}),x.createElement(z,{gap:"1",flexDirection:"row",alignItems:"center",justifyContent:"center"},x.createElement(ne,{color:"text100",fontWeight:"bold",fontSize:"normal",style:{textOverflow:"ellipsis",overflow:"hidden",maxWidth:"250px",textWrap:"nowrap"}},c),x.createElement(mr,{src:o.logoURI,alt:"network logo",style:{width:"12px",height:"12px"}}))),x.createElement(z,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"1"},x.createElement(ne,{color:"text50",fontWeight:"bold",fontSize:"normal"},l()),x.createElement(Lo,{color:"text50"})))},$I=({toLocation:t,label:e})=>{const{setNavigation:r}=Is(),n=()=>{r(t)};return x.createElement(z,{onClick:n,width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",className:oo},x.createElement(ne,{color:"text50",fontSize:"normal",fontWeight:"medium"},e),x.createElement(z,{flexDirection:"row",justifyContent:"center",alignItems:"center"},x.createElement(ne,{color:"text50",fontSize:"normal",fontWeight:"medium"},"View all"),x.createElement(Lo,{color:"text50",size:"sm"})))},TAe=()=>{const{chains:t=[]}=an(),{fiatCurrency:e,hideUnlistedTokens:r,selectedNetworks:n}=Un(),[i,s]=C.useState(""),{address:o}=kn(),{data:a,isLoading:c}=wk({accountAddress:o||"",chainIds:n},{hideUnlistedTokens:r}),l=(a==null?void 0:a.filter(j=>j.contractType==="ERC20"||ar(j.contractAddress,lr)))||[],{data:u=[],isLoading:f}=fu({tokens:l.map(j=>({chainId:j.chainId,contractAddress:j.contractAddress}))}),{data:d=1,isLoading:h}=Fc({toCurrency:e.symbol}),p=l.sort((j,H)=>{var K,F;return Number(yo({balance:H,prices:u,conversionRate:d,decimals:((K=H.contractInfo)==null?void 0:K.decimals)||18}))-Number(yo({balance:j,prices:u,conversionRate:d,decimals:((F=H.contractInfo)==null?void 0:F.decimals)||18}))}),b=((a==null?void 0:a.filter(j=>j.contractType==="ERC721"||j.contractType==="ERC1155"))||[]).sort((j,H)=>Number(H.balance)-Number(j.balance)),y=c||f||h,m=b.map((j,H)=>{var K;return{index:H,name:((K=j.contractInfo)==null?void 0:K.name)||"Unknown"}}),g=p.map((j,H)=>{if(ar(j.contractAddress,lr)){const F=Pr(j.chainId,t);return{index:H,name:F.name}}else{var K;return{index:H,name:((K=j.contractInfo)==null?void 0:K.name)||"Unknown"}}}),S=p.length,P=b.length,T=new ta(g,{keys:["name"]}),w=new ta(m,{keys:["name"]}),I=(i===""?g:T.search(i).map(j=>j.item)).slice(0,5),B=(i===""?m:w.search(i).map(j=>j.item)).slice(0,5);return x.createElement(z,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",flexDirection:"column",gap:"10",alignItems:"center",justifyContent:"center",style:{paddingRight:`calc(${ve.space[5]} - ${Os})`}},x.createElement(z,{width:"full"},x.createElement(Mc,{autoFocus:!0,name:"search wallet",leftIcon:jg,value:i,onChange:j=>s(j.target.value),placeholder:"Search your wallet","data-1p-ignore":!0})),x.createElement(z,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5"},x.createElement($I,{toLocation:{location:"search-view-all",params:{defaultTab:"collections"}},label:`Collections (${P})`}),y?Array(5).fill(null).map((j,H)=>x.createElement(bt,{key:H,width:"100%",height:"32px"})):B.length===0?x.createElement(ne,{color:"text100"},"No collections found"):B.map(j=>{const H=b[j.index];return x.createElement(eg,{key:H.contractAddress,balance:H})})),x.createElement(z,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5"},x.createElement($I,{toLocation:{location:"search-view-all",params:{defaultTab:"coins"}},label:`Coins (${S})`}),y?Array(5).fill(null).map((j,H)=>x.createElement(bt,{key:H,width:"100%",height:"32px"})):I.length===0?x.createElement(ne,{color:"text100"},"No coins found"):I.map(j=>{const H=p[j.index];return x.createElement(eg,{key:H.contractAddress,balance:H})})))},IAe=({defaultTab:t})=>{const{chains:e=[]}=an(),{fiatCurrency:r,hideUnlistedTokens:n,selectedNetworks:i}=Un(),[s,o]=C.useState(""),[a,c]=C.useState(t);C.useEffect(()=>{o("")},[a]);const{address:l}=kn(),{data:u,isLoading:f}=wk({accountAddress:l||"",chainIds:i},{hideUnlistedTokens:n}),d=(u==null?void 0:u.filter(_=>_.contractType==="ERC20"||ar(_.contractAddress,lr)))||[],{data:h=[],isLoading:p}=fu({tokens:d.map(_=>({chainId:_.chainId,contractAddress:_.contractAddress}))}),{data:v=1,isLoading:b}=Fc({toCurrency:r.symbol}),y=d.sort((_,O)=>{var N,k;return Number(yo({balance:O,prices:h,conversionRate:v,decimals:((N=O.contractInfo)==null?void 0:N.decimals)||18}))-Number(yo({balance:_,prices:h,conversionRate:v,decimals:((k=_.contractInfo)==null?void 0:k.decimals)||18}))}),g=((u==null?void 0:u.filter(_=>_.contractType==="ERC721"||_.contractType==="ERC1155"))||[]).sort((_,O)=>Number(O.balance)-Number(_.balance)),S=y.length,P=g.length,T=f||p||b,w=g.map((_,O)=>{var N;return{index:O,name:((N=_.contractInfo)==null?void 0:N.name)||"Unknown"}}),I=y.map((_,O)=>{if(ar(_.contractAddress,lr)){const k=Pr(_.chainId,e);return{index:O,name:k.name}}else{var N;return{index:O,name:((N=_.contractInfo)==null?void 0:N.name)||"Unknown"}}}),B=new ta(I,{keys:["name"]}),j=new ta(w,{keys:["name"]}),H=s===""?I:B.search(s).map(_=>_.item),K=s===""?w:j.search(s).map(_=>_.item),F=()=>x.createElement(bt,{width:"360px",height:"48px"}),E=()=>x.createElement(x.Fragment,null,Array(8).fill(null).map((_,O)=>x.createElement(bt,{key:O,width:"full",height:"32px"})));return x.createElement(z,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",flexDirection:"column",gap:"5",alignItems:"center",justifyContent:"center",style:{paddingRight:`calc(${ve.space[5]} - ${Os})`}},x.createElement(z,{width:"full"},x.createElement(Mc,{autoFocus:!0,name:"search wallet",leftIcon:jg,value:s,onChange:_=>o(_.target.value),placeholder:"Search your wallet","data-1p-ignore":!0})),x.createElement(z,{width:"full"},x.createElement(Mce,{value:a,onValueChange:_=>c(_)},x.createElement(z,{marginBottom:"5"},!T&&x.createElement(Rce,{value:a,tabs:[{label:`Collections (${P})`,value:"collections"},{label:`Coins (${S})`,value:"coins"}]}),T&&x.createElement(F,null)),x.createElement(IP,{value:"collections"},x.createElement(z,{flexDirection:"column",gap:"3"},T&&x.createElement(E,null),!T&&K.length===0&&x.createElement(ne,{color:"text100"},"No Collectibles Found"),!T&&K.length>0&&K.map(_=>{const O=g[_.index];return x.createElement(eg,{key:O.contractAddress,balance:O})}))),x.createElement(IP,{value:"coins"},x.createElement(z,{flexDirection:"column",gap:"3"},T&&x.createElement(E,null),!T&&y.length==0&&x.createElement(ne,{color:"text100"},"No Coins Found"),!T&&H.length>0&&H.map(_=>{const O=y[_.index];return x.createElement(eg,{key:O.contractAddress,balance:O})}))))))},OAe=()=>{const{setNavigation:t}=Is(),e=()=>{t({location:"settings-general"})},r=()=>{t({location:"settings-currency"})},n=()=>{t({location:"settings-networks"})};return x.createElement(z,{style:{paddingTop:Ai}},x.createElement(z,{padding:"5",paddingTop:"3"},x.createElement(z,{flexDirection:"column",gap:"2"},x.createElement(tt,{onClick:e,leftIcon:AN,rightIcon:Lo,width:"full",label:"General",style:{height:"52px",borderRadius:ve.radii.md}}),x.createElement(tt,{onClick:r,leftIcon:Zre,rightIcon:Lo,width:"full",label:"Currency",style:{height:"52px",borderRadius:ve.radii.md}}),x.createElement(tt,{onClick:n,leftIcon:ane,rightIcon:Lo,width:"full",label:"Networks",style:{height:"52px",borderRadius:ve.radii.md}}))))},RAe=()=>{rp();const{hideUnlistedTokens:t,setHideUnlistedTokens:e,hideCollectibles:r,setHideCollectibles:n}=Un(),i=()=>{e(!t)},s=()=>{n(!r)};return x.createElement(z,{style:{paddingTop:Ai}},x.createElement(z,{gap:"2",padding:"5",paddingTop:"3",flexDirection:"column"},x.createElement(ho,{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},x.createElement(ne,{color:"text100",fontWeight:"bold"},"Hide unlisted tokens"),x.createElement(TP,{checked:t,onCheckedChange:i})),x.createElement(ho,{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},x.createElement(ne,{color:"text100",fontWeight:"bold"},"Hide collectibles"),x.createElement(TP,{checked:r,onCheckedChange:s}))))},MAe=t=>{const{selected:e,className:r,squareIndicator:n=!1}=t;return x.createElement(z,{borderStyle:"solid",borderColor:n&&e?"transparent":"borderNormal",borderWidth:"thin",position:"relative",alignItems:"center",justifyContent:"center",flexShrink:"0",className:r,style:{borderRadius:n?"4px":ve.radii.circle,width:"20px",height:"20px"}},x.createElement(z,{as:O0.div,background:n?"borderNormal":"backgroundInverse",position:"absolute",color:"textInverse100",initial:{opacity:e?1:0,scale:e?1:.5},animate:{opacity:e?1:0,scale:e?1:.5},transition:{ease:"backOut"},style:{borderRadius:n?"4px":ve.radii.circle,width:n?"20px":"14px",height:n?"20px":"14px"},justifyContent:"center",alignItems:"center"},n&&x.createElement(cd,{color:"white",style:{width:"14px",height:"14px"}})))},$Ae=["value","selected","children","disabled","onClick","className","hideIndicator","squareIndicator"],NW=t=>{const{value:e,selected:r,children:n,disabled:i,onClick:s,className:o,hideIndicator:a,squareIndicator:c=!1}=t,l=rw(t,$Ae);return x.createElement(ho,bn({as:"button",clickable:!0,className:xSe(o),disabled:i,onClick:()=>s(e),userSelect:"none",alignItems:"center",justifyContent:"space-between",textAlign:"left",width:"full",style:{appearance:"none"}},l),n,!a&&x.createElement(MAe,{selected:r,squareIndicator:c}))},NAe=()=>{const{fiatCurrency:t,setFiatCurrency:e}=Un();return x.createElement(z,{paddingBottom:"5",paddingLeft:"5",paddingTop:"3",style:{paddingRight:`calc(${ve.space[5]} - ${Os})`}},x.createElement(z,{flexDirection:"column",gap:"2"},MW.map(r=>x.createElement(NW,{key:r.symbol,value:r.symbol,selected:r.symbol===t.symbol,onClick:()=>e&&e(r)},x.createElement(z,{gap:"2",justifyContent:"flex-start",alignItems:"center"},x.createElement(ne,{color:"text100",fontWeight:"bold"},r.symbol),x.createElement(ne,{color:"text50"},r.name.message))))))},DAe=()=>{const{selectedNetworks:t,setSelectedNetworks:e}=Un(),{chains:r=[]}=an(),n=i=>{if(t.includes(i)){if(t.length===1)return;e(t.filter(s=>s!==i))}else e([...t,i])};return x.createElement(z,{style:{paddingTop:Ai}},x.createElement(z,{padding:"5",paddingTop:"3"},x.createElement(ne,{variant:"small",color:"text50"},"Networks"),x.createElement(z,{flexDirection:"column",gap:"2"},r.map(i=>{const s=Pr(i.id,r);return x.createElement(NW,{disabled:t.length===1&&t.includes(i.id),key:i.id,selected:t.includes(i.id),onClick:()=>n(i.id),value:i.id,squareIndicator:!0},x.createElement(z,{gap:"2",justifyContent:"center",alignItems:"center"},x.createElement(mr,{width:"3",height:"3",src:s.logoURI,alt:"network"}),x.createElement(ne,{color:"text100",variant:"small"},s.name)))}))))},op=({chainId:t})=>{const{chains:e=[]}=an(),{network:r}=ln(t),n=Pr(t,e),i=wxe(t),s=Exe(t);return x.createElement(z,{height:"6",paddingY:"1",paddingLeft:"1.5",paddingRight:"2",gap:"1",style:{background:s},borderRadius:"xs",flexDirection:"row",justifyContent:"center",alignItems:"center",width:"min"},x.createElement(mr,{style:{width:"14px"},src:n.logoURI}),x.createElement(ne,{fontWeight:"bold",fontSize:"xsmall",style:{color:i}},Gke(r.name)))},LAe=({chainId:t})=>x.createElement(z,{style:{paddingTop:Ai}},x.createElement(z,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingLeft:"5",paddingTop:"0",style:{marginTop:"-20px",paddingRight:`calc(${ve.space[5]} - ${Os})`}},x.createElement(z,{marginBottom:"10",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column"},x.createElement(bt,{width:"32px",height:"32px"}),x.createElement(bt,{height:"24px",width:"70px"}),x.createElement(op,{chainId:t})),x.createElement(z,null,x.createElement(ne,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),x.createElement(z,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},x.createElement(bt,{width:"150px",height:"36px"}),x.createElement(bt,{width:"33px",height:"17px"}))),x.createElement(tt,{color:"text100",marginTop:"4",marginBottom:"10",width:"full",variant:"primary",leftIcon:Ug,label:"Send",disabled:!0,onClick:()=>{}}),x.createElement(z,null,x.createElement(Sk,null)))),BAe=(t,e)=>{var r;const[n,i]=C.useState(null),s=C.useMemo(()=>new IntersectionObserver(([o])=>i(o),e),[]);return C.useEffect(()=>(t.current&&s.observe(t.current),()=>{t.current&&s.disconnect()}),[t.current,s]),(r=n==null?void 0:n.isIntersecting)!=null?r:!1},DW=t=>{const{onLoad:e,hasMore:r=!0,children:n}=t,[i,s]=C.useState(0),[o,a]=C.useState(!1),c=C.useRef(null),l=BAe(c);C.useEffect(()=>{l&&r&&!o&&u()},[l]);const u=async()=>{a(!0),await e(i),s(f=>f+1),a(!1)};return x.createElement(x.Fragment,null,n,x.createElement("div",{ref:c}))},FAe=({contractAddress:t,chainId:e})=>{var r,n,i,s;const{chains:o=[]}=an(),{setNavigation:a}=Is(),{fiatCurrency:c,hideUnlistedTokens:l}=Un(),{address:u}=kn(),{data:f,isLoading:d,fetchNextPage:h,hasNextPage:p,isFetchingNextPage:v}=RW({chainId:e,accountAddress:u||"",contractAddress:t}),b=_W(f),{data:y,isLoading:m}=aAe({accountAddress:u||"",contractAddress:t,chainId:e},{hideUnlistedTokens:l}),{data:g,isLoading:S}=fu({tokens:[{chainId:e,contractAddress:t}]}),{data:P=1,isLoading:T}=Fc({toCurrency:c.symbol});if(m||S||T)return x.createElement(LAe,{chainId:e});const I=ar(t,lr),B=I?Pr(e,o).logoURI:y==null||(r=y.contractInfo)==null?void 0:r.logoURI,j=I?Pr(e,o).symbol:y==null||(n=y.contractInfo)==null?void 0:n.symbol,H=I?Pr(e,o).name:y==null||(i=y.contractInfo)==null?void 0:i.name,K=I?Pr(e,o).decimals:y==null||(s=y.contractInfo)==null?void 0:s.decimals,F=xr((y==null?void 0:y.balance)||"0",K),E=sa(F),_=y?yo({balance:y,prices:g||[],conversionRate:P,decimals:K||0}):"0",O=()=>{a({location:"send-coin",params:{chainId:e,contractAddress:t}})};return x.createElement(z,{style:{paddingTop:Ai}},x.createElement(z,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingLeft:"5",paddingTop:"0",style:{marginTop:"-20px",paddingRight:`calc(${ve.space[5]} - ${Os})`}},x.createElement(z,{marginBottom:"10",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column"},x.createElement(mr,{width:"8",src:B,alt:"logo"}),x.createElement(ne,{color:"text100",fontWeight:"bold",fontSize:"large"},H),x.createElement(op,{chainId:e})),x.createElement(z,null,x.createElement(ne,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),x.createElement(z,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},x.createElement(ne,{fontWeight:"bold",color:"text100",fontSize:"xlarge"},`${E} ${j}`),x.createElement(ne,{fontWeight:"medium",color:"text50",fontSize:"normal"},`${c.sign}${_}`))),x.createElement(tt,{width:"full",variant:"primary",leftIcon:Ug,color:"text100",label:"Send",onClick:O}),x.createElement(z,null,x.createElement(DW,{onLoad:()=>h(),hasMore:p},x.createElement(kk,{transactions:b,isLoading:d,isFetchingNextPage:v})))))},jAe=({chainId:t})=>x.createElement(z,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",marginTop:"8",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10",style:{paddingRight:`calc(${ve.space[5]} - ${Os})`}},x.createElement(z,{flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"center"},x.createElement(bt,{width:"32px",height:"32px"}),x.createElement(bt,{width:"100px",height:"24px"}),x.createElement(op,{chainId:t}),x.createElement(bt,{width:"142px",height:"17px"})),x.createElement(z,{width:"full"},x.createElement(bt,{width:"168px",height:"20px"}),x.createElement(z,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${ve.space[1]}) calc(50% - ${ve.space[1]})`,gap:ve.space[2]},width:"full",marginTop:"3"},Array(8).fill(null).map((e,r)=>x.createElement(bt,{width:"full",aspectRatio:"1/1"}))))),UAe=({chainId:t,contractAddress:e})=>{var r;const{setNavigation:n}=Is(),{address:i}=kn(),{data:s,isLoading:o}=sAe({chainId:t,accountAddress:i||"",collectionAddress:e}),a=s==null||(r=s[0])==null?void 0:r.contractInfo,c=a==null?void 0:a.logoURI;if(o)return x.createElement(jAe,{chainId:t});const l=u=>{n&&n({location:"collectible-details",params:{contractAddress:u.contractAddress,chainId:u.chainId,tokenId:u.tokenID}})};return x.createElement(z,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",marginTop:"8",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10",style:{paddingRight:`calc(${ve.space[5]} - ${Os})`}},x.createElement(z,{flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"center"},x.createElement(Gl,{imageUrl:c,size:32}),x.createElement(ne,{fontWeight:"bold",fontSize:"large",color:"text100"},(a==null?void 0:a.name)||"Unknown"),x.createElement(op,{chainId:t}),x.createElement(ne,{fontWeight:"medium",fontSize:"normal",color:"text50"},`${(s==null?void 0:s.length)||0} Unique Collectibles`)),x.createElement(z,{width:"full"},x.createElement(ne,{fontWeight:"medium",fontSize:"normal",color:"text50"},`Owned (${(s==null?void 0:s.length)||0})`),x.createElement(z,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${ve.space[1]}) calc(50% - ${ve.space[1]})`,gap:ve.space[2]},width:"full",marginTop:"3"},s==null?void 0:s.map(u=>{var f,d,h;const p=u.balance,v=(u==null||(f=u.tokenMetadata)==null?void 0:f.decimals)||0,b=sa(xr(p,v));return x.createElement(z,{key:`${u.contractAddress}-${u.tokenID}`,onClick:()=>l(u),className:oo},x.createElement(z,{background:"backgroundSecondary",aspectRatio:"1/1",width:"full",borderRadius:"md",justifyContent:"center",alignItems:"center",marginBottom:"2"},x.createElement(mr,{style:{height:"100%"},src:(d=u.tokenMetadata)==null?void 0:d.image})),x.createElement(z,null,x.createElement(ne,{fontWeight:"bold",fontSize:"normal",color:"text100"},`${(h=u.tokenMetadata)==null?void 0:h.name}`)),x.createElement(z,null,x.createElement(ne,{marginTop:"1",fontWeight:"medium",fontSize:"normal",color:"text50"},b," Owned")))}))))},zAe=()=>x.createElement(z,{style:{paddingTop:Ai}},x.createElement(z,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingLeft:"5",paddingTop:"0",style:{marginTop:"-20px",paddingRight:`calc(${ve.space[5]} - ${Os})`}},x.createElement(z,{gap:"3",alignItems:"center",justifyContent:"center",flexDirection:"column"},x.createElement(bt,{width:"120px",height:"30px"}),x.createElement(bt,{width:"140px",height:"40px"})),x.createElement(z,null,x.createElement(bt,{width:"347px",height:"347px"})),x.createElement(z,null,x.createElement(z,null,x.createElement(ne,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),x.createElement(z,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},x.createElement(bt,{width:"44px",height:"36px"}),x.createElement(bt,{width:"34px",height:"17px"}))),x.createElement(tt,{color:"text100",marginTop:"4",width:"full",variant:"primary",leftIcon:Ug,label:"Send",onClick:()=>{}})),x.createElement(z,null,x.createElement(ne,{fontSize:"normal",color:"text50",fontWeight:"medium"},"This week"),x.createElement(Sk,null)))),WAe=({contractAddress:t,chainId:e,tokenId:r})=>{var n,i,s,o,a,c;const{chains:l=[]}=an(),{address:u}=kn(),{fiatCurrency:f}=Un(),{setNavigation:d}=Is(),{data:h,isLoading:p,fetchNextPage:v,hasNextPage:b,isFetchingNextPage:y}=RW({chainId:e,accountAddress:u||"",contractAddress:t,tokenId:r}),m=_W(h),{data:g,isLoading:S}=IW({accountAddress:u||"",collectionAddress:t,chainId:e,tokenId:r}),{data:P,isLoading:T}=OW({tokens:[{chainId:e,contractAddress:t,tokenId:r}]}),{data:w=1,isLoading:I}=Fc({toCurrency:f.symbol});if(S||T||I)return x.createElement(zAe,null);const j=()=>{d({location:"send-collectible",params:{chainId:e,contractAddress:t,tokenId:r}})},H=Pr(e,l),K=g==null||(n=g.contractInfo)==null?void 0:n.logoURI,F=(g==null||(i=g.contractInfo)==null?void 0:i.name)||"Unknown Collection",E=(g==null||(s=g.tokenMetadata)==null?void 0:s.decimals)||0,_=(g==null?void 0:g.balance)||"0",O=xr(_,E),N=sa(Number(O)),k=g?yo({balance:g,prices:P||[],conversionRate:w,decimals:E}):"0";return x.createElement(z,{style:{paddingTop:Ai}},x.createElement(z,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingLeft:"5",paddingTop:"0",style:{marginTop:"-20px",paddingRight:`calc(${ve.space[5]} - ${Os})`}},x.createElement(z,{gap:"3",alignItems:"center",justifyContent:"center",flexDirection:"column"},x.createElement(z,{flexDirection:"row",gap:"2",justifyContent:"center",alignItems:"center"},x.createElement(mr,{borderRadius:"circle",width:"8",src:K,alt:"collection logo",style:{objectFit:"cover"}}),x.createElement(z,{gap:"1",flexDirection:"row",justifyContent:"center",alignItems:"center"},x.createElement(ne,{fontWeight:"bold",fontSize:"small",color:"text100"},F),x.createElement(mr,{width:"3",src:H.logoURI,alt:"collection logo"}))),x.createElement(z,{flexDirection:"column",justifyContent:"center",alignItems:"center"},x.createElement(ne,{color:"text100",fontWeight:"bold",fontSize:"large"},(g==null||(o=g.tokenMetadata)==null?void 0:o.name)||"Unknown Collectible"),x.createElement(ne,{color:"text50",fontSize:"small",fontWeight:"medium"},`#${r}`))),x.createElement(z,null,x.createElement(Ek,{imageUrl:g==null||(a=g.tokenMetadata)==null?void 0:a.image})),x.createElement(z,null,x.createElement(z,null,x.createElement(ne,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),x.createElement(z,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},x.createElement(ne,{fontWeight:"bold",color:"text100",fontSize:"xlarge"},N),P&&((c=P[0].price)==null?void 0:c.value)&&x.createElement(ne,{fontWeight:"medium",color:"text50",fontSize:"normal"},`${f.symbol} ${k}`))),x.createElement(tt,{color:"text100",marginTop:"4",width:"full",variant:"primary",leftIcon:Ug,label:"Send",onClick:j})),x.createElement(z,null,x.createElement(DW,{onLoad:()=>v(),hasMore:b},x.createElement(kk,{transactions:m,isLoading:p,isFetchingNextPage:y})))))},HAe=["buttonVariant","text","size"],LW=t=>{const{buttonVariant:e="icon",text:r,size:n="xs"}=t,i=rw(t,HAe),[s,o]=C.useState(!1);C.useEffect(()=>{s&&setTimeout(()=>{o(!1)},4e3)},[s]);const a=()=>{o(!0)},c=s?"Copied!":"Copy",l=e==="icon"?"rgba(0,0,0,0)":ve.colors.buttonGlass;return x.createElement(Ez.CopyToClipboard,{text:r,onCopy:a},x.createElement(Xo,bn({size:n,icon:s?cd:Fg},i,{style:bn({background:l},t==null?void 0:t.style),label:e==="with-label"?c:void 0})))},qAe=({transaction:t})=>{var e,r;const{chains:n=[]}=an(),{fiatCurrency:i}=Un(),s=[],o=[];(e=t.transfers)==null||e.forEach(m=>{var g,S;if(((g=m.contractInfo)==null?void 0:g.type)==="ERC721"||((S=m.contractInfo)==null?void 0:S.type)==="ERC1155"){var P;(P=m.tokenIds)==null||P.forEach(w=>{if(!o.find(j=>{var H;return j.chainId===t.chainId&&ar(j.contractAddress,((H=m.contractInfo)==null?void 0:H.address)||"")&&j.tokenId===w})){var B;o.push({chainId:t.chainId,contractAddress:((B=m.contractInfo)==null?void 0:B.address)||"",tokenId:w})}})}else{var T;const w=(m==null||(T=m.contractInfo)==null?void 0:T.address)||lr;s.find(B=>B.chainId===t.chainId&&ar(B.contractAddress,w))||s.push({chainId:t.chainId,contractAddress:w})}});const{data:a,isLoading:c}=fu({tokens:s}),{data:l,isLoading:u}=OW({tokens:o}),{data:f=1,isLoading:d}=Fc({toCurrency:i.symbol}),h=s.length>0&&c||o.length>0&&u||d,p=Pr(t.chainId,n),v=$z(t.timestamp).format("ddd MMM DD YYYY, h:m:s a"),b=()=>{window.open(`${p.blockExplorerUrl}/tx/${t.txnHash}`,"_blank")},y=({transfer:m})=>{var g,S,P,T;const w=m.to,I=w.substring(0,10)+"..."+w.substring(m.to.length-4,m.to.length),B=ar((m==null||(g=m.contractInfo)==null?void 0:g.address)||"",lr),j=B?p.logoURI:m==null||(S=m.contractInfo)==null?void 0:S.logoURI,H=B?p.symbol:(m==null||(P=m.contractInfo)==null?void 0:P.symbol)||"";return x.createElement(x.Fragment,null,(T=m.amounts)==null?void 0:T.map((K,F)=>{var E,_,O,N,k;const M=m.contractType==="ERC721"||m.contractType==="ERC1155",L=((E=m.tokenIds)==null?void 0:E[F])||"0",$=(m==null||(_=m.tokenMetadata)==null||(_=_[L])==null?void 0:_.decimals)||0,A=B?p.decimals:(m==null||(O=m.contractInfo)==null?void 0:O.decimals)||0,V=xr(K,M?$:A),R=sa(V),U=M?l==null||(N=l.find(q=>{var Y,X;return ar(q.token.contractAddress,((Y=m.contractInfo)==null?void 0:Y.address)||"")&&q.token.tokenId===((X=m.tokenIds)==null?void 0:X[F])&&q.token.chainId===t.chainId}))==null||(N=N.price)==null?void 0:N.value:a==null||(k=a.find(q=>{var Y;return ar(q.token.contractAddress,((Y=m.contractInfo)==null?void 0:Y.address)||lr)&&q.token.chainId===t.chainId}))==null||(k=k.price)==null?void 0:k.value,W=(parseFloat(V)*(f*(U||0))).toFixed(2);return x.createElement(z,{key:F,width:"full",flexDirection:"row",gap:"2",justifyContent:"space-between",alignItems:"center"},x.createElement(z,{flexDirection:"row",justifyContent:"flex-start",alignItems:"center",gap:"2",height:"12",borderRadius:"md",background:"buttonGlass",padding:"2",style:{flexBasis:"100%"}},x.createElement(Gl,{imageUrl:j,size:20}),x.createElement(z,{gap:"0.5",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"},x.createElement(ne,{fontWeight:"bold",fontSize:"xsmall",color:"text100"},`${R} ${H}`),h?x.createElement(bt,{width:"44px",height:"12px"}):x.createElement(ne,{fontWeight:"bold",fontSize:"xsmall",color:"text50"},U?`${i.sign}${W}`:""))),x.createElement(Jx,{color:"text50",style:{width:"16px"}}),x.createElement(z,{flexDirection:"row",justifyContent:"flex-start",alignItems:"center",gap:"2",height:"12",borderRadius:"md",background:"buttonGlass",padding:"2",style:{flexBasis:"100%"}},x.createElement(M1,{address:w,style:{width:"20px"}}),x.createElement(ne,{fontWeight:"bold",fontSize:"xsmall",color:"text100"},I)))}))};return x.createElement(z,{padding:"5",paddingTop:"3",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10",marginTop:"5"},x.createElement(z,{marginTop:"6",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"1"},x.createElement(ne,{fontSize:"normal",fontWeight:"medium"},"Transaction details"),x.createElement(ne,{marginBottom:"1",fontSize:"small",fontWeight:"medium",color:"text50"},v),x.createElement(op,{chainId:t.chainId})),x.createElement(z,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"4",width:"full",padding:"4",background:"backgroundSecondary",borderRadius:"md"},x.createElement(z,{width:"full",gap:"1",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"},x.createElement(ne,{fontSize:"normal",fontWeight:"medium",color:"text50"},"Transfer"),x.createElement(mr,{width:"3",src:p.logoURI,alt:"network logo"})),(r=t.transfers)==null?void 0:r.map((m,g)=>x.createElement(z,{width:"full",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"4",key:`transfer-${g}`},x.createElement(y,{transfer:m})))),x.createElement(tt,{onClick:b,width:"full",borderRadius:"md",rightIcon:nne,label:`View on ${p.blockExplorerName}`}),x.createElement(z,null,x.createElement(z,{width:"full",flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"flex-start"},x.createElement(R0,{width:"full",margin:"0",style:{marginBottom:"-4px"}}),x.createElement(ne,{color:"text50",fontSize:"normal",fontWeight:"medium"},"Status"),x.createElement(ne,{fontSize:"normal",fontWeight:"medium",color:"text100"},"Complete")),x.createElement(z,{width:"full",flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"flex-start"},x.createElement(R0,{width:"full",margin:"0",style:{marginBottom:"-4px"}}),x.createElement(ne,{color:"text50",fontSize:"normal",fontWeight:"medium"},"Transaction Hash"),x.createElement(ne,{color:"text100",fontSize:"normal",fontWeight:"medium",style:{overflowWrap:"anywhere"}},t.txnHash),x.createElement(LW,{marginTop:"2",buttonVariant:"with-label",text:t.txnHash}))))},VAe=C.forwardRef(({onClickAccount:t},e)=>{const{address:r}=kn();return x.createElement(z,{gap:"2",alignItems:"center"},x.createElement(z,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center"},x.createElement(z,{onClick:t,gap:"2",alignItems:"center",justifyContent:"center",className:oo,position:"relative",ref:e},x.createElement(M1,{size:"sm",address:r||""}),x.createElement(ne,{color:"text100",fontWeight:"medium",variant:"normal"},SW(r||"")),x.createElement(kN,{color:"text100"}))))}),GAe=C.forwardRef(({setOpenWalletDropdown:t},e)=>{const{setNavigation:r}=Is(),{setOpenWalletModal:n}=sp(),{address:i}=kn(),{disconnect:s}=DB(),{theme:o}=rp(),a=()=>{t(!1),r({location:"receive"})},c=()=>{t(!1),r({location:"history"})},l=()=>{t(!1),r({location:"settings"})},u=()=>{n(!1),t(!1),s()},f=()=>{switch(o){case"dark":return"rgba(38, 38, 38, 0.85)";case"light":return"rgba(217, 217, 217, 0.85)";default:return ve.colors.transparent}};return x.createElement(z,{padding:"3",ref:e,zIndex:"30",borderRadius:"md",style:{position:"relative",pointerEvents:"auto",width:"370px",backdropFilter:"blur(12.5px)",top:"16px",left:"15px",background:f()}},x.createElement(z,{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},x.createElement(z,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"3",marginLeft:"2",color:"text100"},x.createElement(M1,{style:{width:"28px"},size:"md",address:i||""}),x.createElement(ne,{fontSize:"large",style:{fontWeight:"700"},color:"text100"},SW(i||"")),x.createElement(LW,{buttonVariant:"icon",size:"md",text:i||"",color:"text100",style:{marginLeft:"-16px"}})),x.createElement(Xo,{onClick:()=>t(!1),size:"xs",background:"buttonGlass",icon:ru})),x.createElement(z,{gap:"2",marginTop:"3",flexDirection:"column"},x.createElement(tt,{variant:"glass",style:{borderRadius:ve.radii.md},width:"full",leftIcon:lne,label:"Receive",onClick:a}),x.createElement(tt,{style:{borderRadius:ve.radii.md},width:"full",leftIcon:PN,label:"History",onClick:c}),x.createElement(tt,{style:{borderRadius:ve.radii.md},width:"full",leftIcon:AN,label:"Settings",onClick:l}),x.createElement(tt,{label:"Sign Out",style:{borderRadius:ve.radii.md},width:"full",leftIcon:_N,onClick:u})))});au("packages/wallet/src/shared/WalletHeader/styles.css.ts","kit");const KAe=ki({":focus-visible":{boxShadow:"none"}},"searchButton");cu();const bE=({})=>{const{openWalletModalState:t}=sp(),[e,r]=C.useState(!1),{goBack:n,history:i,setNavigation:s}=Is(),o=C.useRef(!1);C.useEffect(()=>{t||r(!1)},[t]),C.useEffect(()=>{e?o.current?r(!1):o.current=!0:o.current=!1},[i.length,e]);const a=()=>{r(!0)},c=()=>{n()},l=()=>{s({location:"search"})};return x.createElement(z,{as:O0.div},x.createElement(Uke,{open:e},x.createElement(zke,null),x.createElement(z,{background:"backgroundPrimary",zIndex:"20",position:"fixed",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"full",style:{height:Ai,paddingTop:"6px"}},i.length>0?x.createElement(Xo,{onClick:c,icon:Bg,style:{backgroundColor:ve.colors.backgroundPrimary,width:"44px"}}):x.createElement(Xo,{onClick:l,icon:jg,className:KAe,style:{backgroundColor:ve.colors.backgroundPrimary,width:"44px"}}),x.createElement(Wke,{asChild:!0},x.createElement(VAe,{onClickAccount:a})),x.createElement(z,{style:{width:"44px"}})),x.createElement(Ng,null,e&&x.createElement(Hke,{asChild:!0,side:"bottom",align:"start"},x.createElement(GAe,{setOpenWalletDropdown:r})))))},Ns=({secondaryText:t,primaryText:e})=>{const{goBack:r,history:n}=Is(),i=()=>{r()};return x.createElement(z,{background:"backgroundPrimary",zIndex:"20",position:"fixed",width:"full",flexDirection:"row",alignItems:"center",justifyContent:"space-between",style:{height:Ai,paddingTop:"6px",backgroundColor:ve.colors.backgroundPrimary}},n.length>0?x.createElement(Xo,{onClick:i,icon:Bg,size:"sm",style:{background:"rgba(0,0,0,0)",width:"44px"}}):x.createElement(z,null),x.createElement(z,null,x.createElement(ne,{fontWeight:"medium",variant:"small",color:"text50"},t),x.createElement(ne,{fontWeight:"medium",variant:"small",color:"text100"},e)),x.createElement(z,{style:{width:"44px"}}))},NI=t=>{const{location:e}=t;switch(e){case"send-coin":return x.createElement(kAe,{chainId:t.params.chainId,contractAddress:t.params.contractAddress});case"send-collectible":return x.createElement(AAe,{chainId:t.params.chainId,contractAddress:t.params.contractAddress,tokenId:t.params.tokenId});case"receive":return x.createElement(SAe,null);case"history":return x.createElement(PAe,null);case"search":return x.createElement(TAe,null);case"search-view-all":return x.createElement(IAe,{defaultTab:t.params.defaultTab});case"settings":return x.createElement(OAe,null);case"settings-general":return x.createElement(RAe,null);case"settings-currency":return x.createElement(NAe,null);case"settings-networks":return x.createElement(DAe,null);case"coin-details":return x.createElement(FAe,{contractAddress:t.params.contractAddress,chainId:t.params.chainId});case"collectible-details":return x.createElement(WAe,{contractAddress:t.params.contractAddress,chainId:t.params.chainId,tokenId:t.params.tokenId});case"collection-details":return x.createElement(UAe,{contractAddress:t.params.contractAddress,chainId:t.params.chainId});case"transaction-details":return x.createElement(qAe,{transaction:t.params.transaction});case"home":default:return x.createElement(CAe,null)}},QAe=t=>{const{location:e}=t;switch(e){case"search":return x.createElement(Ns,{primaryText:"Search wallet"});case"search-view-all":return x.createElement(Ns,{secondaryText:"Search wallet / ",primaryText:"View all"});case"settings":return x.createElement(Ns,{secondaryText:"Wallet / ",primaryText:"Settings"});case"settings-general":return x.createElement(Ns,{secondaryText:"Wallet / Settings / ",primaryText:"General"});case"settings-currency":return x.createElement(Ns,{secondaryText:"Wallet / Settings / ",primaryText:"Currency"});case"settings-networks":return x.createElement(Ns,{secondaryText:"Wallet / Settings / ",primaryText:"Networks"});case"receive":return x.createElement(Ns,{secondaryText:"Wallet / ",primaryText:"Receive"});case"history":return x.createElement(Ns,{secondaryText:"Wallet / ",primaryText:"History"});case"coin-details":return x.createElement(bE,null);case"collectible-details":return x.createElement(bE,null);case"transaction-details":return x.createElement(Ns,{secondaryText:"",primaryText:""});case"send-collectible":case"send-coin":return x.createElement(Ns,{secondaryText:"Wallet /",primaryText:"Send"});case"home":default:return x.createElement(bE,null)}},YAe={location:"home"},JAe=t=>{const e=new lS;return x.createElement(hS,{client:e},x.createElement(XAe,t))},XAe=({children:t})=>{const{theme:e,position:r}=rp(),[n,i]=C.useState(!1),[s,o]=C.useState([]),a=s.length>0?s[s.length-1]:YAe,c=a.location==="home"||a.location==="collection-details"||a.location==="collectible-details"||a.location==="coin-details"||a.location==="history"||a.location==="search"||a.location==="search-view-all"||a.location==="settings-currency";return C.useEffect(()=>{n&&o([])},[n]),x.createElement(Vke,{value:{setOpenWalletModal:i,openWalletModalState:n}},x.createElement(dAe,{value:{setHistory:o,history:s}},x.createElement("div",{id:"kit-wallet"},x.createElement(Kg,{root:"#kit-wallet",scope:"kit",theme:e},x.createElement(Ng,null,n&&x.createElement(rS,{contentProps:{style:bn({maxWidth:"400px",height:"fit-content"},sk(r))},scroll:!1,backdropColor:"backgroundBackdrop",onClose:()=>i(!1)},x.createElement(z,{className:Ck,id:"sequence-kit-wallet-content"},QAe(a),c?x.createElement(SD,{className:xk,style:{paddingTop:Ai,height:"min(800px, 80vh)"}},NI(a)):NI(a)))))),t))};var ZAe=()=>typeof window<"u"&&window.localStorage.getItem("IS_PAPER_DEV")==="true",e4e=()=>typeof window<"u"&&window.location.origin.includes("paper.xyz"),BW=()=>{var t;return ZAe()?(t=window.localStorage.getItem("PAPER_DEV_URL"))!=null?t:"http://localhost:3000":e4e()?window.location.origin:"https://withpaper.com"},FW={colorPrimary:"#cf3781",colorBackground:"#ffffff",colorText:"#1a202c",borderRadius:12,fontFamily:"Open Sans"},t4e=Object.defineProperty,r4e=Object.defineProperties,n4e=Object.getOwnPropertyDescriptors,DI=Object.getOwnPropertySymbols,i4e=Object.prototype.hasOwnProperty,s4e=Object.prototype.propertyIsEnumerable,LI=(t,e,r)=>e in t?t4e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wn=(t,e)=>{for(var r in e||(e={}))i4e.call(e,r)&&LI(t,r,e[r]);if(DI)for(var r of DI(e))s4e.call(e,r)&&LI(t,r,e[r]);return t},BI=(t,e)=>r4e(t,n4e(e)),o4e=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),jW=o4e((t,e)=>{e.exports={name:"@paperxyz/js-client-sdk",description:"Paper JS SDK for Checkout Elements",version:"0.2.5",license:"Apache-2.0",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",files:["dist/**"],bugs:{url:"https://github.com/paperxyz/js-sdk/issues"},homepage:"https://github.com/paperxyz/js-sdk",repository:{type:"git",url:"git+https://github.com/paperxyz/js-sdk.git"},author:"Paper ",scripts:{build:"tsup src/index.ts --env.NODE_ENV production","build-package-checkout":"yarn build","dev-checkout":"tsup src/index.ts --env.NODE_ENV development --watch",lint:'eslint "src/**/*.ts*"',"lint:fix":"yarn lint --fix",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",prepare:"cd ../../ && node ./scripts/postInstall && cd ./packages/js-client-sdk"},keywords:[],devDependencies:{"@paperxyz/tsconfig":"*","eslint-config-paperxyz":"*",typescript:"^4.7.4"},dependencies:{"@paperxyz/sdk-common-utilities":"*",ethers:"^5.7.2"},publishConfig:{access:"public"}}}),UW=BW(),a4e="/sdk/2022-08-12/checkout-with-card",c4e=(t=>(t.UserAbandonedCheckout="User abandoned the checkout",t.UserLoginFailed="User login failed",t.InvalidProps="The props you passed in to this component are not valid.",t.InvalidCard="The card information is invalid. Please double check that the Card, CVC, and Zip code are all correct.",t.EmailNotVerified="The email was unable to be verified.",t.NotEnoughSupply="There is not enough supply to claim.",t.AddressNotAllowed="This address is not on the allowlist.",t.NoActiveClaimPhase="There is no active claim phase at the moment.",t))(c4e||{}),l4e=(t=>(t.ErrorConnectingToWallet="Error connecting to wallet",t.ErrorSendingTransaction="Something went wrong sending transaction",t.InsufficientBalance="Insufficient ETH",t.TransactionCancelled="Transaction Cancelled",t.WrongChain="Wrong Chain Detected",t.ChainSwitchUnderway="There is a network switch already underway",t.PendingSignature="Pending Signature",t))(l4e||{}),u4e=class{constructor(t){this.link=t}addStylingOptions(t){t.colorPrimary&&this.link.searchParams.set("colorPrimary",t.colorPrimary),t.colorBackground&&this.link.searchParams.set("colorBackground",t.colorBackground),t.colorText&&this.link.searchParams.set("colorText",t.colorText),t.borderRadius!==void 0&&this.link.searchParams.set("borderRadius",t.borderRadius.toString()),t.fontFamily&&this.link.searchParams.set("fontFamily",t.fontFamily),t.inputBackgroundColor&&this.link.searchParams.set("inputBackgroundColor",t.inputBackgroundColor),t.inputBorderColor&&this.link.searchParams.set("inputBorderColor",t.inputBorderColor)}addClientSecret(t){this.link.searchParams.set("sdkClientSecret",t)}addLocale(t){t&&this.link.searchParams.set("locale",t.toString())}addOTP(){this.link.searchParams.set("withOTP","true")}addAppName(t){t&&this.link.searchParams.set("appName",t)}addShowConnectWalletOptions(t){this.link.searchParams.append("showConnectWalletOptions",t.toString())}addReceivingWalletType(t){this.link.searchParams.append("walletType",t||"Preset")}addRecipientWalletAddress(t){this.link.searchParams.set("recipientWalletAddress",t)}addPayerWalletAddress(t){this.link.searchParams.append("payerWalletAddress",t)}addDate(t){this.link.searchParams.set("date",t?t.toString():Date.now().toString())}getLink(){return this.link}},f4e=({url:t,width:e=440,height:r=700})=>{if(!(window!=null&&window.top))return null;let n=window.top.outerHeight/2+window.top.screenY-r/2,i=window.top.outerWidth/2+window.top.screenX-e/2;return window.open(t,"_blank",`popup=true,width=${e},height=${r},top=${n},left=${i}`)};function FI(t,e,r){var n;(n=t.contentWindow)==null||n.postMessage(Wn({eventType:e},r),"*")}var d4e=jW(),h4e=class{constructor({elementOrId:e,onLoad:r}){this.elementOrId=e,this.onLoad=r}createPaymentElement({handler:e,link:r,iframeId:n}){let i=document.createElement("iframe");if(i.src=r.href,i.id=n,i.allow="payment",i.setAttribute("style","margin-left:auto; margin-right:auto; width:100%; height: 100%; min-height:375px; transition-property:all; transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1); transition-duration:150ms; color-scheme: light;"),i.onload=a=>{this.onLoad&&this.onLoad(a)},i.setAttribute("data-paper-sdk-version",`@paperxyz/js-client-sdk@${d4e.version}`),!this.elementOrId)return window.addEventListener("message",e(i)),i;let s=this.elementOrId;if(typeof s=="string"){let a=document.getElementById(s);if(!a)throw new Error("Invalid id given");s=a}let o=s.querySelector("#"+n);return o?(o.src===r.href||(o.src=r.href),o):(window.addEventListener("message",e(i)),s.appendChild(i))}},jI={top:"0px",left:"0px",right:"0px",bottom:"0px"},p4e=()=>({main:BI(Wn({},jI),{position:"fixed",zIndex:"10000",display:"flex",alignItems:"center",justifyContent:"center"}),overlay:BI(Wn({},jI),{position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.33)"}),body:{background:"transparent",borderRadius:"12px",position:"relative",overflow:"hidden",width:"100%",maxWidth:"500px",height:"700px",maxHeight:"80%",animation:"pew-modal-slideIn 0.2s forwards"},spinner:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",margin:"auto",borderWidth:"3px",borderColor:"#2D3748 #2D3748 transparent transparent",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite"},iframe:{position:"relative",height:"100%",width:"100%",border:"none",background:"transparent"}}),v4e=` +`)},lAe=0,Au=[];function uAe(t){var e=C.useRef([]),r=C.useRef([0,0]),n=C.useRef(),i=C.useState(lAe++)[0],s=C.useState(function(){return qW()})[0],o=C.useRef(t);C.useEffect(function(){o.current=t},[t]),C.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var v=X3([t.lockRef.current],(t.shards||[]).map(UI),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=C.useCallback(function(v,b){if("touches"in v&&v.touches.length===2)return!o.current.allowPinchZoom;var y=pv(v),m=r.current,g="deltaX"in v?v.deltaX:m[0]-y[0],S="deltaY"in v?v.deltaY:m[1]-y[1],P,T=v.target,w=Math.abs(g)>Math.abs(S)?"h":"v";if("touches"in v&&w==="h"&&T.type==="range")return!1;var I=BI(w,T);if(!I)return!0;if(I?P=w:(P=w==="v"?"h":"v",I=BI(w,T)),!I)return!1;if(!n.current&&"changedTouches"in v&&(g||S)&&(n.current=P),!P)return!0;var F=n.current||P;return oAe(F,b,v,F==="h"?g:S,!0)},[]),c=C.useCallback(function(v){var b=v;if(!(!Au.length||Au[Au.length-1]!==s)){var y="deltaY"in b?jI(b):pv(b),m=e.current.filter(function(P){return P.name===b.type&&P.target===b.target&&aAe(P.delta,y)})[0];if(m&&m.should){b.cancelable&&b.preventDefault();return}if(!m){var g=(o.current.shards||[]).map(UI).filter(Boolean).filter(function(P){return P.contains(b.target)}),S=g.length>0?a(b,g[0]):!o.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),l=C.useCallback(function(v,b,y,m){var g={name:v,delta:b,target:y,should:m};e.current.push(g),setTimeout(function(){e.current=e.current.filter(function(S){return S!==g})},1)},[]),u=C.useCallback(function(v){r.current=pv(v),n.current=void 0},[]),f=C.useCallback(function(v){l(v.type,jI(v),v.target,a(v,t.lockRef.current))},[]),d=C.useCallback(function(v){l(v.type,pv(v),v.target,a(v,t.lockRef.current))},[]);C.useEffect(function(){return Au.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",c,ku),document.addEventListener("touchmove",c,ku),document.addEventListener("touchstart",u,ku),function(){Au=Au.filter(function(v){return v!==s}),document.removeEventListener("wheel",c,ku),document.removeEventListener("touchmove",c,ku),document.removeEventListener("touchstart",u,ku)}},[]);var h=t.removeScrollBar,p=t.inert;return C.createElement(C.Fragment,null,p?C.createElement(s,{styles:cAe(i)}):null,h?C.createElement(Zke,{gapMode:"margin"}):null)}const fAe=Uke(HW,uAe);var QW=C.forwardRef(function(t,e){return C.createElement(aw,Di({},t,{ref:e,sideCar:fAe}))});QW.classNames=aw.classNames;const dAe=QW,YW="Popover",[JW,v9e]=xW(YW,[DW]),cw=DW(),[hAe,Nd]=JW(YW),pAe=t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=cw(e),c=C.useRef(null),[l,u]=C.useState(!1),[f=!1,d]=_ke({prop:n,defaultProp:i,onChange:s});return C.createElement(Cke,a,C.createElement(hAe,{scope:e,contentId:I8e(),triggerRef:c,open:f,onOpenChange:d,onOpenToggle:C.useCallback(()=>d(h=>!h),[d]),hasCustomAnchor:l,onCustomAnchorAdd:C.useCallback(()=>u(!0),[]),onCustomAnchorRemove:C.useCallback(()=>u(!1),[]),modal:o},r))},vAe="PopoverAnchor",mAe=C.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=Nd(vAe,r),s=cw(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return C.useEffect(()=>(o(),()=>a()),[o,a]),C.createElement(jW,sn({},s,n,{ref:e}))}),yAe="PopoverTrigger",gAe=C.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=Nd(yAe,r),s=cw(r),o=fu(e,i.triggerRef),a=C.createElement(cp.button,sn({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ZW(i.open)},n,{ref:o,onClick:Pl(t.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:C.createElement(jW,sn({asChild:!0},s),a)}),bAe="PopoverPortal",[m9e,wAe]=JW(bAe,{forceMount:void 0}),m1="PopoverContent",EAe=C.forwardRef((t,e)=>{const r=wAe(m1,t.__scopePopover),{forceMount:n=r.forceMount,...i}=t,s=Nd(m1,t.__scopePopover);return C.createElement(UW,{present:n||s.open},s.modal?C.createElement(xAe,sn({},i,{ref:e})):C.createElement(CAe,sn({},i,{ref:e})))}),xAe=C.forwardRef((t,e)=>{const r=Nd(m1,t.__scopePopover),n=C.useRef(null),i=fu(e,n),s=C.useRef(!1);return C.useEffect(()=>{const o=n.current;if(o)return Rke(o)},[]),C.createElement(dAe,{as:Ek,allowPinchZoom:!0},C.createElement(XW,sn({},t,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pl(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=r.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Pl(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:Pl(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})))}),CAe=C.forwardRef((t,e)=>{const r=Nd(m1,t.__scopePopover),n=C.useRef(!1),i=C.useRef(!1);return C.createElement(XW,sn({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,s),!s.defaultPrevented){var a;n.current||(a=r.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)===null||o===void 0||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=s.target;((a=r.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),XW=C.forwardRef((t,e)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...f}=t,d=Nd(m1,r),h=cw(r);return w8e(),C.createElement(E8e,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s},C.createElement(y8e,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>d.onOpenChange(!1)},C.createElement(Ske,sn({"data-state":ZW(d.open),role:"dialog",id:d.contentId},h,f,{ref:e,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function ZW(t){return t?"open":"closed"}const SAe=pAe,kAe=mAe,AAe=gAe,_Ae=EAe,[PAe,TAe]=uu(),up=()=>{const{setOpenWalletModal:t,openWalletModalState:e}=PAe();return{setOpenWalletModal:t,openWalletModalState:e}};function bn(){return bn=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}const ar=(t,e)=>t.toLowerCase()===e.toLowerCase(),Pk=(t,e)=>{let r=t;return t.length>=e&&(r=t.slice(0,e/2)+"..."+t.slice(t.length-e/2,t.length)),r},eH=t=>`0x${Pk((t==null?void 0:t.substring(2))||"",8)}`;var Pa=function(t){return t[t.VERY_LARGE=0]="VERY_LARGE",t[t.FRACTION=1]="FRACTION",t[t.VERY_TINY=2]="VERY_TINY",t[t.MIXED=3]="MIXED",t}(Pa||{});const oa=t=>{if(isNaN(Number(t)))return console.error(`display format error ${t} is not a number`),"NaN";const e=Number(t);if(e===0)return"0";let r;e>1e8?r=Pa.VERY_LARGE:e<1e-10?r=Pa.VERY_TINY:e<1?r=Pa.FRACTION:r=Pa.MIXED;let n,i;switch(r){case Pa.VERY_LARGE:n="compact",i={maximumFractionDigits:4};break;case Pa.VERY_TINY:n="scientific",i={maximumFractionDigits:4};break;case Pa.FRACTION:n="standard",i={maximumSignificantDigits:4};break;default:n="standard",i={maximumFractionDigits:2}}return Intl.NumberFormat("en-US",bn({notation:n},i)).format(e)},IAe=t=>t.charAt(0).toUpperCase()+t.slice(1),tH=(t,e)=>{const r=t.split(".");return r.length===1?t:`${r[0]}.${r[1].slice(0,e)}`},ng=t=>/0x[a-fA-F0-9]{40}/.test(t),OAe=t=>t>0?ve.colors.positive:t<0?ve.colors.negative:ve.colors.text50,zI=(t,e)=>{var r;const n=e.find(s=>ar(s.token.contractAddress,t.contractAddress));return n&&(n==null||(r=n.price24hChange)==null?void 0:r.value)||0},go=({balance:t,prices:e,decimals:r,conversionRate:n})=>{var i;let s=0;const o=e.find(f=>ar(f.token.contractAddress,t.contractAddress));if(!o)return"0.00";const a=((i=o.price)==null?void 0:i.value)||0,c=xr(t.balance,r),l=parseFloat(c)*a;return s+=l,`${(s*n).toFixed(2)}`},rH=t=>{const e=[],r=[],n=[];return t.forEach(i=>{i.contractAddress===lr?e.push(i):i.contractType==="ERC20"?r.push(i):(i.contractType==="ERC721"||i.contractType==="ERC1155")&&n.push(i)}),{nativeTokens:e,erc20Tokens:r,collectibles:n}},nH=t=>{const e=[];return t==null||t.pages.forEach(r=>{e.push(...r.transactions)}),e},ig=async({accountAddress:t,chainId:e})=>{try{const{indexerClient:r}=await ln(e),n=await r.getEtherBalance({accountAddress:t});return[{chainId:e,contractAddress:lr,accountAddress:t,balance:(n==null?void 0:n.balance.balanceWei)||"0",contractType:R8.UNKNOWN,blockHash:"",blockNumber:0,tokenID:""}]}catch(r){return console.error(r),[]}},Tk=async({tokens:t})=>{try{if(t.length===0)return[];const e=t[0].chainId,{apiClient:r}=await ln(e),n=await r.getCoinPrices({tokens:t});return(n==null?void 0:n.tokenPrices)||[]}catch(e){console.error(e);return}},sg=async({accountAddress:t,chainId:e,contractAddress:r},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:s=!0})=>{try{const{indexerClient:o}=await ln(e),a=await o.getTokenBalances(bn({accountAddress:t,includeMetadata:s},r?{contractAddress:r}:{}));let c=(a==null?void 0:a.balances)||[];if(n&&c.length>0){const l=await Tk({tokens:c.map(u=>({chainId:u.chainId,contractAddress:u.contractAddress,tokenId:u.tokenID}))});c=c.filter(u=>{const f=l==null?void 0:l.find(d=>ar(d.token.contractAddress,u.contractAddress)&&d.token.chainId===u.chainId);return u.contractType!=="ERC20"||!!f&&f.price!==null})}return i&&c.length>0&&(c=c.filter(l=>l.contractType!=="ERC721"&&l.contractType!=="ERC1155")),c}catch(o){return console.error(o),[]}},RAe=async({accountAddress:t,chainId:e},{hideUnlistedTokens:r,hideCollectibles:n})=>{try{return(await Promise.all([ig({accountAddress:t,chainId:e}),sg({accountAddress:t,chainId:e},{hideUnlistedTokens:r,hideCollectibles:n})])).flat()}catch(i){return console.error(i),[]}},iH=async({accountAddress:t,chainId:e,collectionAddress:r,includeMetadata:n=!0})=>{try{const{indexerClient:i}=await ln(e),s=await i.getTokenBalances({accountAddress:t,includeMetadata:n,contractAddress:r});return(s==null?void 0:s.balances)||[]}catch(i){return console.error(i),[]}},$Ae=async({accountAddress:t,chainIds:e,displayAssets:r},{hideUnlistedTokens:n,hideCollectibles:i})=>{let o=[];const a=r.length>0;try{if(a){const S=r.filter(I=>ar(I.contractAddress,lr)),P=r.filter(I=>!ar(I.contractAddress,lr)),T={},w={};S.forEach(I=>{T[I.chainId]||(T[I.chainId]=[]),T[I.chainId].push(I)}),P.forEach(I=>{w[I.chainId]||(w[I.chainId]=[]),w[I.chainId].push(I)}),o=(await Promise.all([...Object.keys(T).map(I=>ig({accountAddress:t,chainId:Number(I)})),...Object.keys(w).map(I=>w[Number(I)].map(F=>sg({accountAddress:t,chainId:Number(I),contractAddress:F.contractAddress},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:!1}))).flat()])).flat()}else o=(await Promise.all([...e.map(S=>ig({accountAddress:t,chainId:S})),...e.map(S=>sg({accountAddress:t,chainId:S},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:!1}))])).flat();const{nativeTokens:c,erc20Tokens:l,collectibles:u}=rH(o),f=new Promise(async(S,P)=>{if(l.length>0){const T=l.map(I=>({chainId:I.chainId,contractAddress:I.contractAddress})),w=await Tk({tokens:T})||[];S(w)}else S([])}),d=u.map(async S=>a?S:await iH({accountAddress:t,chainId:S.chainId,collectionAddress:S.contractAddress,includeMetadata:!1})),h=async()=>{const S={},P={};l.forEach(w=>{P[w.chainId]?P[w.chainId].push(w):P[w.chainId]=[w]});const T=Object.keys(P).map(async w=>{const{metadataClient:I}=ln(w),j=P[Number(w)].map(K=>K.contractAddress),H=await I.getContractInfoBatch({chainID:String(w),contractAddresses:j});S[Number(w)]=H});return await Promise.all([...T]),S},[p,v,...b]=await Promise.all([f,h(),...d]),y=l.sort((S,P)=>{var T,w;const I=p.find(k=>ar(k.token.contractAddress,S.contractAddress)),F=p.find(k=>ar(k.token.contractAddress,P.contractAddress)),j=I!=null&&I.price?I.price.value:0,H=F!=null&&F.price?F.price.value:0,K=(T=v[S.chainId].contractInfoMap[S.contractAddress])==null?void 0:T.decimals,B=(w=v[P.chainId].contractInfoMap[P.contractAddress])==null?void 0:w.decimals,E=K===void 0?0:Number(xr(S.balance,K)),_=B===void 0?0:Number(xr(P.balance,B)),O=E*j;return _*H-O}),m=K3e(b.flat(),10).sort((S,P)=>S.contractAddress.localeCompare(P.contractAddress));return i?[...c.length>0?[c[0]]:[],...y.length>0?y.slice(0,11):[]]:[...c.length>0?[c[0]]:[],...y.length>0?[y[0]]:[],...m.length>0?[...m]:[]]}catch(c){return console.error(c),[]}},MAe=async({accountAddress:t,chainId:e,collectionAddress:r,tokenId:n})=>{const{indexerClient:i}=await ln(e);return(await i.getTokenBalances({accountAddress:t,includeMetadata:!0,contractAddress:r,tokenID:n})).balances[0]},NAe=async({tokens:t})=>{try{if(t.length===0)return[];const e=t[0].chainId,{apiClient:r}=await ln(e),n=await r.getCollectiblePrices({tokens:t});return(n==null?void 0:n.tokenPrices)||[]}catch(e){console.error(e);return}},sH=async({chainId:t,contractAddress:e,accountAddress:r,tokenId:n,page:i})=>{const{indexerClient:s}=ln(t);return s.getTransactionHistory({includeMetadata:!0,page:i,filter:{accountAddress:r,contractAddress:e,tokenID:n}})},DAe=async({chainIds:t,accountAddress:e})=>(await Promise.all([...t.map(s=>sH({chainId:s,accountAddress:e,page:{page:1}}))])).map(s=>s.transactions).flat().sort((s,o)=>{const a=new Date(s.timestamp).getTime();return new Date(o.timestamp).getTime()-a}),LAe=async({toCurrency:t})=>{if(t==="USD")return 1;const{apiClient:e}=ln(137);return(await e.getExchangeRate({toCurrency:t})).exchangeRate.value},FAe=async({tokens:t})=>{const{metadataClient:e}=ln(t.chainId);return(await e.getTokenMetadata({chainID:t.chainId.toString(),contractAddress:t.contractAddress,tokenIDs:t.tokenIds})).tokenMetadata},BAe=async t=>{const{metadataClient:e}=ln(Number(t.chainID));return(await e.getContractInfo(t)).contractInfo},jAe=["chainIds"],UAe=["disabled"],Zi={oneSecond:1*1e3,oneMinute:60*1e3,oneHour:60*60*1e3},Ik=(t,e)=>oi({queryKey:["balances",t,e],queryFn:async()=>{const{chainIds:r}=t,n=lw(t,jAe);return(await Promise.all(r.map(s=>RAe(bn({},n,{chainId:s}),e)))).flat()},retry:!0,staleTime:10*Zi.oneMinute,enabled:t.chainIds.length>0&&!!t.accountAddress}),zAe=t=>oi({queryKey:["collectionBalance",t],queryFn:()=>iH(t),retry:!0,staleTime:10*Zi.oneMinute,enabled:!!t.chainId&&!!t.accountAddress&&!!t.collectionAddress}),du=t=>{let{disabled:e}=t,r=lw(t,UAe);return oi({queryKey:["coinPrices",r],queryFn:()=>Tk(r),retry:!0,staleTime:1*Zi.oneMinute,enabled:r.tokens.length>0&&!e})},WAe=(t,e)=>oi({queryKey:["balancesAssetsSummary",t,e],queryFn:()=>$Ae(t,e),retry:!0,staleTime:10*Zi.oneMinute,enabled:t.chainIds.length>0&&!!t.accountAddress}),HAe=(t,e)=>oi({queryKey:["coinBalance",t,e],queryFn:()=>ar((t==null?void 0:t.contractAddress)||"",lr)?ig({accountAddress:t.accountAddress,chainId:t.chainId}).then(i=>i[0]):sg(t,e).then(n=>n[0]),retry:!0,staleTime:1*Zi.oneMinute,enabled:!!t.chainId&&!!t.accountAddress}),oH=t=>oi({queryKey:["collectibleBalance",t],queryFn:()=>MAe(t),retry:!0,staleTime:5*Zi.oneMinute,enabled:!!t.chainId&&!!t.accountAddress&&!!t.collectionAddress&&!!t.tokenId}),aH=t=>oi({queryKey:["useCollectiblePrices",t],queryFn:()=>NAe(t),retry:!0,staleTime:5*Zi.oneMinute,enabled:t.tokens.length>0}),cH=t=>$ue({queryKey:["transactionHistory",t],queryFn:({pageParam:e})=>sH(bn({},t,e?{page:{page:e}}:{page:{page:1}})),getNextPageParam:({page:e})=>{if(e.more)return(e==null?void 0:e.page)||1},retry:!0,staleTime:10*Zi.oneMinute,enabled:!!t.chainId&&!t.disabled&&!!t.accountAddress}),qAe=t=>oi({queryKey:["transactionHistorySummary",t],queryFn:()=>DAe(t),retry:!0,staleTime:10*Zi.oneMinute,enabled:t.chainIds.length>0&&!!t.accountAddress}),Bc=t=>oi({queryKey:["useConversionRate",t],queryFn:()=>LAe(t),retry:!0,staleTime:60*Zi.oneMinute}),VAe=t=>oi({queryKey:["useTokenMetadata",t],queryFn:()=>FAe(t),retry:!0,staleTime:60*Zi.oneMinute,enabled:!!t.tokens.chainId&&!!t.tokens.contractAddress}),GAe=t=>oi({queryKey:["useContractInfo",t],queryFn:()=>BAe(t),retry:!0,staleTime:60*Zi.oneMinute,enabled:!!t.chainID&&!!t.contractAddress}),[KAe,QAe]=uu(),Rs=()=>{const{setHistory:t,history:e}=KAe();return{setNavigation:i=>{const s=document.getElementById("sequence-kit-wallet-content"),o=s==null?void 0:s.parentElement;o==null||o.scrollTo(0,0);const a=[...e,i];t(a)},history:e,setHistory:t,goBack:()=>{const i=[...e];i.pop(),t(i)}}},YAe=[{inputs:[{internalType:"address",name:"_from",type:"address"},{internalType:"address",name:"_to",type:"address"},{internalType:"uint256[]",name:"_ids",type:"uint256[]"},{internalType:"uint256[]",name:"_amounts",type:"uint256[]"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],JAe=[{constant:!1,inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],XAe=[{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"}],lH=[{symbol:"USD",sign:"$",name:{message:"US Dollar"},decimals:2},{symbol:"CAD",sign:"$",name:{message:"Canadian Dollar"},decimals:2},{symbol:"GBP",sign:"£",name:{message:"British Pound Sterling"},decimals:2},{symbol:"EUR",sign:"€",name:{message:"Euro"},decimals:2},{symbol:"CNY",sign:"¥",name:{message:"Chinese Yuan"},decimals:2},{symbol:"JPY",sign:"¥",name:{message:"Japanese Yen"},decimals:2},{symbol:"KRW",sign:"₩",name:{message:"South Korean Won"},decimals:2},{symbol:"SGD",sign:"$",name:{message:"Singapore Dollar"},decimals:2},{symbol:"CHF",sign:"CHF ",name:{message:"Swiss Franc"},decimals:2},{symbol:"AUD",sign:"$",name:{message:"Australian Dollar"},decimals:2},{symbol:"NZD",sign:"$",name:{message:"New Zealand Dollar"},decimals:2},{symbol:"SEK",sign:"kr ",name:{message:"Swedish Krona"},decimals:2},{symbol:"NOK",sign:"kr ",name:{message:"Norwegian Krone"},decimals:2},{symbol:"MXN",sign:"$",name:{message:"Mexican Peso"},decimals:2},{symbol:"INR",sign:"₹",name:{message:"Indian Rupee"},decimals:2},{symbol:"ZAR",sign:"R ",name:{message:"South African Rand"},decimals:2},{symbol:"TRY",sign:"₺",name:{message:"Turkish Lira"},decimals:2},{symbol:"BRL",sign:"R$",name:{message:"Brazilian Real"},decimals:2},{symbol:"DKK",sign:"kr ",name:{message:"Danish Krone"},decimals:2},{symbol:"PLN",sign:"zł ",name:{message:"Polish Zloty"},decimals:2},{symbol:"THB",sign:"฿",name:{message:"Thai Baht"},decimals:2},{symbol:"IDR",sign:"Rp",name:{message:"Indonesian Rupiah"},decimals:2}],ZAe=lH[0],_i="54px",$s=navigator.userAgent.match(/chrome|chromium|crios/i)?"13px":"0px",zn=()=>{const{chains:t}=an(),e=()=>{let l=!0,u=!1,f=ZAe,d=t.map(h=>h.id);try{const h=localStorage.getItem(gn.Settings),p=JSON.parse(h||"{}");if((p==null?void 0:p.hideUnlistedTokens)!==void 0&&(l=p==null?void 0:p.hideUnlistedTokens),(p==null?void 0:p.hideCollectibles)!==void 0&&(u=p==null?void 0:p.hideCollectibles),(p==null?void 0:p.fiatCurrency)!==void 0&&(f=p==null?void 0:p.fiatCurrency),(p==null?void 0:p.selectedNetworks)!==void 0){let v=!0;p.selectedNetworks.forEach(b=>{t.find(y=>y.id===b)===void 0&&(v=!1)}),v&&(d=p==null?void 0:p.selectedNetworks)}}catch(h){console.error(h,"Failed to fetch settings")}return{hideUnlistedTokens:l,hideCollectibles:u,fiatCurrency:f,selectedNetworks:d}},r=e(),[n,i]=C.useState(r);return bn({},n,{setFiatCurrency:l=>{const u=e(),f=bn({},u,{fiatCurrency:l});localStorage.setItem(gn.Settings,JSON.stringify(f)),i(f)},setHideCollectibles:l=>{const u=e(),f=bn({},u,{hideCollectibles:l});localStorage.setItem(gn.Settings,JSON.stringify(f)),i(f)},setHideUnlistedTokens:l=>{const u=e(),f=bn({},u,{hideUnlistedTokens:l});localStorage.setItem(gn.Settings,JSON.stringify(f)),i(f)},setSelectedNetworks:l=>{const u=e(),f=bn({},u,{selectedNetworks:l});localStorage.setItem(gn.Settings,JSON.stringify(f)),i(f)}})},e4e=({size:t=30})=>x.createElement(z,{alignItems:"center",justifyContent:"center",borderRadius:"circle",background:"backgroundInverse",flexShrink:"0",style:{width:`${t}px`,height:`${t}px`}},x.createElement(ne,{variant:"large",color:"textInverse100"},"?")),Kl=({imageUrl:t,size:e=30})=>t?x.createElement(mr,{src:t,borderRadius:"circle",style:{width:`${e}px`,height:`${e}px`}}):x.createElement(e4e,{size:e}),WI=({networkLogoUrl:t,logoUrl:e,tokenName:r,balance:n,balanceFiat:i,priceChangePercentage:s,symbol:o})=>{const{fiatCurrency:a}=zn(),c=s>0?"+":"";return x.createElement(z,{background:"backgroundSecondary",width:"full",height:"full",borderRadius:"md",padding:"4",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"1"},x.createElement(z,{marginBottom:"1"},x.createElement(Kl,{size:36,imageUrl:e})),x.createElement(z,{marginBottom:"3"},x.createElement(z,{flexDirection:"row",gap:"1",justifyContent:"flex-start",alignItems:"center"},x.createElement(ne,{fontWeight:"bold",whiteSpace:"nowrap",color:"text100",style:{maxWidth:"130px",textOverflow:"ellipsis",overflow:"hidden"}},r),x.createElement(Kl,{size:12,imageUrl:t})),x.createElement(ne,{color:"text50",whiteSpace:"nowrap",style:{display:"block",maxWidth:"150px",textOverflow:"ellipsis",overflow:"hidden"}},`${n} ${o}`)),x.createElement(z,null,x.createElement(z,null,x.createElement(ne,{fontWeight:"bold",color:"text100"},`${a.sign}${i}`)),x.createElement(ne,{style:{color:OAe(s)}},`${c}${s.toFixed(2)}%`)))},HI=({balance:t})=>{var e;const{chains:r=[]}=an(),{fiatCurrency:n}=zn(),i=ar(t.contractAddress,lr),s=Tr(t.chainId,r),{data:o=[],isLoading:a}=du({tokens:[{chainId:t.chainId,contractAddress:t.contractAddress}]}),{data:c=1,isLoading:l}=Bc({toCurrency:n.symbol}),{data:u,isLoading:f}=GAe({chainID:String(t.chainId),contractAddress:t.contractAddress});if(a||l||f)return x.createElement(z,{background:"backgroundSecondary",width:"full",height:"full",borderRadius:"md"});if(i){const P=go({balance:t,prices:o,conversionRate:c,decimals:s.decimals}),T=zI(t,o),w=xr(t.balance,s.decimals),I=oa(w);return x.createElement(WI,{networkLogoUrl:s.logoURI,logoUrl:s.logoURI,tokenName:s.name,balance:I,balanceFiat:P,priceChangePercentage:T,symbol:s.symbol})}const h=(e=u==null?void 0:u.decimals)!=null?e:18,p=go({balance:t,prices:o,conversionRate:c,decimals:h}),v=zI(t,o),b=xr(t.balance,h),y=oa(b),m=(u==null?void 0:u.name)||"Unknown",g=(u==null?void 0:u.name)||"TOKEN",S=u==null?void 0:u.logoURI;return x.createElement(WI,{networkLogoUrl:s.logoURI,logoUrl:S,tokenName:m,balance:y,balanceFiat:p,priceChangePercentage:v,symbol:g})},Ok=({imageUrl:t})=>x.createElement(po,{padding:"0",aspectRatio:"1/1",justifyContent:"center",alignItems:"center",overflow:"hidden",borderRadius:"md",background:"backgroundSecondary"},x.createElement(mr,{style:{height:"100%"},src:t})),t4e=({balance:t})=>{var e;const{data:r}=VAe({tokens:{chainId:t.chainId,contractAddress:t.contractAddress,tokenIds:[t.tokenID]}}),n=r==null||(e=r[0])==null?void 0:e.image;return x.createElement(Ok,{imageUrl:n})};cu("packages/wallet/src/shared/Skeleton/styles.css.ts","kit");const r4e=$z({"0%":{opacity:.25},"50%":{opacity:.1},"100%":{opacity:.25}},"PulseSimple"),n4e=Ai({height:"76px",backgroundColor:"#909090",animation:`${r4e} 2s ease-in-out infinite`},"skeleton");lu();const bt=({width:t="100%",height:e="100%",borderRadius:r="md",aspectRatio:n})=>x.createElement(z,{className:n4e,borderRadius:r,aspectRatio:n,style:{width:t,height:e}}),i4e=()=>x.createElement(z,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${ve.space[1]}) calc(50% - ${ve.space[1]})`,gap:ve.space[2]}},Array(12).fill(null).map((t,e)=>x.createElement(z,{key:e},x.createElement(bt,{height:"100%",width:"100%",aspectRatio:"1/1"}))));cu("packages/wallet/src/shared/styles.css.ts","kit");const ao=Ai({":hover":{cursor:"pointer",opacity:"0.8",userSelect:"none"}},"clickable"),Rk=Ai({"> div":{overflowY:"scroll"}},"scrollbar");Os(`html:not(.is-apple) ${Rk} > div::-webkit-scrollbar-thumb`,{background:"none",backgroundClip:"content-box",transition:"background 0.5s linear"});Os(`html:not(.is-apple) ${Rk} > div:hover::-webkit-scrollbar-thumb`,{background:ve.colors.text50,backgroundClip:"content-box"});const $k=Ai({},"walletContent");Os(`${$k} + button`,{backgroundColor:"transparent"});Os(`${$k} + button > svg`,{width:"20px",height:"20px"});lu();const s4e=()=>{const{address:t}=kn(),{setNavigation:e}=Rs(),{displayedAssets:r}=ECe(),{hideUnlistedTokens:n,hideCollectibles:i,selectedNetworks:s}=zn(),{data:o=[],isLoading:a}=WAe({accountAddress:t||"",chainIds:s,displayAssets:r},{hideUnlistedTokens:n,hideCollectibles:i});if(a)return x.createElement(i4e,null);const{nativeTokens:c,erc20Tokens:l,collectibles:u}=rH(o),f=d=>{d.contractType==="ERC1155"||d.contractType==="ERC721"?e&&e({location:"collectible-details",params:{contractAddress:d.contractAddress,chainId:d.chainId,tokenId:d.tokenID}}):d.contractType==="ERC20"?e&&e({location:"coin-details",params:{contractAddress:d.contractAddress,chainId:d.chainId}}):e&&e({location:"coin-details",params:{contractAddress:d.contractAddress,chainId:d.chainId}})};return x.createElement(z,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${ve.space[1]}) calc(50% - ${ve.space[1]})`,gap:ve.space[2]}},c.map(d=>x.createElement(z,{key:d.contractAddress,className:ao,aspectRatio:"1/1",onClick:()=>f(d)},x.createElement(HI,{balance:d}))),l.map(d=>x.createElement(z,{className:ao,key:d.contractAddress,aspectRatio:"1/1",onClick:()=>f(d)},x.createElement(HI,{balance:d}))),u.map(d=>x.createElement(z,{className:ao,aspectRatio:"1/1",key:`${d.contractAddress}-${d.tokenID}}`,onClick:()=>f(d)},x.createElement(t4e,{balance:d}))))},o4e=()=>x.createElement(z,{paddingLeft:"5",paddingBottom:"5",gap:"4",flexDirection:"column",style:{paddingRight:`calc(${ve.space[5]} - ${$s})`}},x.createElement(s4e,null)),a4e=()=>{const{address:t}=kn(),{chain:e,chains:r=[]}=an(),[n,i]=C.useState(!1),s=Tr((e==null?void 0:e.id)||1,r);C.useEffect(()=>{n&&setTimeout(()=>{i(!1)},4e3)},[n]);const o=()=>{i(!0)},a=()=>{window.open(`https://twitter.com/intent/tweet?text=Here%20is%20my%20address%20${t}`)};return x.createElement(z,{style:{paddingTop:_i}},x.createElement(z,{padding:"5",paddingTop:"3",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"4"},x.createElement(z,{marginTop:"1",width:"fit",background:"white",borderRadius:"md",alignItems:"center",justifyContent:"center",padding:"4"},x.createElement(ySe,{value:t||"",size:200,bgColor:"white",fgColor:"black","data-id":"receiveQR"})),x.createElement(z,null,x.createElement(z,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},x.createElement(ne,{variant:"medium",color:"text100",textAlign:"center",lineHeight:"inherit",style:{fontWeight:"700"}},"My Wallet"),x.createElement(mr,{width:"5",src:s.logoURI,alt:"icon"})),x.createElement(z,{marginTop:"2",style:{maxWidth:"180px",textAlign:"center"}},x.createElement(ne,{textAlign:"center",color:"text50",style:{fontSize:"14px",maxWidth:"180px",overflowWrap:"anywhere"}},t))),x.createElement(z,{gap:"3"},x.createElement(Jz.CopyToClipboard,{text:t||""},x.createElement(rt,{onClick:o,leftIcon:Gg,label:n?"Copied!":"Copy"})),x.createElement(rt,{onClick:a,leftIcon:Yne,label:"Share"})),x.createElement(z,{justifyContent:"center",alignItems:"center",style:{maxWidth:"260px",textAlign:"center"}},x.createElement(ne,{color:"text100",variant:"small",style:{maxWidth:"260px",overflowWrap:"anywhere"}},`This is a ${s.name} address. Please only send assets on the ${s.name} network.`))))},uH=({imageUrl:t,name:e,decimals:r,balance:n,symbol:i,fiatValue:s,chainId:o,showSquareImage:a})=>{const{chains:c=[]}=an(),{fiatCurrency:l}=zn(),u=xr(n,r),f=oa(u),d=Tr(o,c);return x.createElement(z,{alignItems:"flex-end",justifyContent:"space-between"},x.createElement(z,{justifyContent:"space-between",alignItems:"center",gap:"2"},a?x.createElement(z,{style:{width:"40px"}},x.createElement(Ok,{imageUrl:t})):x.createElement(Kl,{imageUrl:t,size:40}),x.createElement(z,{flexDirection:"column",alignItems:"flex-start"},x.createElement(z,{flexDirection:"row",alignItems:"center",gap:"1"},x.createElement(ne,{variant:"medium",color:"text100"},e),x.createElement(Kl,{imageUrl:d.logoURI,size:12})),x.createElement(ne,{color:"text50",variant:"normal"}," ",`${f} ${i} available`))),x.createElement(z,{flexDirection:"column",alignItems:"flex-end",justifyContent:"flex-end"},s&&x.createElement(ne,{variant:"normal",color:"text100"},`${l.sign}${s}`)))},c4e=({chainId:t,contractAddress:e})=>{var r,n,i,s,o;const{chains:a=[]}=an(),c=Ib(),{address:l="",connector:u}=kn(),f=!!(u!=null&&(r=u._wallet)!=null&&r.isSequenceBased),d=c===t,h=!d&&!f,{switchNetwork:p}=n8(),v=C.useRef(null),{setOpenWalletModal:b}=up(),{fiatCurrency:y}=zn(),[m,g]=C.useState("0"),[S,P]=C.useState(""),{data:T}=r8(),{data:w=[],isLoading:I}=Ik({accountAddress:l,chainIds:[t],contractAddress:e},{hideUnlistedTokens:!1}),F=Tr(t,a),j=w.find(Q=>Q.contractAddress===e),{data:H=[],isLoading:K}=du({tokens:[{chainId:t,contractAddress:e}]}),{data:B=1,isLoading:E}=Bc({toCurrency:y.symbol});if(I||K||E)return null;const O=ar(e,lr),N=O?F.decimals:(j==null||(n=j.contractInfo)==null?void 0:n.decimals)||18,k=O?F.name:(j==null||(i=j.contractInfo)==null?void 0:i.name)||"",$=O?F.logoURI:j==null||(s=j.contractInfo)==null?void 0:s.logoURI,L=O?F.symbol:(j==null||(o=j.contractInfo)==null?void 0:o.symbol)||"",M=m===""?"0":m,A=Df(M,N),D=go({balance:bn({},j,{balance:A.toString()}),prices:H,conversionRate:B,decimals:N}),V=A.gt((j==null?void 0:j.balance)||"0"),R=A.gt(0),U=Q=>{const{value:Z}=Q.target,ae=tH(Z,N);g(ae)},W=()=>{var Q;(Q=v.current)==null||Q.focus();const Z=xr((j==null?void 0:j.balance)||0,N).toString();g(Z)},q=async()=>{const Q=await navigator.clipboard.readText();P(Q)},Y=()=>{P("")},X=async Q=>{!d&&f&&p&&p(t),Q.preventDefault();const Z=Df(M,N);O?T==null||T.sendTransaction({to:S,value:BigInt(Z.toString())}).catch(ae=>console.error("User rejected transaction",ae)):T==null||T.sendTransaction({to:j==null?void 0:j.contractAddress,data:new jr(JAe).encodeFunctionData("transfer",[S,Z.toHexString()])}).catch(ae=>console.error("User rejected transaction",ae)),b(!1)};return x.createElement(z,{padding:"5",paddingTop:"3",style:{marginTop:_i},gap:"2",flexDirection:"column",as:"form",onSubmit:X},x.createElement(z,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},x.createElement(uH,{imageUrl:$,decimals:N,name:k,symbol:L,balance:(j==null?void 0:j.balance)||"0",fiatValue:go({balance:j,prices:H,conversionRate:B,decimals:N}),chainId:t}),x.createElement(iL,{ref:v,style:{fontSize:ve.fontSizes.xlarge,fontWeight:ve.fontWeights.bold},name:"amount",value:m,onChange:U,controls:x.createElement(x.Fragment,null,x.createElement(ne,{variant:"small",color:"text50",whiteSpace:"nowrap"},`~${y.sign}${D}`),x.createElement(rt,{size:"xs",shape:"square",label:"Max",onClick:W,"data-id":"maxCoin",flexShrink:"0"}),x.createElement(ne,{fontSize:"xlarge",fontWeight:"bold",color:"text100"},L))}),V&&x.createElement(ne,{as:"div",variant:"normal",color:"negative",marginTop:"2"},"Insufficient Funds")),x.createElement(z,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},x.createElement(ne,{fontSize:"normal",color:"text50"},"To"),ng(S)?x.createElement(z,{borderRadius:"md",background:"backgroundSecondary",width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4",className:ao,onClick:Y,style:{height:"52px"}},x.createElement(z,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"2"},x.createElement(D1,{address:S,style:{width:"20px"}}),x.createElement(ne,{color:"text100"},`0x${Pk(S.substring(2),8)}`)),x.createElement(nu,{size:"xs"})):x.createElement($c,{value:S,onChange:Q=>P(Q.target.value),placeholder:`${F.name} Address (0x...)`,name:"to-address","data-1p-ignore":!0,controls:x.createElement(rt,{size:"xs",shape:"square",label:"Paste",onClick:q,"data-id":"to-address",flexShrink:"0",leftIcon:Gg})})),h&&x.createElement(z,{marginTop:"3"},x.createElement(ne,{color:"negative"},"The wallet is connected to the wrong network. Please switch network before proceeding"),x.createElement(rt,{marginTop:"2",width:"full",variant:"primary",type:"button",label:"Switch Network",onClick:()=>p&&p(t),disabled:d,style:{height:"52px",borderRadius:ve.radii.md}})),x.createElement(rt,{color:"text100",marginTop:"3",width:"full",variant:"primary",type:"submit",disabled:!R||!ng(S)||V||!d&&!f,label:"Send",rightIcon:Lo,style:{height:"52px",borderRadius:ve.radii.md}}))},l4e=({chainId:t,contractAddress:e,tokenId:r})=>{var n,i,s,o,a;const{chains:c=[]}=an(),l=Ib(),{address:u="",connector:f}=kn(),d=!!(f!=null&&(n=f._wallet)!=null&&n.isSequenceBased),h=l===t,p=!h&&!d,{switchNetwork:v}=n8(),b=C.useRef(null),{setOpenWalletModal:y}=up(),[m,g]=C.useState("0"),[S,P]=C.useState(""),{data:T}=r8(),{data:w,isLoading:I}=oH({accountAddress:u,chainId:t,collectionAddress:e,tokenId:r}),F=Tr(t,c);if(I)return null;const H=(w==null||(i=w.tokenMetadata)==null?void 0:i.decimals)||0,K=(w==null||(s=w.tokenMetadata)==null?void 0:s.name)||"Unknown",B=(w==null||(o=w.tokenMetadata)==null?void 0:o.image)||(w==null||(a=w.contractInfo)==null?void 0:a.logoURI)||"",E=m===""?"0":m,_=Df(E,H),O=_.gt((w==null?void 0:w.balance)||"0"),N=_.gt(0),k=q=>{const{value:Y}=q.target,X=tH(Y,H);g(X)},$=()=>{var q;(q=b.current)==null||q.focus();const Y=Number(m)-1,X=Math.max(Y,0).toString();g(X)},L=()=>{var q;(q=b.current)==null||q.focus();const Y=Number(m)+1,X=Number(xr((w==null?void 0:w.balance)||0,H)),Q=Math.min(Y,X).toString();g(Q)},M=()=>{var q;(q=b.current)==null||q.focus();const Y=xr((w==null?void 0:w.balance)||0,H).toString();g(Y)},A=async()=>{const q=await navigator.clipboard.readText();P(q)},D=()=>{P("")},V=async q=>{q.preventDefault(),!h&&d&&v&&v(t);const Y=Df(E,H),{contractType:X}=w;switch(X){case"ERC721":T==null||T.sendTransaction({to:w.contractAddress,data:new jr(XAe).encodeFunctionData("safeTransferFrom",[u,S,r])}).catch(Q=>console.error("User rejected transaction",Q));break;case"ERC1155":default:T==null||T.sendTransaction({to:w.contractAddress,data:new jr(YAe).encodeFunctionData("safeBatchTransferFrom",[u,S,[r],[Y.toHexString()],[]])}).catch(Q=>console.error("User rejected transaction",Q))}y(!1)},R=xr((w==null?void 0:w.balance)||0,H).toString(),U=Number(m)===0,W=Number(m)>=Number(R);return x.createElement(z,{padding:"5",paddingTop:"3",style:{marginTop:_i},gap:"2",flexDirection:"column",as:"form",onSubmit:V},x.createElement(z,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},x.createElement(uH,{imageUrl:B,showSquareImage:!0,decimals:H,name:K,symbol:"",balance:(w==null?void 0:w.balance)||"0",chainId:t}),x.createElement(iL,{ref:b,style:{fontSize:ve.fontSizes.xlarge,fontWeight:ve.fontWeights.bold},name:"amount",value:m,onChange:k,controls:x.createElement(z,{gap:"2"},x.createElement(rt,{disabled:U,size:"xs",onClick:$,leftIcon:Zne}),x.createElement(rt,{disabled:W,size:"xs",onClick:L,leftIcon:Ane}),x.createElement(rt,{size:"xs",shape:"square",label:"Max",onClick:M,"data-id":"maxCoin",flexShrink:"0"}))}),O&&x.createElement(ne,{as:"div",variant:"normal",color:"negative",marginTop:"2"},"Insufficient Balance")),x.createElement(z,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},x.createElement(ne,{fontSize:"normal",color:"text50"},"To"),ng(S)?x.createElement(z,{borderRadius:"md",background:"backgroundSecondary",width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4",className:ao,onClick:D,style:{height:"52px"}},x.createElement(z,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"2"},x.createElement(D1,{address:S,style:{width:"20px"}}),x.createElement(ne,{color:"text100"},`0x${Pk(S.substring(2),8)}`)),x.createElement(nu,{size:"xs"})):x.createElement($c,{value:S,onChange:q=>P(q.target.value),placeholder:`${F.name} Address (0x...)`,name:"to-address","data-1p-ignore":!0,controls:x.createElement(rt,{size:"xs",shape:"square",label:"Paste",onClick:A,"data-id":"to-address",flexShrink:"0",leftIcon:Gg})})),p&&x.createElement(z,{marginTop:"3"},x.createElement(ne,{color:"negative"},"The wallet is connected to the wrong network. Please switch network before proceeding"),x.createElement(rt,{marginTop:"2",width:"full",variant:"primary",type:"button",label:"Switch Network",onClick:()=>v&&v(t),disabled:h,style:{height:"52px",borderRadius:ve.radii.md}})),x.createElement(rt,{color:"text100",marginTop:"3",width:"full",variant:"primary",type:"submit",disabled:!N||!ng(S)||O||!h&&!d,label:"Send",rightIcon:Lo,style:{height:"52px",borderRadius:ve.radii.md}}))},u4e=({transaction:t})=>{var e;const{chains:r=[]}=an(),{fiatCurrency:n}=zn(),{setNavigation:i}=Rs(),s=()=>{i({location:"transaction-details",params:{transaction:t}})};let o=[];(e=t.transfers)==null||e.forEach(m=>{const g=m.contractAddress;o.includes(g)||o.push(g)});const{data:a=[],isLoading:c}=du({tokens:o.map(m=>({contractAddress:m,chainId:t.chainId}))}),{data:l=1,isLoading:u}=Bc({toCurrency:n.symbol}),f=c||u,{transfers:d}=t,h=Tr(t.chainId,r),p=m=>{switch(m){case cs.SEND:return x.createElement(sC,{style:{transform:"rotate(270deg)",width:"16px"}});case cs.RECEIVE:return x.createElement(sC,{style:{transform:"rotate(90deg)",width:"16px"}});case cs.UNKNOWN:default:return x.createElement(iD,{style:{width:"14px"}})}},v=m=>{switch(m){case cs.SEND:return"Sent";case cs.RECEIVE:return"Received";case cs.UNKNOWN:default:return"Transacted"}},b=(m,g,S)=>{let P="";S===cs.SEND?P="-":S===cs.RECEIVE&&(P="+");let T="text50";return S===cs.SEND?T=ve.colors.negative:S===cs.RECEIVE&&(T=ve.colors.positive),x.createElement(ne,{fontWeight:"bold",fontSize:"normal",style:{color:T}},`${P}${m} ${g}`)},y=({transfer:m,isFirstItem:g})=>{const{amounts:S}=m,P=uW(t.timestamp).format("MMM DD, YYYY");return x.createElement(z,{gap:"2",width:"full",flexDirection:"column",justifyContent:"space-between"},x.createElement(z,{flexDirection:"row",justifyContent:"space-between"},x.createElement(z,{color:"text50",gap:"1",flexDirection:"row",justifyContent:"center",alignItems:"center"},p(m.transferType),x.createElement(ne,{fontWeight:"medium",fontSize:"normal",color:"text100"},v(m.transferType)),x.createElement(mr,{src:h.logoURI,width:"3"})),g&&x.createElement(z,null,x.createElement(ne,{fontWeight:"medium",fontSize:"normal",color:"text50"},P))),S.map((T,w)=>{var I,F,j,H,K,B;const E=Tr(t.chainId,r),_=ar(m.contractAddress,lr),O=((I=m.contractInfo)==null?void 0:I.type)==="ERC721"||((F=m.contractInfo)==null?void 0:F.type)==="ERC1155";let N;const k=(j=m.tokenIds)==null?void 0:j[w];if(O&&k){var $;N=(($=m.tokenMetadata)==null||($=$[k])==null?void 0:$.decimals)||0}else{var L;N=_?E.decimals:(L=m.contractInfo)==null?void 0:L.decimals}const M=xr(T,N),A=_?E.symbol:((H=m.contractInfo)==null?void 0:H.symbol)||"",D=_?E.logoURI:(K=m.contractInfo)==null?void 0:K.logoURI,V=(B=a.find(R=>ar(R.token.contractAddress,m.contractAddress)))==null||(B=B.price)==null?void 0:B.value;return x.createElement(z,{key:w,flexDirection:"row",justifyContent:"space-between"},x.createElement(z,{flexDirection:"row",gap:"2",justifyContent:"center",alignItems:"center"},D&&x.createElement(mr,{src:D,width:"5",alt:"token logo"}),b(oa(M),A,m.transferType)),f&&x.createElement(bt,{width:"35px",height:"20px"}),V&&x.createElement(ne,{fontWeight:"medium",fontSize:"normal",color:"text50"},`${n.sign}${(Number(M)*V*l).toFixed(2)}`))}))};return x.createElement(z,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column",className:ao,onClick:()=>s()},d==null?void 0:d.map((m,g)=>x.createElement(z,{key:`${t.txnHash}-${g}`,width:"full"},y({transfer:m,isFirstItem:g===0}))))},Mk=()=>{const t=()=>x.createElement(z,{flexDirection:"column",gap:"2",width:"full",justifyContent:"space-between"},x.createElement(z,{flexDirection:"row",justifyContent:"space-between"},x.createElement(bt,{width:"65px",height:"20px"}),x.createElement(bt,{width:"75px",height:"17px"})),x.createElement(z,{flexDirection:"row",justifyContent:"space-between"},x.createElement(bt,{width:"120px",height:"20px"}),x.createElement(bt,{width:"35px",height:"17px"})));return x.createElement(z,{flexDirection:"column",gap:"3"},x.createElement(bt,{width:"70px",height:"17px"}),x.createElement(z,{flexDirection:"column",gap:"2"},Array(8).fill(null).map((e,r)=>x.createElement(z,{borderRadius:"md",padding:"4",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column",background:"backgroundSecondary",key:r},t()))))},Nk=({transactions:t,isLoading:e,isFetchingNextPage:r})=>{const n=[{id:"today",label:"Today"},{id:"yesterday",label:"Yesterday"},{id:"week",label:"Last Week"},{id:"month",label:"Last Month"},{id:"year",label:"Last Year"},{id:"years",label:"Past Years"}],i=C.useMemo(()=>{const a=new Date(new Date().setHours(0,0,0,0)).getTime(),c=new Date(new Date().setDate(new Date(a).getDate()-1)).getTime(),l=new Date(new Date().setDate(new Date().getDate()-7)).getTime(),u=new Date(new Date().setDate(new Date().getDate()-30)).getTime(),f=new Date(new Date().setDate(new Date().getDate()-365)).getTime(),d={today:[],yesterday:[],week:[],month:[],year:[],years:[]};return t.forEach(h=>{const p=new Date(h.timestamp).getTime();p>a?d.today.push(h):p>c?d.yesterday.push(h):p>l?d.week.push(h):p>u?d.month.push(h):p>f?d.year.push(h):d.years.push(h)}),d},[t]);if(e)return x.createElement(z,{flexDirection:"column",gap:"2"},x.createElement(Mk,null));const s=({label:a})=>x.createElement(z,null,x.createElement(ne,{color:"text50",fontWeight:"medium",fontSize:"normal"},a)),o=({transactions:a})=>x.createElement(z,{flexDirection:"column",gap:"2"},a.map((c,l)=>x.createElement(z,{key:`${c.txnHash}-${l}`,flexDirection:"column",gap:"2"},x.createElement(u4e,{transaction:c}))));return x.createElement(z,{flexDirection:"column",gap:"5"},n.map(a=>{const c=i[a.id];return c.length===0?null:x.createElement(z,{key:a.id,flexDirection:"column",gap:"3"},x.createElement(s,{label:a.label}),x.createElement(o,{transactions:c}))}),t.length===0&&x.createElement(z,{flexDirection:"column",gap:"3"},x.createElement(s,{label:"History"}),x.createElement(ne,{color:"text100"},"No Recent Transaction History Found")),r&&x.createElement(z,{margin:"4",alignItems:"center",justifyContent:"center"},x.createElement(vS,null)))},f4e=()=>{const{selectedNetworks:t}=zn(),{address:e}=kn(),{data:r=[],isLoading:n}=qAe({accountAddress:e||"",chainIds:t});return x.createElement(z,null,x.createElement(z,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",style:{paddingRight:`calc(${ve.space[5]} - ${$s})`}},x.createElement(Nk,{transactions:r,isLoading:n,isFetchingNextPage:!1})))},og=({balance:t})=>{var e,r;const{chains:n=[]}=an(),{setNavigation:i}=Rs(),s=ar(t.contractAddress,lr),o=Tr(t.chainId,n),a=s?o.logoURI:t==null||(e=t.contractInfo)==null?void 0:e.logoURI,c=s?o.name:(t==null||(r=t.contractInfo)==null?void 0:r.name)||"Unknown",l=()=>{var f,d;if(t.contractType==="ERC721"||t.contractType==="ERC1155")return t.balance;const h=s?o.decimals:t==null||(f=t.contractInfo)==null?void 0:f.decimals,p=xr(t.balance,h||0),v=oa(p),b=s?o.symbol:t==null||(d=t.contractInfo)==null?void 0:d.symbol;return`${v} ${b}`},u=()=>{const f=t.contractType==="ERC721"||t.contractType==="ERC1155";i(f?{location:"collection-details",params:{contractAddress:t.contractAddress,chainId:t.chainId}}:{location:"coin-details",params:{contractAddress:t.contractAddress,chainId:t.chainId}})};return x.createElement(z,{key:t.contractAddress,onClick:u,width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",className:ao},x.createElement(z,{gap:"3",flexDirection:"row",alignItems:"center",justifyContent:"center"},x.createElement(Kl,{imageUrl:a,size:30}),x.createElement(z,{gap:"1",flexDirection:"row",alignItems:"center",justifyContent:"center"},x.createElement(ne,{color:"text100",fontWeight:"bold",fontSize:"normal",style:{textOverflow:"ellipsis",overflow:"hidden",maxWidth:"250px",textWrap:"nowrap"}},c),x.createElement(mr,{src:o.logoURI,alt:"network logo",style:{width:"12px",height:"12px"}}))),x.createElement(z,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"1"},x.createElement(ne,{color:"text50",fontWeight:"bold",fontSize:"normal"},l()),x.createElement(Lo,{color:"text50"})))},qI=({toLocation:t,label:e})=>{const{setNavigation:r}=Rs(),n=()=>{r(t)};return x.createElement(z,{onClick:n,width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",className:ao},x.createElement(ne,{color:"text50",fontSize:"normal",fontWeight:"medium"},e),x.createElement(z,{flexDirection:"row",justifyContent:"center",alignItems:"center"},x.createElement(ne,{color:"text50",fontSize:"normal",fontWeight:"medium"},"View all"),x.createElement(Lo,{color:"text50",size:"sm"})))},d4e=()=>{const{chains:t=[]}=an(),{fiatCurrency:e,hideUnlistedTokens:r,selectedNetworks:n}=zn(),[i,s]=C.useState(""),{address:o}=kn(),{data:a,isLoading:c}=Ik({accountAddress:o||"",chainIds:n},{hideUnlistedTokens:r}),l=(a==null?void 0:a.filter(j=>j.contractType==="ERC20"||ar(j.contractAddress,lr)))||[],{data:u=[],isLoading:f}=du({tokens:l.map(j=>({chainId:j.chainId,contractAddress:j.contractAddress}))}),{data:d=1,isLoading:h}=Bc({toCurrency:e.symbol}),p=l.sort((j,H)=>{var K,B;return Number(go({balance:H,prices:u,conversionRate:d,decimals:((K=H.contractInfo)==null?void 0:K.decimals)||18}))-Number(go({balance:j,prices:u,conversionRate:d,decimals:((B=H.contractInfo)==null?void 0:B.decimals)||18}))}),b=((a==null?void 0:a.filter(j=>j.contractType==="ERC721"||j.contractType==="ERC1155"))||[]).sort((j,H)=>Number(H.balance)-Number(j.balance)),y=c||f||h,m=b.map((j,H)=>{var K;return{index:H,name:((K=j.contractInfo)==null?void 0:K.name)||"Unknown"}}),g=p.map((j,H)=>{if(ar(j.contractAddress,lr)){const B=Tr(j.chainId,t);return{index:H,name:B.name}}else{var K;return{index:H,name:((K=j.contractInfo)==null?void 0:K.name)||"Unknown"}}}),S=p.length,P=b.length,T=new ra(g,{keys:["name"]}),w=new ra(m,{keys:["name"]}),I=(i===""?g:T.search(i).map(j=>j.item)).slice(0,5),F=(i===""?m:w.search(i).map(j=>j.item)).slice(0,5);return x.createElement(z,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",flexDirection:"column",gap:"10",alignItems:"center",justifyContent:"center",style:{paddingRight:`calc(${ve.space[5]} - ${$s})`}},x.createElement(z,{width:"full"},x.createElement($c,{autoFocus:!0,name:"search wallet",leftIcon:Kg,value:i,onChange:j=>s(j.target.value),placeholder:"Search your wallet","data-1p-ignore":!0})),x.createElement(z,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5"},x.createElement(qI,{toLocation:{location:"search-view-all",params:{defaultTab:"collections"}},label:`Collections (${P})`}),y?Array(5).fill(null).map((j,H)=>x.createElement(bt,{key:H,width:"100%",height:"32px"})):F.length===0?x.createElement(ne,{color:"text100"},"No collections found"):F.map(j=>{const H=b[j.index];return x.createElement(og,{key:H.contractAddress,balance:H})})),x.createElement(z,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5"},x.createElement(qI,{toLocation:{location:"search-view-all",params:{defaultTab:"coins"}},label:`Coins (${S})`}),y?Array(5).fill(null).map((j,H)=>x.createElement(bt,{key:H,width:"100%",height:"32px"})):I.length===0?x.createElement(ne,{color:"text100"},"No coins found"):I.map(j=>{const H=p[j.index];return x.createElement(og,{key:H.contractAddress,balance:H})})))},h4e=({defaultTab:t})=>{const{chains:e=[]}=an(),{fiatCurrency:r,hideUnlistedTokens:n,selectedNetworks:i}=zn(),[s,o]=C.useState(""),[a,c]=C.useState(t);C.useEffect(()=>{o("")},[a]);const{address:l}=kn(),{data:u,isLoading:f}=Ik({accountAddress:l||"",chainIds:i},{hideUnlistedTokens:n}),d=(u==null?void 0:u.filter(_=>_.contractType==="ERC20"||ar(_.contractAddress,lr)))||[],{data:h=[],isLoading:p}=du({tokens:d.map(_=>({chainId:_.chainId,contractAddress:_.contractAddress}))}),{data:v=1,isLoading:b}=Bc({toCurrency:r.symbol}),y=d.sort((_,O)=>{var N,k;return Number(go({balance:O,prices:h,conversionRate:v,decimals:((N=O.contractInfo)==null?void 0:N.decimals)||18}))-Number(go({balance:_,prices:h,conversionRate:v,decimals:((k=_.contractInfo)==null?void 0:k.decimals)||18}))}),g=((u==null?void 0:u.filter(_=>_.contractType==="ERC721"||_.contractType==="ERC1155"))||[]).sort((_,O)=>Number(O.balance)-Number(_.balance)),S=y.length,P=g.length,T=f||p||b,w=g.map((_,O)=>{var N;return{index:O,name:((N=_.contractInfo)==null?void 0:N.name)||"Unknown"}}),I=y.map((_,O)=>{if(ar(_.contractAddress,lr)){const k=Tr(_.chainId,e);return{index:O,name:k.name}}else{var N;return{index:O,name:((N=_.contractInfo)==null?void 0:N.name)||"Unknown"}}}),F=new ra(I,{keys:["name"]}),j=new ra(w,{keys:["name"]}),H=s===""?I:F.search(s).map(_=>_.item),K=s===""?w:j.search(s).map(_=>_.item),B=()=>x.createElement(bt,{width:"360px",height:"48px"}),E=()=>x.createElement(x.Fragment,null,Array(8).fill(null).map((_,O)=>x.createElement(bt,{key:O,width:"full",height:"32px"})));return x.createElement(z,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",flexDirection:"column",gap:"5",alignItems:"center",justifyContent:"center",style:{paddingRight:`calc(${ve.space[5]} - ${$s})`}},x.createElement(z,{width:"full"},x.createElement($c,{autoFocus:!0,name:"search wallet",leftIcon:Kg,value:s,onChange:_=>o(_.target.value),placeholder:"Search your wallet","data-1p-ignore":!0})),x.createElement(z,{width:"full"},x.createElement(vle,{value:a,onValueChange:_=>c(_)},x.createElement(z,{marginBottom:"5"},!T&&x.createElement(ple,{value:a,tabs:[{label:`Collections (${P})`,value:"collections"},{label:`Coins (${S})`,value:"coins"}]}),T&&x.createElement(B,null)),x.createElement(jP,{value:"collections"},x.createElement(z,{flexDirection:"column",gap:"3"},T&&x.createElement(E,null),!T&&K.length===0&&x.createElement(ne,{color:"text100"},"No Collectibles Found"),!T&&K.length>0&&K.map(_=>{const O=g[_.index];return x.createElement(og,{key:O.contractAddress,balance:O})}))),x.createElement(jP,{value:"coins"},x.createElement(z,{flexDirection:"column",gap:"3"},T&&x.createElement(E,null),!T&&y.length==0&&x.createElement(ne,{color:"text100"},"No Coins Found"),!T&&H.length>0&&H.map(_=>{const O=y[_.index];return x.createElement(og,{key:O.contractAddress,balance:O})}))))))},p4e=()=>{const{setNavigation:t}=Rs(),e=()=>{t({location:"settings-general"})},r=()=>{t({location:"settings-currency"})},n=()=>{t({location:"settings-networks"})};return x.createElement(z,{style:{paddingTop:_i}},x.createElement(z,{padding:"5",paddingTop:"3"},x.createElement(z,{flexDirection:"column",gap:"2"},x.createElement(rt,{onClick:e,leftIcon:rD,rightIcon:Lo,width:"full",label:"General",style:{height:"52px",borderRadius:ve.radii.md}}),x.createElement(rt,{onClick:r,leftIcon:Nne,rightIcon:Lo,width:"full",label:"Currency",style:{height:"52px",borderRadius:ve.radii.md}}),x.createElement(rt,{onClick:n,leftIcon:Wne,rightIcon:Lo,width:"full",label:"Networks",style:{height:"52px",borderRadius:ve.radii.md}}))))},v4e=()=>{ap();const{hideUnlistedTokens:t,setHideUnlistedTokens:e,hideCollectibles:r,setHideCollectibles:n}=zn(),i=()=>{e(!t)},s=()=>{n(!r)};return x.createElement(z,{style:{paddingTop:_i}},x.createElement(z,{gap:"2",padding:"5",paddingTop:"3",flexDirection:"column"},x.createElement(po,{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},x.createElement(ne,{color:"text100",fontWeight:"bold"},"Hide unlisted tokens"),x.createElement(BP,{checked:t,onCheckedChange:i})),x.createElement(po,{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},x.createElement(ne,{color:"text100",fontWeight:"bold"},"Hide collectibles"),x.createElement(BP,{checked:r,onCheckedChange:s}))))},m4e=t=>{const{selected:e,className:r,squareIndicator:n=!1}=t;return x.createElement(z,{borderStyle:"solid",borderColor:n&&e?"transparent":"borderNormal",borderWidth:"thin",position:"relative",alignItems:"center",justifyContent:"center",flexShrink:"0",className:r,style:{borderRadius:n?"4px":ve.radii.circle,width:"20px",height:"20px"}},x.createElement(z,{as:M0.div,background:n?"borderNormal":"backgroundInverse",position:"absolute",color:"textInverse100",initial:{opacity:e?1:0,scale:e?1:.5},animate:{opacity:e?1:0,scale:e?1:.5},transition:{ease:"backOut"},style:{borderRadius:n?"4px":ve.radii.circle,width:n?"20px":"14px",height:n?"20px":"14px"},justifyContent:"center",alignItems:"center"},n&&x.createElement(fd,{color:"white",style:{width:"14px",height:"14px"}})))},y4e=["value","selected","children","disabled","onClick","className","hideIndicator","squareIndicator"],fH=t=>{const{value:e,selected:r,children:n,disabled:i,onClick:s,className:o,hideIndicator:a,squareIndicator:c=!1}=t,l=lw(t,y4e);return x.createElement(po,bn({as:"button",clickable:!0,className:s8e(o),disabled:i,onClick:()=>s(e),userSelect:"none",alignItems:"center",justifyContent:"space-between",textAlign:"left",width:"full",style:{appearance:"none"}},l),n,!a&&x.createElement(m4e,{selected:r,squareIndicator:c}))},g4e=()=>{const{fiatCurrency:t,setFiatCurrency:e}=zn();return x.createElement(z,{paddingBottom:"5",paddingLeft:"5",paddingTop:"3",style:{paddingRight:`calc(${ve.space[5]} - ${$s})`}},x.createElement(z,{flexDirection:"column",gap:"2"},lH.map(r=>x.createElement(fH,{key:r.symbol,value:r.symbol,selected:r.symbol===t.symbol,onClick:()=>e&&e(r)},x.createElement(z,{gap:"2",justifyContent:"flex-start",alignItems:"center"},x.createElement(ne,{color:"text100",fontWeight:"bold"},r.symbol),x.createElement(ne,{color:"text50"},r.name.message))))))},b4e=()=>{const{selectedNetworks:t,setSelectedNetworks:e}=zn(),{chains:r=[]}=an(),n=i=>{if(t.includes(i)){if(t.length===1)return;e(t.filter(s=>s!==i))}else e([...t,i])};return x.createElement(z,{style:{paddingTop:_i}},x.createElement(z,{padding:"5",paddingTop:"3"},x.createElement(ne,{variant:"small",color:"text50"},"Networks"),x.createElement(z,{flexDirection:"column",gap:"2"},r.map(i=>{const s=Tr(i.id,r);return x.createElement(fH,{disabled:t.length===1&&t.includes(i.id),key:i.id,selected:t.includes(i.id),onClick:()=>n(i.id),value:i.id,squareIndicator:!0},x.createElement(z,{gap:"2",justifyContent:"center",alignItems:"center"},x.createElement(mr,{width:"3",height:"3",src:s.logoURI,alt:"network"}),x.createElement(ne,{color:"text100",variant:"small"},s.name)))}))))},fp=({chainId:t})=>{const{chains:e=[]}=an(),{network:r}=ln(t),n=Tr(t,e),i=nCe(t),s=iCe(t);return x.createElement(z,{height:"6",paddingY:"1",paddingLeft:"1.5",paddingRight:"2",gap:"1",style:{background:s},borderRadius:"xs",flexDirection:"row",justifyContent:"center",alignItems:"center",width:"min"},x.createElement(mr,{style:{width:"14px"},src:n.logoURI}),x.createElement(ne,{fontWeight:"bold",fontSize:"xsmall",style:{color:i}},IAe(r.name)))},w4e=({chainId:t})=>x.createElement(z,{style:{paddingTop:_i}},x.createElement(z,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingLeft:"5",paddingTop:"0",style:{marginTop:"-20px",paddingRight:`calc(${ve.space[5]} - ${$s})`}},x.createElement(z,{marginBottom:"10",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column"},x.createElement(bt,{width:"32px",height:"32px"}),x.createElement(bt,{height:"24px",width:"70px"}),x.createElement(fp,{chainId:t})),x.createElement(z,null,x.createElement(ne,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),x.createElement(z,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},x.createElement(bt,{width:"150px",height:"36px"}),x.createElement(bt,{width:"33px",height:"17px"}))),x.createElement(rt,{color:"text100",marginTop:"4",marginBottom:"10",width:"full",variant:"primary",leftIcon:Qg,label:"Send",disabled:!0,onClick:()=>{}}),x.createElement(z,null,x.createElement(Mk,null)))),E4e=(t,e)=>{var r;const[n,i]=C.useState(null),s=C.useMemo(()=>new IntersectionObserver(([o])=>i(o),e),[]);return C.useEffect(()=>(t.current&&s.observe(t.current),()=>{t.current&&s.disconnect()}),[t.current,s]),(r=n==null?void 0:n.isIntersecting)!=null?r:!1},dH=t=>{const{onLoad:e,hasMore:r=!0,children:n}=t,[i,s]=C.useState(0),[o,a]=C.useState(!1),c=C.useRef(null),l=E4e(c);C.useEffect(()=>{l&&r&&!o&&u()},[l]);const u=async()=>{a(!0),await e(i),s(f=>f+1),a(!1)};return x.createElement(x.Fragment,null,n,x.createElement("div",{ref:c}))},x4e=({contractAddress:t,chainId:e})=>{var r,n,i,s;const{chains:o=[]}=an(),{setNavigation:a}=Rs(),{fiatCurrency:c,hideUnlistedTokens:l}=zn(),{address:u}=kn(),{data:f,isLoading:d,fetchNextPage:h,hasNextPage:p,isFetchingNextPage:v}=cH({chainId:e,accountAddress:u||"",contractAddress:t}),b=nH(f),{data:y,isLoading:m}=HAe({accountAddress:u||"",contractAddress:t,chainId:e},{hideUnlistedTokens:l}),{data:g,isLoading:S}=du({tokens:[{chainId:e,contractAddress:t}]}),{data:P=1,isLoading:T}=Bc({toCurrency:c.symbol});if(m||S||T)return x.createElement(w4e,{chainId:e});const I=ar(t,lr),F=I?Tr(e,o).logoURI:y==null||(r=y.contractInfo)==null?void 0:r.logoURI,j=I?Tr(e,o).symbol:y==null||(n=y.contractInfo)==null?void 0:n.symbol,H=I?Tr(e,o).name:y==null||(i=y.contractInfo)==null?void 0:i.name,K=I?Tr(e,o).decimals:y==null||(s=y.contractInfo)==null?void 0:s.decimals,B=xr((y==null?void 0:y.balance)||"0",K),E=oa(B),_=y?go({balance:y,prices:g||[],conversionRate:P,decimals:K||0}):"0",O=()=>{a({location:"send-coin",params:{chainId:e,contractAddress:t}})};return x.createElement(z,{style:{paddingTop:_i}},x.createElement(z,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingLeft:"5",paddingTop:"0",style:{marginTop:"-20px",paddingRight:`calc(${ve.space[5]} - ${$s})`}},x.createElement(z,{marginBottom:"10",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column"},x.createElement(mr,{width:"8",src:F,alt:"logo"}),x.createElement(ne,{color:"text100",fontWeight:"bold",fontSize:"large"},H),x.createElement(fp,{chainId:e})),x.createElement(z,null,x.createElement(ne,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),x.createElement(z,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},x.createElement(ne,{fontWeight:"bold",color:"text100",fontSize:"xlarge"},`${E} ${j}`),x.createElement(ne,{fontWeight:"medium",color:"text50",fontSize:"normal"},`${c.sign}${_}`))),x.createElement(rt,{width:"full",variant:"primary",leftIcon:Qg,color:"text100",label:"Send",onClick:O}),x.createElement(z,null,x.createElement(dH,{onLoad:()=>h(),hasMore:p},x.createElement(Nk,{transactions:b,isLoading:d,isFetchingNextPage:v})))))},C4e=({chainId:t})=>x.createElement(z,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",marginTop:"8",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10",style:{paddingRight:`calc(${ve.space[5]} - ${$s})`}},x.createElement(z,{flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"center"},x.createElement(bt,{width:"32px",height:"32px"}),x.createElement(bt,{width:"100px",height:"24px"}),x.createElement(fp,{chainId:t}),x.createElement(bt,{width:"142px",height:"17px"})),x.createElement(z,{width:"full"},x.createElement(bt,{width:"168px",height:"20px"}),x.createElement(z,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${ve.space[1]}) calc(50% - ${ve.space[1]})`,gap:ve.space[2]},width:"full",marginTop:"3"},Array(8).fill(null).map((e,r)=>x.createElement(bt,{width:"full",aspectRatio:"1/1"}))))),S4e=({chainId:t,contractAddress:e})=>{var r;const{setNavigation:n}=Rs(),{address:i}=kn(),{data:s,isLoading:o}=zAe({chainId:t,accountAddress:i||"",collectionAddress:e}),a=s==null||(r=s[0])==null?void 0:r.contractInfo,c=a==null?void 0:a.logoURI;if(o)return x.createElement(C4e,{chainId:t});const l=u=>{n&&n({location:"collectible-details",params:{contractAddress:u.contractAddress,chainId:u.chainId,tokenId:u.tokenID}})};return x.createElement(z,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",marginTop:"8",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10",style:{paddingRight:`calc(${ve.space[5]} - ${$s})`}},x.createElement(z,{flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"center"},x.createElement(Kl,{imageUrl:c,size:32}),x.createElement(ne,{fontWeight:"bold",fontSize:"large",color:"text100"},(a==null?void 0:a.name)||"Unknown"),x.createElement(fp,{chainId:t}),x.createElement(ne,{fontWeight:"medium",fontSize:"normal",color:"text50"},`${(s==null?void 0:s.length)||0} Unique Collectibles`)),x.createElement(z,{width:"full"},x.createElement(ne,{fontWeight:"medium",fontSize:"normal",color:"text50"},`Owned (${(s==null?void 0:s.length)||0})`),x.createElement(z,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${ve.space[1]}) calc(50% - ${ve.space[1]})`,gap:ve.space[2]},width:"full",marginTop:"3"},s==null?void 0:s.map(u=>{var f,d,h;const p=u.balance,v=(u==null||(f=u.tokenMetadata)==null?void 0:f.decimals)||0,b=oa(xr(p,v));return x.createElement(z,{key:`${u.contractAddress}-${u.tokenID}`,onClick:()=>l(u),className:ao},x.createElement(z,{background:"backgroundSecondary",aspectRatio:"1/1",width:"full",borderRadius:"md",justifyContent:"center",alignItems:"center",marginBottom:"2"},x.createElement(mr,{style:{height:"100%"},src:(d=u.tokenMetadata)==null?void 0:d.image})),x.createElement(z,null,x.createElement(ne,{fontWeight:"bold",fontSize:"normal",color:"text100"},`${(h=u.tokenMetadata)==null?void 0:h.name}`)),x.createElement(z,null,x.createElement(ne,{marginTop:"1",fontWeight:"medium",fontSize:"normal",color:"text50"},b," Owned")))}))))},k4e=()=>x.createElement(z,{style:{paddingTop:_i}},x.createElement(z,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingLeft:"5",paddingTop:"0",style:{marginTop:"-20px",paddingRight:`calc(${ve.space[5]} - ${$s})`}},x.createElement(z,{gap:"3",alignItems:"center",justifyContent:"center",flexDirection:"column"},x.createElement(bt,{width:"120px",height:"30px"}),x.createElement(bt,{width:"140px",height:"40px"})),x.createElement(z,null,x.createElement(bt,{width:"347px",height:"347px"})),x.createElement(z,null,x.createElement(z,null,x.createElement(ne,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),x.createElement(z,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},x.createElement(bt,{width:"44px",height:"36px"}),x.createElement(bt,{width:"34px",height:"17px"}))),x.createElement(rt,{color:"text100",marginTop:"4",width:"full",variant:"primary",leftIcon:Qg,label:"Send",onClick:()=>{}})),x.createElement(z,null,x.createElement(ne,{fontSize:"normal",color:"text50",fontWeight:"medium"},"This week"),x.createElement(Mk,null)))),A4e=({contractAddress:t,chainId:e,tokenId:r})=>{var n,i,s,o,a,c;const{chains:l=[]}=an(),{address:u}=kn(),{fiatCurrency:f}=zn(),{setNavigation:d}=Rs(),{data:h,isLoading:p,fetchNextPage:v,hasNextPage:b,isFetchingNextPage:y}=cH({chainId:e,accountAddress:u||"",contractAddress:t,tokenId:r}),m=nH(h),{data:g,isLoading:S}=oH({accountAddress:u||"",collectionAddress:t,chainId:e,tokenId:r}),{data:P,isLoading:T}=aH({tokens:[{chainId:e,contractAddress:t,tokenId:r}]}),{data:w=1,isLoading:I}=Bc({toCurrency:f.symbol});if(S||T||I)return x.createElement(k4e,null);const j=()=>{d({location:"send-collectible",params:{chainId:e,contractAddress:t,tokenId:r}})},H=Tr(e,l),K=g==null||(n=g.contractInfo)==null?void 0:n.logoURI,B=(g==null||(i=g.contractInfo)==null?void 0:i.name)||"Unknown Collection",E=(g==null||(s=g.tokenMetadata)==null?void 0:s.decimals)||0,_=(g==null?void 0:g.balance)||"0",O=xr(_,E),N=oa(Number(O)),k=g?go({balance:g,prices:P||[],conversionRate:w,decimals:E}):"0";return x.createElement(z,{style:{paddingTop:_i}},x.createElement(z,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingLeft:"5",paddingTop:"0",style:{marginTop:"-20px",paddingRight:`calc(${ve.space[5]} - ${$s})`}},x.createElement(z,{gap:"3",alignItems:"center",justifyContent:"center",flexDirection:"column"},x.createElement(z,{flexDirection:"row",gap:"2",justifyContent:"center",alignItems:"center"},x.createElement(mr,{borderRadius:"circle",width:"8",src:K,alt:"collection logo",style:{objectFit:"cover"}}),x.createElement(z,{gap:"1",flexDirection:"row",justifyContent:"center",alignItems:"center"},x.createElement(ne,{fontWeight:"bold",fontSize:"small",color:"text100"},B),x.createElement(mr,{width:"3",src:H.logoURI,alt:"collection logo"}))),x.createElement(z,{flexDirection:"column",justifyContent:"center",alignItems:"center"},x.createElement(ne,{color:"text100",fontWeight:"bold",fontSize:"large"},(g==null||(o=g.tokenMetadata)==null?void 0:o.name)||"Unknown Collectible"),x.createElement(ne,{color:"text50",fontSize:"small",fontWeight:"medium"},`#${r}`))),x.createElement(z,null,x.createElement(Ok,{imageUrl:g==null||(a=g.tokenMetadata)==null?void 0:a.image})),x.createElement(z,null,x.createElement(z,null,x.createElement(ne,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),x.createElement(z,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},x.createElement(ne,{fontWeight:"bold",color:"text100",fontSize:"xlarge"},N),P&&((c=P[0].price)==null?void 0:c.value)&&x.createElement(ne,{fontWeight:"medium",color:"text50",fontSize:"normal"},`${f.symbol} ${k}`))),x.createElement(rt,{color:"text100",marginTop:"4",width:"full",variant:"primary",leftIcon:Qg,label:"Send",onClick:j})),x.createElement(z,null,x.createElement(dH,{onLoad:()=>v(),hasMore:b},x.createElement(Nk,{transactions:m,isLoading:p,isFetchingNextPage:y})))))},_4e=["buttonVariant","text","size"],hH=t=>{const{buttonVariant:e="icon",text:r,size:n="xs"}=t,i=lw(t,_4e),[s,o]=C.useState(!1);C.useEffect(()=>{s&&setTimeout(()=>{o(!1)},4e3)},[s]);const a=()=>{o(!0)},c=s?"Copied!":"Copy",l=e==="icon"?"rgba(0,0,0,0)":ve.colors.buttonGlass;return x.createElement(Jz.CopyToClipboard,{text:r,onCopy:a},x.createElement(Xo,bn({size:n,icon:s?fd:Gg},i,{style:bn({background:l},t==null?void 0:t.style),label:e==="with-label"?c:void 0})))},P4e=({transaction:t})=>{var e,r;const{chains:n=[]}=an(),{fiatCurrency:i}=zn(),s=[],o=[];(e=t.transfers)==null||e.forEach(m=>{var g,S;if(((g=m.contractInfo)==null?void 0:g.type)==="ERC721"||((S=m.contractInfo)==null?void 0:S.type)==="ERC1155"){var P;(P=m.tokenIds)==null||P.forEach(w=>{if(!o.find(j=>{var H;return j.chainId===t.chainId&&ar(j.contractAddress,((H=m.contractInfo)==null?void 0:H.address)||"")&&j.tokenId===w})){var F;o.push({chainId:t.chainId,contractAddress:((F=m.contractInfo)==null?void 0:F.address)||"",tokenId:w})}})}else{var T;const w=(m==null||(T=m.contractInfo)==null?void 0:T.address)||lr;s.find(F=>F.chainId===t.chainId&&ar(F.contractAddress,w))||s.push({chainId:t.chainId,contractAddress:w})}});const{data:a,isLoading:c}=du({tokens:s}),{data:l,isLoading:u}=aH({tokens:o}),{data:f=1,isLoading:d}=Bc({toCurrency:i.symbol}),h=s.length>0&&c||o.length>0&&u||d,p=Tr(t.chainId,n),v=uW(t.timestamp).format("ddd MMM DD YYYY, h:m:s a"),b=()=>{window.open(`${p.blockExplorerUrl}/tx/${t.txnHash}`,"_blank")},y=({transfer:m})=>{var g,S,P,T;const w=m.to,I=w.substring(0,10)+"..."+w.substring(m.to.length-4,m.to.length),F=ar((m==null||(g=m.contractInfo)==null?void 0:g.address)||"",lr),j=F?p.logoURI:m==null||(S=m.contractInfo)==null?void 0:S.logoURI,H=F?p.symbol:(m==null||(P=m.contractInfo)==null?void 0:P.symbol)||"";return x.createElement(x.Fragment,null,(T=m.amounts)==null?void 0:T.map((K,B)=>{var E,_,O,N,k;const $=m.contractType==="ERC721"||m.contractType==="ERC1155",L=((E=m.tokenIds)==null?void 0:E[B])||"0",M=(m==null||(_=m.tokenMetadata)==null||(_=_[L])==null?void 0:_.decimals)||0,A=F?p.decimals:(m==null||(O=m.contractInfo)==null?void 0:O.decimals)||0,V=xr(K,$?M:A),R=oa(V),U=$?l==null||(N=l.find(q=>{var Y,X;return ar(q.token.contractAddress,((Y=m.contractInfo)==null?void 0:Y.address)||"")&&q.token.tokenId===((X=m.tokenIds)==null?void 0:X[B])&&q.token.chainId===t.chainId}))==null||(N=N.price)==null?void 0:N.value:a==null||(k=a.find(q=>{var Y;return ar(q.token.contractAddress,((Y=m.contractInfo)==null?void 0:Y.address)||lr)&&q.token.chainId===t.chainId}))==null||(k=k.price)==null?void 0:k.value,W=(parseFloat(V)*(f*(U||0))).toFixed(2);return x.createElement(z,{key:B,width:"full",flexDirection:"row",gap:"2",justifyContent:"space-between",alignItems:"center"},x.createElement(z,{flexDirection:"row",justifyContent:"flex-start",alignItems:"center",gap:"2",height:"12",borderRadius:"md",background:"buttonGlass",padding:"2",style:{flexBasis:"100%"}},x.createElement(Kl,{imageUrl:j,size:20}),x.createElement(z,{gap:"0.5",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"},x.createElement(ne,{fontWeight:"bold",fontSize:"xsmall",color:"text100"},`${R} ${H}`),h?x.createElement(bt,{width:"44px",height:"12px"}):x.createElement(ne,{fontWeight:"bold",fontSize:"xsmall",color:"text50"},U?`${i.sign}${W}`:""))),x.createElement(sC,{color:"text50",style:{width:"16px"}}),x.createElement(z,{flexDirection:"row",justifyContent:"flex-start",alignItems:"center",gap:"2",height:"12",borderRadius:"md",background:"buttonGlass",padding:"2",style:{flexBasis:"100%"}},x.createElement(D1,{address:w,style:{width:"20px"}}),x.createElement(ne,{fontWeight:"bold",fontSize:"xsmall",color:"text100"},I)))}))};return x.createElement(z,{padding:"5",paddingTop:"3",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10",marginTop:"5"},x.createElement(z,{marginTop:"6",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"1"},x.createElement(ne,{fontSize:"normal",fontWeight:"medium"},"Transaction details"),x.createElement(ne,{marginBottom:"1",fontSize:"small",fontWeight:"medium",color:"text50"},v),x.createElement(fp,{chainId:t.chainId})),x.createElement(z,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"4",width:"full",padding:"4",background:"backgroundSecondary",borderRadius:"md"},x.createElement(z,{width:"full",gap:"1",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"},x.createElement(ne,{fontSize:"normal",fontWeight:"medium",color:"text50"},"Transfer"),x.createElement(mr,{width:"3",src:p.logoURI,alt:"network logo"})),(r=t.transfers)==null?void 0:r.map((m,g)=>x.createElement(z,{width:"full",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"4",key:`transfer-${g}`},x.createElement(y,{transfer:m})))),x.createElement(rt,{onClick:b,width:"full",borderRadius:"md",rightIcon:Bne,label:`View on ${p.blockExplorerName}`}),x.createElement(z,null,x.createElement(z,{width:"full",flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"flex-start"},x.createElement(N0,{width:"full",margin:"0",style:{marginBottom:"-4px"}}),x.createElement(ne,{color:"text50",fontSize:"normal",fontWeight:"medium"},"Status"),x.createElement(ne,{fontSize:"normal",fontWeight:"medium",color:"text100"},"Complete")),x.createElement(z,{width:"full",flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"flex-start"},x.createElement(N0,{width:"full",margin:"0",style:{marginBottom:"-4px"}}),x.createElement(ne,{color:"text50",fontSize:"normal",fontWeight:"medium"},"Transaction Hash"),x.createElement(ne,{color:"text100",fontSize:"normal",fontWeight:"medium",style:{overflowWrap:"anywhere"}},t.txnHash),x.createElement(hH,{marginTop:"2",buttonVariant:"with-label",text:t.txnHash}))))},T4e=C.forwardRef(({onClickAccount:t},e)=>{const{address:r}=kn();return x.createElement(z,{gap:"2",alignItems:"center"},x.createElement(z,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center"},x.createElement(z,{onClick:t,gap:"2",alignItems:"center",justifyContent:"center",className:ao,position:"relative",ref:e},x.createElement(D1,{size:"sm",address:r||""}),x.createElement(ne,{color:"text100",fontWeight:"medium",variant:"normal"},eH(r||"")),x.createElement(tD,{color:"text100"}))))}),I4e=C.forwardRef(({setOpenWalletDropdown:t},e)=>{const{setNavigation:r}=Rs(),{setOpenWalletModal:n}=up(),{address:i}=kn(),{disconnect:s}=dB(),{theme:o}=ap(),a=()=>{t(!1),r({location:"receive"})},c=()=>{t(!1),r({location:"history"})},l=()=>{t(!1),r({location:"settings"})},u=()=>{n(!1),t(!1),s()},f=()=>{switch(o){case"dark":return"rgba(38, 38, 38, 0.85)";case"light":return"rgba(217, 217, 217, 0.85)";default:return ve.colors.transparent}};return x.createElement(z,{padding:"3",ref:e,zIndex:"30",borderRadius:"md",style:{position:"relative",pointerEvents:"auto",width:"370px",backdropFilter:"blur(12.5px)",top:"16px",left:"15px",background:f()}},x.createElement(z,{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},x.createElement(z,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"3",marginLeft:"2",color:"text100"},x.createElement(D1,{style:{width:"28px"},size:"md",address:i||""}),x.createElement(ne,{fontSize:"large",style:{fontWeight:"700"},color:"text100"},eH(i||"")),x.createElement(hH,{buttonVariant:"icon",size:"md",text:i||"",color:"text100",style:{marginLeft:"-16px"}})),x.createElement(Xo,{onClick:()=>t(!1),size:"xs",background:"buttonGlass",icon:nu})),x.createElement(z,{gap:"2",marginTop:"3",flexDirection:"column"},x.createElement(rt,{variant:"glass",style:{borderRadius:ve.radii.md},width:"full",leftIcon:qne,label:"Receive",onClick:a}),x.createElement(rt,{style:{borderRadius:ve.radii.md},width:"full",leftIcon:iD,label:"History",onClick:c}),x.createElement(rt,{style:{borderRadius:ve.radii.md},width:"full",leftIcon:rD,label:"Settings",onClick:l}),x.createElement(rt,{label:"Sign Out",style:{borderRadius:ve.radii.md},width:"full",leftIcon:nD,onClick:u})))});cu("packages/wallet/src/shared/WalletHeader/styles.css.ts","kit");const O4e=Ai({":focus-visible":{boxShadow:"none"}},"searchButton");lu();const AE=({})=>{const{openWalletModalState:t}=up(),[e,r]=C.useState(!1),{goBack:n,history:i,setNavigation:s}=Rs(),o=C.useRef(!1);C.useEffect(()=>{t||r(!1)},[t]),C.useEffect(()=>{e?o.current?r(!1):o.current=!0:o.current=!1},[i.length,e]);const a=()=>{r(!0)},c=()=>{n()},l=()=>{s({location:"search"})};return x.createElement(z,{as:M0.div},x.createElement(SAe,{open:e},x.createElement(kAe,null),x.createElement(z,{background:"backgroundPrimary",zIndex:"20",position:"fixed",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"full",style:{height:_i,paddingTop:"6px"}},i.length>0?x.createElement(Xo,{onClick:c,icon:Vg,style:{backgroundColor:ve.colors.backgroundPrimary,width:"44px"}}):x.createElement(Xo,{onClick:l,icon:Kg,className:O4e,style:{backgroundColor:ve.colors.backgroundPrimary,width:"44px"}}),x.createElement(AAe,{asChild:!0},x.createElement(T4e,{onClickAccount:a})),x.createElement(z,{style:{width:"44px"}})),x.createElement(Ug,null,e&&x.createElement(_Ae,{asChild:!0,side:"bottom",align:"start"},x.createElement(I4e,{setOpenWalletDropdown:r})))))},Ls=({secondaryText:t,primaryText:e})=>{const{goBack:r,history:n}=Rs(),i=()=>{r()};return x.createElement(z,{background:"backgroundPrimary",zIndex:"20",position:"fixed",width:"full",flexDirection:"row",alignItems:"center",justifyContent:"space-between",style:{height:_i,paddingTop:"6px",backgroundColor:ve.colors.backgroundPrimary}},n.length>0?x.createElement(Xo,{onClick:i,icon:Vg,size:"sm",style:{background:"rgba(0,0,0,0)",width:"44px"}}):x.createElement(z,null),x.createElement(z,null,x.createElement(ne,{fontWeight:"medium",variant:"small",color:"text50"},t),x.createElement(ne,{fontWeight:"medium",variant:"small",color:"text100"},e)),x.createElement(z,{style:{width:"44px"}}))},VI=t=>{const{location:e}=t;switch(e){case"send-coin":return x.createElement(c4e,{chainId:t.params.chainId,contractAddress:t.params.contractAddress});case"send-collectible":return x.createElement(l4e,{chainId:t.params.chainId,contractAddress:t.params.contractAddress,tokenId:t.params.tokenId});case"receive":return x.createElement(a4e,null);case"history":return x.createElement(f4e,null);case"search":return x.createElement(d4e,null);case"search-view-all":return x.createElement(h4e,{defaultTab:t.params.defaultTab});case"settings":return x.createElement(p4e,null);case"settings-general":return x.createElement(v4e,null);case"settings-currency":return x.createElement(g4e,null);case"settings-networks":return x.createElement(b4e,null);case"coin-details":return x.createElement(x4e,{contractAddress:t.params.contractAddress,chainId:t.params.chainId});case"collectible-details":return x.createElement(A4e,{contractAddress:t.params.contractAddress,chainId:t.params.chainId,tokenId:t.params.tokenId});case"collection-details":return x.createElement(S4e,{contractAddress:t.params.contractAddress,chainId:t.params.chainId});case"transaction-details":return x.createElement(P4e,{transaction:t.params.transaction});case"home":default:return x.createElement(o4e,null)}},R4e=t=>{const{location:e}=t;switch(e){case"search":return x.createElement(Ls,{primaryText:"Search wallet"});case"search-view-all":return x.createElement(Ls,{secondaryText:"Search wallet / ",primaryText:"View all"});case"settings":return x.createElement(Ls,{secondaryText:"Wallet / ",primaryText:"Settings"});case"settings-general":return x.createElement(Ls,{secondaryText:"Wallet / Settings / ",primaryText:"General"});case"settings-currency":return x.createElement(Ls,{secondaryText:"Wallet / Settings / ",primaryText:"Currency"});case"settings-networks":return x.createElement(Ls,{secondaryText:"Wallet / Settings / ",primaryText:"Networks"});case"receive":return x.createElement(Ls,{secondaryText:"Wallet / ",primaryText:"Receive"});case"history":return x.createElement(Ls,{secondaryText:"Wallet / ",primaryText:"History"});case"coin-details":return x.createElement(AE,null);case"collectible-details":return x.createElement(AE,null);case"transaction-details":return x.createElement(Ls,{secondaryText:"",primaryText:""});case"send-collectible":case"send-coin":return x.createElement(Ls,{secondaryText:"Wallet /",primaryText:"Send"});case"home":default:return x.createElement(AE,null)}},$4e={location:"home"},M4e=t=>{const e=new bS;return x.createElement(CS,{client:e},x.createElement(N4e,t))},N4e=({children:t})=>{const{theme:e,position:r}=ap(),[n,i]=C.useState(!1),[s,o]=C.useState([]),a=s.length>0?s[s.length-1]:$4e,c=a.location==="home"||a.location==="collection-details"||a.location==="collectible-details"||a.location==="coin-details"||a.location==="history"||a.location==="search"||a.location==="search-view-all"||a.location==="settings-currency";return C.useEffect(()=>{n&&o([])},[n]),x.createElement(TAe,{value:{setOpenWalletModal:i,openWalletModalState:n}},x.createElement(QAe,{value:{setHistory:o,history:s}},x.createElement("div",{id:"kit-wallet"},x.createElement(rb,{root:"#kit-wallet",scope:"kit",theme:e},x.createElement(Ug,null,n&&x.createElement(dS,{contentProps:{style:bn({maxWidth:"400px",height:"fit-content"},vk(r))},scroll:!1,backdropColor:"backgroundBackdrop",onClose:()=>i(!1)},x.createElement(z,{className:$k,id:"sequence-kit-wallet-content"},R4e(a),c?x.createElement(eL,{className:Rk,style:{paddingTop:_i,height:"min(800px, 80vh)"}},VI(a)):VI(a)))))),t))};var D4e=()=>typeof window<"u"&&window.localStorage.getItem("IS_PAPER_DEV")==="true",L4e=()=>typeof window<"u"&&window.location.origin.includes("paper.xyz"),pH=()=>{var t;return D4e()?(t=window.localStorage.getItem("PAPER_DEV_URL"))!=null?t:"http://localhost:3000":L4e()?window.location.origin:"https://withpaper.com"},vH={colorPrimary:"#cf3781",colorBackground:"#ffffff",colorText:"#1a202c",borderRadius:12,fontFamily:"Open Sans"},F4e=Object.defineProperty,B4e=Object.defineProperties,j4e=Object.getOwnPropertyDescriptors,GI=Object.getOwnPropertySymbols,U4e=Object.prototype.hasOwnProperty,z4e=Object.prototype.propertyIsEnumerable,KI=(t,e,r)=>e in t?F4e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Hn=(t,e)=>{for(var r in e||(e={}))U4e.call(e,r)&&KI(t,r,e[r]);if(GI)for(var r of GI(e))z4e.call(e,r)&&KI(t,r,e[r]);return t},QI=(t,e)=>B4e(t,j4e(e)),W4e=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),mH=W4e((t,e)=>{e.exports={name:"@paperxyz/js-client-sdk",description:"Paper JS SDK for Checkout Elements",version:"0.2.5",license:"Apache-2.0",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",files:["dist/**"],bugs:{url:"https://github.com/paperxyz/js-sdk/issues"},homepage:"https://github.com/paperxyz/js-sdk",repository:{type:"git",url:"git+https://github.com/paperxyz/js-sdk.git"},author:"Paper ",scripts:{build:"tsup src/index.ts --env.NODE_ENV production","build-package-checkout":"yarn build","dev-checkout":"tsup src/index.ts --env.NODE_ENV development --watch",lint:'eslint "src/**/*.ts*"',"lint:fix":"yarn lint --fix",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",prepare:"cd ../../ && node ./scripts/postInstall && cd ./packages/js-client-sdk"},keywords:[],devDependencies:{"@paperxyz/tsconfig":"*","eslint-config-paperxyz":"*",typescript:"^4.7.4"},dependencies:{"@paperxyz/sdk-common-utilities":"*",ethers:"^5.7.2"},publishConfig:{access:"public"}}}),yH=pH(),H4e="/sdk/2022-08-12/checkout-with-card",q4e=(t=>(t.UserAbandonedCheckout="User abandoned the checkout",t.UserLoginFailed="User login failed",t.InvalidProps="The props you passed in to this component are not valid.",t.InvalidCard="The card information is invalid. Please double check that the Card, CVC, and Zip code are all correct.",t.EmailNotVerified="The email was unable to be verified.",t.NotEnoughSupply="There is not enough supply to claim.",t.AddressNotAllowed="This address is not on the allowlist.",t.NoActiveClaimPhase="There is no active claim phase at the moment.",t))(q4e||{}),V4e=(t=>(t.ErrorConnectingToWallet="Error connecting to wallet",t.ErrorSendingTransaction="Something went wrong sending transaction",t.InsufficientBalance="Insufficient ETH",t.TransactionCancelled="Transaction Cancelled",t.WrongChain="Wrong Chain Detected",t.ChainSwitchUnderway="There is a network switch already underway",t.PendingSignature="Pending Signature",t))(V4e||{}),G4e=class{constructor(t){this.link=t}addStylingOptions(t){t.colorPrimary&&this.link.searchParams.set("colorPrimary",t.colorPrimary),t.colorBackground&&this.link.searchParams.set("colorBackground",t.colorBackground),t.colorText&&this.link.searchParams.set("colorText",t.colorText),t.borderRadius!==void 0&&this.link.searchParams.set("borderRadius",t.borderRadius.toString()),t.fontFamily&&this.link.searchParams.set("fontFamily",t.fontFamily),t.inputBackgroundColor&&this.link.searchParams.set("inputBackgroundColor",t.inputBackgroundColor),t.inputBorderColor&&this.link.searchParams.set("inputBorderColor",t.inputBorderColor)}addClientSecret(t){this.link.searchParams.set("sdkClientSecret",t)}addLocale(t){t&&this.link.searchParams.set("locale",t.toString())}addOTP(){this.link.searchParams.set("withOTP","true")}addAppName(t){t&&this.link.searchParams.set("appName",t)}addShowConnectWalletOptions(t){this.link.searchParams.append("showConnectWalletOptions",t.toString())}addReceivingWalletType(t){this.link.searchParams.append("walletType",t||"Preset")}addRecipientWalletAddress(t){this.link.searchParams.set("recipientWalletAddress",t)}addPayerWalletAddress(t){this.link.searchParams.append("payerWalletAddress",t)}addDate(t){this.link.searchParams.set("date",t?t.toString():Date.now().toString())}getLink(){return this.link}},K4e=({url:t,width:e=440,height:r=700})=>{if(!(window!=null&&window.top))return null;let n=window.top.outerHeight/2+window.top.screenY-r/2,i=window.top.outerWidth/2+window.top.screenX-e/2;return window.open(t,"_blank",`popup=true,width=${e},height=${r},top=${n},left=${i}`)};function YI(t,e,r){var n;(n=t.contentWindow)==null||n.postMessage(Hn({eventType:e},r),"*")}var Q4e=mH(),Y4e=class{constructor({elementOrId:e,onLoad:r}){this.elementOrId=e,this.onLoad=r}createPaymentElement({handler:e,link:r,iframeId:n}){let i=document.createElement("iframe");if(i.src=r.href,i.id=n,i.allow="payment",i.setAttribute("style","margin-left:auto; margin-right:auto; width:100%; height: 100%; min-height:375px; transition-property:all; transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1); transition-duration:150ms; color-scheme: light;"),i.onload=a=>{this.onLoad&&this.onLoad(a)},i.setAttribute("data-paper-sdk-version",`@paperxyz/js-client-sdk@${Q4e.version}`),!this.elementOrId)return window.addEventListener("message",e(i)),i;let s=this.elementOrId;if(typeof s=="string"){let a=document.getElementById(s);if(!a)throw new Error("Invalid id given");s=a}let o=s.querySelector("#"+n);return o?(o.src===r.href||(o.src=r.href),o):(window.addEventListener("message",e(i)),s.appendChild(i))}},JI={top:"0px",left:"0px",right:"0px",bottom:"0px"},J4e=()=>({main:QI(Hn({},JI),{position:"fixed",zIndex:"10000",display:"flex",alignItems:"center",justifyContent:"center"}),overlay:QI(Hn({},JI),{position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.33)"}),body:{background:"transparent",borderRadius:"12px",position:"relative",overflow:"hidden",width:"100%",maxWidth:"500px",height:"700px",maxHeight:"80%",animation:"pew-modal-slideIn 0.2s forwards"},spinner:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",margin:"auto",borderWidth:"3px",borderColor:"#2D3748 #2D3748 transparent transparent",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite"},iframe:{position:"relative",height:"100%",width:"100%",border:"none",background:"transparent"}}),X4e=` @keyframes pew-modal-slideIn { from {opacity: 0; transform: translate3d(0, 20px, 0);} to {opacity: 1; transform: translate3d(0, 0, 0);} @@ -315,54 +315,54 @@ Invalid media condition`));var d=t(e.slice(i+2),r,f.value);return{operator:f.val @keyframes spin { to { transform: rotate(360deg); } } -`,oh="paper-js-sdk-modal",m4e=class{constructor(t,e){this.styles=p4e(),this.container=t||document.body,e&&this.mergeStyles(e),this.main=document.createElement("div"),this.main.id=oh,this.overlay=document.createElement("div"),this.overlay.id=`${oh}-overlay`,this.body=document.createElement("div"),this.body.id=`${oh}-body`,this.spinner=document.createElement("div"),this.spinner.id=`${oh}-spinner`,this.iframe=document.createElement("iframe"),this.iframe.id=`${oh}-iframe`,this.iframe.allow="camera; microphone; payment",this.style=document.createElement("style"),this.style.innerHTML=v4e,this.assignStyles(this.main,this.styles.main),this.assignStyles(this.overlay,this.styles.overlay),this.assignStyles(this.body,this.styles.body),this.assignStyles(this.spinner,this.styles.spinner),this.assignStyles(this.iframe,this.styles.iframe)}open({iframeUrl:t}={}){t&&(this.body.appendChild(this.spinner),this.iframe.src=t,this.iframe.onload=()=>this.body.removeChild(this.spinner),this.body.appendChild(this.iframe)),this.addAccessibility(),this.main.appendChild(this.overlay),this.main.appendChild(this.style),this.main.appendChild(this.body),this.container.appendChild(this.main),document.body.style.overflow="hidden"}close(){this.body.style.animation="pew-modal-slideOut 0.2s forwards",window.setTimeout(()=>this.main.remove(),250)}mergeStyles(t){this.styles.body=Wn(Wn({},this.styles.body),t.body||{}),this.styles.spinner=Wn(Wn({},this.styles.spinner),t.spinner||{}),this.styles.overlay=Wn(Wn({},this.styles.overlay),t.overlay||{}),this.styles.main=Wn(Wn({},this.styles.main),t.main||{}),this.styles.iframe=Wn(Wn({},this.styles.iframe),t.iframe||{})}addAccessibility(){this.main.setAttribute("aria-hidden","true"),this.overlay.setAttribute("aria-hidden","true"),this.body.setAttribute("aria-modal","true"),this.body.setAttribute("role","dialog")}assignStyles(t,e){Object.assign(t.style,e)}};function y4e({sdkClientSecret:t,appName:e,options:r=Wn({},FW),locale:n,configs:i}){let s=new URL(a4e,UW),o=t;if(!o&&i&&(o=btoa(JSON.stringify(i))),!o){let c="/error?errorMessage=Must have either sdkClientSecret or configs field set. Received neither",l=BW();return new URL(c,l)}let a=new u4e(s);return a.addClientSecret(o??""),a.addStylingOptions(r),a.addLocale(n),a.addAppName(e),a.getLink()}function g4e({iframe:t,onError:e,onReview:r,onPaymentSuccess:n,onBeforeModalOpen:i,onPriceUpdate:s}){let o;return a=>{if(!a.origin.startsWith(UW))return;let{data:c}=a;switch(c.eventType){case"checkoutWithCardError":e&&e({code:c.code,error:c.error});break;case"paymentSuccess":n&&n({transactionId:c.id,id:c.id}),c.postToIframe&&FI(t,c.eventType,c);break;case"reviewComplete":r&&r({id:c.id,cardholderName:c.cardholderName});break;case"openModalWithUrl":i&&c.url&&c.url.includes("promptKYCModal")?i({url:c.url}):(o=new m4e(void 0,{body:{colorScheme:"light"}}),o.open({iframeUrl:c.url}));break;case"completedSDKModal":o.close(),c.postToIframe&&FI(t,c.eventType,c);break;case"requestedPopup":{f4e({url:c.url,width:c.width,height:c.height})||console.error("CheckoutWithCard: Unable to open popup.");break}case"sizing":t.style.height=c.height+"px",t.style.maxHeight=c.height+"px";break;case"onPriceUpdate":{s==null||s(c);break}}}}function b4e({onCloseKycModal:t,onOpenKycModal:e,sdkClientSecret:r,appName:n,elementOrId:i,onLoad:s,onError:o,locale:a,options:c,onPaymentSuccess:l,onReview:u,onBeforeModalOpen:f,onPriceUpdate:d,useAltDomain:h=!0,configs:p}){let v="checkout-with-card-iframe",b=m=>g4e({iframe:m,onCloseKycModal:t,onOpenKycModal:e,onError:o,onPaymentSuccess:l,onReview:u,onBeforeModalOpen:f,onPriceUpdate:d,useAltDomain:h}),y=y4e({sdkClientSecret:r,appName:n,locale:a,options:c,useAltDomain:h,configs:p});return new h4e({onLoad:s,elementOrId:i}).createPaymentElement({handler:b,iframeId:v,link:y})}jW();function w4e(t){if(t.sheet)return t.sheet;for(var e=0;e0?en(Md,--ii):0,Jf--,Ar===10&&(Jf=1,iw--),Ar}function gi(){return Ar=ii2||v1(Ar)>3?"":" "}function M4e(t,e){for(;--e&&gi()&&!(Ar<48||Ar>102||Ar>57&&Ar<65||Ar>70&&Ar<97););return ap(t,em()+(e<6&&ao()==32&&gi()==32))}function G5(t){for(;gi();)switch(Ar){case t:return ii;case 34:case 39:t!==34&&t!==39&&G5(Ar);break;case 40:t===41&&G5(t);break;case 92:gi();break}return ii}function $4e(t,e){for(;gi()&&t+Ar!==47+10;)if(t+Ar===42+42&&ao()===47)break;return"/*"+ap(e,ii-1)+"*"+nw(t===47?t:gi())}function N4e(t){for(;!v1(ao());)gi();return ap(t,ii)}function D4e(t){return GW(rm("",null,null,null,[""],t=VW(t),0,[0],t))}function rm(t,e,r,n,i,s,o,a,c){for(var l=0,u=0,f=o,d=0,h=0,p=0,v=1,b=1,y=1,m=0,g="",S=i,P=s,T=n,w=g;b;)switch(p=m,m=gi()){case 40:if(p!=108&&en(w,f-1)==58){V5(w+=it(tm(m),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:w+=tm(m);break;case 9:case 10:case 13:case 32:w+=R4e(p);break;case 92:w+=M4e(em()-1,7);continue;case 47:switch(ao()){case 42:case 47:uv(L4e($4e(gi(),em()),e,r),c);break;default:w+="/"}break;case 123*v:a[l++]=Ws(w)*y;case 125*v:case 59:case 0:switch(m){case 0:case 125:b=0;case 59+u:y==-1&&(w=it(w,/\f/g,"")),h>0&&Ws(w)-f&&uv(h>32?zI(w+";",n,r,f-1):zI(it(w," ","")+";",n,r,f-2),c);break;case 59:w+=";";default:if(uv(T=UI(w,e,r,l,u,i,a,g,S=[],P=[],f),s),m===123)if(u===0)rm(w,e,T,T,S,s,f,a,P);else switch(d===99&&en(w,3)===110?100:d){case 100:case 108:case 109:case 115:rm(t,T,T,n&&uv(UI(t,T,T,0,0,i,a,g,i,S=[],f),P),i,P,f,a,n?S:P);break;default:rm(w,T,T,T,[""],P,0,a,P)}}l=u=h=0,v=y=1,g=w="",f=o;break;case 58:f=1+Ws(w),h=p;default:if(v<1){if(m==123)--v;else if(m==125&&v++==0&&O4e()==125)continue}switch(w+=nw(m),m*v){case 38:y=u>0?1:(w+="\f",-1);break;case 44:a[l++]=(Ws(w)-1)*y,y=1;break;case 64:ao()===45&&(w+=tm(gi())),d=ao(),u=f=Ws(g=w+=N4e(em())),m++;break;case 45:p===45&&Ws(w)==2&&(v=0)}}return s}function UI(t,e,r,n,i,s,o,a,c,l,u){for(var f=i-1,d=i===0?s:[""],h=Pk(d),p=0,v=0,b=0;p0?d[y]+" "+m:it(m,/&\f/g,d[y])))&&(c[b++]=g);return sw(t,e,r,i===0?Ak:a,c,l,u)}function L4e(t,e,r){return sw(t,e,r,zW,nw(I4e()),p1(t,2,-2),0)}function zI(t,e,r,n){return sw(t,e,r,_k,p1(t,0,n),p1(t,n+1,-1),n)}function Ef(t,e){for(var r="",n=Pk(t),i=0;i6)switch(en(t,e+1)){case 109:if(en(t,e+4)!==45)break;case 102:return it(t,/(.+:)(.+)-([^]+)/,"$1"+nt+"$2-$3$1"+tg+(en(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~V5(t,"stretch")?KW(it(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(en(t,e+1)!==115)break;case 6444:switch(en(t,Ws(t)-3-(~V5(t,"!important")&&10))){case 107:return it(t,":",":"+nt)+t;case 101:return it(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+nt+(en(t,14)===45?"inline-":"")+"box$3$1"+nt+"$2$3$1"+pn+"$2box$3")+t}break;case 5936:switch(en(t,e+11)){case 114:return nt+t+pn+it(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return nt+t+pn+it(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return nt+t+pn+it(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return nt+t+pn+t+t}return t}var G4e=function(e,r,n,i){if(e.length>-1&&!e.return)switch(e.type){case _k:e.return=KW(e.value,e.length);break;case WW:return Ef([ah(e,{value:it(e.value,"@","@"+nt)})],i);case Ak:if(e.length)return T4e(e.props,function(s){switch(P4e(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ef([ah(e,{props:[it(s,/:(read-\w+)/,":"+tg+"$1")]})],i);case"::placeholder":return Ef([ah(e,{props:[it(s,/:(plac\w+)/,":"+nt+"input-$1")]}),ah(e,{props:[it(s,/:(plac\w+)/,":"+tg+"$1")]}),ah(e,{props:[it(s,/:(plac\w+)/,pn+"input-$1")]})],i)}return""})}},K4e=[G4e],Q4e=function(e){var r=e.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(v){var b=v.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(v),v.setAttribute("data-s",""))})}var i=e.stylisPlugins||K4e,s={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(v){for(var b=v.getAttribute("data-emotion").split(" "),y=1;ye in t?a_e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,u_e=(t,e)=>{for(var r in e||(e={}))c_e.call(e,r)&&YI(t,r,e[r]);if(QI)for(var r of QI(e))l_e.call(e,r)&&YI(t,r,e[r]);return t},f_e=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ik=f_e((t,e)=>{e.exports={name:"@paperxyz/react-client-sdk",version:"1.1.3",description:"Paper React Client SDK for Checkout Elements",license:"Apache-2.0",main:"dist/index.js",types:"./dist/index.d.ts",type:"module",files:["dist/**"],exports:{".":{import:"./dist/index.js",types:"./dist/index.d.ts"}},bugs:{url:"https://github.com/paperxyz/js-sdk/issues"},homepage:"https://github.com/paperxyz/js-sdk",repository:{type:"git",url:"git+https://github.com/paperxyz/js-sdk.git"},author:"Paper ",keywords:[],scripts:{build:"tsup-node src/index.ts --env.NODE_ENV production --env.ESM_ONLY true ","build-package-checkout":"yarn build","dev-checkout":"tsup-node src/index.ts --env.NODE_ENV development --watch --env.ESM_ONLY true",lint:'eslint "src/**/*.ts*"',"lint:fix":"yarn lint --fix",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",prepare:"cd ../../ && node ./scripts/postInstall && cd ./packages/react-client-sdk"},peerDependencies:{react:">=16.0.0","react-dom":">=16.0.0"},devDependencies:{"@paperxyz/tsconfig":"*","@types/react":"18.0.26","eslint-config-paperxyz":"*",react:"^18.2.0","react-dom":"^18.2.0",typescript:"^4.7.4"},dependencies:{"@emotion/css":"11.10.5","@headlessui/react":"1.7.6","@paperxyz/js-client-sdk":"*","@paperxyz/sdk-common-utilities":"*"}}}),d_e=C.createContext({chainName:"Polygon",setChainName:()=>{},clientId:"",appName:""}),h_e=()=>C.useContext(d_e);Rs` +`,lh="paper-js-sdk-modal",Z4e=class{constructor(t,e){this.styles=J4e(),this.container=t||document.body,e&&this.mergeStyles(e),this.main=document.createElement("div"),this.main.id=lh,this.overlay=document.createElement("div"),this.overlay.id=`${lh}-overlay`,this.body=document.createElement("div"),this.body.id=`${lh}-body`,this.spinner=document.createElement("div"),this.spinner.id=`${lh}-spinner`,this.iframe=document.createElement("iframe"),this.iframe.id=`${lh}-iframe`,this.iframe.allow="camera; microphone; payment",this.style=document.createElement("style"),this.style.innerHTML=X4e,this.assignStyles(this.main,this.styles.main),this.assignStyles(this.overlay,this.styles.overlay),this.assignStyles(this.body,this.styles.body),this.assignStyles(this.spinner,this.styles.spinner),this.assignStyles(this.iframe,this.styles.iframe)}open({iframeUrl:t}={}){t&&(this.body.appendChild(this.spinner),this.iframe.src=t,this.iframe.onload=()=>this.body.removeChild(this.spinner),this.body.appendChild(this.iframe)),this.addAccessibility(),this.main.appendChild(this.overlay),this.main.appendChild(this.style),this.main.appendChild(this.body),this.container.appendChild(this.main),document.body.style.overflow="hidden"}close(){this.body.style.animation="pew-modal-slideOut 0.2s forwards",window.setTimeout(()=>this.main.remove(),250)}mergeStyles(t){this.styles.body=Hn(Hn({},this.styles.body),t.body||{}),this.styles.spinner=Hn(Hn({},this.styles.spinner),t.spinner||{}),this.styles.overlay=Hn(Hn({},this.styles.overlay),t.overlay||{}),this.styles.main=Hn(Hn({},this.styles.main),t.main||{}),this.styles.iframe=Hn(Hn({},this.styles.iframe),t.iframe||{})}addAccessibility(){this.main.setAttribute("aria-hidden","true"),this.overlay.setAttribute("aria-hidden","true"),this.body.setAttribute("aria-modal","true"),this.body.setAttribute("role","dialog")}assignStyles(t,e){Object.assign(t.style,e)}};function e_e({sdkClientSecret:t,appName:e,options:r=Hn({},vH),locale:n,configs:i}){let s=new URL(H4e,yH),o=t;if(!o&&i&&(o=btoa(JSON.stringify(i))),!o){let c="/error?errorMessage=Must have either sdkClientSecret or configs field set. Received neither",l=pH();return new URL(c,l)}let a=new G4e(s);return a.addClientSecret(o??""),a.addStylingOptions(r),a.addLocale(n),a.addAppName(e),a.getLink()}function t_e({iframe:t,onError:e,onReview:r,onPaymentSuccess:n,onBeforeModalOpen:i,onPriceUpdate:s}){let o;return a=>{if(!a.origin.startsWith(yH))return;let{data:c}=a;switch(c.eventType){case"checkoutWithCardError":e&&e({code:c.code,error:c.error});break;case"paymentSuccess":n&&n({transactionId:c.id,id:c.id}),c.postToIframe&&YI(t,c.eventType,c);break;case"reviewComplete":r&&r({id:c.id,cardholderName:c.cardholderName});break;case"openModalWithUrl":i&&c.url&&c.url.includes("promptKYCModal")?i({url:c.url}):(o=new Z4e(void 0,{body:{colorScheme:"light"}}),o.open({iframeUrl:c.url}));break;case"completedSDKModal":o.close(),c.postToIframe&&YI(t,c.eventType,c);break;case"requestedPopup":{K4e({url:c.url,width:c.width,height:c.height})||console.error("CheckoutWithCard: Unable to open popup.");break}case"sizing":t.style.height=c.height+"px",t.style.maxHeight=c.height+"px";break;case"onPriceUpdate":{s==null||s(c);break}}}}function r_e({onCloseKycModal:t,onOpenKycModal:e,sdkClientSecret:r,appName:n,elementOrId:i,onLoad:s,onError:o,locale:a,options:c,onPaymentSuccess:l,onReview:u,onBeforeModalOpen:f,onPriceUpdate:d,useAltDomain:h=!0,configs:p}){let v="checkout-with-card-iframe",b=m=>t_e({iframe:m,onCloseKycModal:t,onOpenKycModal:e,onError:o,onPaymentSuccess:l,onReview:u,onBeforeModalOpen:f,onPriceUpdate:d,useAltDomain:h}),y=e_e({sdkClientSecret:r,appName:n,locale:a,options:c,useAltDomain:h,configs:p});return new Y4e({onLoad:s,elementOrId:i}).createPaymentElement({handler:b,iframeId:v,link:y})}mH();function n_e(t){if(t.sheet)return t.sheet;for(var e=0;e0?en(Dd,--si):0,ed--,Ar===10&&(ed=1,fw--),Ar}function bi(){return Ar=si2||g1(Ar)>3?"":" "}function m_e(t,e){for(;--e&&bi()&&!(Ar<48||Ar>102||Ar>57&&Ar<65||Ar>70&&Ar<97););return dp(t,sm()+(e<6&&co()==32&&bi()==32))}function t6(t){for(;bi();)switch(Ar){case t:return si;case 34:case 39:t!==34&&t!==39&&t6(Ar);break;case 40:t===41&&t6(t);break;case 92:bi();break}return si}function y_e(t,e){for(;bi()&&t+Ar!==47+10;)if(t+Ar===42+42&&co()===47)break;return"/*"+dp(e,si-1)+"*"+uw(t===47?t:bi())}function g_e(t){for(;!g1(co());)bi();return dp(t,si)}function b_e(t){return CH(am("",null,null,null,[""],t=xH(t),0,[0],t))}function am(t,e,r,n,i,s,o,a,c){for(var l=0,u=0,f=o,d=0,h=0,p=0,v=1,b=1,y=1,m=0,g="",S=i,P=s,T=n,w=g;b;)switch(p=m,m=bi()){case 40:if(p!=108&&en(w,f-1)==58){e6(w+=st(om(m),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:w+=om(m);break;case 9:case 10:case 13:case 32:w+=v_e(p);break;case 92:w+=m_e(sm()-1,7);continue;case 47:switch(co()){case 42:case 47:vv(w_e(y_e(bi(),sm()),e,r),c);break;default:w+="/"}break;case 123*v:a[l++]=qs(w)*y;case 125*v:case 59:case 0:switch(m){case 0:case 125:b=0;case 59+u:y==-1&&(w=st(w,/\f/g,"")),h>0&&qs(w)-f&&vv(h>32?ZI(w+";",n,r,f-1):ZI(st(w," ","")+";",n,r,f-2),c);break;case 59:w+=";";default:if(vv(T=XI(w,e,r,l,u,i,a,g,S=[],P=[],f),s),m===123)if(u===0)am(w,e,T,T,S,s,f,a,P);else switch(d===99&&en(w,3)===110?100:d){case 100:case 108:case 109:case 115:am(t,T,T,n&&vv(XI(t,T,T,0,0,i,a,g,i,S=[],f),P),i,P,f,a,n?S:P);break;default:am(w,T,T,T,[""],P,0,a,P)}}l=u=h=0,v=y=1,g=w="",f=o;break;case 58:f=1+qs(w),h=p;default:if(v<1){if(m==123)--v;else if(m==125&&v++==0&&p_e()==125)continue}switch(w+=uw(m),m*v){case 38:y=u>0?1:(w+="\f",-1);break;case 44:a[l++]=(qs(w)-1)*y,y=1;break;case 64:co()===45&&(w+=om(bi())),d=co(),u=f=qs(g=w+=g_e(sm())),m++;break;case 45:p===45&&qs(w)==2&&(v=0)}}return s}function XI(t,e,r,n,i,s,o,a,c,l,u){for(var f=i-1,d=i===0?s:[""],h=Fk(d),p=0,v=0,b=0;p0?d[y]+" "+m:st(m,/&\f/g,d[y])))&&(c[b++]=g);return dw(t,e,r,i===0?Dk:a,c,l,u)}function w_e(t,e,r){return dw(t,e,r,gH,uw(h_e()),y1(t,2,-2),0)}function ZI(t,e,r,n){return dw(t,e,r,Lk,y1(t,0,n),y1(t,n+1,-1),n)}function Cf(t,e){for(var r="",n=Fk(t),i=0;i6)switch(en(t,e+1)){case 109:if(en(t,e+4)!==45)break;case 102:return st(t,/(.+:)(.+)-([^]+)/,"$1"+it+"$2-$3$1"+ag+(en(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~e6(t,"stretch")?SH(st(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(en(t,e+1)!==115)break;case 6444:switch(en(t,qs(t)-3-(~e6(t,"!important")&&10))){case 107:return st(t,":",":"+it)+t;case 101:return st(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+it+(en(t,14)===45?"inline-":"")+"box$3$1"+it+"$2$3$1"+pn+"$2box$3")+t}break;case 5936:switch(en(t,e+11)){case 114:return it+t+pn+st(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return it+t+pn+st(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return it+t+pn+st(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return it+t+pn+t+t}return t}var I_e=function(e,r,n,i){if(e.length>-1&&!e.return)switch(e.type){case Lk:e.return=SH(e.value,e.length);break;case bH:return Cf([uh(e,{value:st(e.value,"@","@"+it)})],i);case Dk:if(e.length)return d_e(e.props,function(s){switch(f_e(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Cf([uh(e,{props:[st(s,/:(read-\w+)/,":"+ag+"$1")]})],i);case"::placeholder":return Cf([uh(e,{props:[st(s,/:(plac\w+)/,":"+it+"input-$1")]}),uh(e,{props:[st(s,/:(plac\w+)/,":"+ag+"$1")]}),uh(e,{props:[st(s,/:(plac\w+)/,pn+"input-$1")]})],i)}return""})}},O_e=[I_e],R_e=function(e){var r=e.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(v){var b=v.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(v),v.setAttribute("data-s",""))})}var i=e.stylisPlugins||O_e,s={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(v){for(var b=v.getAttribute("data-emotion").split(" "),y=1;ye in t?H_e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,G_e=(t,e)=>{for(var r in e||(e={}))q_e.call(e,r)&&a7(t,r,e[r]);if(o7)for(var r of o7(e))V_e.call(e,r)&&a7(t,r,e[r]);return t},K_e=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),jk=K_e((t,e)=>{e.exports={name:"@paperxyz/react-client-sdk",version:"1.1.3",description:"Paper React Client SDK for Checkout Elements",license:"Apache-2.0",main:"dist/index.js",types:"./dist/index.d.ts",type:"module",files:["dist/**"],exports:{".":{import:"./dist/index.js",types:"./dist/index.d.ts"}},bugs:{url:"https://github.com/paperxyz/js-sdk/issues"},homepage:"https://github.com/paperxyz/js-sdk",repository:{type:"git",url:"git+https://github.com/paperxyz/js-sdk.git"},author:"Paper ",keywords:[],scripts:{build:"tsup-node src/index.ts --env.NODE_ENV production --env.ESM_ONLY true ","build-package-checkout":"yarn build","dev-checkout":"tsup-node src/index.ts --env.NODE_ENV development --watch --env.ESM_ONLY true",lint:'eslint "src/**/*.ts*"',"lint:fix":"yarn lint --fix",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",prepare:"cd ../../ && node ./scripts/postInstall && cd ./packages/react-client-sdk"},peerDependencies:{react:">=16.0.0","react-dom":">=16.0.0"},devDependencies:{"@paperxyz/tsconfig":"*","@types/react":"18.0.26","eslint-config-paperxyz":"*",react:"^18.2.0","react-dom":"^18.2.0",typescript:"^4.7.4"},dependencies:{"@emotion/css":"11.10.5","@headlessui/react":"1.7.6","@paperxyz/js-client-sdk":"*","@paperxyz/sdk-common-utilities":"*"}}}),Q_e=C.createContext({chainName:"Polygon",setChainName:()=>{},clientId:"",appName:""}),Y_e=()=>C.useContext(Q_e);Ms` opacity: 0; -`;Rs` +`;Ms` opacity: 1; -`;var p_e=Rs` +`;var J_e=Ms` position: relative; width: 100%; height: 100%; -`;Rs` +`;Ms` display: grid; position: relative; width: 100%; -`;Rs` +`;Ms` transition-delay: 150ms; transition-property: opacity; transition-duration: 75ms; -`;Rs` +`;Ms` transition-property: opacity; transition-duration: 150ms; -`;Rs` +`;Ms` background-color: transparent; grid-column-start: 1; grid-row-start: 1; -`;var v_e=({className:t})=>pe("div",{id:"loader",className:s_e(y_e,t)}),m_e=o_e` +`;var X_e=({className:t})=>pe("div",{id:"loader",className:z_e(ePe,t)}),Z_e=W_e` from { transform: rotate(0deg); } to { transform: rotate(360deg); } -`,y_e=Rs` +`,ePe=Ms` border: 0.15rem solid #f3f3f300; border-top: 0.15rem solid #000000; border-left: 0.15rem solid #000000; border-radius: 50%; width: 4rem; height: 4rem; - animation: ${m_e} 1s linear infinite; -`,g_e=()=>pe("div",{className:b_e,children:pe(v_e,{className:w_e})}),b_e=Rs` + animation: ${Z_e} 1s linear infinite; +`,tPe=()=>pe("div",{className:rPe,children:pe(X_e,{className:nPe})}),rPe=Ms` position: absolute; top: 50%; left: 50%; transform: translate3d(-50%, -50%, 0); -`,w_e=Rs` +`,nPe=Ms` color: #000000; width: 2rem; height: 2rem; -`,E_e=Ik(),x_e=({sdkClientSecret:t,appName:e,options:r=u_e({},FW),onPaymentSuccess:n,onReview:i,onError:s,onBeforeModalOpen:o,onPriceUpdate:a,locale:c,configs:l})=>{let{appName:u}=h_e(),[f,d]=C.useState(!0),h=C.useCallback(()=>{d(!1)},[]),p=C.useRef(null),v=e||u;return C.useEffect(()=>{let b=setTimeout(()=>{d(!1)},1e3);return()=>{clearTimeout(b)}},[]),C.useEffect(()=>{p.current&&b4e({sdkClientSecret:t,appName:v,elementOrId:p.current,locale:c,onError:s,onLoad:h,onPaymentSuccess:n,onReview:i,onBeforeModalOpen:o,onPriceUpdate:a,options:r,configs:l})},[p.current]),pe(xH,{children:pe("div",{className:p_e,ref:p,"data-paper-sdk-version":`@paperxyz/react-client-sdk@${E_e.version}`,children:f&&pe(g_e,{})})})};Rs` +`,iPe=jk(),sPe=({sdkClientSecret:t,appName:e,options:r=G_e({},vH),onPaymentSuccess:n,onReview:i,onError:s,onBeforeModalOpen:o,onPriceUpdate:a,locale:c,configs:l})=>{let{appName:u}=Y_e(),[f,d]=C.useState(!0),h=C.useCallback(()=>{d(!1)},[]),p=C.useRef(null),v=e||u;return C.useEffect(()=>{let b=setTimeout(()=>{d(!1)},1e3);return()=>{clearTimeout(b)}},[]),C.useEffect(()=>{p.current&&r_e({sdkClientSecret:t,appName:v,elementOrId:p.current,locale:c,onError:s,onLoad:h,onPaymentSuccess:n,onReview:i,onBeforeModalOpen:o,onPriceUpdate:a,options:r,configs:l})},[p.current]),pe(XH,{children:pe("div",{className:J_e,ref:p,"data-paper-sdk-version":`@paperxyz/react-client-sdk@${iPe.version}`,children:f&&pe(tPe,{})})})};Ms` padding-top: 0.625rem; padding-bottom: 0.625rem; padding-left: 1.25rem; @@ -377,7 +377,7 @@ Invalid media condition`));var d=t(e.slice(i+2),r,f.value);return{operator:f.val border-radius: 0.5rem; border: none; cursor: pointer; -`;Ik();Ik();var C_e=(t=>(t.THIRDWEB_NFT_DROP_V2="THIRDWEB_NFT_DROP_V2",t.THIRDWEB_EDITION_DROP_V2="THIRDWEB_EDITION_DROP_V2",t.THIRDWEB_SIGNATURE="THIRDWEB_SIGNATURE",t.CANDY_MACHINE="CANDY_MACHINE",t.AUCTION_HOUSE="AUCTION_HOUSE",t))(C_e||{}),S_e=(t=>(t.POPUP="POPUP",t.NEW_TAB="NEW_TAB",t.MODAL="MODAL",t.DRAWER="DRAWER",t.EMBED="EMBED",t))(S_e||{});const[k_e,A_e]=lu(),cp=()=>{const{triggerCheckout:t,closeCheckout:e,settings:r}=k_e();return{triggerCheckout:t,closeCheckout:e,settings:r}};function Kl(){return Kl=Object.assign?Object.assign.bind():function(t){for(var e=1;et.toLowerCase()===e.toLowerCase();var Pa=function(t){return t[t.VERY_LARGE=0]="VERY_LARGE",t[t.FRACTION=1]="FRACTION",t[t.VERY_TINY=2]="VERY_TINY",t[t.MIXED=3]="MIXED",t}(Pa||{});const K5=t=>{if(isNaN(Number(t)))return console.error(`display format error ${t} is not a number`),"NaN";const e=Number(t);if(e===0)return"0";let r;e>1e8?r=Pa.VERY_LARGE:e<1e-10?r=Pa.VERY_TINY:e<1?r=Pa.FRACTION:r=Pa.MIXED;let n,i;switch(r){case Pa.VERY_LARGE:n="compact",i={maximumFractionDigits:4};break;case Pa.VERY_TINY:n="scientific",i={maximumFractionDigits:4};break;case Pa.FRACTION:n="standard",i={maximumSignificantDigits:4};break;default:n="standard",i={maximumFractionDigits:2}}return Intl.NumberFormat("en-US",Kl({notation:n},i)).format(e)},__e=t=>t.charAt(0).toUpperCase()+t.slice(1),P_e=t=>t.chainId===1?"Ethereum":__e(t.name),T_e=async({accountAddress:t,chainId:e})=>{try{const{indexerClient:r}=await ln(e),n=await r.getEtherBalance({accountAddress:t});return[{chainId:e,contractAddress:lr,accountAddress:t,balance:(n==null?void 0:n.balance.balanceWei)||"0",contractType:x8.UNKNOWN,blockHash:"",blockNumber:0,tokenID:""}]}catch(r){return console.error(r),[]}},I_e=async({accountAddress:t,chainId:e})=>{try{const{indexerClient:r}=await ln(e),n=await r.getTokenBalances({accountAddress:t,includeMetadata:!0});return(n==null?void 0:n.balances)||[]}catch(r){return console.error(r),[]}},O_e=async({accountAddress:t,chainId:e})=>{try{return(await Promise.all([T_e({accountAddress:t,chainId:e}),I_e({accountAddress:t,chainId:e})])).flat()}catch(r){return console.error(r),[]}},R_e=async({chainId:t,tokenId:e,contractAddress:r})=>{const{metadataClient:n}=await ln(t);return(await n.getTokenMetadata({chainID:String(t),contractAddress:r,tokenIDs:[e]})).tokenMetadata[0]},M_e=async({chainID:t,contractAddress:e})=>{const{metadataClient:r}=await ln(t);return(await r.getContractInfo({chainID:t,contractAddress:e})).contractInfo},$_e=async({chainId:t,email:e,contractAddress:r,abi:n,receiptTitle:i,collectionContractAddress:s,methodArguments:o,currency:a,currencyAmount:c,methodName:l,recipientAddress:u})=>{const{network:f,apiClient:d}=await ln(t),h=P_e(f),p=JSON.stringify(Kl({title:i,email:e,limitPerTransaction:1,quantity:1,mintMethod:{args:o,payment:{currency:a,value:`${c} * $QUANTITY`},name:l},walletAddress:u},s?{contractArgs:{collectionContractAddress:s}}:{})),{secret:v}=await d.paperSessionSecret2({chainName:h,contractAddress:r,abi:n,paramsJson:p});return v},Ok={oneSecond:1*1e3,oneMinute:60*1e3,oneHour:60*60*1e3},N_e=t=>si({queryKey:["balances",t],queryFn:()=>O_e(t),retry:!0,staleTime:10*Ok.oneMinute,enabled:!!t.chainId&&!!t.accountAddress}),D_e=t=>si({queryKey:["useTokenMetadata",t],queryFn:()=>R_e(t),retry:!0,staleTime:10*Ok.oneMinute,enabled:!!t.chainId&&!!t.contractAddress}),JW=t=>si({queryKey:["useContractInfo",t],queryFn:()=>M_e(t),retry:!0,staleTime:60*Ok.oneMinute,enabled:!!t.chainID&&!!t.contractAddress}),[L_e,B_e]=lu(),F_e=({settings:t})=>{var e,r;const[n,i]=C.useState(!0),[s,o]=C.useState(((e=t.creditCardCheckout)==null?void 0:e.email)||""),[a,c]=C.useState(s),[l,u]=C.useState(null),[f,d]=C.useState(!1),{setNavigation:h}=$d(),p=()=>{n&&o(a||""),n||c(s),i(!n)},v=async()=>{d(!0);try{if(!s)throw"No email address found";if(!t.creditCardCheckout)throw"No credit card checkout settings found";const P=await $_e(Kl({email:s},t.creditCardCheckout));u(P)}catch(P){console.error("Failed to fetch paper secret",P),h({location:"transaction-error",params:{error:P}})}d(!1)};C.useEffect(()=>{const P=setInterval(()=>{const T=document.getElementById("paper-js-sdk-modal");T&&(T.style.pointerEvents="visible")},100);return()=>{clearInterval(P)}},[]),C.useEffect(()=>{s!==""&&v()},[s]);const b=()=>/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/.test(a||""),y=P=>{c(P.target.value)},m=P=>{h({location:"transaction-pending",params:{transactionId:P}})},g=P=>{h({location:"transaction-error",params:{error:P}})},S=()=>n?x.createElement(z,{as:"form",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",onSubmit:p},x.createElement(z,{flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"2"},x.createElement(ne,{fontSize:"normal",fontWeight:"normal",color:"text50"},"Receipt email address"),x.createElement(Mc,{autoFocus:!0,name:"email",type:"email",placeholder:"Email Address",value:a,onChange:y,"data-1p-ignore":!0})),x.createElement(tt,{size:"xs",label:"Save",leftIcon:cd,disabled:!b(),type:"submit"})):x.createElement(z,{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},x.createElement(z,{flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"2"},x.createElement(ne,{fontSize:"normal",fontWeight:"normal",color:"text50"},"Receipt email address"),x.createElement(ne,{fontSize:"normal",fontWeight:"bold",color:"text100"},s)),x.createElement(tt,{size:"xs",label:"Edit",leftIcon:tne,onClick:p}));return x.createElement(z,null,S(),f&&x.createElement(z,{width:"full",height:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",style:{height:"200px"}},x.createElement(sS,{size:"lg",style:{width:"60px",height:"60px"}})),l&&!f&&x.createElement(ho,{marginY:"4",flexDirection:"column"},x.createElement(x_e,{sdkClientSecret:l,appName:t==null||(r=t.creditCardCheckout)==null?void 0:r.receiptTitle,onReview:()=>{},onPaymentSuccess:P=>{m(P.id)},onError:P=>{console.error("Payment error:",P),g(P.error)},options:{colorPrimary:"#447dd1",colorText:"#ffffff",borderRadius:12}})))},Rk="54px",j_e=()=>{const{settings:t}=cp();return x.createElement(z,{paddingX:"4",paddingBottom:"8",gap:"4",flexDirection:"column",style:{marginTop:Rk}},t&&x.createElement(F_e,{settings:t}))},U_e=10*1e3,z_e=()=>{const t=$d(),{params:{transactionId:e}}=t.navigation,{setNavigation:r}=t,n=`https://withpaper.com/api/v1/transaction-status/${e}`,i=async()=>{try{console.log("Polling for transaction status");const s=await fetch(n,{method:"GET",headers:{accept:"application/json"}}).then(c=>c.json()),o=s.result.status,a=s.result.transactionHash;if(console.log("transaction status poll response:",o),o==="PENDING")return;if(o==="TRANSFER_SUCCEEDED"){r&&r({location:"transaction-success",params:{transactionHash:a}});return}if(o==="TRANSFER_FAILED"||o==="PAYMENT_FAILED"){r&&r({location:"transaction-error",params:{error:new Error("Failed to transfer collectible")}});return}}catch(s){console.error("An error occurred while fetching the transaction status"),r&&r({location:"transaction-error",params:{error:s}})}};return C.useEffect(()=>{const s=setInterval(()=>{i()},U_e);return()=>{clearInterval(s)}},[]),x.createElement(z,{style:{height:"500px"}},x.createElement(z,{position:"absolute",top:"0",left:"0",width:"full",height:"full",flexDirection:"column",alignItems:"center",justifyContent:"center"},x.createElement(sS,{size:"lg",style:{width:"60px",height:"60px"}}),x.createElement(ne,{variant:"medium",color:"text50",textAlign:"center",marginTop:"8"},"Transaction in progress. ",x.createElement("br",null),"This may take a few minutes.")))},W_e=()=>{const{closeCheckout:t,settings:e}=cp(),n=$d().navigation;return C.useEffect(()=>{setTimeout(()=>{var i,s;t(),!(e==null||(i=e.creditCardCheckout)==null)&&i.onSuccess&&(e==null||(s=e.creditCardCheckout)==null||s.onSuccess(n.params.transactionHash))},3e3)},[]),x.createElement(z,{style:{height:"500px"}},x.createElement(z,{flexDirection:"column",alignItems:"center",position:"absolute",style:{top:"50%",right:"50%",transform:"translate(50%, -50%)"}},x.createElement(H_e,null),x.createElement(ne,{fontSize:"xlarge"},"Success!"),x.createElement(ne,{textAlign:"center",variant:"normal",color:"text80"},"The transaction was successful.")))},H_e=()=>x.createElement(z,{color:"white",background:"positive",alignItems:"center",justifyContent:"center",width:"16",height:"16",borderRadius:"circle",marginBottom:"2"},x.createElement(cd,{size:"xl"})),q_e=()=>{const{closeCheckout:t,settings:e}=cp(),n=$d().navigation;return C.useEffect(()=>{setTimeout(()=>{var i,s;t(),!(e==null||(i=e.creditCardCheckout)==null)&&i.onError&&(e==null||(s=e.creditCardCheckout)==null||s.onError(n.params.error))},3e3)},[]),x.createElement(z,{style:{height:"500px"}},x.createElement(z,{flexDirection:"column",alignItems:"center",position:"absolute",style:{top:"50%",right:"50%",transform:"translate(50%, -50%)"}},x.createElement(V_e,null),x.createElement(ne,{fontSize:"xlarge"},"Error"),x.createElement(ne,{textAlign:"center",variant:"normal",color:"text80"},"An error occurred while processing the transaction.")))},V_e=()=>x.createElement(z,{color:"white",alignItems:"center",justifyContent:"center",width:"16",height:"16",borderRadius:"circle",marginBottom:"2",background:"negative"},x.createElement(ru,{size:"xl"})),G_e=({size:t=30})=>x.createElement(z,{alignItems:"center",justifyContent:"center",borderRadius:"circle",background:"backgroundInverse",style:{width:`${t}px`,height:`${t}px`}},x.createElement(ne,{style:{fontSize:`${t-4}px`},display:"inline-block",variant:"large",color:"textInverse100"},"?")),e0=({imageUrl:t,size:e=30})=>t?x.createElement(mr,{src:t,borderRadius:"circle",style:{width:`${e}px`,height:`${e}px`}}):x.createElement(G_e,{size:e});au("packages/checkout/src/shared/components/Skeleton/styles.css.ts","kit");const K_e=nz({"0%":{opacity:.25},"50%":{opacity:.1},"100%":{opacity:.25}},"PulseSimple"),Q_e=ki({height:"76px",backgroundColor:"#909090",animation:`${K_e} 2s ease-in-out infinite`},"skeleton");cu();const ef=({width:t="100%",height:e="100%",borderRadius:r="md"})=>x.createElement(z,{className:Q_e,borderRadius:r,style:{width:t,height:e}}),Y_e=({contractAddress:t,tokenId:e,quantityRaw:r,chainId:n})=>{const{chains:i=[]}=an(),{data:s,isLoading:o}=D_e({chainId:n,contractAddress:t,tokenId:e}),{data:a,isLoading:c}=JW({chainID:String(n),contractAddress:t});if(o||c)return x.createElement(J_e,null);const u=Pr(n,i),{name:f="unknown",image:d,decimals:h=0}=s||{},{logoURI:p,name:v="Unknown Collection"}=a||{},b=xr(r,h);return x.createElement(ho,{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},x.createElement(z,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},x.createElement(z,{aspectRatio:"1/1",height:"full",justifyContent:"center",alignItems:"center",style:{width:"80px"}},x.createElement(mr,{src:d,borderRadius:"md",style:{height:"80px"}})),x.createElement(z,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"2"},x.createElement(z,{gap:"1",alignItems:"center"},x.createElement(e0,{size:12,imageUrl:p}),x.createElement(ne,{marginLeft:"1",fontSize:"small",color:"text80",fontWeight:"bold"},v),x.createElement(e0,{size:12,imageUrl:u.logoURI})),x.createElement(z,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",style:{width:"180px"}},x.createElement(ne,{color:"text100",fontSize:"normal",fontWeight:"normal"},f),x.createElement(ne,{color:"text50",fontSize:"normal",fontWeight:"normal"},`#${e}`)))),x.createElement(z,{height:"full",fontSize:"small",color:"text50",fontWeight:"bold"},`x${K5(b)}`))},J_e=()=>x.createElement(ho,{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},x.createElement(z,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},x.createElement(ef,{height:"80px",width:"80px"}),x.createElement(z,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"2"},x.createElement(ef,{width:"100px",height:"14px"}),x.createElement(ef,{width:"180px",height:"34px"}))),x.createElement(ef,{height:"14px",width:"14px"}));au("packages/checkout/src/views/CheckoutSelection/styles.css.ts","kit");const XW=ki({},"insufficientBalanceButton");Ts(`${XW} > div`,{justifyContent:"center"});cu();const X_e=()=>{var t,e,r,n;const{chains:i=[]}=an();$d();const{closeCheckout:s,settings:o}=cp(),{address:a}=kn(),c=o==null?void 0:o.cryptoCheckout,l=!!c,{data:u,isLoading:f}=JW({contractAddress:(c==null||(t=c.coinQuantity)==null?void 0:t.contractAddress)||"",chainID:String((c==null?void 0:c.chainId)||1)}),{data:d,isLoading:h}=N_e({accountAddress:a||"",chainId:(c==null?void 0:c.chainId)||1}),p=(f||h)&&c,v=JI((c==null||(e=c.coinQuantity)==null?void 0:e.contractAddress)||"",lr),b=Pr((c==null?void 0:c.chainId)||1,i),y=v?b.decimals:(u==null?void 0:u.decimals)||0,m=v?b.symbol:(u==null?void 0:u.symbol)||"COIN",g=v?b.logoURI:(u==null?void 0:u.logoURI)||"",S=d==null?void 0:d.find(F=>{var E;return JI(F.contractAddress,(c==null||(E=c.coinQuantity)==null?void 0:E.contractAddress)||"")}),P=S?S.balance:"0",T=(c==null||(r=c.coinQuantity)==null?void 0:r.amountRequiredRaw)||"0",w=xr(P,y),I=xr(T,y),B=J.from(P).lt(J.from(T)),j=(o==null?void 0:o.orderSummaryItems)||[],H=(o==null||(n=o.cryptoCheckout)==null?void 0:n.chainId)||1,K=()=>{var F;console.log("trigger transaction");const E=o==null||(F=o.cryptoCheckout)==null?void 0:F.triggerTransaction;E&&E(),s()};return x.createElement(z,{paddingX:"5",paddingBottom:"5",style:{marginTop:Rk},flexDirection:"column",gap:"3"},j.length>0&&x.createElement(x.Fragment,null,x.createElement(ne,{fontWeight:"normal",fontSize:"normal",color:"text50"},"Order summary"),x.createElement(z,{flexDirection:"column",gap:"2"},j.map((F,E)=>x.createElement(Y_e,Kl({key:E},F,{chainId:H})))),x.createElement(z,{marginTop:"2"},x.createElement(R0,{color:"backgroundSecondary",style:{margin:"0px"}}))),l&&x.createElement(z,{justifyContent:"space-between",alignItems:"center"},x.createElement(ne,{fontWeight:"normal",fontSize:"normal",color:"text50"},"Total"),p?x.createElement(ef,{width:"100px",height:"17px"}):x.createElement(z,{flexDirection:"row",gap:"1",alignItems:"center"},x.createElement(e0,{imageUrl:g,size:12}),x.createElement(ne,{fontWeight:"normal",fontSize:"normal",color:"text100"},`${K5(I)} ${m}`))),x.createElement(z,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"2"},l&&!B&&!p&&x.createElement(tt,{style:{borderRadius:ve.radii.md,height:"56px"},width:"full",leftIcon:()=>x.createElement(e0,{size:20,imageUrl:g}),variant:"primary",label:`Pay with ${m}`,rightIcon:Lo,onClick:K}),l&&(B||p)&&x.createElement(tt,{className:XW,style:{borderRadius:ve.radii.md,height:"56px",justifyContent:"center"},width:"full",leftIcon:()=>x.createElement(e0,{size:20,imageUrl:g}),variant:"glass",label:`Insufficient ${m}`,onClick:K,disabled:!0})),l&&x.createElement(z,{width:"full",justifyContent:"flex-end"},p?x.createElement(ef,{width:"102px",height:"14px"}):x.createElement(ne,{fontWeight:"bold",fontSize:"small",color:"text50"},"Balance: ",`${K5(w)} ${m}`)))},xE=({secondaryText:t,primaryText:e,disableBack:r=!1})=>{const{goBack:n,history:i}=$d(),s=()=>{n()};return x.createElement(z,{background:"backgroundPrimary",zIndex:"20",position:"fixed",width:"full",flexDirection:"row",alignItems:"center",justifyContent:"space-between",style:{height:Rk,paddingTop:"6px",backgroundColor:ve.colors.backgroundPrimary}},i.length>0&&!r?x.createElement(Xo,{onClick:s,icon:Bg,size:"sm",style:{background:"rgba(0,0,0,0)",width:"44px"}}):x.createElement(z,null),x.createElement(z,null,x.createElement(ne,{fontWeight:"medium",variant:"small",color:"text50"},t),x.createElement(ne,{fontWeight:"medium",variant:"small",color:"text100"},e)),x.createElement(z,{style:{width:"44px"}}))};au("packages/checkout/src/shared/styles.css.ts","kit");const Mk=ki({},"walletContent");Ts(`${Mk} + button`,{backgroundColor:"transparent"});Ts(`${Mk} + button > svg`,{width:"20px",height:"20px"});cu();const ZW={location:"select-method-checkout"},Z_e=t=>{const e=new lS;return x.createElement(hS,{client:e},x.createElement(ePe,t))},ePe=({children:t})=>{const{theme:e,position:r}=rp(),[n,i]=C.useState(!1),[s,o]=C.useState(),[a,c]=C.useState([]),l=a.length>0?a[a.length-1]:ZW,u=p=>{o(p),i(!0)},f=()=>{i(!1)},d=()=>{const{location:p}=l;switch(p){case"select-method-checkout":return x.createElement(X_e,null);case"transaction-pending":return x.createElement(z_e,null);case"transaction-success":return x.createElement(W_e,null);case"transaction-error":return x.createElement(q_e,null);case"transaction-form":default:return x.createElement(j_e,null)}},h=()=>{const{location:p}=l;switch(p){case"select-method-checkout":return x.createElement(xE,{primaryText:"Checkout"});case"transaction-success":case"transaction-error":case"transaction-pending":return x.createElement(xE,{disableBack:!0,primaryText:"Pay with credit or debit card"});case"transaction-form":default:return x.createElement(xE,{primaryText:"Pay with credit or debit card"})}};return C.useEffect(()=>{n&&c([])},[n]),x.createElement(A_e,{value:{triggerCheckout:u,closeCheckout:f,settings:s,theme:e}},x.createElement(B_e,{value:{history:a,setHistory:c}},x.createElement("div",{id:"kit-checkout"},x.createElement(Kg,{root:"#kit-checkout",scope:"kit",theme:e},x.createElement(Ng,null,n&&x.createElement(rS,{contentProps:{style:Kl({maxWidth:"400px",height:"auto"},sk(r))},scroll:!1,backdropColor:"backgroundBackdrop",onClose:()=>i(!1)},x.createElement(z,{id:"sequence-kit-checkout-content",className:Mk},h(),d()))))),t))},$d=()=>{const{setHistory:t,history:e}=L_e(),r=s=>{const o=document.getElementById("sequence-kit-wallet-content"),a=o==null?void 0:o.parentElement;a==null||a.scrollTo(0,0);const c=[...e,s];t(c)},n=()=>{const s=[...e];s.pop(),t(s)},i=e.length>0?e[e.length-1]:ZW;return{setNavigation:r,history:e,setHistory:t,goBack:n,navigation:i}},tPe=`Two roads diverged in a yellow wood, +`;jk();jk();var oPe=(t=>(t.THIRDWEB_NFT_DROP_V2="THIRDWEB_NFT_DROP_V2",t.THIRDWEB_EDITION_DROP_V2="THIRDWEB_EDITION_DROP_V2",t.THIRDWEB_SIGNATURE="THIRDWEB_SIGNATURE",t.CANDY_MACHINE="CANDY_MACHINE",t.AUCTION_HOUSE="AUCTION_HOUSE",t))(oPe||{}),aPe=(t=>(t.POPUP="POPUP",t.NEW_TAB="NEW_TAB",t.MODAL="MODAL",t.DRAWER="DRAWER",t.EMBED="EMBED",t))(aPe||{});const[cPe,lPe]=uu(),hp=()=>{const{triggerCheckout:t,closeCheckout:e,settings:r}=cPe();return{triggerCheckout:t,closeCheckout:e,settings:r}};function Ql(){return Ql=Object.assign?Object.assign.bind():function(t){for(var e=1;et.toLowerCase()===e.toLowerCase();var Ta=function(t){return t[t.VERY_LARGE=0]="VERY_LARGE",t[t.FRACTION=1]="FRACTION",t[t.VERY_TINY=2]="VERY_TINY",t[t.MIXED=3]="MIXED",t}(Ta||{});const r6=t=>{if(isNaN(Number(t)))return console.error(`display format error ${t} is not a number`),"NaN";const e=Number(t);if(e===0)return"0";let r;e>1e8?r=Ta.VERY_LARGE:e<1e-10?r=Ta.VERY_TINY:e<1?r=Ta.FRACTION:r=Ta.MIXED;let n,i;switch(r){case Ta.VERY_LARGE:n="compact",i={maximumFractionDigits:4};break;case Ta.VERY_TINY:n="scientific",i={maximumFractionDigits:4};break;case Ta.FRACTION:n="standard",i={maximumSignificantDigits:4};break;default:n="standard",i={maximumFractionDigits:2}}return Intl.NumberFormat("en-US",Ql({notation:n},i)).format(e)},uPe=t=>t.charAt(0).toUpperCase()+t.slice(1),fPe=t=>t.chainId===1?"Ethereum":uPe(t.name),dPe=async({accountAddress:t,chainId:e})=>{try{const{indexerClient:r}=await ln(e),n=await r.getEtherBalance({accountAddress:t});return[{chainId:e,contractAddress:lr,accountAddress:t,balance:(n==null?void 0:n.balance.balanceWei)||"0",contractType:R8.UNKNOWN,blockHash:"",blockNumber:0,tokenID:""}]}catch(r){return console.error(r),[]}},hPe=async({accountAddress:t,chainId:e})=>{try{const{indexerClient:r}=await ln(e),n=await r.getTokenBalances({accountAddress:t,includeMetadata:!0});return(n==null?void 0:n.balances)||[]}catch(r){return console.error(r),[]}},pPe=async({accountAddress:t,chainId:e})=>{try{return(await Promise.all([dPe({accountAddress:t,chainId:e}),hPe({accountAddress:t,chainId:e})])).flat()}catch(r){return console.error(r),[]}},vPe=async({chainId:t,tokenId:e,contractAddress:r})=>{const{metadataClient:n}=await ln(t);return(await n.getTokenMetadata({chainID:String(t),contractAddress:r,tokenIDs:[e]})).tokenMetadata[0]},mPe=async({chainID:t,contractAddress:e})=>{const{metadataClient:r}=await ln(t);return(await r.getContractInfo({chainID:t,contractAddress:e})).contractInfo},yPe=async({chainId:t,email:e,contractAddress:r,abi:n,receiptTitle:i,collectionContractAddress:s,methodArguments:o,currency:a,currencyAmount:c,methodName:l,recipientAddress:u})=>{const{network:f,apiClient:d}=await ln(t),h=fPe(f),p=JSON.stringify(Ql({title:i,email:e,limitPerTransaction:1,quantity:1,mintMethod:{args:o,payment:{currency:a,value:`${c} * $QUANTITY`},name:l},walletAddress:u},s?{contractArgs:{collectionContractAddress:s}}:{})),{secret:v}=await d.paperSessionSecret2({chainName:h,contractAddress:r,abi:n,paramsJson:p});return v},Uk={oneSecond:1*1e3,oneMinute:60*1e3,oneHour:60*60*1e3},gPe=t=>oi({queryKey:["balances",t],queryFn:()=>pPe(t),retry:!0,staleTime:10*Uk.oneMinute,enabled:!!t.chainId&&!!t.accountAddress}),bPe=t=>oi({queryKey:["useTokenMetadata",t],queryFn:()=>vPe(t),retry:!0,staleTime:10*Uk.oneMinute,enabled:!!t.chainId&&!!t.contractAddress}),_H=t=>oi({queryKey:["useContractInfo",t],queryFn:()=>mPe(t),retry:!0,staleTime:60*Uk.oneMinute,enabled:!!t.chainID&&!!t.contractAddress}),[wPe,EPe]=uu(),xPe=({settings:t})=>{var e,r;const[n,i]=C.useState(!0),[s,o]=C.useState(((e=t.creditCardCheckout)==null?void 0:e.email)||""),[a,c]=C.useState(s),[l,u]=C.useState(null),[f,d]=C.useState(!1),{setNavigation:h}=Ld(),p=()=>{n&&o(a||""),n||c(s),i(!n)},v=async()=>{d(!0);try{if(!s)throw"No email address found";if(!t.creditCardCheckout)throw"No credit card checkout settings found";const P=await yPe(Ql({email:s},t.creditCardCheckout));u(P)}catch(P){console.error("Failed to fetch paper secret",P),h({location:"transaction-error",params:{error:P}})}d(!1)};C.useEffect(()=>{const P=setInterval(()=>{const T=document.getElementById("paper-js-sdk-modal");T&&(T.style.pointerEvents="visible")},100);return()=>{clearInterval(P)}},[]),C.useEffect(()=>{s!==""&&v()},[s]);const b=()=>/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/.test(a||""),y=P=>{c(P.target.value)},m=P=>{h({location:"transaction-pending",params:{transactionId:P}})},g=P=>{h({location:"transaction-error",params:{error:P}})},S=()=>n?x.createElement(z,{as:"form",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",onSubmit:p},x.createElement(z,{flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"2"},x.createElement(ne,{fontSize:"normal",fontWeight:"normal",color:"text50"},"Receipt email address"),x.createElement($c,{autoFocus:!0,name:"email",type:"email",placeholder:"Email Address",value:a,onChange:y,"data-1p-ignore":!0})),x.createElement(rt,{size:"xs",label:"Save",leftIcon:fd,disabled:!b(),type:"submit"})):x.createElement(z,{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},x.createElement(z,{flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"2"},x.createElement(ne,{fontSize:"normal",fontWeight:"normal",color:"text50"},"Receipt email address"),x.createElement(ne,{fontSize:"normal",fontWeight:"bold",color:"text100"},s)),x.createElement(rt,{size:"xs",label:"Edit",leftIcon:Lne,onClick:p}));return x.createElement(z,null,S(),f&&x.createElement(z,{width:"full",height:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",style:{height:"200px"}},x.createElement(vS,{size:"lg",style:{width:"60px",height:"60px"}})),l&&!f&&x.createElement(po,{marginY:"4",flexDirection:"column"},x.createElement(sPe,{sdkClientSecret:l,appName:t==null||(r=t.creditCardCheckout)==null?void 0:r.receiptTitle,onReview:()=>{},onPaymentSuccess:P=>{m(P.id)},onError:P=>{console.error("Payment error:",P),g(P.error)},options:{colorPrimary:"#447dd1",colorText:"#ffffff",borderRadius:12}})))},zk="54px",CPe=()=>{const{settings:t}=hp();return x.createElement(z,{paddingX:"4",paddingBottom:"8",gap:"4",flexDirection:"column",style:{marginTop:zk}},t&&x.createElement(xPe,{settings:t}))},SPe=10*1e3,kPe=()=>{const t=Ld(),{params:{transactionId:e}}=t.navigation,{setNavigation:r}=t,n=`https://withpaper.com/api/v1/transaction-status/${e}`,i=async()=>{try{console.log("Polling for transaction status");const s=await fetch(n,{method:"GET",headers:{accept:"application/json"}}).then(c=>c.json()),o=s.result.status,a=s.result.transactionHash;if(console.log("transaction status poll response:",o),o==="PENDING")return;if(o==="TRANSFER_SUCCEEDED"){r&&r({location:"transaction-success",params:{transactionHash:a}});return}if(o==="TRANSFER_FAILED"||o==="PAYMENT_FAILED"){r&&r({location:"transaction-error",params:{error:new Error("Failed to transfer collectible")}});return}}catch(s){console.error("An error occurred while fetching the transaction status"),r&&r({location:"transaction-error",params:{error:s}})}};return C.useEffect(()=>{const s=setInterval(()=>{i()},SPe);return()=>{clearInterval(s)}},[]),x.createElement(z,{style:{height:"500px"}},x.createElement(z,{position:"absolute",top:"0",left:"0",width:"full",height:"full",flexDirection:"column",alignItems:"center",justifyContent:"center"},x.createElement(vS,{size:"lg",style:{width:"60px",height:"60px"}}),x.createElement(ne,{variant:"medium",color:"text50",textAlign:"center",marginTop:"8"},"Transaction in progress. ",x.createElement("br",null),"This may take a few minutes.")))},APe=()=>{const{closeCheckout:t,settings:e}=hp(),n=Ld().navigation;return C.useEffect(()=>{setTimeout(()=>{var i,s;t(),!(e==null||(i=e.creditCardCheckout)==null)&&i.onSuccess&&(e==null||(s=e.creditCardCheckout)==null||s.onSuccess(n.params.transactionHash))},3e3)},[]),x.createElement(z,{style:{height:"500px"}},x.createElement(z,{flexDirection:"column",alignItems:"center",position:"absolute",style:{top:"50%",right:"50%",transform:"translate(50%, -50%)"}},x.createElement(_Pe,null),x.createElement(ne,{fontSize:"xlarge"},"Success!"),x.createElement(ne,{textAlign:"center",variant:"normal",color:"text80"},"The transaction was successful.")))},_Pe=()=>x.createElement(z,{color:"white",background:"positive",alignItems:"center",justifyContent:"center",width:"16",height:"16",borderRadius:"circle",marginBottom:"2"},x.createElement(fd,{size:"xl"})),PPe=()=>{const{closeCheckout:t,settings:e}=hp(),n=Ld().navigation;return C.useEffect(()=>{setTimeout(()=>{var i,s;t(),!(e==null||(i=e.creditCardCheckout)==null)&&i.onError&&(e==null||(s=e.creditCardCheckout)==null||s.onError(n.params.error))},3e3)},[]),x.createElement(z,{style:{height:"500px"}},x.createElement(z,{flexDirection:"column",alignItems:"center",position:"absolute",style:{top:"50%",right:"50%",transform:"translate(50%, -50%)"}},x.createElement(TPe,null),x.createElement(ne,{fontSize:"xlarge"},"Error"),x.createElement(ne,{textAlign:"center",variant:"normal",color:"text80"},"An error occurred while processing the transaction.")))},TPe=()=>x.createElement(z,{color:"white",alignItems:"center",justifyContent:"center",width:"16",height:"16",borderRadius:"circle",marginBottom:"2",background:"negative"},x.createElement(nu,{size:"xl"})),IPe=({size:t=30})=>x.createElement(z,{alignItems:"center",justifyContent:"center",borderRadius:"circle",background:"backgroundInverse",style:{width:`${t}px`,height:`${t}px`}},x.createElement(ne,{style:{fontSize:`${t-4}px`},display:"inline-block",variant:"large",color:"textInverse100"},"?")),n0=({imageUrl:t,size:e=30})=>t?x.createElement(mr,{src:t,borderRadius:"circle",style:{width:`${e}px`,height:`${e}px`}}):x.createElement(IPe,{size:e});cu("packages/checkout/src/shared/components/Skeleton/styles.css.ts","kit");const OPe=$z({"0%":{opacity:.25},"50%":{opacity:.1},"100%":{opacity:.25}},"PulseSimple"),RPe=Ai({height:"76px",backgroundColor:"#909090",animation:`${OPe} 2s ease-in-out infinite`},"skeleton");lu();const rf=({width:t="100%",height:e="100%",borderRadius:r="md"})=>x.createElement(z,{className:RPe,borderRadius:r,style:{width:t,height:e}}),$Pe=({contractAddress:t,tokenId:e,quantityRaw:r,chainId:n})=>{const{chains:i=[]}=an(),{data:s,isLoading:o}=bPe({chainId:n,contractAddress:t,tokenId:e}),{data:a,isLoading:c}=_H({chainID:String(n),contractAddress:t});if(o||c)return x.createElement(MPe,null);const u=Tr(n,i),{name:f="unknown",image:d,decimals:h=0}=s||{},{logoURI:p,name:v="Unknown Collection"}=a||{},b=xr(r,h);return x.createElement(po,{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},x.createElement(z,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},x.createElement(z,{aspectRatio:"1/1",height:"full",justifyContent:"center",alignItems:"center",style:{width:"80px"}},x.createElement(mr,{src:d,borderRadius:"md",style:{height:"80px"}})),x.createElement(z,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"2"},x.createElement(z,{gap:"1",alignItems:"center"},x.createElement(n0,{size:12,imageUrl:p}),x.createElement(ne,{marginLeft:"1",fontSize:"small",color:"text80",fontWeight:"bold"},v),x.createElement(n0,{size:12,imageUrl:u.logoURI})),x.createElement(z,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",style:{width:"180px"}},x.createElement(ne,{color:"text100",fontSize:"normal",fontWeight:"normal"},f),x.createElement(ne,{color:"text50",fontSize:"normal",fontWeight:"normal"},`#${e}`)))),x.createElement(z,{height:"full",fontSize:"small",color:"text50",fontWeight:"bold"},`x${r6(b)}`))},MPe=()=>x.createElement(po,{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},x.createElement(z,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},x.createElement(rf,{height:"80px",width:"80px"}),x.createElement(z,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"2"},x.createElement(rf,{width:"100px",height:"14px"}),x.createElement(rf,{width:"180px",height:"34px"}))),x.createElement(rf,{height:"14px",width:"14px"}));cu("packages/checkout/src/views/CheckoutSelection/styles.css.ts","kit");const PH=Ai({},"insufficientBalanceButton");Os(`${PH} > div`,{justifyContent:"center"});lu();const NPe=()=>{var t,e,r,n;const{chains:i=[]}=an();Ld();const{closeCheckout:s,settings:o}=hp(),{address:a}=kn(),c=o==null?void 0:o.cryptoCheckout,l=!!c,{data:u,isLoading:f}=_H({contractAddress:(c==null||(t=c.coinQuantity)==null?void 0:t.contractAddress)||"",chainID:String((c==null?void 0:c.chainId)||1)}),{data:d,isLoading:h}=gPe({accountAddress:a||"",chainId:(c==null?void 0:c.chainId)||1}),p=(f||h)&&c,v=c7((c==null||(e=c.coinQuantity)==null?void 0:e.contractAddress)||"",lr),b=Tr((c==null?void 0:c.chainId)||1,i),y=v?b.decimals:(u==null?void 0:u.decimals)||0,m=v?b.symbol:(u==null?void 0:u.symbol)||"COIN",g=v?b.logoURI:(u==null?void 0:u.logoURI)||"",S=d==null?void 0:d.find(B=>{var E;return c7(B.contractAddress,(c==null||(E=c.coinQuantity)==null?void 0:E.contractAddress)||"")}),P=S?S.balance:"0",T=(c==null||(r=c.coinQuantity)==null?void 0:r.amountRequiredRaw)||"0",w=xr(P,y),I=xr(T,y),F=J.from(P).lt(J.from(T)),j=(o==null?void 0:o.orderSummaryItems)||[],H=(o==null||(n=o.cryptoCheckout)==null?void 0:n.chainId)||1,K=()=>{var B;console.log("trigger transaction");const E=o==null||(B=o.cryptoCheckout)==null?void 0:B.triggerTransaction;E&&E(),s()};return x.createElement(z,{paddingX:"5",paddingBottom:"5",style:{marginTop:zk},flexDirection:"column",gap:"3"},j.length>0&&x.createElement(x.Fragment,null,x.createElement(ne,{fontWeight:"normal",fontSize:"normal",color:"text50"},"Order summary"),x.createElement(z,{flexDirection:"column",gap:"2"},j.map((B,E)=>x.createElement($Pe,Ql({key:E},B,{chainId:H})))),x.createElement(z,{marginTop:"2"},x.createElement(N0,{color:"backgroundSecondary",style:{margin:"0px"}}))),l&&x.createElement(z,{justifyContent:"space-between",alignItems:"center"},x.createElement(ne,{fontWeight:"normal",fontSize:"normal",color:"text50"},"Total"),p?x.createElement(rf,{width:"100px",height:"17px"}):x.createElement(z,{flexDirection:"row",gap:"1",alignItems:"center"},x.createElement(n0,{imageUrl:g,size:12}),x.createElement(ne,{fontWeight:"normal",fontSize:"normal",color:"text100"},`${r6(I)} ${m}`))),x.createElement(z,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"2"},l&&!F&&!p&&x.createElement(rt,{style:{borderRadius:ve.radii.md,height:"56px"},width:"full",leftIcon:()=>x.createElement(n0,{size:20,imageUrl:g}),variant:"primary",label:`Pay with ${m}`,rightIcon:Lo,onClick:K}),l&&(F||p)&&x.createElement(rt,{className:PH,style:{borderRadius:ve.radii.md,height:"56px",justifyContent:"center"},width:"full",leftIcon:()=>x.createElement(n0,{size:20,imageUrl:g}),variant:"glass",label:`Insufficient ${m}`,onClick:K,disabled:!0})),l&&x.createElement(z,{width:"full",justifyContent:"flex-end"},p?x.createElement(rf,{width:"102px",height:"14px"}):x.createElement(ne,{fontWeight:"bold",fontSize:"small",color:"text50"},"Balance: ",`${r6(w)} ${m}`)))},TE=({secondaryText:t,primaryText:e,disableBack:r=!1})=>{const{goBack:n,history:i}=Ld(),s=()=>{n()};return x.createElement(z,{background:"backgroundPrimary",zIndex:"20",position:"fixed",width:"full",flexDirection:"row",alignItems:"center",justifyContent:"space-between",style:{height:zk,paddingTop:"6px",backgroundColor:ve.colors.backgroundPrimary}},i.length>0&&!r?x.createElement(Xo,{onClick:s,icon:Vg,size:"sm",style:{background:"rgba(0,0,0,0)",width:"44px"}}):x.createElement(z,null),x.createElement(z,null,x.createElement(ne,{fontWeight:"medium",variant:"small",color:"text50"},t),x.createElement(ne,{fontWeight:"medium",variant:"small",color:"text100"},e)),x.createElement(z,{style:{width:"44px"}}))};cu("packages/checkout/src/shared/styles.css.ts","kit");const Wk=Ai({},"walletContent");Os(`${Wk} + button`,{backgroundColor:"transparent"});Os(`${Wk} + button > svg`,{width:"20px",height:"20px"});lu();const TH={location:"select-method-checkout"},DPe=t=>{const e=new bS;return x.createElement(CS,{client:e},x.createElement(LPe,t))},LPe=({children:t})=>{const{theme:e,position:r}=ap(),[n,i]=C.useState(!1),[s,o]=C.useState(),[a,c]=C.useState([]),l=a.length>0?a[a.length-1]:TH,u=p=>{o(p),i(!0)},f=()=>{i(!1)},d=()=>{const{location:p}=l;switch(p){case"select-method-checkout":return x.createElement(NPe,null);case"transaction-pending":return x.createElement(kPe,null);case"transaction-success":return x.createElement(APe,null);case"transaction-error":return x.createElement(PPe,null);case"transaction-form":default:return x.createElement(CPe,null)}},h=()=>{const{location:p}=l;switch(p){case"select-method-checkout":return x.createElement(TE,{primaryText:"Checkout"});case"transaction-success":case"transaction-error":case"transaction-pending":return x.createElement(TE,{disableBack:!0,primaryText:"Pay with credit or debit card"});case"transaction-form":default:return x.createElement(TE,{primaryText:"Pay with credit or debit card"})}};return C.useEffect(()=>{n&&c([])},[n]),x.createElement(lPe,{value:{triggerCheckout:u,closeCheckout:f,settings:s,theme:e}},x.createElement(EPe,{value:{history:a,setHistory:c}},x.createElement("div",{id:"kit-checkout"},x.createElement(rb,{root:"#kit-checkout",scope:"kit",theme:e},x.createElement(Ug,null,n&&x.createElement(dS,{contentProps:{style:Ql({maxWidth:"400px",height:"auto"},vk(r))},scroll:!1,backdropColor:"backgroundBackdrop",onClose:()=>i(!1)},x.createElement(z,{id:"sequence-kit-checkout-content",className:Wk},h(),d()))))),t))},Ld=()=>{const{setHistory:t,history:e}=wPe(),r=s=>{const o=document.getElementById("sequence-kit-wallet-content"),a=o==null?void 0:o.parentElement;a==null||a.scrollTo(0,0);const c=[...e,s];t(c)},n=()=>{const s=[...e];s.pop(),t(s)},i=e.length>0?e[e.length-1]:TH;return{setNavigation:r,history:e,setHistory:t,goBack:n,navigation:i}},FPe=`Two roads diverged in a yellow wood, Robert Frost poet And sorry I could not travel both @@ -401,4 +401,4 @@ I shall be telling this with a sigh Somewhere ages and ages hence: Two roads diverged in a wood, and I— I took the one less traveled by, -And that has made all the difference.`,rPe=[{label:"Terms",url:"https://sequence.xyz/terms"},{label:"About",url:"https://github.com/0xsequence/kit"},{label:"Blog",url:"https://sequence.xyz/blog"},{label:"Builder",url:"https://sequence.build"},{label:"Docs",url:"https://docs.sequence.xyz/wallet/connectors/kit/kit/overview"}],nPe=[{id:"discord",url:"https://discord.gg/sequence",icon:"img/social/discord.svg"},{id:"twitter",url:"https://www.twitter.com/0xsequence",icon:"img/social/twitter.svg"},{id:"youtube",url:"https://www.youtube.com/channel/UC1zHgUyV-doddTcnFNqt62Q",icon:"img/social/youtube.svg"},{id:"github",url:"https://github.com/0xsequence",icon:"img/social/github.svg"}];var XI="u3q5o00";const iPe=()=>{const{theme:t}=$1(),e=sle("isMobile"),r=s=>{window.open(s)},n=()=>pe(z,{flexDirection:"row",gap:"4",children:rPe.map((s,o)=>pe(z,{onClick:()=>r(s.url),className:XI,gap:"4",children:pe(ne,{fontWeight:"normal",fontSize:"small",color:"text50",children:s.label})},o))}),i=()=>pe(z,{gap:"4",justifyContent:"center",alignItems:"center",children:nPe.map((s,o)=>pe(z,{className:XI,onClick:()=>window.open(s.url),children:pe(mr,{height:"3",src:s.icon,alt:s.id,style:{filter:t==="dark"?"invert(0)":"invert(1)"}})},o))});return e?Ti(z,{flexDirection:"column",padding:"5",gap:"2",style:{height:"60px"},position:"fixed",bottom:"0",width:"full",justifyContent:"center",alignItems:"center",children:[pe(n,{}),pe(i,{})]}):Ti(z,{padding:"5",style:{height:"60px"},position:"fixed",bottom:"0",width:"full",justifyContent:"space-between",children:[pe(n,{}),pe(i,{})]})},sPe=t=>({cryptoCheckout:{chainId:137,triggerTransaction:async()=>{console.log("triggered transaction")},coinQuantity:{contractAddress:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",amountRequiredRaw:"10000000000"}},orderSummaryItems:[{contractAddress:"0x631998e91476da5b870d741192fc5cbc55f5a52e",tokenId:"66597",quantityRaw:"100"},{contractAddress:"0x624e4fa6980afcf8ea27bfe08e2fb5979b64df1c",tokenId:"1741",quantityRaw:"100"}]}),oPe=(t,e)=>{let r=t;return t.length>=e&&(r=t.slice(0,e/2)+"..."+t.slice(t.length-e/2,t.length)),r},aPe=t=>`0x${oPe((t==null?void 0:t.substring(2))||"",8)}`;function cPe(){const{theme:t,setTheme:e}=$1(),{setTheme:r}=rp(),{address:n,connector:i,isConnected:s}=kn(),{setOpenConnectModal:o}=Lxe(),{setOpenWalletModal:a}=sp(),{triggerCheckout:c}=cp(),{disconnect:l}=DB(),{data:u}=VS(),{switchNetwork:f}=GS(),d=Cb(),h=MB(),{debug:p}=n$.parse(location.search),v=p==="true",b=async()=>{if(!(!u||!h))try{const B=await Sxe(u);console.log("proof:",B);const j=await kxe(u,h,B);console.log("isValid?:",j)}catch(B){console.error(B)}},y=async()=>{if(u)try{const B=tPe,j=await u.signMessage({account:n||"",message:B});console.log("signature:",j);const[H]=await u.getAddresses(),K=await h.verifyMessage({address:H,message:B,signature:j});console.log("isValid?",K)}catch(B){console.error(B)}},m=()=>{e(t==="dark"?"light":"dark"),r(t==="dark"?"light":"dark")},g=()=>s?Ti(z,{padding:"5",justifyContent:"space-between",children:[Ti(z,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:[pe(mr,{style:{width:"36px"},src:"kit-logo.svg"}),pe(mr,{style:{width:"24px",filter:t==="dark"?"invert(0)":"invert(1)"},src:"kit-logo-text.svg"})]}),pe(z,{children:Ti(z,{flexDirection:"column",children:[Ti(z,{flexDirection:"row",gap:"2",justifyContent:"flex-end",alignItems:"center",children:[pe(z,{style:{marginRight:"-12px"},children:pe(w,{})}),pe(ne,{fontWeight:"medium",fontSize:"normal",color:"text100",children:aPe(n||"")})]}),pe(z,{alignItems:"center",justifyContent:"flex-end",flexDirection:"row",children:pe(ne,{fontWeight:"medium",fontSize:"normal",color:"text50",children:i==null?void 0:i.name})})]})})]}):pe(z,{padding:"5",justifyContent:"flex-end",children:pe(z,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:pe(w,{})})}),S=({title:B,description:j,onClick:H})=>Ti(ho,{style:{width:"332px"},clickable:!0,onClick:H,children:[pe(ne,{color:"text100",lineHeight:"5",fontSize:"normal",fontWeight:"bold",children:B}),pe(z,{marginTop:"1",children:pe(ne,{fontWeight:"medium",lineHeight:"5",color:"text50",fontSize:"normal",children:j})})]}),P=()=>{o(!0)},T=()=>{c(sPe())},w=()=>pe(tt,{variant:"base",style:{color:ve.colors.text100},onClick:m,leftIcon:t==="dark"?bne:sne});return Ti(z,{background:"backgroundPrimary",children:[v&&pe(z,{justifyContent:"center",alignItems:"center",children:pe(ne,{children:"Debug mode"})}),pe(z,{style:{height:"72px"},position:"fixed",width:"full",top:"0",children:pe(g,{})}),pe(z,{style:{height:"100vh"},flexDirection:"column",justifyContent:"center",alignItems:"center",children:s?Ti(z,{flexDirection:"column",gap:"4",children:[Ti(z,{flexDirection:"column",gap:"2",children:[pe(ne,{color:"text50",fontSize:"small",fontWeight:"medium",children:"Demos"}),pe(S,{title:"Embedded wallet",description:"Connect a Sequence wallet to view, swap, send, and receive collections",onClick:()=>a(!0)}),pe(S,{title:"Checkout",description:"Checkout screen before placing a purchase on coins or collections",onClick:T}),pe(S,{title:"Sign message",description:"Sign a message with your wallet",onClick:y}),v&&pe(S,{title:"Generate EthAuth proof",description:"Generate EthAuth proof",onClick:b}),v&&pe(S,{title:"Switch network",description:"Switch network",onClick:()=>{f(d===1?137:1)}})]}),pe(z,{width:"full",gap:"2",flexDirection:"row",justifyContent:"flex-end",children:pe(tt,{onClick:()=>l(),leftIcon:_N,label:"Sign out"})})]}):pe(z,{children:Ti(z,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5",children:[Ti(z,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:[pe(mr,{style:{width:"48px"},src:"kit-logo.svg"}),pe(mr,{style:{width:"32px",filter:t==="dark"?"invert(0)":"invert(1)"},src:"kit-logo-text.svg"})]}),pe(z,{gap:"2",flexDirection:"row",alignItems:"center",children:pe(tt,{onClick:P,variant:"feature",label:"Connect"})})]})})}),pe(iPe,{})]})}function lPe(){return function(t){return t.rpcUrls.public.http[0]?{chain:t,rpcUrls:t.rpcUrls.public}:null}}function uPe(){const{debug:t}=n$.parse(location.search),e=t==="true",{chains:r,publicClient:n,webSocketPublicClient:i}=Hhe([hT,s0e],[lPe()]),s=[...m2e({chains:r,walletConnectProjectId:"c65a6cb1aa83c4e24500130f23a437d8",defaultChainId:137}),...e?oz([v2e({chains:r,options:{chain:hT,account:"0xCb88b6315507e9d8c35D81AFB7F190aB6c3227C9",transport:oB()}})]):[]],o=p0e({autoConnect:!0,publicClient:n,webSocketPublicClient:i,connectors:s});return pe(v0e,{config:o,children:pe(Dxe,{config:{projectAccessKey:"iK0DPkHRt0IFo8o4M3fZIIOAAAAAAAAAA",defaultTheme:"dark",signIn:{projectName:"Skyweaver",useMock:e},displayedAssets:[{contractAddress:lr,chainId:137},{contractAddress:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",chainId:137},{contractAddress:"0x631998e91476da5b870d741192fc5cbc55f5a52e",chainId:137}]},children:pe(JAe,{children:pe(Z_e,{children:pe("div",{id:"app",children:pe(Kg,{root:"#app",scope:"app",theme:"dark",children:pe(cPe,{})})})})})})})}const fPe=CE.createRoot(document.getElementById("root"));fPe.render(pe(x.StrictMode,{children:pe(uPe,{})}));export{Hb as $,pTe as A,wTe as B,qPe as C,VPe as D,hTe as E,Yi as F,rTe as G,eTe as H,Al as I,tTe as J,wwe as K,Ewe as L,RU as M,YPe as N,WPe as O,pwe as P,aTe as Q,cTe as R,qb as S,KPe as T,vTe as U,GPe as V,z8 as W,XPe as X,JPe as Y,OU as Z,zPe as _,ZI as a,fTe as a0,oTe as a1,dTe as a2,gTe as a3,yTe as a4,Zwe as a5,PTe as a6,ETe as a7,e2e as a8,mTe as a9,kTe as aa,xTe as ab,ATe as ac,TTe as ad,CTe as ae,STe as af,_Te as ag,bTe as ah,Hwe as ai,$U as aj,eE as ak,BPe as al,XL as am,le as an,nb as ao,Dn as ap,Uf as aq,B0 as ar,Wfe as as,pb as at,Zo as au,L1 as av,jh as aw,vo as ax,Ue as b,kl as c,Lb as d,FT as e,vs as f,ks as g,ul as h,La as i,FPe as j,jPe as k,UPe as l,HPe as m,ti as n,ZPe as o,ep as p,QPe as q,Wb as r,nTe as s,Ss as t,lTe as u,sTe as v,_s as w,Gf as x,uTe as y,iTe as z}; +And that has made all the difference.`,BPe=[{label:"Terms",url:"https://sequence.xyz/terms"},{label:"About",url:"https://github.com/0xsequence/kit"},{label:"Blog",url:"https://sequence.xyz/blog"},{label:"Builder",url:"https://sequence.build"},{label:"Docs",url:"https://docs.sequence.xyz/wallet/connectors/kit/kit/overview"}],jPe=[{id:"discord",url:"https://discord.gg/sequence",icon:"img/social/discord.svg"},{id:"twitter",url:"https://www.twitter.com/0xsequence",icon:"img/social/twitter.svg"},{id:"youtube",url:"https://www.youtube.com/channel/UC1zHgUyV-doddTcnFNqt62Q",icon:"img/social/youtube.svg"},{id:"github",url:"https://github.com/0xsequence",icon:"img/social/github.svg"}];var l7="u3q5o00";const UPe=()=>{const{theme:t}=L1(),e=Ule("isMobile"),r=s=>{window.open(s)},n=()=>pe(z,{flexDirection:"row",gap:"4",children:BPe.map((s,o)=>pe(z,{onClick:()=>r(s.url),className:l7,gap:"4",children:pe(ne,{fontWeight:"normal",fontSize:"small",color:"text50",children:s.label})},o))}),i=()=>pe(z,{gap:"4",justifyContent:"center",alignItems:"center",children:jPe.map((s,o)=>pe(z,{className:l7,onClick:()=>window.open(s.url),children:pe(mr,{height:"3",src:s.icon,alt:s.id,style:{filter:t==="dark"?"invert(0)":"invert(1)"}})},o))});return e?Ii(z,{flexDirection:"column",padding:"5",gap:"2",style:{height:"60px"},position:"fixed",bottom:"0",width:"full",justifyContent:"center",alignItems:"center",children:[pe(n,{}),pe(i,{})]}):Ii(z,{padding:"5",style:{height:"60px"},position:"fixed",bottom:"0",width:"full",justifyContent:"space-between",children:[pe(n,{}),pe(i,{})]})},zPe=t=>({cryptoCheckout:{chainId:137,triggerTransaction:async()=>{console.log("triggered transaction")},coinQuantity:{contractAddress:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",amountRequiredRaw:"10000000000"}},orderSummaryItems:[{contractAddress:"0x631998e91476da5b870d741192fc5cbc55f5a52e",tokenId:"66597",quantityRaw:"100"},{contractAddress:"0x624e4fa6980afcf8ea27bfe08e2fb5979b64df1c",tokenId:"1741",quantityRaw:"100"}]}),WPe=(t,e)=>{let r=t;return t.length>=e&&(r=t.slice(0,e/2)+"..."+t.slice(t.length-e/2,t.length)),r},HPe=t=>`0x${WPe((t==null?void 0:t.substring(2))||"",8)}`;function qPe(){const{theme:t,setTheme:e}=L1(),{setTheme:r}=ap(),{address:n,connector:i,isConnected:s}=kn(),{setOpenConnectModal:o}=wCe(),{setOpenWalletModal:a}=up(),{triggerCheckout:c}=hp(),{disconnect:l}=dB(),{data:u}=r8(),{switchNetwork:f}=n8(),d=Ib(),h=lB(),{debug:p}=pM.parse(location.search),v=p==="true",b=async()=>{if(!(!u||!h))try{const F=await aCe(u);console.log("proof:",F);const j=await cCe(u,h,F);console.log("isValid?:",j)}catch(F){console.error(F)}},y=async()=>{if(u)try{const F=FPe,j=await u.signMessage({account:n||"",message:F});console.log("signature:",j);const[H]=await u.getAddresses(),K=await h.verifyMessage({address:H,message:F,signature:j});console.log("isValid?",K)}catch(F){console.error(F)}},m=()=>{e(t==="dark"?"light":"dark"),r(t==="dark"?"light":"dark")},g=()=>s?Ii(z,{padding:"5",justifyContent:"space-between",children:[Ii(z,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:[pe(mr,{style:{width:"36px"},src:"kit-logo.svg"}),pe(mr,{style:{width:"24px",filter:t==="dark"?"invert(0)":"invert(1)"},src:"kit-logo-text.svg"})]}),pe(z,{children:Ii(z,{flexDirection:"column",children:[Ii(z,{flexDirection:"row",gap:"2",justifyContent:"flex-end",alignItems:"center",children:[pe(z,{style:{marginRight:"-12px"},children:pe(w,{})}),pe(ne,{fontWeight:"medium",fontSize:"normal",color:"text100",children:HPe(n||"")})]}),pe(z,{alignItems:"center",justifyContent:"flex-end",flexDirection:"row",children:pe(ne,{fontWeight:"medium",fontSize:"normal",color:"text50",children:i==null?void 0:i.name})})]})})]}):pe(z,{padding:"5",justifyContent:"flex-end",children:pe(z,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:pe(w,{})})}),S=({title:F,description:j,onClick:H})=>Ii(po,{style:{width:"332px"},clickable:!0,onClick:H,children:[pe(ne,{color:"text100",lineHeight:"5",fontSize:"normal",fontWeight:"bold",children:F}),pe(z,{marginTop:"1",children:pe(ne,{fontWeight:"medium",lineHeight:"5",color:"text50",fontSize:"normal",children:j})})]}),P=()=>{o(!0)},T=()=>{c(zPe())},w=()=>pe(rt,{variant:"base",style:{color:ve.colors.text100},onClick:m,leftIcon:t==="dark"?tie:Une});return Ii(z,{background:"backgroundPrimary",children:[v&&pe(z,{justifyContent:"center",alignItems:"center",children:pe(ne,{children:"Debug mode"})}),pe(z,{style:{height:"72px"},position:"fixed",width:"full",top:"0",children:pe(g,{})}),pe(z,{style:{height:"100vh"},flexDirection:"column",justifyContent:"center",alignItems:"center",children:s?Ii(z,{flexDirection:"column",gap:"4",children:[Ii(z,{flexDirection:"column",gap:"2",children:[pe(ne,{color:"text50",fontSize:"small",fontWeight:"medium",children:"Demos"}),pe(S,{title:"Embedded wallet",description:"Connect a Sequence wallet to view, swap, send, and receive collections",onClick:()=>a(!0)}),pe(S,{title:"Checkout",description:"Checkout screen before placing a purchase on coins or collections",onClick:T}),pe(S,{title:"Sign message",description:"Sign a message with your wallet",onClick:y}),v&&pe(S,{title:"Generate EthAuth proof",description:"Generate EthAuth proof",onClick:b}),v&&pe(S,{title:"Switch network",description:"Switch network",onClick:()=>{f(d===1?137:1)}})]}),pe(z,{width:"full",gap:"2",flexDirection:"row",justifyContent:"flex-end",children:pe(rt,{onClick:()=>l(),leftIcon:nD,label:"Sign out"})})]}):pe(z,{children:Ii(z,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5",children:[Ii(z,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:[pe(mr,{style:{width:"48px"},src:"kit-logo.svg"}),pe(mr,{style:{width:"32px",filter:t==="dark"?"invert(0)":"invert(1)"},src:"kit-logo-text.svg"})]}),pe(z,{gap:"2",flexDirection:"row",alignItems:"center",children:pe(rt,{onClick:P,variant:"feature",label:"Connect"})})]})})}),pe(UPe,{})]})}function VPe(){return function(t){return t.rpcUrls.public.http[0]?{chain:t,rpcUrls:t.rpcUrls.public}:null}}function GPe(){const{debug:t}=pM.parse(location.search),e=t==="true",{chains:r,publicClient:n,webSocketPublicClient:i}=k0e([CT,j0e],[VPe()]),s=[...Z2e({chains:r,walletConnectProjectId:"c65a6cb1aa83c4e24500130f23a437d8",defaultChainId:137}),...e?Dz([Q2e({chains:r,options:{chain:CT,account:"0xCb88b6315507e9d8c35D81AFB7F190aB6c3227C9",transport:DF()}})]):[]],o=Q0e({autoConnect:!0,publicClient:n,webSocketPublicClient:i,connectors:s});return pe(Y0e,{config:o,children:pe(bCe,{config:{projectAccessKey:"iK0DPkHRt0IFo8o4M3fZIIOAAAAAAAAAA",defaultTheme:"dark",signIn:{projectName:"Skyweaver",useMock:e},displayedAssets:[{contractAddress:lr,chainId:137},{contractAddress:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",chainId:137},{contractAddress:"0x631998e91476da5b870d741192fc5cbc55f5a52e",chainId:137}]},children:pe(M4e,{children:pe(DPe,{children:pe("div",{id:"app",children:pe(rb,{root:"#app",scope:"app",theme:"dark",children:pe(qPe,{})})})})})})})}const KPe=IE.createRoot(document.getElementById("root"));KPe.render(pe(x.StrictMode,{children:pe(GPe,{})}));export{Jb as $,XTe as A,KTe as B,TTe as C,ITe as D,GTe as E,WTe as F,Yf as G,zTe as H,_l as I,i9e as J,JTe as K,Ji as L,jTe as M,FTe as N,BTe as O,Xwe as P,i2e as Q,s2e as R,lz as S,MTe as T,ZTe as U,OTe as V,_Te as W,DTe as X,NTe as Y,cz as Z,nwe as _,Ps as a,qTe as a0,VTe as a1,Xb as a2,RTe as a3,X8 as a4,QTe as a5,HTe as a6,YTe as a7,r9e as a8,t9e as a9,U1 as aA,Wh as aB,mo as aC,L2e as aa,d9e as ab,s9e as ac,F2e as ad,e9e as ae,l9e as af,o9e as ag,u9e as ah,h9e as ai,a9e as aj,c9e as ak,f9e as al,n9e as am,P2e as an,fz as ao,aE as ap,xTe as aq,HS as ar,le as as,fb as at,Ln as au,Hf as av,U0 as aw,Sde as ax,Eb as ay,Zo as az,sG as b,ul as c,Yb as d,Al as e,ze as f,u7 as g,Hb as h,XK as i,gs as j,_s as k,QT as l,Fa as m,CTe as n,STe as o,kTe as p,ATe as q,kR as r,PTe as s,XPe as t,ri as u,LTe as v,Is as w,$Te as x,sp as y,UTe as z}; diff --git a/assets/index-e4b650d6.js b/assets/index-e4b650d6.js new file mode 100644 index 00000000..b14e04be --- /dev/null +++ b/assets/index-e4b650d6.js @@ -0,0 +1 @@ +import{ar as le}from"./index-da732aeb.js";import{b as ce}from"./index-cc134824.js";const de=Symbol(),X=Object.getPrototypeOf,F=new WeakMap,ue=e=>e&&(F.has(e)?F.get(e):X(e)===Object.prototype||X(e)===Array.prototype),fe=e=>ue(e)&&e[de]||null,Y=(e,t=!0)=>{F.set(e,t)},J=e=>typeof e=="object"&&e!==null,C=new WeakMap,B=new WeakSet,pe=(e=Object.is,t=(o,h)=>new Proxy(o,h),s=o=>J(o)&&!B.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),r=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,h,I=r)=>{const w=l.get(o);if((w==null?void 0:w[0])===h)return w[1];const b=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return Y(b,!0),l.set(o,[h,b]),Reflect.ownKeys(o).forEach(P=>{if(Object.getOwnPropertyDescriptor(b,P))return;const O=Reflect.get(o,P),D={value:O,enumerable:!0,configurable:!0};if(B.has(O))Y(O,!1);else if(O instanceof Promise)delete D.value,D.get=()=>I(O);else if(C.has(O)){const[y,z]=C.get(O);D.value=c(y,z(),I)}Object.defineProperty(b,P,D)}),b},m=new WeakMap,f=[1,1],W=o=>{if(!J(o))throw new Error("object required");const h=m.get(o);if(h)return h;let I=f[0];const w=new Set,b=(i,a=++f[0])=>{I!==a&&(I=a,w.forEach(n=>n(i,a)))};let P=f[1];const O=(i=++f[1])=>(P!==i&&!w.size&&(P=i,y.forEach(([a])=>{const n=a[1](i);n>I&&(I=n)})),I),D=i=>(a,n)=>{const g=[...a];g[1]=[i,...g[1]],b(g,n)},y=new Map,z=(i,a)=>{if(w.size){const n=a[3](D(i));y.set(i,[a,n])}else y.set(i,[a])},Q=i=>{var a;const n=y.get(i);n&&(y.delete(i),(a=n[1])==null||a.call(n))},ae=i=>(w.add(i),w.size===1&&y.forEach(([n,g],R)=>{const k=n[3](D(R));y.set(R,[n,k])}),()=>{w.delete(i),w.size===0&&y.forEach(([n,g],R)=>{g&&(g(),y.set(R,[n]))})}),H=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),V=t(H,{deleteProperty(i,a){const n=Reflect.get(i,a);Q(a);const g=Reflect.deleteProperty(i,a);return g&&b(["delete",[a],n]),g},set(i,a,n,g){const R=Reflect.has(i,a),k=Reflect.get(i,a,g);if(R&&(e(k,n)||m.has(n)&&e(k,m.get(n))))return!0;Q(a),J(n)&&(n=fe(n)||n);let $=n;if(n instanceof Promise)n.then(A=>{n.status="fulfilled",n.value=A,b(["resolve",[a],A])}).catch(A=>{n.status="rejected",n.reason=A,b(["reject",[a],A])});else{!C.has(n)&&s(n)&&($=W(n));const A=!B.has($)&&C.get($);A&&z(a,A)}return Reflect.set(i,a,$,g),b(["set",[a],n,k]),!0}});m.set(o,V);const ie=[H,O,c,ae];return C.set(V,ie),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(V[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(H,i,a)}),V})=>[W,C,B,e,t,s,r,l,c,m,f],[me]=pe();function S(e={}){return me(e)}function j(e,t,s){const r=C.get(e);let l;const c=[],m=r[3];let f=!1;const o=m(h=>{if(c.push(h),s){t(c.splice(0));return}l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function ge(e,t){const s=C.get(e),[r,l,c]=s;return c(r,l(),t)}const d=S({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),re={state:d,subscribe(e){return j(d,()=>e(d))},push(e,t){e!==d.view&&(d.view=e,t&&(d.data=t),d.history.push(e))},reset(e){d.view=e,d.history=[e]},replace(e){d.history.length>1&&(d.history[d.history.length-1]=e,d.view=e)},goBack(){if(d.history.length>1){d.history.pop();const[e]=d.history.slice(-1);d.view=e}},setData(e){d.data=e}},p={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return p.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return p.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(p.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!p.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(p.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(p.WCM_VERSION,"2.5.9")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=re.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},he=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),u=S({enabled:he,userSessionId:"",events:[],connectedWalletId:void 0}),we={state:u,subscribe(e){return j(u.events,()=>e(ge(u.events[u.events.length-1])))},initialize(){u.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(u.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){u.connectedWalletId=e},click(e){if(u.enabled){const t={type:"CLICK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},track(e){if(u.enabled){const t={type:"TRACK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},view(e){if(u.enabled){const t={type:"VIEW",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}}},E=S({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),v={state:E,subscribe(e){return j(E,()=>e(E))},setChains(e){E.chains=e},setWalletConnectUri(e){E.walletConnectUri=e},setIsCustomDesktop(e){E.isCustomDesktop=e},setIsCustomMobile(e){E.isCustomMobile=e},setIsDataLoaded(e){E.isDataLoaded=e},setIsUiLoaded(e){E.isUiLoaded=e},setIsAuth(e){E.isAuth=e}},x=S({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),N={state:x,subscribe(e){return j(x,()=>e(x))},setConfig(e){var t,s;we.initialize(),v.setChains(e.chains),v.setIsAuth(!!e.enableAuthMode),v.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),v.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),p.setModalVersionInStorage(),Object.assign(x,e)}},G="https://explorer-api.walletconnect.com";async function K(e,t){const s=new URL(e,G);return s.searchParams.append("projectId",N.state.projectId),Object.entries(t).forEach(([r,l])=>{l&&s.searchParams.append(r,String(l))}),(await fetch(s)).json()}const M={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${N.state.projectId}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${N.state.projectId}`}};var be=Object.defineProperty,Z=Object.getOwnPropertySymbols,ye=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable,ee=(e,t,s)=>t in e?be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ie=(e,t)=>{for(var s in t||(t={}))ye.call(t,s)&&ee(e,s,t[s]);if(Z)for(var s of Z(t))ve.call(t,s)&&ee(e,s,t[s]);return e};const te=p.isMobile(),L=S({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Ue={state:L,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=N.state;if(e==="NONE"||t==="ALL"&&!e)return L.recomendedWallets;if(p.isArray(e)){const s={recommendedIds:e.join(",")},{listings:r}=await M.getAllListings(s),l=Object.values(r);l.sort((c,m)=>{const f=e.indexOf(c.id),W=e.indexOf(m.id);return f-W}),L.recomendedWallets=l}else{const{chains:s,isAuth:r}=v.state,l=s==null?void 0:s.join(","),c=p.isArray(t),m={page:1,sdks:r?"auth_v1":void 0,entries:p.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=te?await M.getMobileListings(m):await M.getDesktopListings(m);L.recomendedWallets=Object.values(f)}return L.recomendedWallets},async getWallets(e){const t=Ie({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=N.state,{recomendedWallets:l}=L;if(r==="ALL")return L.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):p.isArray(s)&&(t.excludedIds=s.join(",")),p.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),v.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:f,total:W}=te?await M.getMobileListings(t):await M.getDesktopListings(t),o=Object.values(f),h=m?"search":"wallets";return L[h]={listings:[...L[h].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return M.getWalletImageUrl(e)},getAssetImageUrl(e){return M.getAssetImageUrl(e)},resetSearch(){L.search={listings:[],total:0,page:1}}},_=S({open:!1}),q={state:_,subscribe(e){return j(_,()=>e(_))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:r}=v.state;if(v.setWalletConnectUri(e==null?void 0:e.uri),v.setChains(e==null?void 0:e.chains),re.reset("ConnectWallet"),s&&r)_.open=!0,t();else{const l=setInterval(()=>{const c=v.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),_.open=!0,t())},200)}})},close(){_.open=!1}};var Ee=Object.defineProperty,se=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,oe=(e,t,s)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t)=>{for(var s in t||(t={}))Le.call(t,s)&&oe(e,s,t[s]);if(se)for(var s of se(t))Oe.call(t,s)&&oe(e,s,t[s]);return e};function Ae(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const T=S({themeMode:Ae()?"dark":"light"}),ne={state:T,subscribe(e){return j(T,()=>e(T))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(T.themeMode=t),s&&(T.themeVariables=We({},s))}},U=S({open:!1,message:"",variant:"success"}),je={state:U,subscribe(e){return j(U,()=>e(U))},openToast(e,t){U.open=!0,U.message=e,U.variant=t},closeToast(){U.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=ce.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}),window.global||(window.global=window));class Ce{constructor(t){this.openModal=q.open,this.closeModal=q.close,this.subscribeModal=q.subscribe,this.setTheme=ne.setThemeConfig,ne.setThemeConfig(t),N.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await le(()=>import("./index-3a237630.js"),["./index-3a237630.js","./index-da732aeb.js","./index-f4824932.css","./index-cc134824.js"],import.meta.url);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),v.setIsUiLoaded(!0)}}}const Pe=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Ce},Symbol.toStringTag,{value:"Module"}));export{we as $,N as C,Ue as G,re as N,q as Q,ne as X,je as Y,Pe as a,v as c,p as i}; diff --git a/assets/index.es-47158634.js b/assets/index.es-47158634.js deleted file mode 100644 index 984be60e..00000000 --- a/assets/index.es-47158634.js +++ /dev/null @@ -1,27 +0,0 @@ -import{g as _c,a as mm,r as vn,c as se,b as wm,w as ql,d as Bl,f as bc,t as yo,e as _m,h as jr,I as bi,A as bm,U as Em,i as Q,j as Im,k as hc,l as xm,_ as Sm,P as Pm,V as Dh,m as Am,D as Cm,C as Om,Z as Lh,$ as Rm,n as Tm,o as lo,q as Nm,p as Hl,s as $r,y as Dm,u as Lm,X as fn,v as Ft,x as rr,z as _i,B as hr,E as Fm,F as pn,G as kl,H as $m,J as Mm,K as jm,L as Kl,M as zm,N as Vl,Y as Gl,O as dn,Q as lc,R as so,S as yn,T as Um,W as oo,a0 as qm,a1 as Bm,a2 as Hm,a3 as km,a4 as Km,a5 as Ga,a6 as Fh,a7 as Vm,a8 as Gm,a9 as Wm,aa as $h,ab as Jm,ac as Ym,ad as Xm,ae as Zm,af as Qm,ag as e1,ah as t1,ai as ao,aj as Wl,ak as Wa,al as r1,am as i1}from"./index-d66ad66e.js";var Ec={exports:{}},gn=typeof Reflect=="object"?Reflect:null,Mh=gn&&typeof gn.apply=="function"?gn.apply:function(t,i,s){return Function.prototype.apply.call(t,i,s)},co;gn&&typeof gn.ownKeys=="function"?co=gn.ownKeys:Object.getOwnPropertySymbols?co=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:co=function(t){return Object.getOwnPropertyNames(t)};function n1(a){console&&console.warn&&console.warn(a)}var Jl=Number.isNaN||function(t){return t!==t};function He(){He.init.call(this)}Ec.exports=He;Ec.exports.once=c1;He.EventEmitter=He;He.prototype._events=void 0;He.prototype._eventsCount=0;He.prototype._maxListeners=void 0;var jh=10;function vo(a){if(typeof a!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof a)}Object.defineProperty(He,"defaultMaxListeners",{enumerable:!0,get:function(){return jh},set:function(a){if(typeof a!="number"||a<0||Jl(a))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+a+".");jh=a}});He.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};He.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Jl(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Yl(a){return a._maxListeners===void 0?He.defaultMaxListeners:a._maxListeners}He.prototype.getMaxListeners=function(){return Yl(this)};He.prototype.emit=function(t){for(var i=[],s=1;s0&&(p=i[0]),p instanceof Error)throw p;var g=new Error("Unhandled error."+(p?" ("+p.message+")":""));throw g.context=p,g}var _=h[t];if(_===void 0)return!1;if(typeof _=="function")Mh(_,this,i);else for(var m=_.length,x=tf(_,m),s=0;s0&&p.length>o&&!p.warned){p.warned=!0;var g=new Error("Possible EventEmitter memory leak detected. "+p.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");g.name="MaxListenersExceededWarning",g.emitter=a,g.type=t,g.count=p.length,n1(g)}return a}He.prototype.addListener=function(t,i){return Xl(this,t,i,!1)};He.prototype.on=He.prototype.addListener;He.prototype.prependListener=function(t,i){return Xl(this,t,i,!0)};function s1(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Zl(a,t,i){var s={fired:!1,wrapFn:void 0,target:a,type:t,listener:i},o=s1.bind(s);return o.listener=i,s.wrapFn=o,o}He.prototype.once=function(t,i){return vo(i),this.on(t,Zl(this,t,i)),this};He.prototype.prependOnceListener=function(t,i){return vo(i),this.prependListener(t,Zl(this,t,i)),this};He.prototype.removeListener=function(t,i){var s,o,h,p,g;if(vo(i),o=this._events,o===void 0)return this;if(s=o[t],s===void 0)return this;if(s===i||s.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete o[t],o.removeListener&&this.emit("removeListener",t,s.listener||i));else if(typeof s!="function"){for(h=-1,p=s.length-1;p>=0;p--)if(s[p]===i||s[p].listener===i){g=s[p].listener,h=p;break}if(h<0)return this;h===0?s.shift():o1(s,h),s.length===1&&(o[t]=s[0]),o.removeListener!==void 0&&this.emit("removeListener",t,g||i)}return this};He.prototype.off=He.prototype.removeListener;He.prototype.removeAllListeners=function(t){var i,s,o;if(s=this._events,s===void 0)return this;if(s.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):s[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete s[t]),this;if(arguments.length===0){var h=Object.keys(s),p;for(o=0;o=0;o--)this.removeListener(t,i[o]);return this};function Ql(a,t,i){var s=a._events;if(s===void 0)return[];var o=s[t];return o===void 0?[]:typeof o=="function"?i?[o.listener||o]:[o]:i?a1(o):tf(o,o.length)}He.prototype.listeners=function(t){return Ql(this,t,!0)};He.prototype.rawListeners=function(t){return Ql(this,t,!1)};He.listenerCount=function(a,t){return typeof a.listenerCount=="function"?a.listenerCount(t):ef.call(a,t)};He.prototype.listenerCount=ef;function ef(a){var t=this._events;if(t!==void 0){var i=t[a];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}He.prototype.eventNames=function(){return this._eventsCount>0?co(this._events):[]};function tf(a,t){for(var i=new Array(t),s=0;s{const a=new Map;return{name:b1,options:{},hasItem(t){return a.has(t)},getItem(t){return a.get(t)??null},getItemRaw(t){return a.get(t)??null},setItem(t,i){a.set(t,i)},setItemRaw(t,i){a.set(t,i)},removeItem(t){a.delete(t)},getKeys(){return Array.from(a.keys())},clear(){a.clear()},dispose(){a.clear()}}};function I1(a={}){const t={mounts:{"":a.driver||E1()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},i=m=>{for(const x of t.mountpoints)if(m.startsWith(x))return{base:x,relativeKey:m.slice(x.length),driver:t.mounts[x]};return{base:"",relativeKey:m,driver:t.mounts[""]}},s=(m,x)=>t.mountpoints.filter(O=>O.startsWith(m)||x&&m.startsWith(O)).map(O=>({relativeBase:m.length>O.length?m.slice(O.length):void 0,mountpoint:O,driver:t.mounts[O]})),o=(m,x)=>{if(t.watching){x=ur(x);for(const O of t.watchListeners)O(m,x)}},h=async()=>{if(!t.watching){t.watching=!0;for(const m in t.mounts)t.unwatch[m]=await zh(t.mounts[m],o,m)}},p=async()=>{if(t.watching){for(const m in t.unwatch)await t.unwatch[m]();t.unwatch={},t.watching=!1}},g=(m,x,O)=>{const L=new Map,z=R=>{let K=L.get(R.base);return K||(K={driver:R.driver,base:R.base,items:[]},L.set(R.base,K)),K};for(const R of m){const K=typeof R=="string",re=ur(K?R:R.key),he=K?void 0:R.value,le=K||!R.options?x:{...x,...R.options},fe=i(re);z(fe).items.push({key:re,value:he,relativeKey:fe.relativeKey,options:le})}return Promise.all([...L.values()].map(R=>O(R))).then(R=>R.flat())},_={hasItem(m,x={}){m=ur(m);const{relativeKey:O,driver:L}=i(m);return Bt(L.hasItem,O,x)},getItem(m,x={}){m=ur(m);const{relativeKey:O,driver:L}=i(m);return Bt(L.getItem,O,x).then(z=>eo(z))},getItems(m,x){return g(m,x,O=>O.driver.getItems?Bt(O.driver.getItems,O.items.map(L=>({key:L.relativeKey,options:L.options})),x).then(L=>L.map(z=>({key:_1(O.base,z.key),value:eo(z.value)}))):Promise.all(O.items.map(L=>Bt(O.driver.getItem,L.relativeKey,L.options).then(z=>({key:L.key,value:eo(z)})))))},getItemRaw(m,x={}){m=ur(m);const{relativeKey:O,driver:L}=i(m);return L.getItemRaw?Bt(L.getItemRaw,O,x):Bt(L.getItem,O,x).then(z=>w1(z))},async setItem(m,x,O={}){if(x===void 0)return _.removeItem(m);m=ur(m);const{relativeKey:L,driver:z}=i(m);z.setItem&&(await Bt(z.setItem,L,uo(x),O),z.watch||o("update",m))},async setItems(m,x){await g(m,x,async O=>{O.driver.setItems&&await Bt(O.driver.setItems,O.items.map(L=>({key:L.relativeKey,value:uo(L.value),options:L.options})),x),O.driver.setItem&&await Promise.all(O.items.map(L=>Bt(O.driver.setItem,L.relativeKey,uo(L.value),L.options)))})},async setItemRaw(m,x,O={}){if(x===void 0)return _.removeItem(m,O);m=ur(m);const{relativeKey:L,driver:z}=i(m);if(z.setItemRaw)await Bt(z.setItemRaw,L,x,O);else if(z.setItem)await Bt(z.setItem,L,m1(x),O);else return;z.watch||o("update",m)},async removeItem(m,x={}){typeof x=="boolean"&&(x={removeMeta:x}),m=ur(m);const{relativeKey:O,driver:L}=i(m);L.removeItem&&(await Bt(L.removeItem,O,x),(x.removeMeta||x.removeMata)&&await Bt(L.removeItem,O+"$",x),L.watch||o("remove",m))},async getMeta(m,x={}){typeof x=="boolean"&&(x={nativeOnly:x}),m=ur(m);const{relativeKey:O,driver:L}=i(m),z=Object.create(null);if(L.getMeta&&Object.assign(z,await Bt(L.getMeta,O,x)),!x.nativeOnly){const R=await Bt(L.getItem,O+"$",x).then(K=>eo(K));R&&typeof R=="object"&&(typeof R.atime=="string"&&(R.atime=new Date(R.atime)),typeof R.mtime=="string"&&(R.mtime=new Date(R.mtime)),Object.assign(z,R))}return z},setMeta(m,x,O={}){return this.setItem(m+"$",x,O)},removeMeta(m,x={}){return this.removeItem(m+"$",x)},async getKeys(m,x={}){m=to(m);const O=s(m,!0);let L=[];const z=[];for(const R of O){const re=(await Bt(R.driver.getKeys,R.relativeBase,x)).map(he=>R.mountpoint+ur(he)).filter(he=>!L.some(le=>he.startsWith(le)));z.push(...re),L=[R.mountpoint,...L.filter(he=>!he.startsWith(R.mountpoint))]}return m?z.filter(R=>R.startsWith(m)&&!R.endsWith("$")):z.filter(R=>!R.endsWith("$"))},async clear(m,x={}){m=to(m),await Promise.all(s(m,!1).map(async O=>{if(O.driver.clear)return Bt(O.driver.clear,O.relativeBase,x);if(O.driver.removeItem){const L=await O.driver.getKeys(O.relativeBase||"",x);return Promise.all(L.map(z=>O.driver.removeItem(z,x)))}}))},async dispose(){await Promise.all(Object.values(t.mounts).map(m=>Uh(m)))},async watch(m){return await h(),t.watchListeners.push(m),async()=>{t.watchListeners=t.watchListeners.filter(x=>x!==m),t.watchListeners.length===0&&await p()}},async unwatch(){t.watchListeners=[],await p()},mount(m,x){if(m=to(m),m&&t.mounts[m])throw new Error(`already mounted at ${m}`);return m&&(t.mountpoints.push(m),t.mountpoints.sort((O,L)=>L.length-O.length)),t.mounts[m]=x,t.watching&&Promise.resolve(zh(x,o,m)).then(O=>{t.unwatch[m]=O}).catch(console.error),_},async unmount(m,x=!0){m=to(m),!(!m||!t.mounts[m])&&(t.watching&&m in t.unwatch&&(t.unwatch[m](),delete t.unwatch[m]),x&&await Uh(t.mounts[m]),t.mountpoints=t.mountpoints.filter(O=>O!==m),delete t.mounts[m])},getMount(m=""){m=ur(m)+":";const x=i(m);return{driver:x.driver,base:x.base}},getMounts(m="",x={}){return m=ur(m),s(m,x.parents).map(L=>({driver:L.driver,base:L.mountpoint}))}};return _}function zh(a,t,i){return a.watch?a.watch((s,o)=>t(s,i+o)):()=>{}}async function Uh(a){typeof a.dispose=="function"&&await Bt(a.dispose)}function Bi(a){return new Promise((t,i)=>{a.oncomplete=a.onsuccess=()=>t(a.result),a.onabort=a.onerror=()=>i(a.error)})}function sf(a,t){const i=indexedDB.open(a);i.onupgradeneeded=()=>i.result.createObjectStore(t);const s=Bi(i);return(o,h)=>s.then(p=>h(p.transaction(t,o).objectStore(t)))}let Ja;function Gn(){return Ja||(Ja=sf("keyval-store","keyval")),Ja}function qh(a,t=Gn()){return t("readonly",i=>Bi(i.get(a)))}function x1(a,t,i=Gn()){return i("readwrite",s=>(s.put(t,a),Bi(s.transaction)))}function S1(a,t=Gn()){return t("readwrite",i=>(i.delete(a),Bi(i.transaction)))}function P1(a=Gn()){return a("readwrite",t=>(t.clear(),Bi(t.transaction)))}function A1(a,t){return a.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},Bi(a.transaction)}function C1(a=Gn()){return a("readonly",t=>{if(t.getAllKeys)return Bi(t.getAllKeys());const i=[];return A1(t,s=>i.push(s.key)).then(()=>i)})}const O1=a=>JSON.stringify(a,(t,i)=>typeof i=="bigint"?i.toString()+"n":i),R1=a=>{const t=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,i=a.replace(t,'$1"$2n"$3');return JSON.parse(i,(s,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function Wn(a){if(typeof a!="string")throw new Error(`Cannot safe json parse value of type ${typeof a}`);try{return R1(a)}catch{return a}}function qi(a){return typeof a=="string"?a:O1(a)||""}const T1="idb-keyval";var N1=(a={})=>{const t=a.base&&a.base.length>0?`${a.base}:`:"",i=o=>t+o;let s;return a.dbName&&a.storeName&&(s=sf(a.dbName,a.storeName)),{name:T1,options:a,async hasItem(o){return!(typeof await qh(i(o),s)>"u")},async getItem(o){return await qh(i(o),s)??null},setItem(o,h){return x1(i(o),h,s)},removeItem(o){return S1(i(o),s)},getKeys(){return C1(s)},clear(){return P1(s)}}};const D1="WALLET_CONNECT_V2_INDEXED_DB",L1="keyvaluestorage";let F1=class{constructor(){this.indexedDb=I1({driver:N1({dbName:D1,storeName:L1})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(t=>[t.key,t.value])}async getItem(t){const i=await this.indexedDb.getItem(t);if(i!==null)return i}async setItem(t,i){await this.indexedDb.setItem(t,qi(i))}async removeItem(t){await this.indexedDb.removeItem(t)}};var Ya=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ho={exports:{}};(function(){let a;function t(){}a=t,a.prototype.getItem=function(i){return this.hasOwnProperty(i)?String(this[i]):null},a.prototype.setItem=function(i,s){this[i]=String(s)},a.prototype.removeItem=function(i){delete this[i]},a.prototype.clear=function(){const i=this;Object.keys(i).forEach(function(s){i[s]=void 0,delete i[s]})},a.prototype.key=function(i){return i=i||0,Object.keys(this)[i]},a.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Ya<"u"&&Ya.localStorage?ho.exports=Ya.localStorage:typeof window<"u"&&window.localStorage?ho.exports=window.localStorage:ho.exports=new t})();function $1(a){var t;return[a[0],Wn((t=a[1])!=null?t:"")]}let M1=class{constructor(){this.localStorage=ho.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map($1)}async getItem(t){const i=this.localStorage.getItem(t);if(i!==null)return Wn(i)}async setItem(t,i){this.localStorage.setItem(t,qi(i))}async removeItem(t){this.localStorage.removeItem(t)}};const j1="wc_storage_version",Bh=1,z1=async(a,t,i)=>{const s=j1,o=await t.getItem(s);if(o&&o>=Bh){i(t);return}const h=await a.getKeys();if(!h.length){i(t);return}const p=[];for(;h.length;){const g=h.shift();if(!g)continue;const _=g.toLowerCase();if(_.includes("wc@")||_.includes("walletconnect")||_.includes("wc_")||_.includes("wallet_connect")){const m=await a.getItem(g);await t.setItem(g,m),p.push(g)}}await t.setItem(s,Bh),i(t),U1(a,p)},U1=async(a,t)=>{t.length&&t.forEach(async i=>{await a.removeItem(i)})};let q1=class{constructor(){this.initialized=!1,this.setInitialized=i=>{this.storage=i,this.initialized=!0};const t=new M1;this.storage=t;try{const i=new F1;z1(t,i,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(t){return await this.initialize(),this.storage.getItem(t)}async setItem(t,i){return await this.initialize(),this.storage.setItem(t,i)}async removeItem(t){return await this.initialize(),this.storage.removeItem(t)}async initialize(){this.initialized||await new Promise(t=>{const i=setInterval(()=>{this.initialized&&(clearInterval(i),t())},20)})}};var mn={},jn={},Xa={},zn={};let Hi=class{};const B1=Object.freeze(Object.defineProperty({__proto__:null,IEvents:Hi},Symbol.toStringTag,{value:"Module"})),H1=mm(B1);var Hh;function k1(){if(Hh)return zn;Hh=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.IHeartBeat=void 0;const a=H1;class t extends a.IEvents{constructor(s){super()}}return zn.IHeartBeat=t,zn}var kh;function of(){return kh||(kh=1,function(a){Object.defineProperty(a,"__esModule",{value:!0}),vn.__exportStar(k1(),a)}(Xa)),Xa}var Za={},zi={},Kh;function K1(){if(Kh)return zi;Kh=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.HEARTBEAT_EVENTS=zi.HEARTBEAT_INTERVAL=void 0;const a=se;return zi.HEARTBEAT_INTERVAL=a.FIVE_SECONDS,zi.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},zi}var Vh;function af(){return Vh||(Vh=1,function(a){Object.defineProperty(a,"__esModule",{value:!0}),vn.__exportStar(K1(),a)}(Za)),Za}var Gh;function V1(){if(Gh)return jn;Gh=1,Object.defineProperty(jn,"__esModule",{value:!0}),jn.HeartBeat=void 0;const a=vn,t=vr,i=se,s=of(),o=af();class h extends s.IHeartBeat{constructor(g){super(g),this.events=new t.EventEmitter,this.interval=o.HEARTBEAT_INTERVAL,this.interval=(g==null?void 0:g.interval)||o.HEARTBEAT_INTERVAL}static init(g){return a.__awaiter(this,void 0,void 0,function*(){const _=new h(g);return yield _.init(),_})}init(){return a.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(g,_){this.events.on(g,_)}once(g,_){this.events.once(g,_)}off(g,_){this.events.off(g,_)}removeListener(g,_){this.events.removeListener(g,_)}initialize(){return a.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),i.toMiliseconds(this.interval))})}pulse(){this.events.emit(o.HEARTBEAT_EVENTS.pulse)}}return jn.HeartBeat=h,jn}(function(a){Object.defineProperty(a,"__esModule",{value:!0});const t=vn;t.__exportStar(V1(),a),t.__exportStar(of(),a),t.__exportStar(af(),a)})(mn);var Re={},Qa,Wh;function G1(){if(Wh)return Qa;Wh=1;function a(i){try{return JSON.stringify(i)}catch{return'"[Circular]"'}}Qa=t;function t(i,s,o){var h=o&&o.stringify||a,p=1;if(typeof i=="object"&&i!==null){var g=s.length+p;if(g===1)return i;var _=new Array(g);_[0]=h(i);for(var m=1;m-1?z:0,i.charCodeAt(K+1)){case 100:case 102:if(L>=x||s[L]==null)break;z=x||s[L]==null)break;z=x||s[L]===void 0)break;z",z=K+2,K++;break}O+=h(s[L]),z=K+2,K++;break;case 115:if(L>=x)break;z-1&&(ue=!1);const Te=["error","fatal","warn","info","debug","trace"];typeof W=="function"&&(W.error=W.fatal=W.warn=W.info=W.debug=W.trace=W),F.enabled===!1&&(F.level="silent");const Ue=F.level||"info",v=Object.create(W);v.log||(v.log=re),Object.defineProperty(v,"levelVal",{get:X}),Object.defineProperty(v,"level",{get:ce,set:V});const I={transmit:q,serialize:ie,asObject:F.browser.asObject,levels:Te,timestamp:z(F)};v.levels=o.levels,v.level=Ue,v.setMaxListeners=v.getMaxListeners=v.emit=v.addListener=v.on=v.prependListener=v.once=v.prependOnceListener=v.removeListener=v.removeAllListeners=v.listeners=v.listenerCount=v.eventNames=v.write=v.flush=re,v.serializers=ve,v._serialize=ie,v._stdErrSerialize=ue,v.child=B,q&&(v._logEvent=O());function X(){return this.level==="silent"?1/0:this.levels.values[this.level]}function ce(){return this._level}function V(k){if(k!=="silent"&&!this.levels.values[k])throw Error("unknown level "+k);this._level=k,h(I,v,"error","log"),h(I,v,"fatal","error"),h(I,v,"warn","error"),h(I,v,"info","log"),h(I,v,"debug","log"),h(I,v,"trace","log")}function B(k,G){if(!k)throw new Error("missing bindings for child Pino");G=G||{},ie&&k.serializers&&(G.serializers=k.serializers);const Ye=G.serializers;if(ie&&Ye){var ke=Object.assign({},ve,Ye),zr=F.browser.serialize===!0?Object.keys(ke):ie;delete k.serializers,_([k],zr,ke,this._stdErrSerialize)}function Ie(St){this._childLevel=(St._childLevel|0)+1,this.error=m(St,k,"error"),this.fatal=m(St,k,"fatal"),this.warn=m(St,k,"warn"),this.info=m(St,k,"info"),this.debug=m(St,k,"debug"),this.trace=m(St,k,"trace"),ke&&(this.serializers=ke,this._serialize=zr),q&&(this._logEvent=O([].concat(St._logEvent.bindings,k)))}return Ie.prototype=this,new Ie(this)}return v}o.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},o.stdSerializers=i,o.stdTimeFunctions=Object.assign({},{nullTime:he,epochTime:le,unixTime:fe,isoTime:pe});function h(F,q,W,ve){const ie=Object.getPrototypeOf(q);q[W]=q.levelVal>q.levels.values[W]?re:ie[W]?ie[W]:t[W]||t[ve]||re,p(F,q,W)}function p(F,q,W){!F.transmit&&q[W]===re||(q[W]=function(ve){return function(){const ue=F.timestamp(),Te=new Array(arguments.length),Ue=Object.getPrototypeOf&&Object.getPrototypeOf(this)===t?t:this;for(var v=0;v-1&&ue in W&&(F[ie][ue]=W[ue](F[ie][ue]))}function m(F,q,W){return function(){const ve=new Array(1+arguments.length);ve[0]=q;for(var ie=1;ie"u"?m=i(g,_):m=g.bindings().context||"",m}tr.getLoggerContext=o;function h(g,_,m=a.PINO_CUSTOM_CONTEXT_KEY){const x=o(g,m);return x.trim()?`${x}/${_}`:_}tr.formatChildLoggerContext=h;function p(g,_,m=a.PINO_CUSTOM_CONTEXT_KEY){const x=h(g,_,m),O=g.child({context:x});return s(O,x,m)}return tr.generateChildLogger=p,tr}(function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.pino=void 0;const t=vn,i=t.__importDefault(W1());Object.defineProperty(a,"pino",{enumerable:!0,get:function(){return i.default}}),t.__exportStar(cf(),a),t.__exportStar(J1(),a)})(Re);class Y1 extends Hi{constructor(t){super(),this.opts=t,this.protocol="wc",this.version=2}}class X1 extends Hi{constructor(t,i){super(),this.core=t,this.logger=i,this.records=new Map}}class Z1{constructor(t,i){this.logger=t,this.core=i}}let Q1=class extends Hi{constructor(t,i){super(),this.relayer=t,this.logger=i}},ew=class extends Hi{constructor(t){super()}},tw=class{constructor(t,i,s,o){this.core=t,this.logger=i,this.name=s}};class rw extends Hi{constructor(t,i){super(),this.relayer=t,this.logger=i}}let iw=class extends Hi{constructor(t,i){super(),this.core=t,this.logger=i}},nw=class{constructor(t,i){this.projectId=t,this.logger=i}},sw=class{constructor(t){this.opts=t,this.protocol="wc",this.version=2}},ow=class{constructor(t){this.client=t}};var xc={},uf={};(function(a){Object.defineProperty(a,"__esModule",{value:!0});var t=wm,i=ql;a.DIGEST_LENGTH=64,a.BLOCK_SIZE=128;var s=function(){function g(){this.digestLength=a.DIGEST_LENGTH,this.blockSize=a.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return g.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},g.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},g.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._tempHi),i.wipe(this._tempLo),this.reset()},g.prototype.update=function(_,m){if(m===void 0&&(m=_.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var x=0;if(this._bytesHashed+=m,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=_[x++],m--;this._bufferLength===this.blockSize&&(h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(m>=this.blockSize&&(x=h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,_,x,m),m%=this.blockSize);m>0;)this._buffer[this._bufferLength++]=_[x++],m--;return this},g.prototype.finish=function(_){if(!this._finished){var m=this._bytesHashed,x=this._bufferLength,O=m/536870912|0,L=m<<3,z=m%128<112?128:256;this._buffer[x]=128;for(var R=x+1;R0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},g.prototype.restoreState=function(_){return this._stateHi.set(_.stateHi),this._stateLo.set(_.stateLo),this._bufferLength=_.bufferLength,_.buffer&&this._buffer.set(_.buffer),this._bytesHashed=_.bytesHashed,this._finished=!1,this},g.prototype.cleanSavedState=function(_){i.wipe(_.stateHi),i.wipe(_.stateLo),_.buffer&&i.wipe(_.buffer),_.bufferLength=0,_.bytesHashed=0},g}();a.SHA512=s;var o=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function h(g,_,m,x,O,L,z){for(var R=m[0],K=m[1],re=m[2],he=m[3],le=m[4],fe=m[5],pe=m[6],de=m[7],F=x[0],q=x[1],W=x[2],ve=x[3],ie=x[4],ue=x[5],Te=x[6],Ue=x[7],v,I,X,ce,V,B,k,G;z>=128;){for(var Ye=0;Ye<16;Ye++){var ke=8*Ye+L;g[Ye]=t.readUint32BE(O,ke),_[Ye]=t.readUint32BE(O,ke+4)}for(var Ye=0;Ye<80;Ye++){var zr=R,Ie=K,St=re,D=he,N=le,C=fe,u=pe,E=de,ee=F,ge=q,be=W,Ne=ve,Le=ie,Pe=ue,Pt=Te,wt=Ue;if(v=de,I=Ue,V=I&65535,B=I>>>16,k=v&65535,G=v>>>16,v=(le>>>14|ie<<32-14)^(le>>>18|ie<<32-18)^(ie>>>41-32|le<<32-(41-32)),I=(ie>>>14|le<<32-14)^(ie>>>18|le<<32-18)^(le>>>41-32|ie<<32-(41-32)),V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,v=le&fe^~le&pe,I=ie&ue^~ie&Te,V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,v=o[Ye*2],I=o[Ye*2+1],V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,v=g[Ye%16],I=_[Ye%16],V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,X=k&65535|G<<16,ce=V&65535|B<<16,v=X,I=ce,V=I&65535,B=I>>>16,k=v&65535,G=v>>>16,v=(R>>>28|F<<32-28)^(F>>>34-32|R<<32-(34-32))^(F>>>39-32|R<<32-(39-32)),I=(F>>>28|R<<32-28)^(R>>>34-32|F<<32-(34-32))^(R>>>39-32|F<<32-(39-32)),V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,v=R&K^R&re^K&re,I=F&q^F&W^q&W,V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,E=k&65535|G<<16,wt=V&65535|B<<16,v=D,I=Ne,V=I&65535,B=I>>>16,k=v&65535,G=v>>>16,v=X,I=ce,V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,D=k&65535|G<<16,Ne=V&65535|B<<16,K=zr,re=Ie,he=St,le=D,fe=N,pe=C,de=u,R=E,q=ee,W=ge,ve=be,ie=Ne,ue=Le,Te=Pe,Ue=Pt,F=wt,Ye%16===15)for(var ke=0;ke<16;ke++)v=g[ke],I=_[ke],V=I&65535,B=I>>>16,k=v&65535,G=v>>>16,v=g[(ke+9)%16],I=_[(ke+9)%16],V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,X=g[(ke+1)%16],ce=_[(ke+1)%16],v=(X>>>1|ce<<32-1)^(X>>>8|ce<<32-8)^X>>>7,I=(ce>>>1|X<<32-1)^(ce>>>8|X<<32-8)^(ce>>>7|X<<32-7),V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,X=g[(ke+14)%16],ce=_[(ke+14)%16],v=(X>>>19|ce<<32-19)^(ce>>>61-32|X<<32-(61-32))^X>>>6,I=(ce>>>19|X<<32-19)^(X>>>61-32|ce<<32-(61-32))^(ce>>>6|X<<32-6),V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,g[ke]=k&65535|G<<16,_[ke]=V&65535|B<<16}v=R,I=F,V=I&65535,B=I>>>16,k=v&65535,G=v>>>16,v=m[0],I=x[0],V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[0]=R=k&65535|G<<16,x[0]=F=V&65535|B<<16,v=K,I=q,V=I&65535,B=I>>>16,k=v&65535,G=v>>>16,v=m[1],I=x[1],V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[1]=K=k&65535|G<<16,x[1]=q=V&65535|B<<16,v=re,I=W,V=I&65535,B=I>>>16,k=v&65535,G=v>>>16,v=m[2],I=x[2],V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[2]=re=k&65535|G<<16,x[2]=W=V&65535|B<<16,v=he,I=ve,V=I&65535,B=I>>>16,k=v&65535,G=v>>>16,v=m[3],I=x[3],V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[3]=he=k&65535|G<<16,x[3]=ve=V&65535|B<<16,v=le,I=ie,V=I&65535,B=I>>>16,k=v&65535,G=v>>>16,v=m[4],I=x[4],V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[4]=le=k&65535|G<<16,x[4]=ie=V&65535|B<<16,v=fe,I=ue,V=I&65535,B=I>>>16,k=v&65535,G=v>>>16,v=m[5],I=x[5],V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[5]=fe=k&65535|G<<16,x[5]=ue=V&65535|B<<16,v=pe,I=Te,V=I&65535,B=I>>>16,k=v&65535,G=v>>>16,v=m[6],I=x[6],V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[6]=pe=k&65535|G<<16,x[6]=Te=V&65535|B<<16,v=de,I=Ue,V=I&65535,B=I>>>16,k=v&65535,G=v>>>16,v=m[7],I=x[7],V+=I&65535,B+=I>>>16,k+=v&65535,G+=v>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[7]=de=k&65535|G<<16,x[7]=Ue=V&65535|B<<16,L+=128,z-=128}return L}function p(g){var _=new s;_.update(g);var m=_.digest();return _.clean(),m}a.hash=p})(uf);(function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.convertSecretKeyToX25519=a.convertPublicKeyToX25519=a.verify=a.sign=a.extractPublicKeyFromSecretKey=a.generateKeyPair=a.generateKeyPairFromSeed=a.SEED_LENGTH=a.SECRET_KEY_LENGTH=a.PUBLIC_KEY_LENGTH=a.SIGNATURE_LENGTH=void 0;const t=Bl,i=uf,s=ql;a.SIGNATURE_LENGTH=64,a.PUBLIC_KEY_LENGTH=32,a.SECRET_KEY_LENGTH=64,a.SEED_LENGTH=32;function o(D){const N=new Float64Array(16);if(D)for(let C=0;C>16&1),C[ge-1]&=65535;C[15]=u[15]-32767-(C[14]>>16&1);const ee=C[15]>>16&1;C[14]&=65535,K(u,C,1-ee)}for(let E=0;E<16;E++)D[2*E]=u[E]&255,D[2*E+1]=u[E]>>8}function he(D,N){let C=0;for(let u=0;u<32;u++)C|=D[u]^N[u];return(1&C-1>>>8)-1}function le(D,N){const C=new Uint8Array(32),u=new Uint8Array(32);return re(C,D),re(u,N),he(C,u)}function fe(D){const N=new Uint8Array(32);return re(N,D),N[0]&1}function pe(D,N){for(let C=0;C<16;C++)D[C]=N[2*C]+(N[2*C+1]<<8);D[15]&=32767}function de(D,N,C){for(let u=0;u<16;u++)D[u]=N[u]+C[u]}function F(D,N,C){for(let u=0;u<16;u++)D[u]=N[u]-C[u]}function q(D,N,C){let u,E,ee=0,ge=0,be=0,Ne=0,Le=0,Pe=0,Pt=0,wt=0,ot=0,$e=0,Ze=0,Qe=0,at=0,qe=0,et=0,De=0,Ke=0,ht=0,je=0,At=0,$t=0,Ht=0,kt=0,zt=0,Jt=0,ir=0,Ur=0,Yt=0,Wr=0,ui=0,Si=0,lt=C[0],it=C[1],ft=C[2],pt=C[3],ct=C[4],nt=C[5],Ct=C[6],Ot=C[7],dt=C[8],Rt=C[9],gt=C[10],_t=C[11],yt=C[12],Xe=C[13],Tt=C[14],Nt=C[15];u=N[0],ee+=u*lt,ge+=u*it,be+=u*ft,Ne+=u*pt,Le+=u*ct,Pe+=u*nt,Pt+=u*Ct,wt+=u*Ot,ot+=u*dt,$e+=u*Rt,Ze+=u*gt,Qe+=u*_t,at+=u*yt,qe+=u*Xe,et+=u*Tt,De+=u*Nt,u=N[1],ge+=u*lt,be+=u*it,Ne+=u*ft,Le+=u*pt,Pe+=u*ct,Pt+=u*nt,wt+=u*Ct,ot+=u*Ot,$e+=u*dt,Ze+=u*Rt,Qe+=u*gt,at+=u*_t,qe+=u*yt,et+=u*Xe,De+=u*Tt,Ke+=u*Nt,u=N[2],be+=u*lt,Ne+=u*it,Le+=u*ft,Pe+=u*pt,Pt+=u*ct,wt+=u*nt,ot+=u*Ct,$e+=u*Ot,Ze+=u*dt,Qe+=u*Rt,at+=u*gt,qe+=u*_t,et+=u*yt,De+=u*Xe,Ke+=u*Tt,ht+=u*Nt,u=N[3],Ne+=u*lt,Le+=u*it,Pe+=u*ft,Pt+=u*pt,wt+=u*ct,ot+=u*nt,$e+=u*Ct,Ze+=u*Ot,Qe+=u*dt,at+=u*Rt,qe+=u*gt,et+=u*_t,De+=u*yt,Ke+=u*Xe,ht+=u*Tt,je+=u*Nt,u=N[4],Le+=u*lt,Pe+=u*it,Pt+=u*ft,wt+=u*pt,ot+=u*ct,$e+=u*nt,Ze+=u*Ct,Qe+=u*Ot,at+=u*dt,qe+=u*Rt,et+=u*gt,De+=u*_t,Ke+=u*yt,ht+=u*Xe,je+=u*Tt,At+=u*Nt,u=N[5],Pe+=u*lt,Pt+=u*it,wt+=u*ft,ot+=u*pt,$e+=u*ct,Ze+=u*nt,Qe+=u*Ct,at+=u*Ot,qe+=u*dt,et+=u*Rt,De+=u*gt,Ke+=u*_t,ht+=u*yt,je+=u*Xe,At+=u*Tt,$t+=u*Nt,u=N[6],Pt+=u*lt,wt+=u*it,ot+=u*ft,$e+=u*pt,Ze+=u*ct,Qe+=u*nt,at+=u*Ct,qe+=u*Ot,et+=u*dt,De+=u*Rt,Ke+=u*gt,ht+=u*_t,je+=u*yt,At+=u*Xe,$t+=u*Tt,Ht+=u*Nt,u=N[7],wt+=u*lt,ot+=u*it,$e+=u*ft,Ze+=u*pt,Qe+=u*ct,at+=u*nt,qe+=u*Ct,et+=u*Ot,De+=u*dt,Ke+=u*Rt,ht+=u*gt,je+=u*_t,At+=u*yt,$t+=u*Xe,Ht+=u*Tt,kt+=u*Nt,u=N[8],ot+=u*lt,$e+=u*it,Ze+=u*ft,Qe+=u*pt,at+=u*ct,qe+=u*nt,et+=u*Ct,De+=u*Ot,Ke+=u*dt,ht+=u*Rt,je+=u*gt,At+=u*_t,$t+=u*yt,Ht+=u*Xe,kt+=u*Tt,zt+=u*Nt,u=N[9],$e+=u*lt,Ze+=u*it,Qe+=u*ft,at+=u*pt,qe+=u*ct,et+=u*nt,De+=u*Ct,Ke+=u*Ot,ht+=u*dt,je+=u*Rt,At+=u*gt,$t+=u*_t,Ht+=u*yt,kt+=u*Xe,zt+=u*Tt,Jt+=u*Nt,u=N[10],Ze+=u*lt,Qe+=u*it,at+=u*ft,qe+=u*pt,et+=u*ct,De+=u*nt,Ke+=u*Ct,ht+=u*Ot,je+=u*dt,At+=u*Rt,$t+=u*gt,Ht+=u*_t,kt+=u*yt,zt+=u*Xe,Jt+=u*Tt,ir+=u*Nt,u=N[11],Qe+=u*lt,at+=u*it,qe+=u*ft,et+=u*pt,De+=u*ct,Ke+=u*nt,ht+=u*Ct,je+=u*Ot,At+=u*dt,$t+=u*Rt,Ht+=u*gt,kt+=u*_t,zt+=u*yt,Jt+=u*Xe,ir+=u*Tt,Ur+=u*Nt,u=N[12],at+=u*lt,qe+=u*it,et+=u*ft,De+=u*pt,Ke+=u*ct,ht+=u*nt,je+=u*Ct,At+=u*Ot,$t+=u*dt,Ht+=u*Rt,kt+=u*gt,zt+=u*_t,Jt+=u*yt,ir+=u*Xe,Ur+=u*Tt,Yt+=u*Nt,u=N[13],qe+=u*lt,et+=u*it,De+=u*ft,Ke+=u*pt,ht+=u*ct,je+=u*nt,At+=u*Ct,$t+=u*Ot,Ht+=u*dt,kt+=u*Rt,zt+=u*gt,Jt+=u*_t,ir+=u*yt,Ur+=u*Xe,Yt+=u*Tt,Wr+=u*Nt,u=N[14],et+=u*lt,De+=u*it,Ke+=u*ft,ht+=u*pt,je+=u*ct,At+=u*nt,$t+=u*Ct,Ht+=u*Ot,kt+=u*dt,zt+=u*Rt,Jt+=u*gt,ir+=u*_t,Ur+=u*yt,Yt+=u*Xe,Wr+=u*Tt,ui+=u*Nt,u=N[15],De+=u*lt,Ke+=u*it,ht+=u*ft,je+=u*pt,At+=u*ct,$t+=u*nt,Ht+=u*Ct,kt+=u*Ot,zt+=u*dt,Jt+=u*Rt,ir+=u*gt,Ur+=u*_t,Yt+=u*yt,Wr+=u*Xe,ui+=u*Tt,Si+=u*Nt,ee+=38*Ke,ge+=38*ht,be+=38*je,Ne+=38*At,Le+=38*$t,Pe+=38*Ht,Pt+=38*kt,wt+=38*zt,ot+=38*Jt,$e+=38*ir,Ze+=38*Ur,Qe+=38*Yt,at+=38*Wr,qe+=38*ui,et+=38*Si,E=1,u=ee+E+65535,E=Math.floor(u/65536),ee=u-E*65536,u=ge+E+65535,E=Math.floor(u/65536),ge=u-E*65536,u=be+E+65535,E=Math.floor(u/65536),be=u-E*65536,u=Ne+E+65535,E=Math.floor(u/65536),Ne=u-E*65536,u=Le+E+65535,E=Math.floor(u/65536),Le=u-E*65536,u=Pe+E+65535,E=Math.floor(u/65536),Pe=u-E*65536,u=Pt+E+65535,E=Math.floor(u/65536),Pt=u-E*65536,u=wt+E+65535,E=Math.floor(u/65536),wt=u-E*65536,u=ot+E+65535,E=Math.floor(u/65536),ot=u-E*65536,u=$e+E+65535,E=Math.floor(u/65536),$e=u-E*65536,u=Ze+E+65535,E=Math.floor(u/65536),Ze=u-E*65536,u=Qe+E+65535,E=Math.floor(u/65536),Qe=u-E*65536,u=at+E+65535,E=Math.floor(u/65536),at=u-E*65536,u=qe+E+65535,E=Math.floor(u/65536),qe=u-E*65536,u=et+E+65535,E=Math.floor(u/65536),et=u-E*65536,u=De+E+65535,E=Math.floor(u/65536),De=u-E*65536,ee+=E-1+37*(E-1),E=1,u=ee+E+65535,E=Math.floor(u/65536),ee=u-E*65536,u=ge+E+65535,E=Math.floor(u/65536),ge=u-E*65536,u=be+E+65535,E=Math.floor(u/65536),be=u-E*65536,u=Ne+E+65535,E=Math.floor(u/65536),Ne=u-E*65536,u=Le+E+65535,E=Math.floor(u/65536),Le=u-E*65536,u=Pe+E+65535,E=Math.floor(u/65536),Pe=u-E*65536,u=Pt+E+65535,E=Math.floor(u/65536),Pt=u-E*65536,u=wt+E+65535,E=Math.floor(u/65536),wt=u-E*65536,u=ot+E+65535,E=Math.floor(u/65536),ot=u-E*65536,u=$e+E+65535,E=Math.floor(u/65536),$e=u-E*65536,u=Ze+E+65535,E=Math.floor(u/65536),Ze=u-E*65536,u=Qe+E+65535,E=Math.floor(u/65536),Qe=u-E*65536,u=at+E+65535,E=Math.floor(u/65536),at=u-E*65536,u=qe+E+65535,E=Math.floor(u/65536),qe=u-E*65536,u=et+E+65535,E=Math.floor(u/65536),et=u-E*65536,u=De+E+65535,E=Math.floor(u/65536),De=u-E*65536,ee+=E-1+37*(E-1),D[0]=ee,D[1]=ge,D[2]=be,D[3]=Ne,D[4]=Le,D[5]=Pe,D[6]=Pt,D[7]=wt,D[8]=ot,D[9]=$e,D[10]=Ze,D[11]=Qe,D[12]=at,D[13]=qe,D[14]=et,D[15]=De}function W(D,N){q(D,N,N)}function ve(D,N){const C=o();let u;for(u=0;u<16;u++)C[u]=N[u];for(u=253;u>=0;u--)W(C,C),u!==2&&u!==4&&q(C,C,N);for(u=0;u<16;u++)D[u]=C[u]}function ie(D,N){const C=o();let u;for(u=0;u<16;u++)C[u]=N[u];for(u=250;u>=0;u--)W(C,C),u!==1&&q(C,C,N);for(u=0;u<16;u++)D[u]=C[u]}function ue(D,N){const C=o(),u=o(),E=o(),ee=o(),ge=o(),be=o(),Ne=o(),Le=o(),Pe=o();F(C,D[1],D[0]),F(Pe,N[1],N[0]),q(C,C,Pe),de(u,D[0],D[1]),de(Pe,N[0],N[1]),q(u,u,Pe),q(E,D[3],N[3]),q(E,E,m),q(ee,D[2],N[2]),de(ee,ee,ee),F(ge,u,C),F(be,ee,E),de(Ne,ee,E),de(Le,u,C),q(D[0],ge,be),q(D[1],Le,Ne),q(D[2],Ne,be),q(D[3],ge,Le)}function Te(D,N,C){for(let u=0;u<4;u++)K(D[u],N[u],C)}function Ue(D,N){const C=o(),u=o(),E=o();ve(E,N[2]),q(C,N[0],E),q(u,N[1],E),re(D,u),D[31]^=fe(C)<<7}function v(D,N,C){z(D[0],p),z(D[1],g),z(D[2],g),z(D[3],p);for(let u=255;u>=0;--u){const E=C[u/8|0]>>(u&7)&1;Te(D,N,E),ue(N,D),ue(D,D),Te(D,N,E)}}function I(D,N){const C=[o(),o(),o(),o()];z(C[0],x),z(C[1],O),z(C[2],g),q(C[3],x,O),v(D,C,N)}function X(D){if(D.length!==a.SEED_LENGTH)throw new Error(`ed25519: seed must be ${a.SEED_LENGTH} bytes`);const N=(0,i.hash)(D);N[0]&=248,N[31]&=127,N[31]|=64;const C=new Uint8Array(32),u=[o(),o(),o(),o()];I(u,N),Ue(C,u);const E=new Uint8Array(64);return E.set(D),E.set(C,32),{publicKey:C,secretKey:E}}a.generateKeyPairFromSeed=X;function ce(D){const N=(0,t.randomBytes)(32,D),C=X(N);return(0,s.wipe)(N),C}a.generateKeyPair=ce;function V(D){if(D.length!==a.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${a.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(D.subarray(32))}a.extractPublicKeyFromSecretKey=V;const B=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function k(D,N){let C,u,E,ee;for(u=63;u>=32;--u){for(C=0,E=u-32,ee=u-12;E>4)*B[E],C=N[E]>>8,N[E]&=255;for(E=0;E<32;E++)N[E]-=C*B[E];for(u=0;u<32;u++)N[u+1]+=N[u]>>8,D[u]=N[u]&255}function G(D){const N=new Float64Array(64);for(let C=0;C<64;C++)N[C]=D[C];for(let C=0;C<64;C++)D[C]=0;k(D,N)}function Ye(D,N){const C=new Float64Array(64),u=[o(),o(),o(),o()],E=(0,i.hash)(D.subarray(0,32));E[0]&=248,E[31]&=127,E[31]|=64;const ee=new Uint8Array(64);ee.set(E.subarray(32),32);const ge=new i.SHA512;ge.update(ee.subarray(32)),ge.update(N);const be=ge.digest();ge.clean(),G(be),I(u,be),Ue(ee,u),ge.reset(),ge.update(ee.subarray(0,32)),ge.update(D.subarray(32)),ge.update(N);const Ne=ge.digest();G(Ne);for(let Le=0;Le<32;Le++)C[Le]=be[Le];for(let Le=0;Le<32;Le++)for(let Pe=0;Pe<32;Pe++)C[Le+Pe]+=Ne[Le]*E[Pe];return k(ee.subarray(32),C),ee}a.sign=Ye;function ke(D,N){const C=o(),u=o(),E=o(),ee=o(),ge=o(),be=o(),Ne=o();return z(D[2],g),pe(D[1],N),W(E,D[1]),q(ee,E,_),F(E,E,D[2]),de(ee,D[2],ee),W(ge,ee),W(be,ge),q(Ne,be,ge),q(C,Ne,E),q(C,C,ee),ie(C,C),q(C,C,E),q(C,C,ee),q(C,C,ee),q(D[0],C,ee),W(u,D[0]),q(u,u,ee),le(u,E)&&q(D[0],D[0],L),W(u,D[0]),q(u,u,ee),le(u,E)?-1:(fe(D[0])===N[31]>>7&&F(D[0],p,D[0]),q(D[3],D[0],D[1]),0)}function zr(D,N,C){const u=new Uint8Array(32),E=[o(),o(),o(),o()],ee=[o(),o(),o(),o()];if(C.length!==a.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${a.SIGNATURE_LENGTH} bytes`);if(ke(ee,D))return!1;const ge=new i.SHA512;ge.update(C.subarray(0,32)),ge.update(D),ge.update(N);const be=ge.digest();return G(be),v(E,ee,be),I(ee,C.subarray(32)),ue(E,ee),Ue(u,E),!he(C,u)}a.verify=zr;function Ie(D){let N=[o(),o(),o(),o()];if(ke(N,D))throw new Error("Ed25519: invalid public key");let C=o(),u=o(),E=N[1];de(C,g,E),F(u,g,E),ve(u,u),q(C,C,u);let ee=new Uint8Array(32);return re(ee,C),ee}a.convertPublicKeyToX25519=Ie;function St(D){const N=(0,i.hash)(D.subarray(0,32));N[0]&=248,N[31]&=127,N[31]|=64;const C=new Uint8Array(N.subarray(0,32));return(0,s.wipe)(N),C}a.convertSecretKeyToX25519=St})(xc);const aw="EdDSA",cw="JWT",hf=".",lf="base64url",uw="utf8",hw="utf8",lw=":",fw="did",pw="key",Zh="base58btc",dw="z",gw="K36",yw=32;function fo(a){return yo(bc(qi(a),uw),lf)}function ff(a){const t=bc(gw,Zh),i=dw+yo(_m([t,a]),Zh);return[fw,pw,i].join(lw)}function vw(a){return yo(a,lf)}function mw(a){return bc([fo(a.header),fo(a.payload)].join(hf),hw)}function ww(a){return[fo(a.header),fo(a.payload),vw(a.signature)].join(hf)}function Qh(a=Bl.randomBytes(yw)){return xc.generateKeyPairFromSeed(a)}async function _w(a,t,i,s,o=se.fromMiliseconds(Date.now())){const h={alg:aw,typ:cw},p=ff(s.publicKey),g=o+i,_={iss:p,sub:a,aud:t,iat:o,exp:g},m=mw({header:h,payload:_}),x=xc.sign(s.secretKey,m);return ww({header:h,payload:_,signature:x})}const bw="PARSE_ERROR",Ew="INVALID_REQUEST",Iw="METHOD_NOT_FOUND",xw="INVALID_PARAMS",pf="INTERNAL_ERROR",Sc="SERVER_ERROR",Sw=[-32700,-32600,-32601,-32602,-32603],Vn={[bw]:{code:-32700,message:"Parse error"},[Ew]:{code:-32600,message:"Invalid Request"},[Iw]:{code:-32601,message:"Method not found"},[xw]:{code:-32602,message:"Invalid params"},[pf]:{code:-32603,message:"Internal error"},[Sc]:{code:-32e3,message:"Server error"}},df=Sc;function Pw(a){return Sw.includes(a)}function el(a){return Object.keys(Vn).includes(a)?Vn[a]:Vn[df]}function Aw(a){const t=Object.values(Vn).find(i=>i.code===a);return t||Vn[df]}function gf(a,t,i){return a.message.includes("getaddrinfo ENOTFOUND")||a.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${i} RPC url at ${t}`):a}var yf={},oi={},tl;function Cw(){if(tl)return oi;tl=1,Object.defineProperty(oi,"__esModule",{value:!0}),oi.isBrowserCryptoAvailable=oi.getSubtleCrypto=oi.getBrowerCrypto=void 0;function a(){return(jr===null||jr===void 0?void 0:jr.crypto)||(jr===null||jr===void 0?void 0:jr.msCrypto)||{}}oi.getBrowerCrypto=a;function t(){const s=a();return s.subtle||s.webkitSubtle}oi.getSubtleCrypto=t;function i(){return!!a()&&!!t()}return oi.isBrowserCryptoAvailable=i,oi}var ai={},rl;function Ow(){if(rl)return ai;rl=1,Object.defineProperty(ai,"__esModule",{value:!0}),ai.isBrowser=ai.isNode=ai.isReactNative=void 0;function a(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}ai.isReactNative=a;function t(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}ai.isNode=t;function i(){return!a()&&!t()}return ai.isBrowser=i,ai}(function(a){Object.defineProperty(a,"__esModule",{value:!0});const t=vn;t.__exportStar(Cw(),a),t.__exportStar(Ow(),a)})(yf);function vf(a=3){const t=Date.now()*Math.pow(10,a),i=Math.floor(Math.random()*Math.pow(10,a));return t+i}function Pc(a=6){return BigInt(vf(a))}function mo(a,t,i){return{id:i||vf(),jsonrpc:"2.0",method:a,params:t}}function Ac(a,t){return{id:a,jsonrpc:"2.0",result:t}}function wo(a,t,i){return{id:a,jsonrpc:"2.0",error:Rw(t,i)}}function Rw(a,t){return typeof a>"u"?el(pf):(typeof a=="string"&&(a=Object.assign(Object.assign({},el(Sc)),{message:a})),typeof t<"u"&&(a.data=t),Pw(a.code)&&(a=Aw(a.code)),a)}class Tw{}class Nw extends Tw{constructor(){super()}}class Dw extends Nw{constructor(t){super()}}const Lw="^https?:",Fw="^wss?:";function $w(a){const t=a.match(new RegExp(/^\w+:/,"gi"));if(!(!t||!t.length))return t[0]}function mf(a,t){const i=$w(a);return typeof i>"u"?!1:new RegExp(t).test(i)}function il(a){return mf(a,Lw)}function nl(a){return mf(a,Fw)}function Mw(a){return new RegExp("wss?://localhost(:d{2,5})?").test(a)}function wf(a){return typeof a=="object"&&"id"in a&&"jsonrpc"in a&&a.jsonrpc==="2.0"}function Cc(a){return wf(a)&&"method"in a}function _o(a){return wf(a)&&(ci(a)||Mr(a))}function ci(a){return"result"in a}function Mr(a){return"error"in a}class Ii extends Dw{constructor(t){super(t),this.events=new vr.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(t),this.connection.connected&&this.registerEventListeners()}async connect(t=this.connection){await this.open(t)}async disconnect(){await this.close()}on(t,i){this.events.on(t,i)}once(t,i){this.events.once(t,i)}off(t,i){this.events.off(t,i)}removeListener(t,i){this.events.removeListener(t,i)}async request(t,i){return this.requestStrict(mo(t.method,t.params||[],t.id||Pc().toString()),i)}async requestStrict(t,i){return new Promise(async(s,o)=>{if(!this.connection.connected)try{await this.open()}catch(h){o(h)}this.events.on(`${t.id}`,h=>{Mr(h)?o(h.error):s(h.result)});try{await this.connection.send(t,i)}catch(h){o(h)}})}setConnection(t=this.connection){return t}onPayload(t){this.events.emit("payload",t),_o(t)?this.events.emit(`${t.id}`,t):this.events.emit("message",{type:t.method,data:t.params})}onClose(t){t&&t.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${t.code} ${t.reason?`(${t.reason})`:""}`)),this.events.emit("disconnect")}async open(t=this.connection){this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),typeof t=="string"&&(await this.connection.open(t),t=this.connection),this.connection=this.setConnection(t),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",t=>this.onPayload(t)),this.connection.on("close",t=>this.onClose(t)),this.connection.on("error",t=>this.events.emit("error",t)),this.connection.on("register_error",t=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const jw=()=>typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:require("ws"),zw=()=>typeof window<"u",sl=a=>a.split("?")[0],ol=10,Uw=jw();class qw{constructor(t){if(this.url=t,this.events=new vr.EventEmitter,this.registering=!1,!nl(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);this.url=t}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(t,i){this.events.on(t,i)}once(t,i){this.events.once(t,i)}off(t,i){this.events.off(t,i)}removeListener(t,i){this.events.removeListener(t,i)}async open(t=this.url){await this.register(t)}async close(){return new Promise((t,i)=>{if(typeof this.socket>"u"){i(new Error("Connection already closed"));return}this.socket.onclose=s=>{this.onClose(s),t()},this.socket.close()})}async send(t,i){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(qi(t))}catch(s){this.onError(t.id,s)}}register(t=this.url){if(!nl(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);if(this.registering){const i=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=i||this.events.listenerCount("open")>=i)&&this.events.setMaxListeners(i+1),new Promise((s,o)=>{this.events.once("register_error",h=>{this.resetMaxListeners(),o(h)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return o(new Error("WebSocket connection is missing or invalid"));s(this.socket)})})}return this.url=t,this.registering=!0,new Promise((i,s)=>{const o=yf.isReactNative()?void 0:{rejectUnauthorized:!Mw(t)},h=new Uw(t,[],o);zw()?h.onerror=p=>{const g=p;s(this.emitError(g.error))}:h.on("error",p=>{s(this.emitError(p))}),h.onopen=()=>{this.onOpen(h),i(h)}})}onOpen(t){t.onmessage=i=>this.onPayload(i),t.onclose=i=>this.onClose(i),this.socket=t,this.registering=!1,this.events.emit("open")}onClose(t){this.socket=void 0,this.registering=!1,this.events.emit("close",t)}onPayload(t){if(typeof t.data>"u")return;const i=typeof t.data=="string"?Wn(t.data):t.data;this.events.emit("payload",i)}onError(t,i){const s=this.parseError(i),o=s.message||s.toString(),h=wo(t,o);this.events.emit("payload",h)}parseError(t,i=this.url){return gf(t,sl(i),"WS")}resetMaxListeners(){this.events.getMaxListeners()>ol&&this.events.setMaxListeners(ol)}emitError(t){const i=this.parseError(new Error((t==null?void 0:t.message)||`WebSocket connection failed for host: ${sl(this.url)}`));return this.events.emit("register_error",i),i}}var po={exports:{}};po.exports;(function(a,t){var i=200,s="__lodash_hash_undefined__",o=1,h=2,p=9007199254740991,g="[object Arguments]",_="[object Array]",m="[object AsyncFunction]",x="[object Boolean]",O="[object Date]",L="[object Error]",z="[object Function]",R="[object GeneratorFunction]",K="[object Map]",re="[object Number]",he="[object Null]",le="[object Object]",fe="[object Promise]",pe="[object Proxy]",de="[object RegExp]",F="[object Set]",q="[object String]",W="[object Symbol]",ve="[object Undefined]",ie="[object WeakMap]",ue="[object ArrayBuffer]",Te="[object DataView]",Ue="[object Float32Array]",v="[object Float64Array]",I="[object Int8Array]",X="[object Int16Array]",ce="[object Int32Array]",V="[object Uint8Array]",B="[object Uint8ClampedArray]",k="[object Uint16Array]",G="[object Uint32Array]",Ye=/[\\^$.*+?()[\]{}|]/g,ke=/^\[object .+?Constructor\]$/,zr=/^(?:0|[1-9]\d*)$/,Ie={};Ie[Ue]=Ie[v]=Ie[I]=Ie[X]=Ie[ce]=Ie[V]=Ie[B]=Ie[k]=Ie[G]=!0,Ie[g]=Ie[_]=Ie[ue]=Ie[x]=Ie[Te]=Ie[O]=Ie[L]=Ie[z]=Ie[K]=Ie[re]=Ie[le]=Ie[de]=Ie[F]=Ie[q]=Ie[ie]=!1;var St=typeof jr=="object"&&jr&&jr.Object===Object&&jr,D=typeof self=="object"&&self&&self.Object===Object&&self,N=St||D||Function("return this")(),C=t&&!t.nodeType&&t,u=C&&!0&&a&&!a.nodeType&&a,E=u&&u.exports===C,ee=E&&St.process,ge=function(){try{return ee&&ee.binding&&ee.binding("util")}catch{}}(),be=ge&&ge.isTypedArray;function Ne(y,S){for(var U=-1,Y=y==null?0:y.length,Ge=0,me=[];++U-1}function Ro(y,S){var U=this.__data__,Y=Pi(U,y);return Y<0?(++this.size,U.push([y,S])):U[Y][1]=S,this}mr.prototype.clear=Po,mr.prototype.delete=Ao,mr.prototype.get=Co,mr.prototype.has=Oo,mr.prototype.set=Ro;function Jr(y){var S=-1,U=y==null?0:y.length;for(this.clear();++SDt))return!1;var We=me.get(y);if(We&&me.get(S))return We==S;var bt=-1,nr=!0,Lt=U&h?new Gi:void 0;for(me.set(y,S),me.set(S,y);++bt-1&&y%1==0&&y-1&&y%1==0&&y<=p}function ps(y){var S=typeof y;return y!=null&&(S=="object"||S=="function")}function Oi(y){return y!=null&&typeof y=="object"}var ds=be?wt(be):ts;function Ho(y){return qo(y)?Qn(y):rs(y)}function Ve(){return[]}function Be(){return!1}a.exports=Bo})(po,po.exports);var Bw=po.exports;const Hw=_c(Bw);function kw(a,t){if(a.length>=255)throw new TypeError("Alphabet too long");for(var i=new Uint8Array(256),s=0;s>>0,pe=new Uint8Array(fe);he!==le;){for(var de=R[he],F=0,q=fe-1;(de!==0||F>>0,pe[q]=de%g>>>0,de=de/g>>>0;if(de!==0)throw new Error("Non-zero carry");re=F,he++}for(var W=fe-re;W!==fe&&pe[W]===0;)W++;for(var ve=_.repeat(K);W>>0,fe=new Uint8Array(le);R[K];){var pe=i[R.charCodeAt(K)];if(pe===255)return;for(var de=0,F=le-1;(pe!==0||de>>0,fe[F]=pe%256>>>0,pe=pe/256>>>0;if(pe!==0)throw new Error("Non-zero carry");he=de,K++}if(R[K]!==" "){for(var q=le-he;q!==le&&fe[q]===0;)q++;for(var W=new Uint8Array(re+(le-q)),ve=re;q!==le;)W[ve++]=fe[q++];return W}}}function z(R){var K=L(R);if(K)return K;throw new Error(`Non-${t} character`)}return{encode:O,decodeUnsafe:L,decode:z}}var Kw=kw,Vw=Kw;const _f=a=>{if(a instanceof Uint8Array&&a.constructor.name==="Uint8Array")return a;if(a instanceof ArrayBuffer)return new Uint8Array(a);if(ArrayBuffer.isView(a))return new Uint8Array(a.buffer,a.byteOffset,a.byteLength);throw new Error("Unknown type, must be binary type")},Gw=a=>new TextEncoder().encode(a),Ww=a=>new TextDecoder().decode(a);class Jw{constructor(t,i,s){this.name=t,this.prefix=i,this.baseEncode=s}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Yw{constructor(t,i,s){if(this.name=t,this.prefix=i,i.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=i.codePointAt(0),this.baseDecode=s}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return bf(this,t)}}class Xw{constructor(t){this.decoders=t}or(t){return bf(this,t)}decode(t){const i=t[0],s=this.decoders[i];if(s)return s.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const bf=(a,t)=>new Xw({...a.decoders||{[a.prefix]:a},...t.decoders||{[t.prefix]:t}});class Zw{constructor(t,i,s,o){this.name=t,this.prefix=i,this.baseEncode=s,this.baseDecode=o,this.encoder=new Jw(t,i,s),this.decoder=new Yw(t,i,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const bo=({name:a,prefix:t,encode:i,decode:s})=>new Zw(a,t,i,s),Jn=({prefix:a,name:t,alphabet:i})=>{const{encode:s,decode:o}=Vw(i,t);return bo({prefix:a,name:t,encode:s,decode:h=>_f(o(h))})},Qw=(a,t,i,s)=>{const o={};for(let x=0;x=8&&(g-=8,p[m++]=255&_>>g)}if(g>=i||255&_<<8-g)throw new SyntaxError("Unexpected end of data");return p},e_=(a,t,i)=>{const s=t[t.length-1]==="=",o=(1<i;)p-=i,h+=t[o&g>>p];if(p&&(h+=t[o&g<bo({prefix:t,name:a,encode(o){return e_(o,s,i)},decode(o){return Qw(o,s,i,a)}}),t_=bo({prefix:"\0",name:"identity",encode:a=>Ww(a),decode:a=>Gw(a)});var r_=Object.freeze({__proto__:null,identity:t_});const i_=Vt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var n_=Object.freeze({__proto__:null,base2:i_});const s_=Vt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var o_=Object.freeze({__proto__:null,base8:s_});const a_=Jn({prefix:"9",name:"base10",alphabet:"0123456789"});var c_=Object.freeze({__proto__:null,base10:a_});const u_=Vt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),h_=Vt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var l_=Object.freeze({__proto__:null,base16:u_,base16upper:h_});const f_=Vt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),p_=Vt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),d_=Vt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),g_=Vt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),y_=Vt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),v_=Vt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),m_=Vt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),w_=Vt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),__=Vt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var b_=Object.freeze({__proto__:null,base32:f_,base32upper:p_,base32pad:d_,base32padupper:g_,base32hex:y_,base32hexupper:v_,base32hexpad:m_,base32hexpadupper:w_,base32z:__});const E_=Jn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),I_=Jn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var x_=Object.freeze({__proto__:null,base36:E_,base36upper:I_});const S_=Jn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),P_=Jn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var A_=Object.freeze({__proto__:null,base58btc:S_,base58flickr:P_});const C_=Vt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),O_=Vt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),R_=Vt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),T_=Vt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var N_=Object.freeze({__proto__:null,base64:C_,base64pad:O_,base64url:R_,base64urlpad:T_});const Ef=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),D_=Ef.reduce((a,t,i)=>(a[i]=t,a),[]),L_=Ef.reduce((a,t,i)=>(a[t.codePointAt(0)]=i,a),[]);function F_(a){return a.reduce((t,i)=>(t+=D_[i],t),"")}function $_(a){const t=[];for(const i of a){const s=L_[i.codePointAt(0)];if(s===void 0)throw new Error(`Non-base256emoji character: ${i}`);t.push(s)}return new Uint8Array(t)}const M_=bo({prefix:"🚀",name:"base256emoji",encode:F_,decode:$_});var j_=Object.freeze({__proto__:null,base256emoji:M_}),z_=If,al=128,U_=127,q_=~U_,B_=Math.pow(2,31);function If(a,t,i){t=t||[],i=i||0;for(var s=i;a>=B_;)t[i++]=a&255|al,a/=128;for(;a&q_;)t[i++]=a&255|al,a>>>=7;return t[i]=a|0,If.bytes=i-s+1,t}var H_=pc,k_=128,cl=127;function pc(a,s){var i=0,s=s||0,o=0,h=s,p,g=a.length;do{if(h>=g)throw pc.bytes=0,new RangeError("Could not decode varint");p=a[h++],i+=o<28?(p&cl)<=k_);return pc.bytes=h-s,i}var K_=Math.pow(2,7),V_=Math.pow(2,14),G_=Math.pow(2,21),W_=Math.pow(2,28),J_=Math.pow(2,35),Y_=Math.pow(2,42),X_=Math.pow(2,49),Z_=Math.pow(2,56),Q_=Math.pow(2,63),eb=function(a){return a(xf.encode(a,t,i),t),hl=a=>xf.encodingLength(a),dc=(a,t)=>{const i=t.byteLength,s=hl(a),o=s+hl(i),h=new Uint8Array(o+i);return ul(a,h,0),ul(i,h,s),h.set(t,o),new rb(a,i,t,h)};class rb{constructor(t,i,s,o){this.code=t,this.size=i,this.digest=s,this.bytes=o}}const Sf=({name:a,code:t,encode:i})=>new ib(a,t,i);class ib{constructor(t,i,s){this.name=t,this.code=i,this.encode=s}digest(t){if(t instanceof Uint8Array){const i=this.encode(t);return i instanceof Uint8Array?dc(this.code,i):i.then(s=>dc(this.code,s))}else throw Error("Unknown type, must be binary type")}}const Pf=a=>async t=>new Uint8Array(await crypto.subtle.digest(a,t)),nb=Sf({name:"sha2-256",code:18,encode:Pf("SHA-256")}),sb=Sf({name:"sha2-512",code:19,encode:Pf("SHA-512")});var ob=Object.freeze({__proto__:null,sha256:nb,sha512:sb});const Af=0,ab="identity",Cf=_f,cb=a=>dc(Af,Cf(a)),ub={code:Af,name:ab,encode:Cf,digest:cb};var hb=Object.freeze({__proto__:null,identity:ub});new TextEncoder,new TextDecoder;const ll={...r_,...n_,...o_,...c_,...l_,...b_,...x_,...A_,...N_,...j_};({...ob,...hb});function Of(a){return globalThis.Buffer!=null?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):a}function lb(a=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Of(globalThis.Buffer.allocUnsafe(a)):new Uint8Array(a)}function Rf(a,t,i,s){return{name:a,prefix:t,encoder:{name:a,prefix:t,encode:i},decoder:{decode:s}}}const fl=Rf("utf8","u",a=>"u"+new TextDecoder("utf8").decode(a),a=>new TextEncoder().encode(a.substring(1))),tc=Rf("ascii","a",a=>{let t="a";for(let i=0;i{a=a.substring(1);const t=lb(a.length);for(let i=0;i{if(!this.initialized){const s=await this.getKeyChain();typeof s<"u"&&(this.keychain=s),this.initialized=!0}},this.has=s=>(this.isInitialized(),this.keychain.has(s)),this.set=async(s,o)=>{this.isInitialized(),this.keychain.set(s,o),await this.persist()},this.get=s=>{this.isInitialized();const o=this.keychain.get(s);if(typeof o>"u"){const{message:h}=Q("NO_MATCHING_KEY",`${this.name}: ${s}`);throw new Error(h)}return o},this.del=async s=>{this.isInitialized(),this.keychain.delete(s),await this.persist()},this.core=t,this.logger=Re.generateChildLogger(i,this.name)}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(t){await this.core.storage.setItem(this.storageKey,Vl(t))}async getKeyChain(){const t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?Gl(t):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:t}=Q("NOT_INITIALIZED",this.name);throw new Error(t)}}}class Hb{constructor(t,i,s){this.core=t,this.logger=i,this.name=vb,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=o=>(this.isInitialized(),this.keychain.has(o)),this.getClientId=async()=>{this.isInitialized();const o=await this.getClientSeed(),h=Qh(o);return ff(h.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const o=Im();return this.setPrivateKey(o.publicKey,o.privateKey)},this.signJWT=async o=>{this.isInitialized();const h=await this.getClientSeed(),p=Qh(h),g=hc();return await _w(g,o,mb,p)},this.generateSharedKey=(o,h,p)=>{this.isInitialized();const g=this.getPrivateKey(o),_=xm(g,h);return this.setSymKey(_,p)},this.setSymKey=async(o,h)=>{this.isInitialized();const p=h||Sm(o);return await this.keychain.set(p,o),p},this.deleteKeyPair=async o=>{this.isInitialized(),await this.keychain.del(o)},this.deleteSymKey=async o=>{this.isInitialized(),await this.keychain.del(o)},this.encode=async(o,h,p)=>{this.isInitialized();const g=Pm(p),_=qi(h);if(Dh(g)){const L=g.senderPublicKey,z=g.receiverPublicKey;o=await this.generateSharedKey(L,z)}const m=this.getSymKey(o),{type:x,senderPublicKey:O}=g;return Am({type:x,symKey:m,message:_,senderPublicKey:O})},this.decode=async(o,h,p)=>{this.isInitialized();const g=Cm(h,p);if(Dh(g)){const x=g.receiverPublicKey,O=g.senderPublicKey;o=await this.generateSharedKey(x,O)}const _=this.getSymKey(o),m=Om({symKey:_,encoded:h});return Wn(m)},this.getPayloadType=o=>{const h=Lh(o);return Rm(h.type)},this.getPayloadSenderPublicKey=o=>{const h=Lh(o);return h.senderPublicKey?yo(h.senderPublicKey,Tm):void 0},this.core=t,this.logger=Re.generateChildLogger(i,this.name),this.keychain=s||new Bb(this.core,this.logger)}get context(){return Re.getLoggerContext(this.logger)}async setPrivateKey(t,i){return await this.keychain.set(t,i),t}getPrivateKey(t){return this.keychain.get(t)}async getClientSeed(){let t="";try{t=this.keychain.get(pl)}catch{t=hc(),await this.keychain.set(pl,t)}return pb(t,"base16")}getSymKey(t){return this.keychain.get(t)}isInitialized(){if(!this.initialized){const{message:t}=Q("NOT_INITIALIZED",this.name);throw new Error(t)}}}class kb extends Z1{constructor(t,i){super(t,i),this.logger=t,this.core=i,this.messages=new Map,this.name=bb,this.version=Eb,this.initialized=!1,this.storagePrefix=Ei,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const s=await this.getRelayerMessages();typeof s<"u"&&(this.messages=s),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(s){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(s)}finally{this.initialized=!0}}},this.set=async(s,o)=>{this.isInitialized();const h=dn(o);let p=this.messages.get(s);return typeof p>"u"&&(p={}),typeof p[h]<"u"||(p[h]=o,this.messages.set(s,p),await this.persist()),h},this.get=s=>{this.isInitialized();let o=this.messages.get(s);return typeof o>"u"&&(o={}),o},this.has=(s,o)=>{this.isInitialized();const h=this.get(s),p=dn(o);return typeof h[p]<"u"},this.del=async s=>{this.isInitialized(),this.messages.delete(s),await this.persist()},this.logger=Re.generateChildLogger(t,this.name),this.core=i}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(t){await this.core.storage.setItem(this.storageKey,Vl(t))}async getRelayerMessages(){const t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?Gl(t):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:t}=Q("NOT_INITIALIZED",this.name);throw new Error(t)}}}class Kb extends Q1{constructor(t,i){super(t,i),this.relayer=t,this.logger=i,this.events=new vr.EventEmitter,this.name=xb,this.queue=new Map,this.publishTimeout=se.toMiliseconds(se.TEN_SECONDS),this.queueTimeout=se.toMiliseconds(se.FIVE_SECONDS),this.needsTransportRestart=!1,this.publish=async(s,o,h)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:s,message:o,opts:h}});try{const p=(h==null?void 0:h.ttl)||Ib,g=lc(h),_=(h==null?void 0:h.prompt)||!1,m=(h==null?void 0:h.tag)||0,x=(h==null?void 0:h.id)||Pc().toString(),O={topic:s,message:o,opts:{ttl:p,relay:g,prompt:_,tag:m,id:x}},L=setTimeout(()=>this.queue.set(x,O),this.queueTimeout);try{await await lo(this.rpcPublish(s,o,p,g,_,m,x),this.publishTimeout),clearTimeout(L),this.relayer.events.emit(mt.publish,O)}catch{this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0;return}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:s,message:o,opts:h}})}catch(p){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(p),p}},this.on=(s,o)=>{this.events.on(s,o)},this.once=(s,o)=>{this.events.once(s,o)},this.off=(s,o)=>{this.events.off(s,o)},this.removeListener=(s,o)=>{this.events.removeListener(s,o)},this.relayer=t,this.logger=Re.generateChildLogger(i,this.name),this.registerEventListeners()}get context(){return Re.getLoggerContext(this.logger)}rpcPublish(t,i,s,o,h,p,g){var _,m,x,O;const L={method:so(o.protocol).publish,params:{topic:t,message:i,ttl:s,prompt:h,tag:p},id:g};return bi((_=L.params)==null?void 0:_.prompt)&&((m=L.params)==null||delete m.prompt),bi((x=L.params)==null?void 0:x.tag)&&((O=L.params)==null||delete O.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:L}),this.relayer.request(L)}onPublish(t){this.queue.delete(t)}checkQueue(){this.queue.forEach(async t=>{const{topic:i,message:s,opts:o}=t;await this.publish(i,s,o)})}registerEventListeners(){this.relayer.core.heartbeat.on(mn.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(mt.connection_stalled);return}this.checkQueue()}),this.relayer.on(mt.message_ack,t=>{this.onPublish(t.id.toString())})}}class Vb{constructor(){this.map=new Map,this.set=(t,i)=>{const s=this.get(t);this.exists(t,i)||this.map.set(t,[...s,i])},this.get=t=>this.map.get(t)||[],this.exists=(t,i)=>this.get(t).includes(i),this.delete=(t,i)=>{if(typeof i>"u"){this.map.delete(t);return}if(!this.map.has(t))return;const s=this.get(t);if(!this.exists(t,i))return;const o=s.filter(h=>h!==i);if(!o.length){this.map.delete(t);return}this.map.set(t,o)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var Gb=Object.defineProperty,Wb=Object.defineProperties,Jb=Object.getOwnPropertyDescriptors,yl=Object.getOwnPropertySymbols,Yb=Object.prototype.hasOwnProperty,Xb=Object.prototype.propertyIsEnumerable,vl=(a,t,i)=>t in a?Gb(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,Bn=(a,t)=>{for(var i in t||(t={}))Yb.call(t,i)&&vl(a,i,t[i]);if(yl)for(var i of yl(t))Xb.call(t,i)&&vl(a,i,t[i]);return a},ic=(a,t)=>Wb(a,Jb(t));class Zb extends rw{constructor(t,i){super(t,i),this.relayer=t,this.logger=i,this.subscriptions=new Map,this.topicMap=new Vb,this.events=new vr.EventEmitter,this.name=Db,this.version=Lb,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Ei,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(s,o)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:s,opts:o}});try{const h=lc(o),p={topic:s,relay:h};this.pending.set(s,p);const g=await this.rpcSubscribe(s,h);return this.onSubscribe(g,p),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:s,opts:o}}),g}catch(h){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(h),h}},this.unsubscribe=async(s,o)=>{await this.restartToComplete(),this.isInitialized(),typeof(o==null?void 0:o.id)<"u"?await this.unsubscribeById(s,o.id,o):await this.unsubscribeByTopic(s,o)},this.isSubscribed=async s=>this.topics.includes(s)?!0:await new Promise((o,h)=>{const p=new se.Watch;p.start(this.pendingSubscriptionWatchLabel);const g=setInterval(()=>{!this.pending.has(s)&&this.topics.includes(s)&&(clearInterval(g),p.stop(this.pendingSubscriptionWatchLabel),o(!0)),p.elapsed(this.pendingSubscriptionWatchLabel)>=Fb&&(clearInterval(g),p.stop(this.pendingSubscriptionWatchLabel),h(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1),this.on=(s,o)=>{this.events.on(s,o)},this.once=(s,o)=>{this.events.once(s,o)},this.off=(s,o)=>{this.events.off(s,o)},this.removeListener=(s,o)=>{this.events.removeListener(s,o)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=t,this.logger=Re.generateChildLogger(i,this.name),this.clientId=""}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(t,i){let s=!1;try{s=this.getSubscription(t).topic===i}catch{}return s}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(t,i){const s=this.topicMap.get(t);await Promise.all(s.map(async o=>await this.unsubscribeById(t,o,i)))}async unsubscribeById(t,i,s){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:i,opts:s}});try{const o=lc(s);await this.rpcUnsubscribe(t,i,o);const h=rr("USER_DISCONNECTED",`${this.name}, ${t}`);await this.onUnsubscribe(t,i,h),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:i,opts:s}})}catch(o){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(o),o}}async rpcSubscribe(t,i){const s={method:so(i.protocol).subscribe,params:{topic:t}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});try{await await lo(this.relayer.request(s),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(mt.connection_stalled)}return dn(t+this.clientId)}async rpcBatchSubscribe(t){if(!t.length)return;const i=t[0].relay,s={method:so(i.protocol).batchSubscribe,params:{topics:t.map(o=>o.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});try{return await await lo(this.relayer.request(s),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(mt.connection_stalled)}}rpcUnsubscribe(t,i,s){const o={method:so(s.protocol).unsubscribe,params:{topic:t,id:i}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:o}),this.relayer.request(o)}onSubscribe(t,i){this.setSubscription(t,ic(Bn({},i),{id:t})),this.pending.delete(i.topic)}onBatchSubscribe(t){t.length&&t.forEach(i=>{this.setSubscription(i.id,Bn({},i)),this.pending.delete(i.topic)})}async onUnsubscribe(t,i,s){this.events.removeAllListeners(i),this.hasSubscription(i,t)&&this.deleteSubscription(i,s),await this.relayer.messages.del(t)}async setRelayerSubscriptions(t){await this.relayer.core.storage.setItem(this.storageKey,t)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(t,i){this.subscriptions.has(t)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:t,subscription:i}),this.addSubscription(t,i))}addSubscription(t,i){this.subscriptions.set(t,Bn({},i)),this.topicMap.set(i.topic,t),this.events.emit(Gr.created,i)}getSubscription(t){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:t});const i=this.subscriptions.get(t);if(!i){const{message:s}=Q("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(s)}return i}deleteSubscription(t,i){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:t,reason:i});const s=this.getSubscription(t);this.subscriptions.delete(t),this.topicMap.delete(s.topic,t),this.events.emit(Gr.deleted,ic(Bn({},s),{reason:i}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Gr.sync)}async reset(){if(this.cached.length){const t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let i=0;i"u"||!t.length)return;if(this.subscriptions.size){const{message:i}=Q("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(i),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(i)}this.cached=t,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(t){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(t)}}async batchSubscribe(t){if(!t.length)return;const i=await this.rpcBatchSubscribe(t);yn(i)&&this.onBatchSubscribe(i.map((s,o)=>ic(Bn({},t[o]),{id:s})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(this.relayer.transportExplicitlyClosed)return;const t=[];this.pending.forEach(i=>{t.push(i)}),await this.batchSubscribe(t)}registerEventListeners(){this.relayer.core.heartbeat.on(mn.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(mt.connect,async()=>{await this.onConnect()}),this.relayer.on(mt.disconnect,()=>{this.onDisconnect()}),this.events.on(Gr.created,async t=>{const i=Gr.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:t}),await this.persist()}),this.events.on(Gr.deleted,async t=>{const i=Gr.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:t}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:t}=Q("NOT_INITIALIZED",this.name);throw new Error(t)}}async restartToComplete(){this.restartInProgress&&await new Promise(t=>{const i=setInterval(()=>{this.restartInProgress||(clearInterval(i),t())},this.pollingInterval)})}}var Qb=Object.defineProperty,ml=Object.getOwnPropertySymbols,eE=Object.prototype.hasOwnProperty,tE=Object.prototype.propertyIsEnumerable,wl=(a,t,i)=>t in a?Qb(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,rE=(a,t)=>{for(var i in t||(t={}))eE.call(t,i)&&wl(a,i,t[i]);if(ml)for(var i of ml(t))tE.call(t,i)&&wl(a,i,t[i]);return a};class iE extends ew{constructor(t){super(t),this.protocol="wc",this.version=2,this.events=new vr.EventEmitter,this.name=Pb,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=async i=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(i)}catch(s){throw this.logger.debug("Failed to Publish Request"),this.logger.error(s),s}},this.core=t.core,this.logger=typeof t.logger<"u"&&typeof t.logger!="string"?Re.generateChildLogger(t.logger,this.name):Re.pino(Re.getDefaultLoggerOptions({level:t.logger||Sb})),this.messages=new kb(this.logger,t.core),this.subscriber=new Zb(this,this.logger),this.publisher=new Kb(this,this.logger),this.relayUrl=(t==null?void 0:t.relayUrl)||Df,this.projectId=t.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${dl}...`),await this.restartTransport(dl)}this.registerEventListeners(),this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},Rb)}get context(){return Re.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(t,i,s){this.isInitialized(),await this.publisher.publish(t,i,s),await this.recordMessageEvent({topic:t,message:i,publishedAt:Date.now()})}async subscribe(t,i){var s;this.isInitialized();let o=((s=this.subscriber.topicMap.get(t))==null?void 0:s[0])||"";return o||(await Promise.all([new Promise(h=>{this.subscriber.once(Gr.created,p=>{p.topic===t&&h()})}),new Promise(async h=>{o=await this.subscriber.subscribe(t,i),h()})]),o)}async unsubscribe(t,i){this.isInitialized(),await this.subscriber.unsubscribe(t,i)}on(t,i){this.events.on(t,i)}once(t,i){this.events.once(t,i)}off(t,i){this.events.off(t,i)}removeListener(t,i){this.events.removeListener(t,i)}async transportClose(){this.transportExplicitlyClosed=!0,this.connected&&(await this.provider.disconnect(),this.events.emit(mt.transport_closed))}async transportOpen(t){if(this.transportExplicitlyClosed=!1,!this.reconnecting){this.relayUrl=t||this.relayUrl,this.reconnecting=!0;try{await Promise.all([new Promise(i=>{this.initialized||i(),this.subscriber.once(Gr.resubscribed,()=>{i()})}),await Promise.race([new Promise(async(i,s)=>{await lo(this.provider.connect(),5e3,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(o=>s(o)).then(()=>i()).finally(()=>this.removeListener(mt.transport_closed,this.rejectTransportOpen))}),new Promise(i=>this.once(mt.transport_closed,this.rejectTransportOpen))])])}catch(i){this.logger.error(i);const s=i;if(!this.isConnectionStalled(s.message))throw i;this.events.emit(mt.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(t){this.transportExplicitlyClosed||this.reconnecting||(this.relayUrl=t||this.relayUrl,this.connected&&await Promise.all([new Promise(i=>{this.provider.once(Un.disconnect,()=>{i()})}),this.transportClose()]),await this.createProvider(),await this.transportOpen())}isConnectionStalled(t){return this.staleConnectionErrors.some(i=>t.includes(i))}rejectTransportOpen(){throw new Error("Attempt to connect to relay via `transportOpen` has stalled. Retrying...")}async createProvider(){const t=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Ii(new qw(Nm({sdkVersion:Ob,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:t,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(t){const{topic:i,message:s}=t;await this.messages.set(i,s)}async shouldIgnoreMessageEvent(t){const{topic:i,message:s}=t;return await this.subscriber.isSubscribed(i)?this.messages.has(i,s):!0}async onProviderPayload(t){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:t}),Cc(t)){if(!t.method.endsWith(Ab))return;const i=t.params,{topic:s,message:o,publishedAt:h}=i.data,p={topic:s,message:o,publishedAt:h};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(rE({type:"event",event:i.id},p)),this.events.emit(i.id,p),await this.acknowledgePayload(t),await this.onMessageEvent(p)}else _o(t)&&this.events.emit(mt.message_ack,t)}async onMessageEvent(t){await this.shouldIgnoreMessageEvent(t)||(this.events.emit(mt.message,t),await this.recordMessageEvent(t))}async acknowledgePayload(t){const i=Ac(t.id,!0);await this.provider.connection.send(i)}registerProviderListeners(){this.provider.on(Un.payload,t=>this.onProviderPayload(t)),this.provider.on(Un.connect,()=>{this.events.emit(mt.connect)}),this.provider.on(Un.disconnect,()=>{this.onProviderDisconnect()}),this.provider.on(Un.error,t=>{this.logger.error(t),this.events.emit(mt.error,t)})}registerEventListeners(){this.events.on(mt.connection_stalled,async()=>{await this.restartTransport()})}onProviderDisconnect(){this.events.emit(mt.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.restartTransport()},se.toMiliseconds(Cb))}isInitialized(){if(!this.initialized){const{message:t}=Q("NOT_INITIALIZED",this.name);throw new Error(t)}}async toEstablishConnection(){if(!this.connected){if(this.connecting)return await new Promise(t=>{const i=setInterval(()=>{this.connected&&(clearInterval(i),t())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var nE=Object.defineProperty,_l=Object.getOwnPropertySymbols,sE=Object.prototype.hasOwnProperty,oE=Object.prototype.propertyIsEnumerable,bl=(a,t,i)=>t in a?nE(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,El=(a,t)=>{for(var i in t||(t={}))sE.call(t,i)&&bl(a,i,t[i]);if(_l)for(var i of _l(t))oE.call(t,i)&&bl(a,i,t[i]);return a};class Eo extends tw{constructor(t,i,s,o=Ei,h=void 0){super(t,i,s,o),this.core=t,this.logger=i,this.name=s,this.map=new Map,this.version=Tb,this.cached=[],this.initialized=!1,this.storagePrefix=Ei,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(p=>{this.getKey&&p!==null&&!bi(p)?this.map.set(this.getKey(p),p):bm(p)?this.map.set(p.id,p):Em(p)&&this.map.set(p.topic,p)}),this.cached=[],this.initialized=!0)},this.set=async(p,g)=>{this.isInitialized(),this.map.has(p)?await this.update(p,g):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:p,value:g}),this.map.set(p,g),await this.persist())},this.get=p=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:p}),this.getData(p)),this.getAll=p=>(this.isInitialized(),p?this.values.filter(g=>Object.keys(p).every(_=>Hw(g[_],p[_]))):this.values),this.update=async(p,g)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:p,update:g});const _=El(El({},this.getData(p)),g);this.map.set(p,_),await this.persist()},this.delete=async(p,g)=>{this.isInitialized(),this.map.has(p)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:p,reason:g}),this.map.delete(p),await this.persist())},this.logger=Re.generateChildLogger(i,this.name),this.storagePrefix=o,this.getKey=h}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(t){await this.core.storage.setItem(this.storageKey,t)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(t){const i=this.map.get(t);if(!i){const{message:s}=Q("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.error(s),new Error(s)}return i}async persist(){await this.setDataStore(this.values)}async restore(){try{const t=await this.getDataStore();if(typeof t>"u"||!t.length)return;if(this.map.size){const{message:i}=Q("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(i),new Error(i)}this.cached=t,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(t){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(t)}}isInitialized(){if(!this.initialized){const{message:t}=Q("NOT_INITIALIZED",this.name);throw new Error(t)}}}class aE{constructor(t,i){this.core=t,this.logger=i,this.name=$b,this.version=Mb,this.events=new Ic,this.initialized=!1,this.storagePrefix=Ei,this.ignoredPayloadTypes=[Hl],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:s})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...s])]},this.create=async()=>{this.isInitialized();const s=hc(),o=await this.core.crypto.setSymKey(s),h=$r(se.FIVE_MINUTES),p={protocol:Nf},g={topic:o,expiry:h,relay:p,active:!1},_=Dm({protocol:this.core.protocol,version:this.core.version,topic:o,symKey:s,relay:p});return await this.pairings.set(o,g),await this.core.relayer.subscribe(o),this.core.expirer.set(o,h),{topic:o,uri:_}},this.pair=async s=>{this.isInitialized(),this.isValidPair(s);const{topic:o,symKey:h,relay:p}=Lm(s.uri);if(this.pairings.keys.includes(o))throw new Error(`Pairing already exists: ${o}`);if(this.core.crypto.hasKeys(o))throw new Error(`Keychain already exists: ${o}`);const g=$r(se.FIVE_MINUTES),_={topic:o,relay:p,expiry:g,active:!1};return await this.pairings.set(o,_),await this.core.crypto.setSymKey(h,o),await this.core.relayer.subscribe(o,{relay:p}),this.core.expirer.set(o,g),s.activatePairing&&await this.activate({topic:o}),_},this.activate=async({topic:s})=>{this.isInitialized();const o=$r(se.THIRTY_DAYS);await this.pairings.update(s,{active:!0,expiry:o}),this.core.expirer.set(s,o)},this.ping=async s=>{this.isInitialized(),await this.isValidPing(s);const{topic:o}=s;if(this.pairings.keys.includes(o)){const h=await this.sendRequest(o,"wc_pairingPing",{}),{done:p,resolve:g,reject:_}=fn();this.events.once(Ft("pairing_ping",h),({error:m})=>{m?_(m):g()}),await p()}},this.updateExpiry=async({topic:s,expiry:o})=>{this.isInitialized(),await this.pairings.update(s,{expiry:o})},this.updateMetadata=async({topic:s,metadata:o})=>{this.isInitialized(),await this.pairings.update(s,{peerMetadata:o})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async s=>{this.isInitialized(),await this.isValidDisconnect(s);const{topic:o}=s;this.pairings.keys.includes(o)&&(await this.sendRequest(o,"wc_pairingDelete",rr("USER_DISCONNECTED")),await this.deletePairing(o))},this.sendRequest=async(s,o,h)=>{const p=mo(o,h),g=await this.core.crypto.encode(s,p),_=qn[o].req;return this.core.history.set(s,p),this.core.relayer.publish(s,g,_),p.id},this.sendResult=async(s,o,h)=>{const p=Ac(s,h),g=await this.core.crypto.encode(o,p),_=await this.core.history.get(o,s),m=qn[_.request.method].res;await this.core.relayer.publish(o,g,m),await this.core.history.resolve(p)},this.sendError=async(s,o,h)=>{const p=wo(s,h),g=await this.core.crypto.encode(o,p),_=await this.core.history.get(o,s),m=qn[_.request.method]?qn[_.request.method].res:qn.unregistered_method.res;await this.core.relayer.publish(o,g,m),await this.core.history.resolve(p)},this.deletePairing=async(s,o)=>{await this.core.relayer.unsubscribe(s),await Promise.all([this.pairings.delete(s,rr("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(s),o?Promise.resolve():this.core.expirer.del(s)])},this.cleanup=async()=>{const s=this.pairings.getAll().filter(o=>_i(o.expiry));await Promise.all(s.map(o=>this.deletePairing(o.topic)))},this.onRelayEventRequest=s=>{const{topic:o,payload:h}=s,p=h.method;if(this.pairings.keys.includes(o))switch(p){case"wc_pairingPing":return this.onPairingPingRequest(o,h);case"wc_pairingDelete":return this.onPairingDeleteRequest(o,h);default:return this.onUnknownRpcMethodRequest(o,h)}},this.onRelayEventResponse=async s=>{const{topic:o,payload:h}=s,p=(await this.core.history.get(o,h.id)).request.method;if(this.pairings.keys.includes(o))switch(p){case"wc_pairingPing":return this.onPairingPingResponse(o,h);default:return this.onUnknownRpcMethodResponse(p)}},this.onPairingPingRequest=async(s,o)=>{const{id:h}=o;try{this.isValidPing({topic:s}),await this.sendResult(h,s,!0),this.events.emit("pairing_ping",{id:h,topic:s})}catch(p){await this.sendError(h,s,p),this.logger.error(p)}},this.onPairingPingResponse=(s,o)=>{const{id:h}=o;setTimeout(()=>{ci(o)?this.events.emit(Ft("pairing_ping",h),{}):Mr(o)&&this.events.emit(Ft("pairing_ping",h),{error:o.error})},500)},this.onPairingDeleteRequest=async(s,o)=>{const{id:h}=o;try{this.isValidDisconnect({topic:s}),await this.deletePairing(s),this.events.emit("pairing_delete",{id:h,topic:s})}catch(p){await this.sendError(h,s,p),this.logger.error(p)}},this.onUnknownRpcMethodRequest=async(s,o)=>{const{id:h,method:p}=o;try{if(this.registeredMethods.includes(p))return;const g=rr("WC_METHOD_UNSUPPORTED",p);await this.sendError(h,s,g),this.logger.error(g)}catch(g){await this.sendError(h,s,g),this.logger.error(g)}},this.onUnknownRpcMethodResponse=s=>{this.registeredMethods.includes(s)||this.logger.error(rr("WC_METHOD_UNSUPPORTED",s))},this.isValidPair=s=>{if(!hr(s)){const{message:o}=Q("MISSING_OR_INVALID",`pair() params: ${s}`);throw new Error(o)}if(!Fm(s.uri)){const{message:o}=Q("MISSING_OR_INVALID",`pair() uri: ${s.uri}`);throw new Error(o)}},this.isValidPing=async s=>{if(!hr(s)){const{message:h}=Q("MISSING_OR_INVALID",`ping() params: ${s}`);throw new Error(h)}const{topic:o}=s;await this.isValidPairingTopic(o)},this.isValidDisconnect=async s=>{if(!hr(s)){const{message:h}=Q("MISSING_OR_INVALID",`disconnect() params: ${s}`);throw new Error(h)}const{topic:o}=s;await this.isValidPairingTopic(o)},this.isValidPairingTopic=async s=>{if(!pn(s,!1)){const{message:o}=Q("MISSING_OR_INVALID",`pairing topic should be a string: ${s}`);throw new Error(o)}if(!this.pairings.keys.includes(s)){const{message:o}=Q("NO_MATCHING_KEY",`pairing topic doesn't exist: ${s}`);throw new Error(o)}if(_i(this.pairings.get(s).expiry)){await this.deletePairing(s);const{message:o}=Q("EXPIRED",`pairing topic: ${s}`);throw new Error(o)}},this.core=t,this.logger=Re.generateChildLogger(i,this.name),this.pairings=new Eo(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Re.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:t}=Q("NOT_INITIALIZED",this.name);throw new Error(t)}}registerRelayerEvents(){this.core.relayer.on(mt.message,async t=>{const{topic:i,message:s}=t;if(this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(s)))return;const o=await this.core.crypto.decode(i,s);Cc(o)?(this.core.history.set(i,o),this.onRelayEventRequest({topic:i,payload:o})):_o(o)&&(await this.core.history.resolve(o),await this.onRelayEventResponse({topic:i,payload:o}),this.core.history.delete(i,o.id))})}registerExpirerEvents(){this.core.expirer.on(Cr.expired,async t=>{const{topic:i}=kl(t.target);i&&this.pairings.keys.includes(i)&&(await this.deletePairing(i,!0),this.events.emit("pairing_expire",{topic:i}))})}}class cE extends X1{constructor(t,i){super(t,i),this.core=t,this.logger=i,this.records=new Map,this.events=new vr.EventEmitter,this.name=jb,this.version=zb,this.cached=[],this.initialized=!1,this.storagePrefix=Ei,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(s=>this.records.set(s.id,s)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(s,o,h)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:s,request:o,chainId:h}),this.records.has(o.id))return;const p={id:o.id,topic:s,request:{method:o.method,params:o.params||null},chainId:h,expiry:$r(se.THIRTY_DAYS)};this.records.set(p.id,p),this.events.emit(Vr.created,p)},this.resolve=async s=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:s}),!this.records.has(s.id))return;const o=await this.getRecord(s.id);typeof o.response>"u"&&(o.response=Mr(s)?{error:s.error}:{result:s.result},this.records.set(o.id,o),this.events.emit(Vr.updated,o))},this.get=async(s,o)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:s,id:o}),await this.getRecord(o)),this.delete=(s,o)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:o}),this.values.forEach(h=>{if(h.topic===s){if(typeof o<"u"&&h.id!==o)return;this.records.delete(h.id),this.events.emit(Vr.deleted,h)}})},this.exists=async(s,o)=>(this.isInitialized(),this.records.has(o)?(await this.getRecord(o)).topic===s:!1),this.on=(s,o)=>{this.events.on(s,o)},this.once=(s,o)=>{this.events.once(s,o)},this.off=(s,o)=>{this.events.off(s,o)},this.removeListener=(s,o)=>{this.events.removeListener(s,o)},this.logger=Re.generateChildLogger(i,this.name)}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const t=[];return this.values.forEach(i=>{if(typeof i.response<"u")return;const s={topic:i.topic,request:mo(i.request.method,i.request.params,i.id),chainId:i.chainId};return t.push(s)}),t}async setJsonRpcRecords(t){await this.core.storage.setItem(this.storageKey,t)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(t){this.isInitialized();const i=this.records.get(t);if(!i){const{message:s}=Q("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(s)}return i}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Vr.sync)}async restore(){try{const t=await this.getJsonRpcRecords();if(typeof t>"u"||!t.length)return;if(this.records.size){const{message:i}=Q("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(i),new Error(i)}this.cached=t,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(t){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(t)}}registerEventListeners(){this.events.on(Vr.created,t=>{const i=Vr.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,record:t}),this.persist()}),this.events.on(Vr.updated,t=>{const i=Vr.updated;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,record:t}),this.persist()}),this.events.on(Vr.deleted,t=>{const i=Vr.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,record:t}),this.persist()}),this.core.heartbeat.on(mn.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(t=>{se.toMiliseconds(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.delete(t.topic,t.id))})}catch(t){this.logger.warn(t)}}isInitialized(){if(!this.initialized){const{message:t}=Q("NOT_INITIALIZED",this.name);throw new Error(t)}}}class uE extends iw{constructor(t,i){super(t,i),this.core=t,this.logger=i,this.expirations=new Map,this.events=new vr.EventEmitter,this.name=Ub,this.version=qb,this.cached=[],this.initialized=!1,this.storagePrefix=Ei,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(s=>this.expirations.set(s.target,s)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=s=>{try{const o=this.formatTarget(s);return typeof this.getExpiration(o)<"u"}catch{return!1}},this.set=(s,o)=>{this.isInitialized();const h=this.formatTarget(s),p={target:h,expiry:o};this.expirations.set(h,p),this.checkExpiry(h,p),this.events.emit(Cr.created,{target:h,expiration:p})},this.get=s=>{this.isInitialized();const o=this.formatTarget(s);return this.getExpiration(o)},this.del=s=>{if(this.isInitialized(),this.has(s)){const o=this.formatTarget(s),h=this.getExpiration(o);this.expirations.delete(o),this.events.emit(Cr.deleted,{target:o,expiration:h})}},this.on=(s,o)=>{this.events.on(s,o)},this.once=(s,o)=>{this.events.once(s,o)},this.off=(s,o)=>{this.events.off(s,o)},this.removeListener=(s,o)=>{this.events.removeListener(s,o)},this.logger=Re.generateChildLogger(i,this.name)}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(t){if(typeof t=="string")return $m(t);if(typeof t=="number")return Mm(t);const{message:i}=Q("UNKNOWN_TYPE",`Target type: ${typeof t}`);throw new Error(i)}async setExpirations(t){await this.core.storage.setItem(this.storageKey,t)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Cr.sync)}async restore(){try{const t=await this.getExpirations();if(typeof t>"u"||!t.length)return;if(this.expirations.size){const{message:i}=Q("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(i),new Error(i)}this.cached=t,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(t){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(t)}}getExpiration(t){const i=this.expirations.get(t);if(!i){const{message:s}=Q("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.error(s),new Error(s)}return i}checkExpiry(t,i){const{expiry:s}=i;se.toMiliseconds(s)-Date.now()<=0&&this.expire(t,i)}expire(t,i){this.expirations.delete(t),this.events.emit(Cr.expired,{target:t,expiration:i})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((t,i)=>this.checkExpiry(i,t))}registerEventListeners(){this.core.heartbeat.on(mn.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(Cr.created,t=>{const i=Cr.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:t}),this.persist()}),this.events.on(Cr.expired,t=>{const i=Cr.expired;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:t}),this.persist()}),this.events.on(Cr.deleted,t=>{const i=Cr.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:t}),this.persist()})}isInitialized(){if(!this.initialized){const{message:t}=Q("NOT_INITIALIZED",this.name);throw new Error(t)}}}class hE extends nw{constructor(t,i){super(t,i),this.projectId=t,this.logger=i,this.name=rc,this.initialized=!1,this.init=async s=>{jm()||!Kl()||(this.verifyUrl=(s==null?void 0:s.verifyUrl)||gl,await this.createIframe())},this.register=async s=>{var o;if(this.initialized||await this.init(),!!this.iframe)try{(o=this.iframe.contentWindow)==null||o.postMessage(s.attestationId,this.verifyUrl),this.logger.info(`postMessage sent: ${s.attestationId} ${this.verifyUrl}`)}catch{}},this.resolve=async s=>{var o;if(this.isDevEnv)return"";this.logger.info(`resolving attestation: ${s.attestationId}`);const h=this.startAbortTimer(se.FIVE_SECONDS),p=await fetch(`${this.verifyUrl}/attestation/${s.attestationId}`,{signal:this.abortController.signal});return clearTimeout(h),p.status===200?(o=await p.json())==null?void 0:o.origin:""},this.createIframe=async()=>{try{await Promise.race([new Promise((s,o)=>{if(document.getElementById(rc))return s();const h=document.createElement("iframe");h.setAttribute("id",rc),h.setAttribute("src",`${this.verifyUrl}/${this.projectId}`),h.style.display="none",h.addEventListener("load",()=>{this.initialized=!0,s()}),h.addEventListener("error",p=>{o(p)}),document.body.append(h),this.iframe=h}),new Promise(s=>{setTimeout(()=>s("iframe load timeout"),se.toMiliseconds(se.ONE_SECOND/2))})])}catch(s){this.logger.error(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.error(s)}},this.logger=Re.generateChildLogger(i,this.name),this.verifyUrl=gl,this.abortController=new AbortController,this.isDevEnv=zm()&&{}.IS_VITEST}get context(){return Re.getLoggerContext(this.logger)}startAbortTimer(t){return setTimeout(()=>this.abortController.abort(),se.toMiliseconds(t))}}var lE=Object.defineProperty,Il=Object.getOwnPropertySymbols,fE=Object.prototype.hasOwnProperty,pE=Object.prototype.propertyIsEnumerable,xl=(a,t,i)=>t in a?lE(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,Sl=(a,t)=>{for(var i in t||(t={}))fE.call(t,i)&&xl(a,i,t[i]);if(Il)for(var i of Il(t))pE.call(t,i)&&xl(a,i,t[i]);return a};class Rc extends Y1{constructor(t){super(t),this.protocol=Tf,this.version=db,this.name=Oc,this.events=new vr.EventEmitter,this.initialized=!1,this.on=(s,o)=>this.events.on(s,o),this.once=(s,o)=>this.events.once(s,o),this.off=(s,o)=>this.events.off(s,o),this.removeListener=(s,o)=>this.events.removeListener(s,o),this.projectId=t==null?void 0:t.projectId,this.relayUrl=(t==null?void 0:t.relayUrl)||Df;const i=typeof(t==null?void 0:t.logger)<"u"&&typeof(t==null?void 0:t.logger)!="string"?t.logger:Re.pino(Re.getDefaultLoggerOptions({level:(t==null?void 0:t.logger)||gb.logger}));this.logger=Re.generateChildLogger(i,this.name),this.heartbeat=new mn.HeartBeat,this.crypto=new Hb(this,this.logger,t==null?void 0:t.keychain),this.history=new cE(this,this.logger),this.expirer=new uE(this,this.logger),this.storage=t!=null&&t.storage?t.storage:new q1(Sl(Sl({},yb),t==null?void 0:t.storageOptions)),this.relayer=new iE({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new aE(this,this.logger),this.verify=new hE(this.projectId||"",this.logger)}static async init(t){const i=new Rc(t);await i.initialize();const s=await i.crypto.getClientId();return await i.storage.setItem(Nb,s),i}get context(){return Re.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(t){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,t),this.logger.error(t.message),t}}}const dE=Rc,Lf="wc",Ff=2,$f="client",Tc=`${Lf}@${Ff}:${$f}:`,nc={name:$f,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},gE="WALLETCONNECT_DEEPLINK_CHOICE",yE="proposal",Mf="Proposal expired",vE="session",ro=se.SEVEN_DAYS,mE="engine",Hn={wc_sessionPropose:{req:{ttl:se.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:se.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:se.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:se.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:se.ONE_DAY,prompt:!1,tag:1104},res:{ttl:se.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:se.ONE_DAY,prompt:!1,tag:1106},res:{ttl:se.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:se.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:se.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:se.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:se.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:se.ONE_DAY,prompt:!1,tag:1112},res:{ttl:se.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:se.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:se.THIRTY_SECONDS,prompt:!1,tag:1115}}},sc={min:se.FIVE_MINUTES,max:se.SEVEN_DAYS},wE="request",_E=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var bE=Object.defineProperty,EE=Object.defineProperties,IE=Object.getOwnPropertyDescriptors,Pl=Object.getOwnPropertySymbols,xE=Object.prototype.hasOwnProperty,SE=Object.prototype.propertyIsEnumerable,Al=(a,t,i)=>t in a?bE(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,Ar=(a,t)=>{for(var i in t||(t={}))xE.call(t,i)&&Al(a,i,t[i]);if(Pl)for(var i of Pl(t))SE.call(t,i)&&Al(a,i,t[i]);return a},oc=(a,t)=>EE(a,IE(t));class PE extends ow{constructor(t){super(t),this.name=mE,this.events=new Ic,this.initialized=!1,this.ignoredPayloadTypes=[Hl],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(Hn)}),this.initialized=!0)},this.connect=async i=>{this.isInitialized();const s=oc(Ar({},i),{requiredNamespaces:i.requiredNamespaces||{},optionalNamespaces:i.optionalNamespaces||{}});await this.isValidConnect(s);const{pairingTopic:o,requiredNamespaces:h,optionalNamespaces:p,sessionProperties:g,relays:_}=s;let m=o,x,O=!1;if(m&&(O=this.client.core.pairing.pairings.get(m).active),!m||!O){const{topic:fe,uri:pe}=await this.client.core.pairing.create();m=fe,x=pe}const L=await this.client.core.crypto.generateKeyPair(),z=Ar({requiredNamespaces:h,optionalNamespaces:p,relays:_??[{protocol:Nf}],proposer:{publicKey:L,metadata:this.client.metadata}},g&&{sessionProperties:g}),{reject:R,resolve:K,done:re}=fn(se.FIVE_MINUTES,Mf);if(this.events.once(Ft("session_connect"),async({error:fe,session:pe})=>{if(fe)R(fe);else if(pe){pe.self.publicKey=L;const de=oc(Ar({},pe),{requiredNamespaces:pe.requiredNamespaces,optionalNamespaces:pe.optionalNamespaces});await this.client.session.set(pe.topic,de),await this.setExpiry(pe.topic,pe.expiry),m&&await this.client.core.pairing.updateMetadata({topic:m,metadata:pe.peer.metadata}),K(de)}}),!m){const{message:fe}=Q("NO_MATCHING_KEY",`connect() pairing topic: ${m}`);throw new Error(fe)}const he=await this.sendRequest(m,"wc_sessionPropose",z),le=$r(se.FIVE_MINUTES);return await this.setProposal(he,Ar({id:he,expiry:le},z)),{uri:x,approval:re}},this.pair=async i=>(this.isInitialized(),await this.client.core.pairing.pair(i)),this.approve=async i=>{this.isInitialized(),await this.isValidApprove(i);const{id:s,relayProtocol:o,namespaces:h,sessionProperties:p}=i,g=this.client.proposal.get(s);let{pairingTopic:_,proposer:m,requiredNamespaces:x,optionalNamespaces:O}=g;_=_||"",oo(x)||(x=qm(h,"approve()"));const L=await this.client.core.crypto.generateKeyPair(),z=m.publicKey,R=await this.client.core.crypto.generateSharedKey(L,z);_&&s&&(await this.client.core.pairing.updateMetadata({topic:_,metadata:m.metadata}),await this.sendResult(s,_,{relay:{protocol:o??"irn"},responderPublicKey:L}),await this.client.proposal.delete(s,rr("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:_}));const K=Ar({relay:{protocol:o??"irn"},namespaces:h,requiredNamespaces:x,optionalNamespaces:O,pairingTopic:_,controller:{publicKey:L,metadata:this.client.metadata},expiry:$r(ro)},p&&{sessionProperties:p});await this.client.core.relayer.subscribe(R),await this.sendRequest(R,"wc_sessionSettle",K);const re=oc(Ar({},K),{topic:R,pairingTopic:_,acknowledged:!1,self:K.controller,peer:{publicKey:m.publicKey,metadata:m.metadata},controller:L});return await this.client.session.set(R,re),await this.setExpiry(R,$r(ro)),{topic:R,acknowledged:()=>new Promise(he=>setTimeout(()=>he(this.client.session.get(R)),500))}},this.reject=async i=>{this.isInitialized(),await this.isValidReject(i);const{id:s,reason:o}=i,{pairingTopic:h}=this.client.proposal.get(s);h&&(await this.sendError(s,h,o),await this.client.proposal.delete(s,rr("USER_DISCONNECTED")))},this.update=async i=>{this.isInitialized(),await this.isValidUpdate(i);const{topic:s,namespaces:o}=i,h=await this.sendRequest(s,"wc_sessionUpdate",{namespaces:o}),{done:p,resolve:g,reject:_}=fn();return this.events.once(Ft("session_update",h),({error:m})=>{m?_(m):g()}),await this.client.session.update(s,{namespaces:o}),{acknowledged:p}},this.extend=async i=>{this.isInitialized(),await this.isValidExtend(i);const{topic:s}=i,o=await this.sendRequest(s,"wc_sessionExtend",{}),{done:h,resolve:p,reject:g}=fn();return this.events.once(Ft("session_extend",o),({error:_})=>{_?g(_):p()}),await this.setExpiry(s,$r(ro)),{acknowledged:h}},this.request=async i=>{this.isInitialized(),await this.isValidRequest(i);const{chainId:s,request:o,topic:h,expiry:p}=i,g=await this.sendRequest(h,"wc_sessionRequest",{request:o,chainId:s},p),{done:_,resolve:m,reject:x}=fn(p);this.events.once(Ft("session_request",g),({error:L,result:z})=>{L?x(L):m(z)}),this.client.events.emit("session_request_sent",{topic:h,request:o,chainId:s,id:g});const O=await this.client.core.storage.getItem(gE);return Bm({id:g,topic:h,wcDeepLink:O}),await _()},this.respond=async i=>{this.isInitialized(),await this.isValidRespond(i);const{topic:s,response:o}=i,{id:h}=o;ci(o)?await this.sendResult(h,s,o.result):Mr(o)&&await this.sendError(h,s,o.error),this.deletePendingSessionRequest(i.response.id,{message:"fulfilled",code:0})},this.ping=async i=>{this.isInitialized(),await this.isValidPing(i);const{topic:s}=i;if(this.client.session.keys.includes(s)){const o=await this.sendRequest(s,"wc_sessionPing",{}),{done:h,resolve:p,reject:g}=fn();this.events.once(Ft("session_ping",o),({error:_})=>{_?g(_):p()}),await h()}else this.client.core.pairing.pairings.keys.includes(s)&&await this.client.core.pairing.ping({topic:s})},this.emit=async i=>{this.isInitialized(),await this.isValidEmit(i);const{topic:s,event:o,chainId:h}=i;await this.sendRequest(s,"wc_sessionEvent",{event:o,chainId:h})},this.disconnect=async i=>{this.isInitialized(),await this.isValidDisconnect(i);const{topic:s}=i;if(this.client.session.keys.includes(s)){const o=Pc().toString();let h;const p=g=>{(g==null?void 0:g.id.toString())===o&&(this.client.core.relayer.events.removeListener(mt.message_ack,p),h())};await Promise.all([new Promise(g=>{h=g,this.client.core.relayer.on(mt.message_ack,p)}),this.sendRequest(s,"wc_sessionDelete",rr("USER_DISCONNECTED"),void 0,o)]),await this.deleteSession(s)}else await this.client.core.pairing.disconnect({topic:s})},this.find=i=>(this.isInitialized(),this.client.session.getAll().filter(s=>Hm(s,i))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async i=>{if(i.pairingTopic)try{const s=this.client.core.pairing.pairings.get(i.pairingTopic),o=this.client.core.pairing.pairings.getAll().filter(h=>{var p,g;return((p=h.peerMetadata)==null?void 0:p.url)&&((g=h.peerMetadata)==null?void 0:g.url)===i.peer.metadata.url&&h.topic&&h.topic!==s.topic});if(o.length===0)return;this.client.logger.info(`Cleaning up ${o.length} duplicate pairing(s)`),await Promise.all(o.map(h=>this.client.core.pairing.disconnect({topic:h.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(s){this.client.logger.error(s)}},this.deleteSession=async(i,s)=>{const{self:o}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),this.client.session.delete(i,rr("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(o.publicKey)&&await this.client.core.crypto.deleteKeyPair(o.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),s||this.client.core.expirer.del(i)},this.deleteProposal=async(i,s)=>{await Promise.all([this.client.proposal.delete(i,rr("USER_DISCONNECTED")),s?Promise.resolve():this.client.core.expirer.del(i)])},this.deletePendingSessionRequest=async(i,s,o=!1)=>{await Promise.all([this.client.pendingRequest.delete(i,s),o?Promise.resolve():this.client.core.expirer.del(i)])},this.setExpiry=async(i,s)=>{this.client.session.keys.includes(i)&&await this.client.session.update(i,{expiry:s}),this.client.core.expirer.set(i,s)},this.setProposal=async(i,s)=>{await this.client.proposal.set(i,s),this.client.core.expirer.set(i,s.expiry)},this.setPendingSessionRequest=async i=>{const s=Hn.wc_sessionRequest.req.ttl,{id:o,topic:h,params:p}=i;await this.client.pendingRequest.set(o,{id:o,topic:h,params:p}),s&&this.client.core.expirer.set(o,$r(s))},this.sendRequest=async(i,s,o,h,p)=>{const g=mo(s,o);if(Kl()&&_E.includes(s)){const x=dn(JSON.stringify(g));await this.client.core.verify.register({attestationId:x})}const _=await this.client.core.crypto.encode(i,g),m=Hn[s].req;return h&&(m.ttl=h),p&&(m.id=p),this.client.core.history.set(i,g),this.client.core.relayer.publish(i,_,m),g.id},this.sendResult=async(i,s,o)=>{const h=Ac(i,o),p=await this.client.core.crypto.encode(s,h),g=await this.client.core.history.get(s,i),_=Hn[g.request.method].res;this.client.core.relayer.publish(s,p,_),await this.client.core.history.resolve(h)},this.sendError=async(i,s,o)=>{const h=wo(i,o),p=await this.client.core.crypto.encode(s,h),g=await this.client.core.history.get(s,i),_=Hn[g.request.method].res;this.client.core.relayer.publish(s,p,_),await this.client.core.history.resolve(h)},this.cleanup=async()=>{const i=[],s=[];this.client.session.getAll().forEach(o=>{_i(o.expiry)&&i.push(o.topic)}),this.client.proposal.getAll().forEach(o=>{_i(o.expiry)&&s.push(o.id)}),await Promise.all([...i.map(o=>this.deleteSession(o)),...s.map(o=>this.deleteProposal(o))])},this.onRelayEventRequest=i=>{const{topic:s,payload:o}=i,h=o.method;switch(h){case"wc_sessionPropose":return this.onSessionProposeRequest(s,o);case"wc_sessionSettle":return this.onSessionSettleRequest(s,o);case"wc_sessionUpdate":return this.onSessionUpdateRequest(s,o);case"wc_sessionExtend":return this.onSessionExtendRequest(s,o);case"wc_sessionPing":return this.onSessionPingRequest(s,o);case"wc_sessionDelete":return this.onSessionDeleteRequest(s,o);case"wc_sessionRequest":return this.onSessionRequest(s,o);case"wc_sessionEvent":return this.onSessionEventRequest(s,o);default:return this.client.logger.info(`Unsupported request method ${h}`)}},this.onRelayEventResponse=async i=>{const{topic:s,payload:o}=i,h=(await this.client.core.history.get(s,o.id)).request.method;switch(h){case"wc_sessionPropose":return this.onSessionProposeResponse(s,o);case"wc_sessionSettle":return this.onSessionSettleResponse(s,o);case"wc_sessionUpdate":return this.onSessionUpdateResponse(s,o);case"wc_sessionExtend":return this.onSessionExtendResponse(s,o);case"wc_sessionPing":return this.onSessionPingResponse(s,o);case"wc_sessionRequest":return this.onSessionRequestResponse(s,o);default:return this.client.logger.info(`Unsupported response method ${h}`)}},this.onRelayEventUnknownPayload=i=>{const{topic:s}=i,{message:o}=Q("MISSING_OR_INVALID",`Decoded payload on topic ${s} is not identifiable as a JSON-RPC request or a response.`);throw new Error(o)},this.onSessionProposeRequest=async(i,s)=>{const{params:o,id:h}=s;try{this.isValidConnect(Ar({},s.params));const p=$r(se.FIVE_MINUTES),g=Ar({id:h,pairingTopic:i,expiry:p},o);await this.setProposal(h,g);const _=dn(JSON.stringify(s)),m=await this.getVerifyContext(_,g.proposer.metadata);this.client.events.emit("session_proposal",{id:h,params:g,verifyContext:m})}catch(p){await this.sendError(h,i,p),this.client.logger.error(p)}},this.onSessionProposeResponse=async(i,s)=>{const{id:o}=s;if(ci(s)){const{result:h}=s;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:h});const p=this.client.proposal.get(o);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:p});const g=p.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:g});const _=h.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:_});const m=await this.client.core.crypto.generateSharedKey(g,_);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:m});const x=await this.client.core.relayer.subscribe(m);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:x}),await this.client.core.pairing.activate({topic:i})}else Mr(s)&&(await this.client.proposal.delete(o,rr("USER_DISCONNECTED")),this.events.emit(Ft("session_connect"),{error:s.error}))},this.onSessionSettleRequest=async(i,s)=>{const{id:o,params:h}=s;try{this.isValidSessionSettleRequest(h);const{relay:p,controller:g,expiry:_,namespaces:m,requiredNamespaces:x,optionalNamespaces:O,sessionProperties:L,pairingTopic:z}=s.params,R=Ar({topic:i,relay:p,expiry:_,namespaces:m,acknowledged:!0,pairingTopic:z,requiredNamespaces:x,optionalNamespaces:O,controller:g.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:g.publicKey,metadata:g.metadata}},L&&{sessionProperties:L});await this.sendResult(s.id,i,!0),this.events.emit(Ft("session_connect"),{session:R}),this.cleanupDuplicatePairings(R)}catch(p){await this.sendError(o,i,p),this.client.logger.error(p)}},this.onSessionSettleResponse=async(i,s)=>{const{id:o}=s;ci(s)?(await this.client.session.update(i,{acknowledged:!0}),this.events.emit(Ft("session_approve",o),{})):Mr(s)&&(await this.client.session.delete(i,rr("USER_DISCONNECTED")),this.events.emit(Ft("session_approve",o),{error:s.error}))},this.onSessionUpdateRequest=async(i,s)=>{const{params:o,id:h}=s;try{this.isValidUpdate(Ar({topic:i},o)),await this.client.session.update(i,{namespaces:o.namespaces}),await this.sendResult(h,i,!0),this.client.events.emit("session_update",{id:h,topic:i,params:o})}catch(p){await this.sendError(h,i,p),this.client.logger.error(p)}},this.onSessionUpdateResponse=(i,s)=>{const{id:o}=s;ci(s)?this.events.emit(Ft("session_update",o),{}):Mr(s)&&this.events.emit(Ft("session_update",o),{error:s.error})},this.onSessionExtendRequest=async(i,s)=>{const{id:o}=s;try{this.isValidExtend({topic:i}),await this.setExpiry(i,$r(ro)),await this.sendResult(o,i,!0),this.client.events.emit("session_extend",{id:o,topic:i})}catch(h){await this.sendError(o,i,h),this.client.logger.error(h)}},this.onSessionExtendResponse=(i,s)=>{const{id:o}=s;ci(s)?this.events.emit(Ft("session_extend",o),{}):Mr(s)&&this.events.emit(Ft("session_extend",o),{error:s.error})},this.onSessionPingRequest=async(i,s)=>{const{id:o}=s;try{this.isValidPing({topic:i}),await this.sendResult(o,i,!0),this.client.events.emit("session_ping",{id:o,topic:i})}catch(h){await this.sendError(o,i,h),this.client.logger.error(h)}},this.onSessionPingResponse=(i,s)=>{const{id:o}=s;setTimeout(()=>{ci(s)?this.events.emit(Ft("session_ping",o),{}):Mr(s)&&this.events.emit(Ft("session_ping",o),{error:s.error})},500)},this.onSessionDeleteRequest=async(i,s)=>{const{id:o}=s;try{this.isValidDisconnect({topic:i,reason:s.params}),await Promise.all([new Promise(h=>{this.client.core.relayer.once(mt.publish,async()=>{h(await this.deleteSession(i))})}),this.sendResult(o,i,!0)]),this.client.events.emit("session_delete",{id:o,topic:i})}catch(h){this.client.logger.error(h)}},this.onSessionRequest=async(i,s)=>{const{id:o,params:h}=s;try{this.isValidRequest(Ar({topic:i},h)),await this.setPendingSessionRequest({id:o,topic:i,params:h});const p=dn(JSON.stringify(s)),g=this.client.session.get(i),_=await this.getVerifyContext(p,g.peer.metadata);this.client.events.emit("session_request",{id:o,topic:i,params:h,verifyContext:_})}catch(p){await this.sendError(o,i,p),this.client.logger.error(p)}},this.onSessionRequestResponse=(i,s)=>{const{id:o}=s;ci(s)?this.events.emit(Ft("session_request",o),{result:s.result}):Mr(s)&&this.events.emit(Ft("session_request",o),{error:s.error})},this.onSessionEventRequest=async(i,s)=>{const{id:o,params:h}=s;try{this.isValidEmit(Ar({topic:i},h)),this.client.events.emit("session_event",{id:o,topic:i,params:h})}catch(p){await this.sendError(o,i,p),this.client.logger.error(p)}},this.isValidConnect=async i=>{if(!hr(i)){const{message:_}=Q("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(i)}`);throw new Error(_)}const{pairingTopic:s,requiredNamespaces:o,optionalNamespaces:h,sessionProperties:p,relays:g}=i;if(bi(s)||await this.isValidPairingTopic(s),!km(g,!0)){const{message:_}=Q("MISSING_OR_INVALID",`connect() relays: ${g}`);throw new Error(_)}!bi(o)&&oo(o)!==0&&this.validateNamespaces(o,"requiredNamespaces"),!bi(h)&&oo(h)!==0&&this.validateNamespaces(h,"optionalNamespaces"),bi(p)||this.validateSessionProps(p,"sessionProperties")},this.validateNamespaces=(i,s)=>{const o=Km(i,"connect()",s);if(o)throw new Error(o.message)},this.isValidApprove=async i=>{if(!hr(i))throw new Error(Q("MISSING_OR_INVALID",`approve() params: ${i}`).message);const{id:s,namespaces:o,relayProtocol:h,sessionProperties:p}=i;await this.isValidProposalId(s);const g=this.client.proposal.get(s),_=Ga(o,"approve()");if(_)throw new Error(_.message);const m=Fh(g.requiredNamespaces,o,"approve()");if(m)throw new Error(m.message);if(!pn(h,!0)){const{message:x}=Q("MISSING_OR_INVALID",`approve() relayProtocol: ${h}`);throw new Error(x)}bi(p)||this.validateSessionProps(p,"sessionProperties")},this.isValidReject=async i=>{if(!hr(i)){const{message:h}=Q("MISSING_OR_INVALID",`reject() params: ${i}`);throw new Error(h)}const{id:s,reason:o}=i;if(await this.isValidProposalId(s),!Vm(o)){const{message:h}=Q("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(o)}`);throw new Error(h)}},this.isValidSessionSettleRequest=i=>{if(!hr(i)){const{message:m}=Q("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${i}`);throw new Error(m)}const{relay:s,controller:o,namespaces:h,expiry:p}=i;if(!Gm(s)){const{message:m}=Q("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(m)}const g=Wm(o,"onSessionSettleRequest()");if(g)throw new Error(g.message);const _=Ga(h,"onSessionSettleRequest()");if(_)throw new Error(_.message);if(_i(p)){const{message:m}=Q("EXPIRED","onSessionSettleRequest()");throw new Error(m)}},this.isValidUpdate=async i=>{if(!hr(i)){const{message:_}=Q("MISSING_OR_INVALID",`update() params: ${i}`);throw new Error(_)}const{topic:s,namespaces:o}=i;await this.isValidSessionTopic(s);const h=this.client.session.get(s),p=Ga(o,"update()");if(p)throw new Error(p.message);const g=Fh(h.requiredNamespaces,o,"update()");if(g)throw new Error(g.message)},this.isValidExtend=async i=>{if(!hr(i)){const{message:o}=Q("MISSING_OR_INVALID",`extend() params: ${i}`);throw new Error(o)}const{topic:s}=i;await this.isValidSessionTopic(s)},this.isValidRequest=async i=>{if(!hr(i)){const{message:_}=Q("MISSING_OR_INVALID",`request() params: ${i}`);throw new Error(_)}const{topic:s,request:o,chainId:h,expiry:p}=i;await this.isValidSessionTopic(s);const{namespaces:g}=this.client.session.get(s);if(!$h(g,h)){const{message:_}=Q("MISSING_OR_INVALID",`request() chainId: ${h}`);throw new Error(_)}if(!Jm(o)){const{message:_}=Q("MISSING_OR_INVALID",`request() ${JSON.stringify(o)}`);throw new Error(_)}if(!Ym(g,h,o.method)){const{message:_}=Q("MISSING_OR_INVALID",`request() method: ${o.method}`);throw new Error(_)}if(p&&!Xm(p,sc)){const{message:_}=Q("MISSING_OR_INVALID",`request() expiry: ${p}. Expiry must be a number (in seconds) between ${sc.min} and ${sc.max}`);throw new Error(_)}},this.isValidRespond=async i=>{if(!hr(i)){const{message:h}=Q("MISSING_OR_INVALID",`respond() params: ${i}`);throw new Error(h)}const{topic:s,response:o}=i;if(await this.isValidSessionTopic(s),!Zm(o)){const{message:h}=Q("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(o)}`);throw new Error(h)}},this.isValidPing=async i=>{if(!hr(i)){const{message:o}=Q("MISSING_OR_INVALID",`ping() params: ${i}`);throw new Error(o)}const{topic:s}=i;await this.isValidSessionOrPairingTopic(s)},this.isValidEmit=async i=>{if(!hr(i)){const{message:g}=Q("MISSING_OR_INVALID",`emit() params: ${i}`);throw new Error(g)}const{topic:s,event:o,chainId:h}=i;await this.isValidSessionTopic(s);const{namespaces:p}=this.client.session.get(s);if(!$h(p,h)){const{message:g}=Q("MISSING_OR_INVALID",`emit() chainId: ${h}`);throw new Error(g)}if(!Qm(o)){const{message:g}=Q("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(g)}if(!e1(p,h,o.name)){const{message:g}=Q("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(g)}},this.isValidDisconnect=async i=>{if(!hr(i)){const{message:o}=Q("MISSING_OR_INVALID",`disconnect() params: ${i}`);throw new Error(o)}const{topic:s}=i;await this.isValidSessionOrPairingTopic(s)},this.getVerifyContext=async(i,s)=>{const o={verified:{verifyUrl:s.verifyUrl||"",validation:"UNKNOWN",origin:s.url||""}};try{const h=await this.client.core.verify.resolve({attestationId:i,verifyUrl:s.verifyUrl});h&&(o.verified.origin=h,o.verified.validation=h===s.url?"VALID":"INVALID")}catch(h){this.client.logger.error(h)}return this.client.logger.info(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(i,s)=>{Object.values(i).forEach(o=>{if(!pn(o,!1)){const{message:h}=Q("MISSING_OR_INVALID",`${s} must be in Record format. Received: ${JSON.stringify(o)}`);throw new Error(h)}})}}isInitialized(){if(!this.initialized){const{message:t}=Q("NOT_INITIALIZED",this.name);throw new Error(t)}}registerRelayerEvents(){this.client.core.relayer.on(mt.message,async t=>{const{topic:i,message:s}=t;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(s)))return;const o=await this.client.core.crypto.decode(i,s);Cc(o)?(this.client.core.history.set(i,o),this.onRelayEventRequest({topic:i,payload:o})):_o(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:i,payload:o}),this.client.core.history.delete(i,o.id)):this.onRelayEventUnknownPayload({topic:i,payload:o})})}registerExpirerEvents(){this.client.core.expirer.on(Cr.expired,async t=>{const{topic:i,id:s}=kl(t.target);if(s&&this.client.pendingRequest.keys.includes(s))return await this.deletePendingSessionRequest(s,Q("EXPIRED"),!0);i?this.client.session.keys.includes(i)&&(await this.deleteSession(i,!0),this.client.events.emit("session_expire",{topic:i})):s&&(await this.deleteProposal(s,!0),this.client.events.emit("proposal_expire",{id:s}))})}isValidPairingTopic(t){if(!pn(t,!1)){const{message:i}=Q("MISSING_OR_INVALID",`pairing topic should be a string: ${t}`);throw new Error(i)}if(!this.client.core.pairing.pairings.keys.includes(t)){const{message:i}=Q("NO_MATCHING_KEY",`pairing topic doesn't exist: ${t}`);throw new Error(i)}if(_i(this.client.core.pairing.pairings.get(t).expiry)){const{message:i}=Q("EXPIRED",`pairing topic: ${t}`);throw new Error(i)}}async isValidSessionTopic(t){if(!pn(t,!1)){const{message:i}=Q("MISSING_OR_INVALID",`session topic should be a string: ${t}`);throw new Error(i)}if(!this.client.session.keys.includes(t)){const{message:i}=Q("NO_MATCHING_KEY",`session topic doesn't exist: ${t}`);throw new Error(i)}if(_i(this.client.session.get(t).expiry)){await this.deleteSession(t);const{message:i}=Q("EXPIRED",`session topic: ${t}`);throw new Error(i)}}async isValidSessionOrPairingTopic(t){if(this.client.session.keys.includes(t))await this.isValidSessionTopic(t);else if(this.client.core.pairing.pairings.keys.includes(t))this.isValidPairingTopic(t);else if(pn(t,!1)){const{message:i}=Q("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${t}`);throw new Error(i)}else{const{message:i}=Q("MISSING_OR_INVALID",`session or pairing topic should be a string: ${t}`);throw new Error(i)}}async isValidProposalId(t){if(!t1(t)){const{message:i}=Q("MISSING_OR_INVALID",`proposal id should be a number: ${t}`);throw new Error(i)}if(!this.client.proposal.keys.includes(t)){const{message:i}=Q("NO_MATCHING_KEY",`proposal id doesn't exist: ${t}`);throw new Error(i)}if(_i(this.client.proposal.get(t).expiry)){await this.deleteProposal(t);const{message:i}=Q("EXPIRED",`proposal id: ${t}`);throw new Error(i)}}}class AE extends Eo{constructor(t,i){super(t,i,yE,Tc),this.core=t,this.logger=i}}class CE extends Eo{constructor(t,i){super(t,i,vE,Tc),this.core=t,this.logger=i}}class OE extends Eo{constructor(t,i){super(t,i,wE,Tc,s=>s.id),this.core=t,this.logger=i}}let RE=class jf extends sw{constructor(t){super(t),this.protocol=Lf,this.version=Ff,this.name=nc.name,this.events=new vr.EventEmitter,this.on=(s,o)=>this.events.on(s,o),this.once=(s,o)=>this.events.once(s,o),this.off=(s,o)=>this.events.off(s,o),this.removeListener=(s,o)=>this.events.removeListener(s,o),this.removeAllListeners=s=>this.events.removeAllListeners(s),this.connect=async s=>{try{return await this.engine.connect(s)}catch(o){throw this.logger.error(o.message),o}},this.pair=async s=>{try{return await this.engine.pair(s)}catch(o){throw this.logger.error(o.message),o}},this.approve=async s=>{try{return await this.engine.approve(s)}catch(o){throw this.logger.error(o.message),o}},this.reject=async s=>{try{return await this.engine.reject(s)}catch(o){throw this.logger.error(o.message),o}},this.update=async s=>{try{return await this.engine.update(s)}catch(o){throw this.logger.error(o.message),o}},this.extend=async s=>{try{return await this.engine.extend(s)}catch(o){throw this.logger.error(o.message),o}},this.request=async s=>{try{return await this.engine.request(s)}catch(o){throw this.logger.error(o.message),o}},this.respond=async s=>{try{return await this.engine.respond(s)}catch(o){throw this.logger.error(o.message),o}},this.ping=async s=>{try{return await this.engine.ping(s)}catch(o){throw this.logger.error(o.message),o}},this.emit=async s=>{try{return await this.engine.emit(s)}catch(o){throw this.logger.error(o.message),o}},this.disconnect=async s=>{try{return await this.engine.disconnect(s)}catch(o){throw this.logger.error(o.message),o}},this.find=s=>{try{return this.engine.find(s)}catch(o){throw this.logger.error(o.message),o}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(s){throw this.logger.error(s.message),s}},this.name=(t==null?void 0:t.name)||nc.name,this.metadata=(t==null?void 0:t.metadata)||Um();const i=typeof(t==null?void 0:t.logger)<"u"&&typeof(t==null?void 0:t.logger)!="string"?t.logger:Re.pino(Re.getDefaultLoggerOptions({level:(t==null?void 0:t.logger)||nc.logger}));this.core=(t==null?void 0:t.core)||new dE(t),this.logger=Re.generateChildLogger(i,this.name),this.session=new CE(this.core,this.logger),this.proposal=new AE(this.core,this.logger),this.pendingRequest=new OE(this.core,this.logger),this.engine=new PE(this)}static async init(t){const i=new jf(t);return await i.initialize(),i}get context(){return Re.getLoggerContext(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(t){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(t.message),t}}};var gc={exports:{}};(function(a,t){var i=typeof self<"u"?self:jr,s=function(){function h(){this.fetch=!1,this.DOMException=i.DOMException}return h.prototype=i,new h}();(function(h){(function(p){var g={searchParams:"URLSearchParams"in h,iterable:"Symbol"in h&&"iterator"in Symbol,blob:"FileReader"in h&&"Blob"in h&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in h,arrayBuffer:"ArrayBuffer"in h};function _(v){return v&&DataView.prototype.isPrototypeOf(v)}if(g.arrayBuffer)var m=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],x=ArrayBuffer.isView||function(v){return v&&m.indexOf(Object.prototype.toString.call(v))>-1};function O(v){if(typeof v!="string"&&(v=String(v)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(v))throw new TypeError("Invalid character in header field name");return v.toLowerCase()}function L(v){return typeof v!="string"&&(v=String(v)),v}function z(v){var I={next:function(){var X=v.shift();return{done:X===void 0,value:X}}};return g.iterable&&(I[Symbol.iterator]=function(){return I}),I}function R(v){this.map={},v instanceof R?v.forEach(function(I,X){this.append(X,I)},this):Array.isArray(v)?v.forEach(function(I){this.append(I[0],I[1])},this):v&&Object.getOwnPropertyNames(v).forEach(function(I){this.append(I,v[I])},this)}R.prototype.append=function(v,I){v=O(v),I=L(I);var X=this.map[v];this.map[v]=X?X+", "+I:I},R.prototype.delete=function(v){delete this.map[O(v)]},R.prototype.get=function(v){return v=O(v),this.has(v)?this.map[v]:null},R.prototype.has=function(v){return this.map.hasOwnProperty(O(v))},R.prototype.set=function(v,I){this.map[O(v)]=L(I)},R.prototype.forEach=function(v,I){for(var X in this.map)this.map.hasOwnProperty(X)&&v.call(I,this.map[X],X,this)},R.prototype.keys=function(){var v=[];return this.forEach(function(I,X){v.push(X)}),z(v)},R.prototype.values=function(){var v=[];return this.forEach(function(I){v.push(I)}),z(v)},R.prototype.entries=function(){var v=[];return this.forEach(function(I,X){v.push([X,I])}),z(v)},g.iterable&&(R.prototype[Symbol.iterator]=R.prototype.entries);function K(v){if(v.bodyUsed)return Promise.reject(new TypeError("Already read"));v.bodyUsed=!0}function re(v){return new Promise(function(I,X){v.onload=function(){I(v.result)},v.onerror=function(){X(v.error)}})}function he(v){var I=new FileReader,X=re(I);return I.readAsArrayBuffer(v),X}function le(v){var I=new FileReader,X=re(I);return I.readAsText(v),X}function fe(v){for(var I=new Uint8Array(v),X=new Array(I.length),ce=0;ce-1?I:v}function W(v,I){I=I||{};var X=I.body;if(v instanceof W){if(v.bodyUsed)throw new TypeError("Already read");this.url=v.url,this.credentials=v.credentials,I.headers||(this.headers=new R(v.headers)),this.method=v.method,this.mode=v.mode,this.signal=v.signal,!X&&v._bodyInit!=null&&(X=v._bodyInit,v.bodyUsed=!0)}else this.url=String(v);if(this.credentials=I.credentials||this.credentials||"same-origin",(I.headers||!this.headers)&&(this.headers=new R(I.headers)),this.method=q(I.method||this.method||"GET"),this.mode=I.mode||this.mode||null,this.signal=I.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(X)}W.prototype.clone=function(){return new W(this,{body:this._bodyInit})};function ve(v){var I=new FormData;return v.trim().split("&").forEach(function(X){if(X){var ce=X.split("="),V=ce.shift().replace(/\+/g," "),B=ce.join("=").replace(/\+/g," ");I.append(decodeURIComponent(V),decodeURIComponent(B))}}),I}function ie(v){var I=new R,X=v.replace(/\r?\n[\t ]+/g," ");return X.split(/\r?\n/).forEach(function(ce){var V=ce.split(":"),B=V.shift().trim();if(B){var k=V.join(":").trim();I.append(B,k)}}),I}de.call(W.prototype);function ue(v,I){I||(I={}),this.type="default",this.status=I.status===void 0?200:I.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in I?I.statusText:"OK",this.headers=new R(I.headers),this.url=I.url||"",this._initBody(v)}de.call(ue.prototype),ue.prototype.clone=function(){return new ue(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new R(this.headers),url:this.url})},ue.error=function(){var v=new ue(null,{status:0,statusText:""});return v.type="error",v};var Te=[301,302,303,307,308];ue.redirect=function(v,I){if(Te.indexOf(I)===-1)throw new RangeError("Invalid status code");return new ue(null,{status:I,headers:{location:v}})},p.DOMException=h.DOMException;try{new p.DOMException}catch{p.DOMException=function(I,X){this.message=I,this.name=X;var ce=Error(I);this.stack=ce.stack},p.DOMException.prototype=Object.create(Error.prototype),p.DOMException.prototype.constructor=p.DOMException}function Ue(v,I){return new Promise(function(X,ce){var V=new W(v,I);if(V.signal&&V.signal.aborted)return ce(new p.DOMException("Aborted","AbortError"));var B=new XMLHttpRequest;function k(){B.abort()}B.onload=function(){var G={status:B.status,statusText:B.statusText,headers:ie(B.getAllResponseHeaders()||"")};G.url="responseURL"in B?B.responseURL:G.headers.get("X-Request-URL");var Ye="response"in B?B.response:B.responseText;X(new ue(Ye,G))},B.onerror=function(){ce(new TypeError("Network request failed"))},B.ontimeout=function(){ce(new TypeError("Network request failed"))},B.onabort=function(){ce(new p.DOMException("Aborted","AbortError"))},B.open(V.method,V.url,!0),V.credentials==="include"?B.withCredentials=!0:V.credentials==="omit"&&(B.withCredentials=!1),"responseType"in B&&g.blob&&(B.responseType="blob"),V.headers.forEach(function(G,Ye){B.setRequestHeader(Ye,G)}),V.signal&&(V.signal.addEventListener("abort",k),B.onreadystatechange=function(){B.readyState===4&&V.signal.removeEventListener("abort",k)}),B.send(typeof V._bodyInit>"u"?null:V._bodyInit)})}return Ue.polyfill=!0,h.fetch||(h.fetch=Ue,h.Headers=R,h.Request=W,h.Response=ue),p.Headers=R,p.Request=W,p.Response=ue,p.fetch=Ue,Object.defineProperty(p,"__esModule",{value:!0}),p})({})})(s),s.fetch.ponyfill=!0,delete s.fetch.polyfill;var o=s;t=o.fetch,t.default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,a.exports=t})(gc,gc.exports);var TE=gc.exports;const Cl=_c(TE),NE={Accept:"application/json","Content-Type":"application/json"},DE="POST",Ol={headers:NE,method:DE},Rl=10;class ki{constructor(t,i=!1){if(this.url=t,this.disableProviderPing=i,this.events=new vr.EventEmitter,this.isAvailable=!1,this.registering=!1,!il(t))throw new Error(`Provided URL is not compatible with HTTP connection: ${t}`);this.url=t,this.disableProviderPing=i}get connected(){return this.isAvailable}get connecting(){return this.registering}on(t,i){this.events.on(t,i)}once(t,i){this.events.once(t,i)}off(t,i){this.events.off(t,i)}removeListener(t,i){this.events.removeListener(t,i)}async open(t=this.url){await this.register(t)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(t,i){this.isAvailable||await this.register();try{const s=qi(t),h=await(await Cl(this.url,Object.assign(Object.assign({},Ol),{body:s}))).json();this.onPayload({data:h})}catch(s){this.onError(t.id,s)}}async register(t=this.url){if(!il(t))throw new Error(`Provided URL is not compatible with HTTP connection: ${t}`);if(this.registering){const i=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=i||this.events.listenerCount("open")>=i)&&this.events.setMaxListeners(i+1),new Promise((s,o)=>{this.events.once("register_error",h=>{this.resetMaxListeners(),o(h)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return o(new Error("HTTP connection is missing or invalid"));s()})})}this.url=t,this.registering=!0;try{if(!this.disableProviderPing){const i=qi({id:1,jsonrpc:"2.0",method:"test",params:[]});await Cl(t,Object.assign(Object.assign({},Ol),{body:i}))}this.onOpen()}catch(i){const s=this.parseError(i);throw this.events.emit("register_error",s),this.onClose(),s}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(t){if(typeof t.data>"u")return;const i=typeof t.data=="string"?Wn(t.data):t.data;this.events.emit("payload",i)}onError(t,i){const s=this.parseError(i),o=s.message||s.toString(),h=wo(t,o);this.events.emit("payload",h)}parseError(t,i=this.url){return gf(t,i,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Rl&&this.events.setMaxListeners(Rl)}}const Tl="error",LE="wss://relay.walletconnect.com",FE="wc",$E="universal_provider",Nl=`${FE}@2:${$E}:`,ME="https://rpc.walletconnect.com/v1",xi={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var kn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},yc={exports:{}};/** -* @license -* Lodash -* Copyright OpenJS Foundation and other contributors -* Released under MIT license -* Based on Underscore.js 1.8.3 -* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -*/(function(a,t){(function(){var i,s="4.17.21",o=200,h="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",p="Expected a function",g="Invalid `variable` option passed into `_.template`",_="__lodash_hash_undefined__",m=500,x="__lodash_placeholder__",O=1,L=2,z=4,R=1,K=2,re=1,he=2,le=4,fe=8,pe=16,de=32,F=64,q=128,W=256,ve=512,ie=30,ue="...",Te=800,Ue=16,v=1,I=2,X=3,ce=1/0,V=9007199254740991,B=17976931348623157e292,k=0/0,G=4294967295,Ye=G-1,ke=G>>>1,zr=[["ary",q],["bind",re],["bindKey",he],["curry",fe],["curryRight",pe],["flip",ve],["partial",de],["partialRight",F],["rearg",W]],Ie="[object Arguments]",St="[object Array]",D="[object AsyncFunction]",N="[object Boolean]",C="[object Date]",u="[object DOMException]",E="[object Error]",ee="[object Function]",ge="[object GeneratorFunction]",be="[object Map]",Ne="[object Number]",Le="[object Null]",Pe="[object Object]",Pt="[object Promise]",wt="[object Proxy]",ot="[object RegExp]",$e="[object Set]",Ze="[object String]",Qe="[object Symbol]",at="[object Undefined]",qe="[object WeakMap]",et="[object WeakSet]",De="[object ArrayBuffer]",Ke="[object DataView]",ht="[object Float32Array]",je="[object Float64Array]",At="[object Int8Array]",$t="[object Int16Array]",Ht="[object Int32Array]",kt="[object Uint8Array]",zt="[object Uint8ClampedArray]",Jt="[object Uint16Array]",ir="[object Uint32Array]",Ur=/\b__p \+= '';/g,Yt=/\b(__p \+=) '' \+/g,Wr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ui=/&(?:amp|lt|gt|quot|#39);/g,Si=/[&<>"']/g,lt=RegExp(ui.source),it=RegExp(Si.source),ft=/<%-([\s\S]+?)%>/g,pt=/<%([\s\S]+?)%>/g,ct=/<%=([\s\S]+?)%>/g,nt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ct=/^\w*$/,Ot=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,dt=/[\\^$.*+?()[\]{}|]/g,Rt=RegExp(dt.source),gt=/^\s+/,_t=/\s/,yt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Xe=/\{\n\/\* \[wrapped with (.+)\] \*/,Tt=/,? & /,Nt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Io=/[()=,{}\[\]\/\s]/,xo=/\\(\\)?/g,So=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,mr=/\w*$/,Po=/^[-+]0x[0-9a-f]+$/i,Ao=/^0b[01]+$/i,Co=/^\[object .+?Constructor\]$/,Oo=/^0o[0-7]+$/i,Ro=/^(?:0|[1-9]\d*)$/,Jr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ki=/($^)/,To=/['\n\r\u2028\u2029\\]/g,Vi="\\ud800-\\udfff",No="\\u0300-\\u036f",Do="\\ufe20-\\ufe2f",Gi="\\u20d0-\\u20ff",Yn=No+Do+Gi,Xn="\\u2700-\\u27bf",Rr="a-z\\xdf-\\xf6\\xf8-\\xff",Lo="\\xac\\xb1\\xd7\\xf7",Fo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",$o="\\u2000-\\u206f",Mo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Zn="A-Z\\xc0-\\xd6\\xd8-\\xde",Qn="\\ufe0e\\ufe0f",Pi=Lo+Fo+$o+Mo,wn="['’]",Ai="["+Vi+"]",_n="["+Pi+"]",Ci="["+Yn+"]",es="\\d+",jo="["+Xn+"]",ts="["+Rr+"]",rs="[^"+Vi+Pi+es+Xn+Rr+Zn+"]",Wi="\\ud83c[\\udffb-\\udfff]",zo="(?:"+Ci+"|"+Wi+")",is="[^"+Vi+"]",Ji="(?:\\ud83c[\\udde6-\\uddff]){2}",hi="[\\ud800-\\udbff][\\udc00-\\udfff]",lr="["+Zn+"]",ns="\\u200d",ss="(?:"+ts+"|"+rs+")",qr="(?:"+lr+"|"+rs+")",os="(?:"+wn+"(?:d|ll|m|re|s|t|ve))?",as="(?:"+wn+"(?:D|LL|M|RE|S|T|VE))?",cs=zo+"?",us="["+Qn+"]?",Uo="(?:"+ns+"(?:"+[is,Ji,hi].join("|")+")"+us+cs+")*",Yr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",hs="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ls=us+cs+Uo,Yi="(?:"+[jo,Ji,hi].join("|")+")"+ls,qo="(?:"+[is+Ci+"?",Ci,Ji,hi,Ai].join("|")+")",bn=RegExp(wn,"g"),Bo=RegExp(Ci,"g"),Xi=RegExp(Wi+"(?="+Wi+")|"+qo+ls,"g"),fs=RegExp([lr+"?"+ts+"+"+os+"(?="+[_n,lr,"$"].join("|")+")",qr+"+"+as+"(?="+[_n,lr+ss,"$"].join("|")+")",lr+"?"+ss+"+"+os,lr+"+"+as,hs,Yr,es,Yi].join("|"),"g"),ps=RegExp("["+ns+Vi+Yn+Qn+"]"),Oi=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ds=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ho=-1,Ve={};Ve[ht]=Ve[je]=Ve[At]=Ve[$t]=Ve[Ht]=Ve[kt]=Ve[zt]=Ve[Jt]=Ve[ir]=!0,Ve[Ie]=Ve[St]=Ve[De]=Ve[N]=Ve[Ke]=Ve[C]=Ve[E]=Ve[ee]=Ve[be]=Ve[Ne]=Ve[Pe]=Ve[ot]=Ve[$e]=Ve[Ze]=Ve[qe]=!1;var Be={};Be[Ie]=Be[St]=Be[De]=Be[Ke]=Be[N]=Be[C]=Be[ht]=Be[je]=Be[At]=Be[$t]=Be[Ht]=Be[be]=Be[Ne]=Be[Pe]=Be[ot]=Be[$e]=Be[Ze]=Be[Qe]=Be[kt]=Be[zt]=Be[Jt]=Be[ir]=!0,Be[E]=Be[ee]=Be[qe]=!1;var y={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},S={"&":"&","<":"<",">":">",'"':""","'":"'"},U={"&":"&","<":"<",">":">",""":'"',"'":"'"},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ge=parseFloat,me=parseInt,tt=typeof kn=="object"&&kn&&kn.Object===Object&&kn,Dt=typeof self=="object"&&self&&self.Object===Object&&self,Ce=tt||Dt||Function("return this")(),We=t&&!t.nodeType&&t,bt=We&&!0&&a&&!a.nodeType&&a,nr=bt&&bt.exports===We,Lt=nr&&tt.process,rt=function(){try{var P=bt&&bt.require&&bt.require("util").types;return P||Lt&&Lt.binding&&Lt.binding("util")}catch{}}(),Xt=rt&&rt.isArrayBuffer,Tr=rt&&rt.isDate,wr=rt&&rt.isMap,Br=rt&&rt.isRegExp,En=rt&&rt.isSet,Ri=rt&&rt.isTypedArray;function Ut(P,$,T){switch(T.length){case 0:return P.call($);case 1:return P.call($,T[0]);case 2:return P.call($,T[0],T[1]);case 3:return P.call($,T[0],T[1],T[2])}return P.apply($,T)}function qf(P,$,T,Z){for(var ye=-1,Fe=P==null?0:P.length;++ye-1}function ko(P,$,T){for(var Z=-1,ye=P==null?0:P.length;++Z-1;);return T}function qc(P,$){for(var T=P.length;T--&&Zi($,P[T],0)>-1;);return T}function Yf(P,$){for(var T=P.length,Z=0;T--;)P[T]===$&&++Z;return Z}var Xf=Wo(y),Zf=Wo(S);function Qf(P){return"\\"+Y[P]}function ep(P,$){return P==null?i:P[$]}function Qi(P){return ps.test(P)}function tp(P){return Oi.test(P)}function rp(P){for(var $,T=[];!($=P.next()).done;)T.push($.value);return T}function Zo(P){var $=-1,T=Array(P.size);return P.forEach(function(Z,ye){T[++$]=[ye,Z]}),T}function Bc(P,$){return function(T){return P($(T))}}function pi(P,$){for(var T=-1,Z=P.length,ye=0,Fe=[];++T-1}function Hp(e,r){var n=this.__data__,c=Ns(n,e);return c<0?(++this.size,n.push([e,r])):n[c][1]=r,this}Xr.prototype.clear=zp,Xr.prototype.delete=Up,Xr.prototype.get=qp,Xr.prototype.has=Bp,Xr.prototype.set=Hp;function Zr(e){var r=-1,n=e==null?0:e.length;for(this.clear();++r=r?e:r)),e}function Ir(e,r,n,c,l,d){var w,b=r&O,A=r&L,M=r&z;if(n&&(w=l?n(e,c,l,d):n(e)),w!==i)return w;if(!ut(e))return e;var j=we(e);if(j){if(w=Gd(e),!b)return sr(e,w)}else{var H=Wt(e),J=H==ee||H==ge;if(wi(e))return xu(e,b);if(H==Pe||H==Ie||J&&!l){if(w=A||J?{}:Hu(e),!b)return A?$d(e,sd(w,e)):Fd(e,eu(w,e))}else{if(!Be[H])return l?e:{};w=Wd(e,H,b)}}d||(d=new Dr);var te=d.get(e);if(te)return te;d.set(e,w),mh(e)?e.forEach(function(ae){w.add(Ir(ae,r,n,ae,e,d))}):yh(e)&&e.forEach(function(ae,Se){w.set(Se,Ir(ae,r,n,Se,e,d))});var oe=M?A?xa:Ia:A?ar:qt,Ee=j?i:oe(e);return _r(Ee||e,function(ae,Se){Ee&&(Se=ae,ae=e[Se]),On(w,Se,Ir(ae,r,n,Se,e,d))}),w}function od(e){var r=qt(e);return function(n){return tu(n,e,r)}}function tu(e,r,n){var c=n.length;if(e==null)return!c;for(e=Je(e);c--;){var l=n[c],d=r[l],w=e[l];if(w===i&&!(l in e)||!d(w))return!1}return!0}function ru(e,r,n){if(typeof e!="function")throw new br(p);return $n(function(){e.apply(i,n)},r)}function Rn(e,r,n,c){var l=-1,d=gs,w=!0,b=e.length,A=[],M=r.length;if(!b)return A;n&&(r=st(r,fr(n))),c?(d=ko,w=!1):r.length>=o&&(d=In,w=!1,r=new Di(r));e:for(;++ll?0:l+n),c=c===i||c>l?l:_e(c),c<0&&(c+=l),c=n>c?0:_h(c);n0&&n(b)?r>1?Kt(b,r-1,n,c,l):fi(l,b):c||(l[l.length]=b)}return l}var sa=Ru(),su=Ru(!0);function Hr(e,r){return e&&sa(e,r,qt)}function oa(e,r){return e&&su(e,r,qt)}function Ls(e,r){return li(r,function(n){return ii(e[n])})}function Fi(e,r){r=vi(r,e);for(var n=0,c=r.length;e!=null&&nr}function ud(e,r){return e!=null&&ze.call(e,r)}function hd(e,r){return e!=null&&r in Je(e)}function ld(e,r,n){return e>=Gt(r,n)&&e=120&&j.length>=120)?new Di(w&&j):i}j=e[0];var H=-1,J=b[0];e:for(;++H-1;)b!==e&&Ss.call(b,A,1),Ss.call(e,A,1);return e}function yu(e,r){for(var n=e?r.length:0,c=n-1;n--;){var l=r[n];if(n==c||l!==d){var d=l;ri(l)?Ss.call(e,l,1):ya(e,l)}}return e}function pa(e,r){return e+Cs(Yc()*(r-e+1))}function xd(e,r,n,c){for(var l=-1,d=jt(As((r-e)/(n||1)),0),w=T(d);d--;)w[c?d:++l]=e,e+=n;return w}function da(e,r){var n="";if(!e||r<1||r>V)return n;do r%2&&(n+=e),r=Cs(r/2),r&&(e+=e);while(r);return n}function xe(e,r){return Ta(Vu(e,r,cr),e+"")}function Sd(e){return Qc(ln(e))}function Pd(e,r){var n=ln(e);return Ks(n,Li(r,0,n.length))}function Dn(e,r,n,c){if(!ut(e))return e;r=vi(r,e);for(var l=-1,d=r.length,w=d-1,b=e;b!=null&&++ll?0:l+r),n=n>l?l:n,n<0&&(n+=l),l=r>n?0:n-r>>>0,r>>>=0;for(var d=T(l);++c>>1,w=e[d];w!==null&&!dr(w)&&(n?w<=r:w=o){var M=r?null:Ud(e);if(M)return vs(M);w=!1,l=In,A=new Di}else A=r?[]:b;e:for(;++c=c?e:xr(e,r,n)}var Iu=vp||function(e){return Ce.clearTimeout(e)};function xu(e,r){if(r)return e.slice();var n=e.length,c=Kc?Kc(n):new e.constructor(n);return e.copy(c),c}function _a(e){var r=new e.constructor(e.byteLength);return new Is(r).set(new Is(e)),r}function Td(e,r){var n=r?_a(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Nd(e){var r=new e.constructor(e.source,mr.exec(e));return r.lastIndex=e.lastIndex,r}function Dd(e){return Cn?Je(Cn.call(e)):{}}function Su(e,r){var n=r?_a(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Pu(e,r){if(e!==r){var n=e!==i,c=e===null,l=e===e,d=dr(e),w=r!==i,b=r===null,A=r===r,M=dr(r);if(!b&&!M&&!d&&e>r||d&&w&&A&&!b&&!M||c&&w&&A||!n&&A||!l)return 1;if(!c&&!d&&!M&&e=b)return A;var M=n[c];return A*(M=="desc"?-1:1)}}return e.index-r.index}function Au(e,r,n,c){for(var l=-1,d=e.length,w=n.length,b=-1,A=r.length,M=jt(d-w,0),j=T(A+M),H=!c;++b1?n[l-1]:i,w=l>2?n[2]:i;for(d=e.length>3&&typeof d=="function"?(l--,d):i,w&&Qt(n[0],n[1],w)&&(d=l<3?i:d,l=1),r=Je(r);++c-1?l[d?r[w]:w]:i}}function Du(e){return ti(function(r){var n=r.length,c=n,l=Er.prototype.thru;for(e&&r.reverse();c--;){var d=r[c];if(typeof d!="function")throw new br(p);if(l&&!w&&Hs(d)=="wrapper")var w=new Er([],!0)}for(c=w?c:n;++c1&&Oe.reverse(),j&&Ab))return!1;var M=d.get(e),j=d.get(r);if(M&&j)return M==r&&j==e;var H=-1,J=!0,te=n&K?new Di:i;for(d.set(e,r),d.set(r,e);++H1?"& ":"")+r[c],r=r.join(n>2?", ":" "),e.replace(yt,`{ -/* [wrapped with `+r+`] */ -`)}function Yd(e){return we(e)||ji(e)||!!(Wc&&e&&e[Wc])}function ri(e,r){var n=typeof e;return r=r??V,!!r&&(n=="number"||n!="symbol"&&Ro.test(e))&&e>-1&&e%1==0&&e0){if(++r>=Te)return arguments[0]}else r=0;return e.apply(i,arguments)}}function Ks(e,r){var n=-1,c=e.length,l=c-1;for(r=r===i?c:r;++n1?e[r-1]:i;return n=typeof n=="function"?(e.pop(),n):i,nh(e,n)});function sh(e){var r=f(e);return r.__chain__=!0,r}function ay(e,r){return r(e),e}function Vs(e,r){return r(e)}var cy=ti(function(e){var r=e.length,n=r?e[0]:0,c=this.__wrapped__,l=function(d){return na(d,e)};return r>1||this.__actions__.length||!(c instanceof Ae)||!ri(n)?this.thru(l):(c=c.slice(n,+n+(r?1:0)),c.__actions__.push({func:Vs,args:[l],thisArg:i}),new Er(c,this.__chain__).thru(function(d){return r&&!d.length&&d.push(i),d}))});function uy(){return sh(this)}function hy(){return new Er(this.value(),this.__chain__)}function ly(){this.__values__===i&&(this.__values__=wh(this.value()));var e=this.__index__>=this.__values__.length,r=e?i:this.__values__[this.__index__++];return{done:e,value:r}}function fy(){return this}function py(e){for(var r,n=this;n instanceof Ts;){var c=Zu(n);c.__index__=0,c.__values__=i,r?l.__wrapped__=c:r=c;var l=c;n=n.__wrapped__}return l.__wrapped__=e,r}function dy(){var e=this.__wrapped__;if(e instanceof Ae){var r=e;return this.__actions__.length&&(r=new Ae(this)),r=r.reverse(),r.__actions__.push({func:Vs,args:[Na],thisArg:i}),new Er(r,this.__chain__)}return this.thru(Na)}function gy(){return bu(this.__wrapped__,this.__actions__)}var yy=js(function(e,r,n){ze.call(e,n)?++e[n]:Qr(e,n,1)});function vy(e,r,n){var c=we(e)?Lc:ad;return n&&Qt(e,r,n)&&(r=i),c(e,ne(r,3))}function my(e,r){var n=we(e)?li:nu;return n(e,ne(r,3))}var wy=Nu(Qu),_y=Nu(eh);function by(e,r){return Kt(Gs(e,r),1)}function Ey(e,r){return Kt(Gs(e,r),ce)}function Iy(e,r,n){return n=n===i?1:_e(n),Kt(Gs(e,r),n)}function oh(e,r){var n=we(e)?_r:gi;return n(e,ne(r,3))}function ah(e,r){var n=we(e)?Bf:iu;return n(e,ne(r,3))}var xy=js(function(e,r,n){ze.call(e,n)?e[n].push(r):Qr(e,n,[r])});function Sy(e,r,n,c){e=or(e)?e:ln(e),n=n&&!c?_e(n):0;var l=e.length;return n<0&&(n=jt(l+n,0)),Zs(e)?n<=l&&e.indexOf(r,n)>-1:!!l&&Zi(e,r,n)>-1}var Py=xe(function(e,r,n){var c=-1,l=typeof r=="function",d=or(e)?T(e.length):[];return gi(e,function(w){d[++c]=l?Ut(r,w,n):Tn(w,r,n)}),d}),Ay=js(function(e,r,n){Qr(e,n,r)});function Gs(e,r){var n=we(e)?st:hu;return n(e,ne(r,3))}function Cy(e,r,n,c){return e==null?[]:(we(r)||(r=r==null?[]:[r]),n=c?i:n,we(n)||(n=n==null?[]:[n]),du(e,r,n))}var Oy=js(function(e,r,n){e[n?0:1].push(r)},function(){return[[],[]]});function Ry(e,r,n){var c=we(e)?Ko:jc,l=arguments.length<3;return c(e,ne(r,4),n,l,gi)}function Ty(e,r,n){var c=we(e)?Hf:jc,l=arguments.length<3;return c(e,ne(r,4),n,l,iu)}function Ny(e,r){var n=we(e)?li:nu;return n(e,Ys(ne(r,3)))}function Dy(e){var r=we(e)?Qc:Sd;return r(e)}function Ly(e,r,n){(n?Qt(e,r,n):r===i)?r=1:r=_e(r);var c=we(e)?rd:Pd;return c(e,r)}function Fy(e){var r=we(e)?id:Cd;return r(e)}function $y(e){if(e==null)return 0;if(or(e))return Zs(e)?en(e):e.length;var r=Wt(e);return r==be||r==$e?e.size:ha(e).length}function My(e,r,n){var c=we(e)?Vo:Od;return n&&Qt(e,r,n)&&(r=i),c(e,ne(r,3))}var jy=xe(function(e,r){if(e==null)return[];var n=r.length;return n>1&&Qt(e,r[0],r[1])?r=[]:n>2&&Qt(r[0],r[1],r[2])&&(r=[r[0]]),du(e,Kt(r,1),[])}),Ws=mp||function(){return Ce.Date.now()};function zy(e,r){if(typeof r!="function")throw new br(p);return e=_e(e),function(){if(--e<1)return r.apply(this,arguments)}}function ch(e,r,n){return r=n?i:r,r=e&&r==null?e.length:r,ei(e,q,i,i,i,i,r)}function uh(e,r){var n;if(typeof r!="function")throw new br(p);return e=_e(e),function(){return--e>0&&(n=r.apply(this,arguments)),e<=1&&(r=i),n}}var La=xe(function(e,r,n){var c=re;if(n.length){var l=pi(n,un(La));c|=de}return ei(e,c,r,n,l)}),hh=xe(function(e,r,n){var c=re|he;if(n.length){var l=pi(n,un(hh));c|=de}return ei(r,c,e,n,l)});function lh(e,r,n){r=n?i:r;var c=ei(e,fe,i,i,i,i,i,r);return c.placeholder=lh.placeholder,c}function fh(e,r,n){r=n?i:r;var c=ei(e,pe,i,i,i,i,i,r);return c.placeholder=fh.placeholder,c}function ph(e,r,n){var c,l,d,w,b,A,M=0,j=!1,H=!1,J=!0;if(typeof e!="function")throw new br(p);r=Pr(r)||0,ut(n)&&(j=!!n.leading,H="maxWait"in n,d=H?jt(Pr(n.maxWait)||0,r):d,J="trailing"in n?!!n.trailing:J);function te(It){var Fr=c,si=l;return c=l=i,M=It,w=e.apply(si,Fr),w}function oe(It){return M=It,b=$n(Se,r),j?te(It):w}function Ee(It){var Fr=It-A,si=It-M,Nh=r-Fr;return H?Gt(Nh,d-si):Nh}function ae(It){var Fr=It-A,si=It-M;return A===i||Fr>=r||Fr<0||H&&si>=d}function Se(){var It=Ws();if(ae(It))return Oe(It);b=$n(Se,Ee(It))}function Oe(It){return b=i,J&&c?te(It):(c=l=i,w)}function gr(){b!==i&&Iu(b),M=0,c=A=l=b=i}function er(){return b===i?w:Oe(Ws())}function yr(){var It=Ws(),Fr=ae(It);if(c=arguments,l=this,A=It,Fr){if(b===i)return oe(A);if(H)return Iu(b),b=$n(Se,r),te(A)}return b===i&&(b=$n(Se,r)),w}return yr.cancel=gr,yr.flush=er,yr}var Uy=xe(function(e,r){return ru(e,1,r)}),qy=xe(function(e,r,n){return ru(e,Pr(r)||0,n)});function By(e){return ei(e,ve)}function Js(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new br(p);var n=function(){var c=arguments,l=r?r.apply(this,c):c[0],d=n.cache;if(d.has(l))return d.get(l);var w=e.apply(this,c);return n.cache=d.set(l,w)||d,w};return n.cache=new(Js.Cache||Zr),n}Js.Cache=Zr;function Ys(e){if(typeof e!="function")throw new br(p);return function(){var r=arguments;switch(r.length){case 0:return!e.call(this);case 1:return!e.call(this,r[0]);case 2:return!e.call(this,r[0],r[1]);case 3:return!e.call(this,r[0],r[1],r[2])}return!e.apply(this,r)}}function Hy(e){return uh(2,e)}var ky=Rd(function(e,r){r=r.length==1&&we(r[0])?st(r[0],fr(ne())):st(Kt(r,1),fr(ne()));var n=r.length;return xe(function(c){for(var l=-1,d=Gt(c.length,n);++l=r}),ji=au(function(){return arguments}())?au:function(e){return vt(e)&&ze.call(e,"callee")&&!Gc.call(e,"callee")},we=T.isArray,sv=Xt?fr(Xt):pd;function or(e){return e!=null&&Xs(e.length)&&!ii(e)}function Et(e){return vt(e)&&or(e)}function ov(e){return e===!0||e===!1||vt(e)&&Zt(e)==N}var wi=_p||Va,av=Tr?fr(Tr):dd;function cv(e){return vt(e)&&e.nodeType===1&&!Mn(e)}function uv(e){if(e==null)return!0;if(or(e)&&(we(e)||typeof e=="string"||typeof e.splice=="function"||wi(e)||hn(e)||ji(e)))return!e.length;var r=Wt(e);if(r==be||r==$e)return!e.size;if(Fn(e))return!ha(e).length;for(var n in e)if(ze.call(e,n))return!1;return!0}function hv(e,r){return Nn(e,r)}function lv(e,r,n){n=typeof n=="function"?n:i;var c=n?n(e,r):i;return c===i?Nn(e,r,i,n):!!c}function $a(e){if(!vt(e))return!1;var r=Zt(e);return r==E||r==u||typeof e.message=="string"&&typeof e.name=="string"&&!Mn(e)}function fv(e){return typeof e=="number"&&Jc(e)}function ii(e){if(!ut(e))return!1;var r=Zt(e);return r==ee||r==ge||r==D||r==wt}function gh(e){return typeof e=="number"&&e==_e(e)}function Xs(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=V}function ut(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}function vt(e){return e!=null&&typeof e=="object"}var yh=wr?fr(wr):yd;function pv(e,r){return e===r||ua(e,r,Pa(r))}function dv(e,r,n){return n=typeof n=="function"?n:i,ua(e,r,Pa(r),n)}function gv(e){return vh(e)&&e!=+e}function yv(e){if(Qd(e))throw new ye(h);return cu(e)}function vv(e){return e===null}function mv(e){return e==null}function vh(e){return typeof e=="number"||vt(e)&&Zt(e)==Ne}function Mn(e){if(!vt(e)||Zt(e)!=Pe)return!1;var r=xs(e);if(r===null)return!0;var n=ze.call(r,"constructor")&&r.constructor;return typeof n=="function"&&n instanceof n&&_s.call(n)==dp}var Ma=Br?fr(Br):vd;function wv(e){return gh(e)&&e>=-V&&e<=V}var mh=En?fr(En):md;function Zs(e){return typeof e=="string"||!we(e)&&vt(e)&&Zt(e)==Ze}function dr(e){return typeof e=="symbol"||vt(e)&&Zt(e)==Qe}var hn=Ri?fr(Ri):wd;function _v(e){return e===i}function bv(e){return vt(e)&&Wt(e)==qe}function Ev(e){return vt(e)&&Zt(e)==et}var Iv=Bs(la),xv=Bs(function(e,r){return e<=r});function wh(e){if(!e)return[];if(or(e))return Zs(e)?Nr(e):sr(e);if(xn&&e[xn])return rp(e[xn]());var r=Wt(e),n=r==be?Zo:r==$e?vs:ln;return n(e)}function ni(e){if(!e)return e===0?e:0;if(e=Pr(e),e===ce||e===-ce){var r=e<0?-1:1;return r*B}return e===e?e:0}function _e(e){var r=ni(e),n=r%1;return r===r?n?r-n:r:0}function _h(e){return e?Li(_e(e),0,G):0}function Pr(e){if(typeof e=="number")return e;if(dr(e))return k;if(ut(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=ut(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=zc(e);var n=Ao.test(e);return n||Oo.test(e)?me(e.slice(2),n?2:8):Po.test(e)?k:+e}function bh(e){return kr(e,ar(e))}function Sv(e){return e?Li(_e(e),-V,V):e===0?e:0}function Me(e){return e==null?"":pr(e)}var Pv=an(function(e,r){if(Fn(r)||or(r)){kr(r,qt(r),e);return}for(var n in r)ze.call(r,n)&&On(e,n,r[n])}),Eh=an(function(e,r){kr(r,ar(r),e)}),Qs=an(function(e,r,n,c){kr(r,ar(r),e,c)}),Av=an(function(e,r,n,c){kr(r,qt(r),e,c)}),Cv=ti(na);function Ov(e,r){var n=on(e);return r==null?n:eu(n,r)}var Rv=xe(function(e,r){e=Je(e);var n=-1,c=r.length,l=c>2?r[2]:i;for(l&&Qt(r[0],r[1],l)&&(c=1);++n1),d}),kr(e,xa(e),n),c&&(n=Ir(n,O|L|z,qd));for(var l=r.length;l--;)ya(n,r[l]);return n});function Wv(e,r){return xh(e,Ys(ne(r)))}var Jv=ti(function(e,r){return e==null?{}:Ed(e,r)});function xh(e,r){if(e==null)return{};var n=st(xa(e),function(c){return[c]});return r=ne(r),gu(e,n,function(c,l){return r(c,l[0])})}function Yv(e,r,n){r=vi(r,e);var c=-1,l=r.length;for(l||(l=1,e=i);++cr){var c=e;e=r,r=c}if(n||e%1||r%1){var l=Yc();return Gt(e+l*(r-e+Ge("1e-"+((l+"").length-1))),r)}return pa(e,r)}var a0=cn(function(e,r,n){return r=r.toLowerCase(),e+(n?Ah(r):r)});function Ah(e){return Ua(Me(e).toLowerCase())}function Ch(e){return e=Me(e),e&&e.replace(Jr,Xf).replace(Bo,"")}function c0(e,r,n){e=Me(e),r=pr(r);var c=e.length;n=n===i?c:Li(_e(n),0,c);var l=n;return n-=r.length,n>=0&&e.slice(n,l)==r}function u0(e){return e=Me(e),e&&it.test(e)?e.replace(Si,Zf):e}function h0(e){return e=Me(e),e&&Rt.test(e)?e.replace(dt,"\\$&"):e}var l0=cn(function(e,r,n){return e+(n?"-":"")+r.toLowerCase()}),f0=cn(function(e,r,n){return e+(n?" ":"")+r.toLowerCase()}),p0=Tu("toLowerCase");function d0(e,r,n){e=Me(e),r=_e(r);var c=r?en(e):0;if(!r||c>=r)return e;var l=(r-c)/2;return qs(Cs(l),n)+e+qs(As(l),n)}function g0(e,r,n){e=Me(e),r=_e(r);var c=r?en(e):0;return r&&c>>0,n?(e=Me(e),e&&(typeof r=="string"||r!=null&&!Ma(r))&&(r=pr(r),!r&&Qi(e))?mi(Nr(e),0,n):e.split(r,n)):[]}var E0=cn(function(e,r,n){return e+(n?" ":"")+Ua(r)});function I0(e,r,n){return e=Me(e),n=n==null?0:Li(_e(n),0,e.length),r=pr(r),e.slice(n,n+r.length)==r}function x0(e,r,n){var c=f.templateSettings;n&&Qt(e,r,n)&&(r=i),e=Me(e),r=Qs({},r,c,ju);var l=Qs({},r.imports,c.imports,ju),d=qt(l),w=Xo(l,d),b,A,M=0,j=r.interpolate||Ki,H="__p += '",J=Qo((r.escape||Ki).source+"|"+j.source+"|"+(j===ct?So:Ki).source+"|"+(r.evaluate||Ki).source+"|$","g"),te="//# sourceURL="+(ze.call(r,"sourceURL")?(r.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ho+"]")+` -`;e.replace(J,function(ae,Se,Oe,gr,er,yr){return Oe||(Oe=gr),H+=e.slice(M,yr).replace(To,Qf),Se&&(b=!0,H+=`' + -__e(`+Se+`) + -'`),er&&(A=!0,H+=`'; -`+er+`; -__p += '`),Oe&&(H+=`' + -((__t = (`+Oe+`)) == null ? '' : __t) + -'`),M=yr+ae.length,ae}),H+=`'; -`;var oe=ze.call(r,"variable")&&r.variable;if(!oe)H=`with (obj) { -`+H+` -} -`;else if(Io.test(oe))throw new ye(g);H=(A?H.replace(Ur,""):H).replace(Yt,"$1").replace(Wr,"$1;"),H="function("+(oe||"obj")+`) { -`+(oe?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(b?", __e = _.escape":"")+(A?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+H+`return __p -}`;var Ee=Rh(function(){return Fe(d,te+"return "+H).apply(i,w)});if(Ee.source=H,$a(Ee))throw Ee;return Ee}function S0(e){return Me(e).toLowerCase()}function P0(e){return Me(e).toUpperCase()}function A0(e,r,n){if(e=Me(e),e&&(n||r===i))return zc(e);if(!e||!(r=pr(r)))return e;var c=Nr(e),l=Nr(r),d=Uc(c,l),w=qc(c,l)+1;return mi(c,d,w).join("")}function C0(e,r,n){if(e=Me(e),e&&(n||r===i))return e.slice(0,Hc(e)+1);if(!e||!(r=pr(r)))return e;var c=Nr(e),l=qc(c,Nr(r))+1;return mi(c,0,l).join("")}function O0(e,r,n){if(e=Me(e),e&&(n||r===i))return e.replace(gt,"");if(!e||!(r=pr(r)))return e;var c=Nr(e),l=Uc(c,Nr(r));return mi(c,l).join("")}function R0(e,r){var n=ie,c=ue;if(ut(r)){var l="separator"in r?r.separator:l;n="length"in r?_e(r.length):n,c="omission"in r?pr(r.omission):c}e=Me(e);var d=e.length;if(Qi(e)){var w=Nr(e);d=w.length}if(n>=d)return e;var b=n-en(c);if(b<1)return c;var A=w?mi(w,0,b).join(""):e.slice(0,b);if(l===i)return A+c;if(w&&(b+=A.length-b),Ma(l)){if(e.slice(b).search(l)){var M,j=A;for(l.global||(l=Qo(l.source,Me(mr.exec(l))+"g")),l.lastIndex=0;M=l.exec(j);)var H=M.index;A=A.slice(0,H===i?b:H)}}else if(e.indexOf(pr(l),b)!=b){var J=A.lastIndexOf(l);J>-1&&(A=A.slice(0,J))}return A+c}function T0(e){return e=Me(e),e&<.test(e)?e.replace(ui,op):e}var N0=cn(function(e,r,n){return e+(n?" ":"")+r.toUpperCase()}),Ua=Tu("toUpperCase");function Oh(e,r,n){return e=Me(e),r=n?i:r,r===i?tp(e)?up(e):Vf(e):e.match(r)||[]}var Rh=xe(function(e,r){try{return Ut(e,i,r)}catch(n){return $a(n)?n:new ye(n)}}),D0=ti(function(e,r){return _r(r,function(n){n=Kr(n),Qr(e,n,La(e[n],e))}),e});function L0(e){var r=e==null?0:e.length,n=ne();return e=r?st(e,function(c){if(typeof c[1]!="function")throw new br(p);return[n(c[0]),c[1]]}):[],xe(function(c){for(var l=-1;++lV)return[];var n=G,c=Gt(e,G);r=ne(r),e-=G;for(var l=Yo(c,r);++n0||r<0)?new Ae(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),r!==i&&(r=_e(r),n=r<0?n.dropRight(-r):n.take(r-e)),n)},Ae.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ae.prototype.toArray=function(){return this.take(G)},Hr(Ae.prototype,function(e,r){var n=/^(?:filter|find|map|reject)|While$/.test(r),c=/^(?:head|last)$/.test(r),l=f[c?"take"+(r=="last"?"Right":""):r],d=c||/^find/.test(r);l&&(f.prototype[r]=function(){var w=this.__wrapped__,b=c?[1]:arguments,A=w instanceof Ae,M=b[0],j=A||we(w),H=function(Se){var Oe=l.apply(f,fi([Se],b));return c&&J?Oe[0]:Oe};j&&n&&typeof M=="function"&&M.length!=1&&(A=j=!1);var J=this.__chain__,te=!!this.__actions__.length,oe=d&&!J,Ee=A&&!te;if(!d&&j){w=Ee?w:new Ae(this);var ae=e.apply(w,b);return ae.__actions__.push({func:Vs,args:[H],thisArg:i}),new Er(ae,J)}return oe&&Ee?e.apply(this,b):(ae=this.thru(H),oe?c?ae.value()[0]:ae.value():ae)})}),_r(["pop","push","shift","sort","splice","unshift"],function(e){var r=ms[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",c=/^(?:pop|shift)$/.test(e);f.prototype[e]=function(){var l=arguments;if(c&&!this.__chain__){var d=this.value();return r.apply(we(d)?d:[],l)}return this[n](function(w){return r.apply(we(w)?w:[],l)})}}),Hr(Ae.prototype,function(e,r){var n=f[r];if(n){var c=n.name+"";ze.call(sn,c)||(sn[c]=[]),sn[c].push({name:r,func:n})}}),sn[zs(i,he).name]=[{name:"wrapper",func:i}],Ae.prototype.clone=Tp,Ae.prototype.reverse=Np,Ae.prototype.value=Dp,f.prototype.at=cy,f.prototype.chain=uy,f.prototype.commit=hy,f.prototype.next=ly,f.prototype.plant=py,f.prototype.reverse=dy,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=gy,f.prototype.first=f.prototype.head,xn&&(f.prototype[xn]=fy),f},tn=hp();bt?((bt.exports=tn)._=tn,We._=tn):Ce._=tn}).call(kn)})(yc,yc.exports);var jE=Object.defineProperty,zE=Object.defineProperties,UE=Object.getOwnPropertyDescriptors,Dl=Object.getOwnPropertySymbols,qE=Object.prototype.hasOwnProperty,BE=Object.prototype.propertyIsEnumerable,Ll=(a,t,i)=>t in a?jE(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,io=(a,t)=>{for(var i in t||(t={}))qE.call(t,i)&&Ll(a,i,t[i]);if(Dl)for(var i of Dl(t))BE.call(t,i)&&Ll(a,i,t[i]);return a},HE=(a,t)=>zE(a,UE(t));function Or(a,t,i){let s;const o=vc(a);return t.rpcMap&&(s=t.rpcMap[o]),s||(s=`${ME}?chainId=eip155:${o}&projectId=${i}`),s}function vc(a){return a.includes("eip155")?Number(a.split(":")[1]):Number(a)}function zf(a){return a.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}function kE(a,t){const i=Object.keys(t.namespaces).filter(o=>o.includes(a));if(!i.length)return[];const s=[];return i.forEach(o=>{const h=t.namespaces[o].accounts;s.push(...h)}),s}function KE(a={},t={}){const i=Fl(a),s=Fl(t);return yc.exports.merge(i,s)}function Fl(a){var t,i,s,o;const h={};if(!oo(a))return h;for(const[p,g]of Object.entries(a)){const _=Wl(p)?[p]:g.chains,m=g.methods||[],x=g.events||[],O=g.rpcMap||{},L=ao(p);h[L]=HE(io(io({},h[L]),g),{chains:Wa(_,(t=h[L])==null?void 0:t.chains),methods:Wa(m,(i=h[L])==null?void 0:i.methods),events:Wa(x,(s=h[L])==null?void 0:s.events),rpcMap:io(io({},O),(o=h[L])==null?void 0:o.rpcMap)})}return h}function VE(a){return a.includes(":")?a.split(":")[2]:a}function GE(a){const t={};for(const[i,s]of Object.entries(a)){const o=s.methods||[],h=s.events||[],p=s.accounts||[],g=Wl(i)?[i]:s.chains?s.chains:zf(s.accounts);t[i]={chains:g,methods:o,events:h,accounts:p}}return t}const Uf={},xt=a=>Uf[a],ac=(a,t)=>{Uf[a]=t};class WE{constructor(t){this.name="polkadot",this.namespace=t.namespace,this.events=xt("events"),this.client=xt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,i){if(this.chainId=t,!this.httpProviders[t]){const s=i||Or(`${this.name}:${t}`,this.namespace);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,s)}this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(i=>{var s;t[i]=this.createHttpProvider(i,(s=this.namespace.rpcMap)==null?void 0:s[i])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,i=this.httpProviders[t];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return i}setHttpProvider(t,i){const s=this.createHttpProvider(t,i);s&&(this.httpProviders[t]=s)}createHttpProvider(t,i){const s=i||Or(t,this.namespace);return typeof s>"u"?void 0:new Ii(new ki(s,xt("disableProviderPing")))}}class JE{constructor(t){this.name="eip155",this.namespace=t.namespace,this.events=xt("events"),this.client=xt("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(t){switch(t.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,i){const s=vc(t);if(!this.httpProviders[s]){const o=i||Or(`${this.name}:${s}`,this.namespace,this.client.core.projectId);if(!o)throw new Error(`No RPC url provided for chainId: ${s}`);this.setHttpProvider(s,o)}this.chainId=s,this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,i){const s=i||Or(`${this.name}:${t}`,this.namespace,this.client.core.projectId);return typeof s>"u"?void 0:new Ii(new ki(s,xt("disableProviderPing")))}setHttpProvider(t,i){const s=this.createHttpProvider(t,i);s&&(this.httpProviders[t]=s)}createHttpProviders(){const t={};return this.namespace.chains.forEach(i=>{var s;const o=vc(i);t[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[i])}),t}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}getHttpProvider(){const t=this.chainId,i=this.httpProviders[t];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return i}async handleSwitchChain(t){var i,s;let o=t.request.params?(i=t.request.params[0])==null?void 0:i.chainId:"0x0";o=o.startsWith("0x")?o:`0x${o}`;const h=parseInt(o,16);if(this.isChainApproved(h))this.setDefaultChain(`${h}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:t.topic,request:{method:t.request.method,params:[{chainId:o}]},chainId:(s=this.namespace.chains)==null?void 0:s[0]}),this.setDefaultChain(`${h}`);else throw new Error(`Failed to switch to chain 'eip155:${h}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(t){return this.namespace.chains.includes(`${this.name}:${t}`)}}class YE{constructor(t){this.name="solana",this.namespace=t.namespace,this.events=xt("events"),this.client=xt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,i){if(!this.httpProviders[t]){const s=i||Or(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,s)}this.chainId=t,this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(i=>{var s;t[i]=this.createHttpProvider(i,(s=this.namespace.rpcMap)==null?void 0:s[i])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,i=this.httpProviders[t];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return i}setHttpProvider(t,i){const s=this.createHttpProvider(t,i);s&&(this.httpProviders[t]=s)}createHttpProvider(t,i){const s=i||Or(t,this.namespace,this.client.core.projectId);return typeof s>"u"?void 0:new Ii(new ki(s,xt("disableProviderPing")))}}class XE{constructor(t){this.name="cosmos",this.namespace=t.namespace,this.events=xt("events"),this.client=xt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,i){if(this.chainId=t,!this.httpProviders[t]){const s=i||Or(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,s)}this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(i=>{var s;t[i]=this.createHttpProvider(i,(s=this.namespace.rpcMap)==null?void 0:s[i])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,i=this.httpProviders[t];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return i}setHttpProvider(t,i){const s=this.createHttpProvider(t,i);s&&(this.httpProviders[t]=s)}createHttpProvider(t,i){const s=i||Or(t,this.namespace,this.client.core.projectId);return typeof s>"u"?void 0:new Ii(new ki(s,xt("disableProviderPing")))}}class ZE{constructor(t){this.name="cip34",this.namespace=t.namespace,this.events=xt("events"),this.client=xt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,i){if(this.chainId=t,!this.httpProviders[t]){const s=i||this.getCardanoRPCUrl(t);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,s)}this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(i=>{const s=this.getCardanoRPCUrl(i);t[i]=this.createHttpProvider(i,s)}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,i=this.httpProviders[t];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return i}getCardanoRPCUrl(t){const i=this.namespace.rpcMap;if(i)return i[t]}setHttpProvider(t,i){const s=this.createHttpProvider(t,i);s&&(this.httpProviders[t]=s)}createHttpProvider(t,i){const s=i||this.getCardanoRPCUrl(t);return typeof s>"u"?void 0:new Ii(new ki(s,xt("disableProviderPing")))}}class QE{constructor(t){this.name="elrond",this.namespace=t.namespace,this.events=xt("events"),this.client=xt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,i){if(!this.httpProviders[t]){const s=i||Or(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,s)}this.chainId=t,this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(i=>{var s;t[i]=this.createHttpProvider(i,(s=this.namespace.rpcMap)==null?void 0:s[i])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,i=this.httpProviders[t];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return i}setHttpProvider(t,i){const s=this.createHttpProvider(t,i);s&&(this.httpProviders[t]=s)}createHttpProvider(t,i){const s=i||Or(t,this.namespace,this.client.core.projectId);return typeof s>"u"?void 0:new Ii(new ki(s,xt("disableProviderPing")))}}class eI{constructor(t){this.name="multiversx",this.namespace=t.namespace,this.events=xt("events"),this.client=xt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,i){if(!this.httpProviders[t]){const s=i||Or(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,s)}this.chainId=t,this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(i=>{var s;t[i]=this.createHttpProvider(i,(s=this.namespace.rpcMap)==null?void 0:s[i])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,i=this.httpProviders[t];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return i}setHttpProvider(t,i){const s=this.createHttpProvider(t,i);s&&(this.httpProviders[t]=s)}createHttpProvider(t,i){const s=i||Or(t,this.namespace,this.client.core.projectId);return typeof s>"u"?void 0:new Ii(new ki(s,xt("disableProviderPing")))}}var tI=Object.defineProperty,rI=Object.defineProperties,iI=Object.getOwnPropertyDescriptors,$l=Object.getOwnPropertySymbols,nI=Object.prototype.hasOwnProperty,sI=Object.prototype.propertyIsEnumerable,Ml=(a,t,i)=>t in a?tI(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,no=(a,t)=>{for(var i in t||(t={}))nI.call(t,i)&&Ml(a,i,t[i]);if($l)for(var i of $l(t))sI.call(t,i)&&Ml(a,i,t[i]);return a},cc=(a,t)=>rI(a,iI(t));class Nc{constructor(t){this.events=new Ic,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger=typeof(t==null?void 0:t.logger)<"u"&&typeof(t==null?void 0:t.logger)!="string"?t.logger:Re.pino(Re.getDefaultLoggerOptions({level:(t==null?void 0:t.logger)||Tl})),this.disableProviderPing=(t==null?void 0:t.disableProviderPing)||!1}static async init(t){const i=new Nc(t);return await i.initialize(),i}async request(t,i){const[s,o]=this.validateChain(i);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(s).request({request:no({},t),chainId:`${s}:${o}`,topic:this.session.topic})}sendAsync(t,i,s){this.request(t,s).then(o=>i(null,o)).catch(o=>i(o,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var t;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(t=this.session)==null?void 0:t.topic,reason:rr("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(t),await this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}on(t,i){this.events.on(t,i)}once(t,i){this.events.once(t,i)}removeListener(t,i){this.events.removeListener(t,i)}off(t,i){this.events.off(t,i)}get isWalletConnect(){return!0}async pair(t){this.shouldAbortPairingAttempt=!1;let i=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(i>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:s,approval:o}=await this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});s&&(this.uri=s,this.events.emit("display_uri",s)),await o().then(h=>{this.session=h,this.namespaces||(this.namespaces=GE(h.namespaces),this.persist("namespaces",this.namespaces))}).catch(h=>{if(h.message!==Mf)throw h;i++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(t,i){try{if(!this.session)return;const[s,o]=this.validateChain(t);this.getProvider(s).setDefaultChain(o,i)}catch(s){if(!/Please call connect/.test(s.message))throw s}}async cleanupPendingPairings(t={}){this.logger.info("Cleaning up inactive pairings...");const i=this.client.pairing.getAll();if(yn(i)){for(const s of i)t.deletePairings?this.client.core.expirer.set(s.topic,0):await this.client.core.relayer.subscriber.unsubscribe(s.topic);this.logger.info(`Inactive pairings cleared: ${i.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const t=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[t]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await RE.init({logger:this.providerOpts.logger||Tl,relayUrl:this.providerOpts.relayUrl||LE,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const t=[...new Set(Object.keys(this.session.namespaces).map(i=>ao(i)))];ac("client",this.client),ac("events",this.events),ac("disableProviderPing",this.disableProviderPing),t.forEach(i=>{if(!this.session)return;const s=kE(i,this.session),o=zf(s),h=KE(this.namespaces,this.optionalNamespaces),p=cc(no({},h[i]),{accounts:s,chains:o});switch(i){case"eip155":this.rpcProviders[i]=new JE({namespace:p});break;case"solana":this.rpcProviders[i]=new YE({namespace:p});break;case"cosmos":this.rpcProviders[i]=new XE({namespace:p});break;case"polkadot":this.rpcProviders[i]=new WE({namespace:p});break;case"cip34":this.rpcProviders[i]=new ZE({namespace:p});break;case"elrond":this.rpcProviders[i]=new QE({namespace:p});break;case"multiversx":this.rpcProviders[i]=new eI({namespace:p});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",t=>{this.events.emit("session_ping",t)}),this.client.on("session_event",t=>{const{params:i}=t,{event:s}=i;if(s.name==="accountsChanged"){const o=s.data;o&&yn(o)&&this.events.emit("accountsChanged",o.map(VE))}else s.name==="chainChanged"?this.onChainChanged(i.chainId):this.events.emit(s.name,s.data);this.events.emit("session_event",t)}),this.client.on("session_update",({topic:t,params:i})=>{var s;const{namespaces:o}=i,h=(s=this.client)==null?void 0:s.session.get(t);this.session=cc(no({},h),{namespaces:o}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:i})}),this.client.on("session_delete",async t=>{await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",cc(no({},rr("USER_DISCONNECTED")),{data:t.topic}))}),this.on(xi.DEFAULT_CHAIN_CHANGED,t=>{this.onChainChanged(t,!0)})}getProvider(t){if(!this.rpcProviders[t])throw new Error(`Provider not found: ${t}`);return this.rpcProviders[t]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{var i;this.getProvider(t).updateNamespace((i=this.session)==null?void 0:i.namespaces[t])})}setNamespaces(t){const{namespaces:i,optionalNamespaces:s,sessionProperties:o}=t;i&&Object.keys(i).length&&(this.namespaces=i),s&&Object.keys(s).length&&(this.optionalNamespaces=s),this.sessionProperties=o,this.persist("namespaces",i),this.persist("optionalNamespaces",s)}validateChain(t){const[i,s]=(t==null?void 0:t.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[i,s];if(i&&!Object.keys(this.namespaces||{}).map(p=>ao(p)).includes(i))throw new Error(`Namespace '${i}' is not configured. Please call connect() first with namespace config.`);if(i&&s)return[i,s];const o=ao(Object.keys(this.namespaces)[0]),h=this.rpcProviders[o].getDefaultChain();return[o,h]}async requestAccounts(){const[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}onChainChanged(t,i=!1){var s;if(!this.namespaces)return;const[o,h]=this.validateChain(t);i||this.getProvider(o).setDefaultChain(h),((s=this.namespaces[o])!=null?s:this.namespaces[`${o}:${h}`]).defaultChain=h,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",h)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(t,i){this.client.core.storage.setItem(`${Nl}/${t}`,i)}async getFromStore(t){return await this.client.core.storage.getItem(`${Nl}/${t}`)}}const oI=Nc,aI="wc",cI="ethereum_provider",uI=`${aI}@2:${cI}:`,hI="https://rpc.walletconnect.com/v1/",mc=["eth_sendTransaction","personal_sign"],lI=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],wc=["chainChanged","accountsChanged"],fI=["message","disconnect","connect"];var pI=Object.defineProperty,dI=Object.defineProperties,gI=Object.getOwnPropertyDescriptors,jl=Object.getOwnPropertySymbols,yI=Object.prototype.hasOwnProperty,vI=Object.prototype.propertyIsEnumerable,zl=(a,t,i)=>t in a?pI(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,Kn=(a,t)=>{for(var i in t||(t={}))yI.call(t,i)&&zl(a,i,t[i]);if(jl)for(var i of jl(t))vI.call(t,i)&&zl(a,i,t[i]);return a},Ul=(a,t)=>dI(a,gI(t));function go(a){return Number(a[0].split(":")[1])}function uc(a){return`0x${a.toString(16)}`}function mI(a){const{chains:t,optionalChains:i,methods:s,optionalMethods:o,events:h,optionalEvents:p,rpcMap:g}=a;if(!yn(t))throw new Error("Invalid chains");const _={chains:t,methods:s||mc,events:h||wc,rpcMap:Kn({},t.length?{[go(t)]:g[go(t)]}:{})},m=h==null?void 0:h.filter(z=>!wc.includes(z)),x=s==null?void 0:s.filter(z=>!mc.includes(z));if(!i&&!p&&!o&&!(m!=null&&m.length)&&!(x!=null&&x.length))return{required:t.length?_:void 0};const O=(m==null?void 0:m.length)&&(x==null?void 0:x.length)||!i,L={chains:[...new Set(O?_.chains.concat(i||[]):i)],methods:[...new Set(_.methods.concat(o!=null&&o.length?o:lI))],events:[...new Set(_.events.concat(p||fI))],rpcMap:g};return{required:t.length?_:void 0,optional:i.length?L:void 0}}class Dc{constructor(){this.events=new vr.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=uI,this.on=(t,i)=>(this.events.on(t,i),this),this.once=(t,i)=>(this.events.once(t,i),this),this.removeListener=(t,i)=>(this.events.removeListener(t,i),this),this.off=(t,i)=>(this.events.off(t,i),this),this.parseAccount=t=>this.isCompatibleChainId(t)?this.parseAccountId(t).address:t,this.signer={},this.rpc={}}static async init(t){const i=new Dc;return await i.initialize(t),i}async request(t){return await this.signer.request(t,this.formatChainId(this.chainId))}sendAsync(t,i){this.signer.sendAsync(t,i,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(t);const{required:i,optional:s}=mI(this.rpc);try{const o=await new Promise(async(p,g)=>{var _;this.rpc.showQrModal&&((_=this.modal)==null||_.subscribeModal(m=>{!m.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),g(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Ul(Kn({namespaces:Kn({},i&&{[this.namespace]:i})},s&&{optionalNamespaces:{[this.namespace]:s}}),{pairingTopic:t==null?void 0:t.pairingTopic})).then(m=>{p(m)}).catch(m=>{g(new Error(m.message))})});if(!o)return;this.setChainIds(this.rpc.chains);const h=r1(o.namespaces,[this.namespace]);this.setAccounts(h),this.events.emit("connect",{chainId:uc(this.chainId)})}catch(o){throw this.signer.logger.error(o),o}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",t=>{const{params:i}=t,{event:s}=i;s.name==="accountsChanged"?(this.accounts=this.parseAccounts(s.data),this.events.emit("accountsChanged",this.accounts)):s.name==="chainChanged"?this.setChainId(this.formatChainId(s.data)):this.events.emit(s.name,s.data),this.events.emit("session_event",t)}),this.signer.on("chainChanged",t=>{const i=parseInt(t);this.chainId=i,this.events.emit("chainChanged",uc(this.chainId)),this.persist()}),this.signer.on("session_update",t=>{this.events.emit("session_update",t)}),this.signer.on("session_delete",t=>{this.reset(),this.events.emit("session_delete",t),this.events.emit("disconnect",Ul(Kn({},rr("USER_DISCONNECTED")),{data:t.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",t=>{var i,s;this.rpc.showQrModal&&((i=this.modal)==null||i.closeModal(),(s=this.modal)==null||s.openModal({uri:t})),this.events.emit("display_uri",t)})}switchEthereumChain(t){this.request({method:"wallet_switchEthereumChain",params:[{chainId:t.toString(16)}]})}isCompatibleChainId(t){return typeof t=="string"?t.startsWith(`${this.namespace}:`):!1}formatChainId(t){return`${this.namespace}:${t}`}parseChainId(t){return Number(t.split(":")[1])}setChainIds(t){const i=t.filter(s=>this.isCompatibleChainId(s)).map(s=>this.parseChainId(s));i.length&&(this.chainId=i[0],this.events.emit("chainChanged",uc(this.chainId)),this.persist())}setChainId(t){if(this.isCompatibleChainId(t)){const i=this.parseChainId(t);this.chainId=i,this.switchEthereumChain(i)}}parseAccountId(t){const[i,s,o]=t.split(":");return{chainId:`${i}:${s}`,address:o}}setAccounts(t){this.accounts=t.filter(i=>this.parseChainId(this.parseAccountId(i).chainId)===this.chainId).map(i=>this.parseAccountId(i).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(t){var i,s;const o=(i=t==null?void 0:t.chains)!=null?i:[],h=(s=t==null?void 0:t.optionalChains)!=null?s:[],p=o.concat(h);if(!p.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const g=o.length?(t==null?void 0:t.methods)||mc:[],_=o.length?(t==null?void 0:t.events)||wc:[],m=(t==null?void 0:t.optionalMethods)||[],x=(t==null?void 0:t.optionalEvents)||[],O=(t==null?void 0:t.rpcMap)||this.buildRpcMap(p,t.projectId),L=(t==null?void 0:t.qrModalOptions)||void 0;return{chains:o==null?void 0:o.map(z=>this.formatChainId(z)),optionalChains:h.map(z=>this.formatChainId(z)),methods:g,events:_,optionalMethods:m,optionalEvents:x,rpcMap:O,showQrModal:!!(t!=null&&t.showQrModal),qrModalOptions:L,projectId:t.projectId,metadata:t.metadata}}buildRpcMap(t,i){const s={};return t.forEach(o=>{s[o]=this.getRpcUrl(o,i)}),s}async initialize(t){if(this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?go(this.rpc.chains):go(this.rpc.optionalChains),this.signer=await oI.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storageOptions:t.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let i;try{const{WalletConnectModal:s}=await i1(()=>import("./index-7c92980a.js").then(o=>o.a),["./index-7c92980a.js","./index-d66ad66e.js","./index-f4824932.css"],import.meta.url);i=s}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(i)try{this.modal=new i(Kn({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(s){throw this.signer.logger.error(s),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(t){if(!t)return;const{chains:i,optionalChains:s,rpcMap:o}=t;i&&yn(i)&&(this.rpc.chains=i.map(h=>this.formatChainId(h)),i.forEach(h=>{this.rpc.rpcMap[h]=(o==null?void 0:o[h])||this.getRpcUrl(h)})),s&&yn(s)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=s==null?void 0:s.map(h=>this.formatChainId(h)),s.forEach(h=>{this.rpc.rpcMap[h]=(o==null?void 0:o[h])||this.getRpcUrl(h)}))}getRpcUrl(t,i){var s;return((s=this.rpc.rpcMap)==null?void 0:s[t])||`${hI}?chainId=eip155:${t}&projectId=${i||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const t=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),i=this.session.namespaces[`${this.namespace}:${t}`]?this.session.namespaces[`${this.namespace}:${t}`]:this.session.namespaces[this.namespace];this.setChainIds(t?[this.formatChainId(t)]:i==null?void 0:i.accounts),this.setAccounts(i==null?void 0:i.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(t){return typeof t=="string"||t instanceof String?[this.parseAccount(t)]:t.map(i=>this.parseAccount(i))}}const TI=Dc;export{TI as EthereumProvider,fI as OPTIONAL_EVENTS,lI as OPTIONAL_METHODS,wc as REQUIRED_EVENTS,mc as REQUIRED_METHODS,Dc as default}; diff --git a/assets/index.es-69483be7.js b/assets/index.es-69483be7.js new file mode 100644 index 00000000..65332ed5 --- /dev/null +++ b/assets/index.es-69483be7.js @@ -0,0 +1,27 @@ +import{g as im,d as ds,e as ne,f as sm,w as Dl,h as Fl,j as yc,k as fo,l as nm,c as Mr,a as Ll,I as _i,A as om,U as am,m as Q,n as cm,o as oc,p as um,q as hm,P as lm,V as Ah,s as fm,D as pm,C as dm,Z as Ch,$ as gm,u as ym,v as co,x as vm,y as $l,z as Lr,B as mm,E as wm,X as hs,F as Ft,G as tr,H as wi,J as ur,K as _m,L as ls,M as Ml,N as bm,O as Em,Q as Im,R as jl,S as xm,T as zl,Y as Ul,W as fs,a0 as ac,a1 as io,a2 as ps,a3 as Sm,a4 as so,a5 as Pm,a6 as Am,a7 as Cm,a8 as Om,a9 as Rm,aa as Ha,ab as Oh,ac as Tm,ad as Nm,ae as Dm,af as Rh,ag as Fm,ah as Lm,ai as $m,aj as Mm,ak as jm,al as zm,am as Um,an as no,ao as ql,ap as ka,aq as qm,ar as Bm}from"./index-da732aeb.js";import{e as Cr,N as vc}from"./events-d5745873.js";const Hm=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,km=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Km=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Vm(c,r){if(c==="__proto__"||c==="constructor"&&r&&typeof r=="object"&&"prototype"in r){Gm(c);return}return r}function Gm(c){console.warn(`[destr] Dropping "${c}" key to prevent prototype pollution.`)}function Zn(c,r={}){if(typeof c!="string")return c;const i=c.trim();if(c[0]==='"'&&c.at(-1)==='"'&&!c.includes("\\"))return i.slice(1,-1);if(i.length<=9){const n=i.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!Km.test(c)){if(r.strict)throw new SyntaxError("[destr] Invalid JSON");return c}try{if(Hm.test(c)||km.test(c)){if(r.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(c,Vm)}return JSON.parse(c)}catch(n){if(r.strict)throw n;return c}}function Wm(c){return!c||typeof c.then!="function"?Promise.resolve(c):c}function qt(c,...r){try{return Wm(c(...r))}catch(i){return Promise.reject(i)}}function Jm(c){const r=typeof c;return c===null||r!=="object"&&r!=="function"}function Ym(c){const r=Object.getPrototypeOf(c);return!r||r.isPrototypeOf(Object)}function oo(c){if(Jm(c))return String(c);if(Ym(c)||Array.isArray(c))return JSON.stringify(c);if(typeof c.toJSON=="function")return oo(c.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function Bl(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const cc="base64:";function Xm(c){if(typeof c=="string")return c;Bl();const r=Buffer.from(c).toString("base64");return cc+r}function Zm(c){return typeof c!="string"||!c.startsWith(cc)?c:(Bl(),Buffer.from(c.slice(cc.length),"base64"))}function cr(c){return c?c.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function Qm(...c){return cr(c.join(":"))}function Qn(c){return c=cr(c),c?c+":":""}const e1="memory",t1=()=>{const c=new Map;return{name:e1,options:{},hasItem(r){return c.has(r)},getItem(r){return c.get(r)??null},getItemRaw(r){return c.get(r)??null},setItem(r,i){c.set(r,i)},setItemRaw(r,i){c.set(r,i)},removeItem(r){c.delete(r)},getKeys(){return Array.from(c.keys())},clear(){c.clear()},dispose(){c.clear()}}};function r1(c={}){const r={mounts:{"":c.driver||t1()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},i=m=>{for(const S of r.mountpoints)if(m.startsWith(S))return{base:S,relativeKey:m.slice(S.length),driver:r.mounts[S]};return{base:"",relativeKey:m,driver:r.mounts[""]}},n=(m,S)=>r.mountpoints.filter(O=>O.startsWith(m)||S&&m.startsWith(O)).map(O=>({relativeBase:m.length>O.length?m.slice(O.length):void 0,mountpoint:O,driver:r.mounts[O]})),o=(m,S)=>{if(r.watching){S=cr(S);for(const O of r.watchListeners)O(m,S)}},l=async()=>{if(!r.watching){r.watching=!0;for(const m in r.mounts)r.unwatch[m]=await Th(r.mounts[m],o,m)}},d=async()=>{if(r.watching){for(const m in r.unwatch)await r.unwatch[m]();r.unwatch={},r.watching=!1}},v=(m,S,O)=>{const F=new Map,z=R=>{let K=F.get(R.base);return K||(K={driver:R.driver,base:R.base,items:[]},F.set(R.base,K)),K};for(const R of m){const K=typeof R=="string",re=cr(K?R:R.key),he=K?void 0:R.value,le=K||!R.options?S:{...S,...R.options},fe=i(re);z(fe).items.push({key:re,value:he,relativeKey:fe.relativeKey,options:le})}return Promise.all([...F.values()].map(R=>O(R))).then(R=>R.flat())},b={hasItem(m,S={}){m=cr(m);const{relativeKey:O,driver:F}=i(m);return qt(F.hasItem,O,S)},getItem(m,S={}){m=cr(m);const{relativeKey:O,driver:F}=i(m);return qt(F.getItem,O,S).then(z=>Zn(z))},getItems(m,S){return v(m,S,O=>O.driver.getItems?qt(O.driver.getItems,O.items.map(F=>({key:F.relativeKey,options:F.options})),S).then(F=>F.map(z=>({key:Qm(O.base,z.key),value:Zn(z.value)}))):Promise.all(O.items.map(F=>qt(O.driver.getItem,F.relativeKey,F.options).then(z=>({key:F.key,value:Zn(z)})))))},getItemRaw(m,S={}){m=cr(m);const{relativeKey:O,driver:F}=i(m);return F.getItemRaw?qt(F.getItemRaw,O,S):qt(F.getItem,O,S).then(z=>Zm(z))},async setItem(m,S,O={}){if(S===void 0)return b.removeItem(m);m=cr(m);const{relativeKey:F,driver:z}=i(m);z.setItem&&(await qt(z.setItem,F,oo(S),O),z.watch||o("update",m))},async setItems(m,S){await v(m,S,async O=>{O.driver.setItems&&await qt(O.driver.setItems,O.items.map(F=>({key:F.relativeKey,value:oo(F.value),options:F.options})),S),O.driver.setItem&&await Promise.all(O.items.map(F=>qt(O.driver.setItem,F.relativeKey,oo(F.value),F.options)))})},async setItemRaw(m,S,O={}){if(S===void 0)return b.removeItem(m,O);m=cr(m);const{relativeKey:F,driver:z}=i(m);if(z.setItemRaw)await qt(z.setItemRaw,F,S,O);else if(z.setItem)await qt(z.setItem,F,Xm(S),O);else return;z.watch||o("update",m)},async removeItem(m,S={}){typeof S=="boolean"&&(S={removeMeta:S}),m=cr(m);const{relativeKey:O,driver:F}=i(m);F.removeItem&&(await qt(F.removeItem,O,S),(S.removeMeta||S.removeMata)&&await qt(F.removeItem,O+"$",S),F.watch||o("remove",m))},async getMeta(m,S={}){typeof S=="boolean"&&(S={nativeOnly:S}),m=cr(m);const{relativeKey:O,driver:F}=i(m),z=Object.create(null);if(F.getMeta&&Object.assign(z,await qt(F.getMeta,O,S)),!S.nativeOnly){const R=await qt(F.getItem,O+"$",S).then(K=>Zn(K));R&&typeof R=="object"&&(typeof R.atime=="string"&&(R.atime=new Date(R.atime)),typeof R.mtime=="string"&&(R.mtime=new Date(R.mtime)),Object.assign(z,R))}return z},setMeta(m,S,O={}){return this.setItem(m+"$",S,O)},removeMeta(m,S={}){return this.removeItem(m+"$",S)},async getKeys(m,S={}){m=Qn(m);const O=n(m,!0);let F=[];const z=[];for(const R of O){const re=(await qt(R.driver.getKeys,R.relativeBase,S)).map(he=>R.mountpoint+cr(he)).filter(he=>!F.some(le=>he.startsWith(le)));z.push(...re),F=[R.mountpoint,...F.filter(he=>!he.startsWith(R.mountpoint))]}return m?z.filter(R=>R.startsWith(m)&&!R.endsWith("$")):z.filter(R=>!R.endsWith("$"))},async clear(m,S={}){m=Qn(m),await Promise.all(n(m,!1).map(async O=>{if(O.driver.clear)return qt(O.driver.clear,O.relativeBase,S);if(O.driver.removeItem){const F=await O.driver.getKeys(O.relativeBase||"",S);return Promise.all(F.map(z=>O.driver.removeItem(z,S)))}}))},async dispose(){await Promise.all(Object.values(r.mounts).map(m=>Nh(m)))},async watch(m){return await l(),r.watchListeners.push(m),async()=>{r.watchListeners=r.watchListeners.filter(S=>S!==m),r.watchListeners.length===0&&await d()}},async unwatch(){r.watchListeners=[],await d()},mount(m,S){if(m=Qn(m),m&&r.mounts[m])throw new Error(`already mounted at ${m}`);return m&&(r.mountpoints.push(m),r.mountpoints.sort((O,F)=>F.length-O.length)),r.mounts[m]=S,r.watching&&Promise.resolve(Th(S,o,m)).then(O=>{r.unwatch[m]=O}).catch(console.error),b},async unmount(m,S=!0){m=Qn(m),!(!m||!r.mounts[m])&&(r.watching&&m in r.unwatch&&(r.unwatch[m](),delete r.unwatch[m]),S&&await Nh(r.mounts[m]),r.mountpoints=r.mountpoints.filter(O=>O!==m),delete r.mounts[m])},getMount(m=""){m=cr(m)+":";const S=i(m);return{driver:S.driver,base:S.base}},getMounts(m="",S={}){return m=cr(m),n(m,S.parents).map(F=>({driver:F.driver,base:F.mountpoint}))}};return b}function Th(c,r,i){return c.watch?c.watch((n,o)=>r(n,i+o)):()=>{}}async function Nh(c){typeof c.dispose=="function"&&await qt(c.dispose)}function qi(c){return new Promise((r,i)=>{c.oncomplete=c.onsuccess=()=>r(c.result),c.onabort=c.onerror=()=>i(c.error)})}function Hl(c,r){const i=indexedDB.open(c);i.onupgradeneeded=()=>i.result.createObjectStore(r);const n=qi(i);return(o,l)=>n.then(d=>l(d.transaction(r,o).objectStore(r)))}let Ka;function ks(){return Ka||(Ka=Hl("keyval-store","keyval")),Ka}function Dh(c,r=ks()){return r("readonly",i=>qi(i.get(c)))}function i1(c,r,i=ks()){return i("readwrite",n=>(n.put(r,c),qi(n.transaction)))}function s1(c,r=ks()){return r("readwrite",i=>(i.delete(c),qi(i.transaction)))}function n1(c=ks()){return c("readwrite",r=>(r.clear(),qi(r.transaction)))}function o1(c,r){return c.openCursor().onsuccess=function(){this.result&&(r(this.result),this.result.continue())},qi(c.transaction)}function a1(c=ks()){return c("readonly",r=>{if(r.getAllKeys)return qi(r.getAllKeys());const i=[];return o1(r,n=>i.push(n.key)).then(()=>i)})}const c1=c=>JSON.stringify(c,(r,i)=>typeof i=="bigint"?i.toString()+"n":i),u1=c=>{const r=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,i=c.replace(r,'$1"$2n"$3');return JSON.parse(i,(n,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function Ks(c){if(typeof c!="string")throw new Error(`Cannot safe json parse value of type ${typeof c}`);try{return u1(c)}catch{return c}}function Ui(c){return typeof c=="string"?c:c1(c)||""}const h1="idb-keyval";var l1=(c={})=>{const r=c.base&&c.base.length>0?`${c.base}:`:"",i=o=>r+o;let n;return c.dbName&&c.storeName&&(n=Hl(c.dbName,c.storeName)),{name:h1,options:c,async hasItem(o){return!(typeof await Dh(i(o),n)>"u")},async getItem(o){return await Dh(i(o),n)??null},setItem(o,l){return i1(i(o),l,n)},removeItem(o){return s1(i(o),n)},getKeys(){return a1(n)},clear(){return n1(n)}}};const f1="WALLET_CONNECT_V2_INDEXED_DB",p1="keyvaluestorage";let d1=class{constructor(){this.indexedDb=r1({driver:l1({dbName:f1,storeName:p1})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(r=>[r.key,r.value])}async getItem(r){const i=await this.indexedDb.getItem(r);if(i!==null)return i}async setItem(r,i){await this.indexedDb.setItem(r,Ui(i))}async removeItem(r){await this.indexedDb.removeItem(r)}};var Va=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ao={exports:{}};(function(){let c;function r(){}c=r,c.prototype.getItem=function(i){return this.hasOwnProperty(i)?String(this[i]):null},c.prototype.setItem=function(i,n){this[i]=String(n)},c.prototype.removeItem=function(i){delete this[i]},c.prototype.clear=function(){const i=this;Object.keys(i).forEach(function(n){i[n]=void 0,delete i[n]})},c.prototype.key=function(i){return i=i||0,Object.keys(this)[i]},c.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Va<"u"&&Va.localStorage?ao.exports=Va.localStorage:typeof window<"u"&&window.localStorage?ao.exports=window.localStorage:ao.exports=new r})();function g1(c){var r;return[c[0],Ks((r=c[1])!=null?r:"")]}let y1=class{constructor(){this.localStorage=ao.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(g1)}async getItem(r){const i=this.localStorage.getItem(r);if(i!==null)return Ks(i)}async setItem(r,i){this.localStorage.setItem(r,Ui(i))}async removeItem(r){this.localStorage.removeItem(r)}};const v1="wc_storage_version",Fh=1,m1=async(c,r,i)=>{const n=v1,o=await r.getItem(n);if(o&&o>=Fh){i(r);return}const l=await c.getKeys();if(!l.length){i(r);return}const d=[];for(;l.length;){const v=l.shift();if(!v)continue;const b=v.toLowerCase();if(b.includes("wc@")||b.includes("walletconnect")||b.includes("wc_")||b.includes("wallet_connect")){const m=await c.getItem(v);await r.setItem(v,m),d.push(v)}}await r.setItem(n,Fh),i(r),w1(c,d)},w1=async(c,r)=>{r.length&&r.forEach(async i=>{await c.removeItem(i)})};let _1=class{constructor(){this.initialized=!1,this.setInitialized=i=>{this.storage=i,this.initialized=!0};const r=new y1;this.storage=r;try{const i=new d1;m1(r,i,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(r){return await this.initialize(),this.storage.getItem(r)}async setItem(r,i){return await this.initialize(),this.storage.setItem(r,i)}async removeItem(r){return await this.initialize(),this.storage.removeItem(r)}async initialize(){this.initialized||await new Promise(r=>{const i=setInterval(()=>{this.initialized&&(clearInterval(i),r())},20)})}};var gs={},Ls={},Ga={},$s={};let Bi=class{};const b1=Object.freeze(Object.defineProperty({__proto__:null,IEvents:Bi},Symbol.toStringTag,{value:"Module"})),E1=im(b1);var Lh;function I1(){if(Lh)return $s;Lh=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.IHeartBeat=void 0;const c=E1;class r extends c.IEvents{constructor(n){super()}}return $s.IHeartBeat=r,$s}var $h;function kl(){return $h||($h=1,function(c){Object.defineProperty(c,"__esModule",{value:!0}),ds.__exportStar(I1(),c)}(Ga)),Ga}var Wa={},ji={},Mh;function x1(){if(Mh)return ji;Mh=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.HEARTBEAT_EVENTS=ji.HEARTBEAT_INTERVAL=void 0;const c=ne;return ji.HEARTBEAT_INTERVAL=c.FIVE_SECONDS,ji.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},ji}var jh;function Kl(){return jh||(jh=1,function(c){Object.defineProperty(c,"__esModule",{value:!0}),ds.__exportStar(x1(),c)}(Wa)),Wa}var zh;function S1(){if(zh)return Ls;zh=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.HeartBeat=void 0;const c=ds,r=Cr,i=ne,n=kl(),o=Kl();class l extends n.IHeartBeat{constructor(v){super(v),this.events=new r.EventEmitter,this.interval=o.HEARTBEAT_INTERVAL,this.interval=(v==null?void 0:v.interval)||o.HEARTBEAT_INTERVAL}static init(v){return c.__awaiter(this,void 0,void 0,function*(){const b=new l(v);return yield b.init(),b})}init(){return c.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(v,b){this.events.on(v,b)}once(v,b){this.events.once(v,b)}off(v,b){this.events.off(v,b)}removeListener(v,b){this.events.removeListener(v,b)}initialize(){return c.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),i.toMiliseconds(this.interval))})}pulse(){this.events.emit(o.HEARTBEAT_EVENTS.pulse)}}return Ls.HeartBeat=l,Ls}(function(c){Object.defineProperty(c,"__esModule",{value:!0});const r=ds;r.__exportStar(S1(),c),r.__exportStar(kl(),c),r.__exportStar(Kl(),c)})(gs);var Re={},Ja,Uh;function P1(){if(Uh)return Ja;Uh=1;function c(i){try{return JSON.stringify(i)}catch{return'"[Circular]"'}}Ja=r;function r(i,n,o){var l=o&&o.stringify||c,d=1;if(typeof i=="object"&&i!==null){var v=n.length+d;if(v===1)return i;var b=new Array(v);b[0]=l(i);for(var m=1;m-1?z:0,i.charCodeAt(K+1)){case 100:case 102:if(F>=S||n[F]==null)break;z=S||n[F]==null)break;z=S||n[F]===void 0)break;z",z=K+2,K++;break}O+=l(n[F]),z=K+2,K++;break;case 115:if(F>=S)break;z-1&&(ue=!1);const Te=["error","fatal","warn","info","debug","trace"];typeof W=="function"&&(W.error=W.fatal=W.warn=W.info=W.debug=W.trace=W),L.enabled===!1&&(L.level="silent");const Ue=L.level||"info",y=Object.create(W);y.log||(y.log=re),Object.defineProperty(y,"levelVal",{get:X}),Object.defineProperty(y,"level",{get:ce,set:V});const I={transmit:q,serialize:ie,asObject:L.browser.asObject,levels:Te,timestamp:z(L)};y.levels=o.levels,y.level=Ue,y.setMaxListeners=y.getMaxListeners=y.emit=y.addListener=y.on=y.prependListener=y.once=y.prependOnceListener=y.removeListener=y.removeAllListeners=y.listeners=y.listenerCount=y.eventNames=y.write=y.flush=re,y.serializers=ve,y._serialize=ie,y._stdErrSerialize=ue,y.child=B,q&&(y._logEvent=O());function X(){return this.level==="silent"?1/0:this.levels.values[this.level]}function ce(){return this._level}function V(k){if(k!=="silent"&&!this.levels.values[k])throw Error("unknown level "+k);this._level=k,l(I,y,"error","log"),l(I,y,"fatal","error"),l(I,y,"warn","error"),l(I,y,"info","log"),l(I,y,"debug","log"),l(I,y,"trace","log")}function B(k,G){if(!k)throw new Error("missing bindings for child Pino");G=G||{},ie&&k.serializers&&(G.serializers=k.serializers);const Je=G.serializers;if(ie&&Je){var He=Object.assign({},ve,Je),jr=L.browser.serialize===!0?Object.keys(He):ie;delete k.serializers,b([k],jr,He,this._stdErrSerialize)}function Ie(xt){this._childLevel=(xt._childLevel|0)+1,this.error=m(xt,k,"error"),this.fatal=m(xt,k,"fatal"),this.warn=m(xt,k,"warn"),this.info=m(xt,k,"info"),this.debug=m(xt,k,"debug"),this.trace=m(xt,k,"trace"),He&&(this.serializers=He,this._serialize=jr),q&&(this._logEvent=O([].concat(xt._logEvent.bindings,k)))}return Ie.prototype=this,new Ie(this)}return y}o.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},o.stdSerializers=i,o.stdTimeFunctions=Object.assign({},{nullTime:he,epochTime:le,unixTime:fe,isoTime:pe});function l(L,q,W,ve){const ie=Object.getPrototypeOf(q);q[W]=q.levelVal>q.levels.values[W]?re:ie[W]?ie[W]:r[W]||r[ve]||re,d(L,q,W)}function d(L,q,W){!L.transmit&&q[W]===re||(q[W]=function(ve){return function(){const ue=L.timestamp(),Te=new Array(arguments.length),Ue=Object.getPrototypeOf&&Object.getPrototypeOf(this)===r?r:this;for(var y=0;y-1&&ue in W&&(L[ie][ue]=W[ue](L[ie][ue]))}function m(L,q,W){return function(){const ve=new Array(1+arguments.length);ve[0]=q;for(var ie=1;ie"u"?m=i(v,b):m=v.bindings().context||"",m}er.getLoggerContext=o;function l(v,b,m=c.PINO_CUSTOM_CONTEXT_KEY){const S=o(v,m);return S.trim()?`${S}/${b}`:b}er.formatChildLoggerContext=l;function d(v,b,m=c.PINO_CUSTOM_CONTEXT_KEY){const S=l(v,b,m),O=v.child({context:S});return n(O,S,m)}return er.generateChildLogger=d,er}(function(c){Object.defineProperty(c,"__esModule",{value:!0}),c.pino=void 0;const r=ds,i=r.__importDefault(A1());Object.defineProperty(c,"pino",{enumerable:!0,get:function(){return i.default}}),r.__exportStar(Vl(),c),r.__exportStar(C1(),c)})(Re);class O1 extends Bi{constructor(r){super(),this.opts=r,this.protocol="wc",this.version=2}}class R1 extends Bi{constructor(r,i){super(),this.core=r,this.logger=i,this.records=new Map}}class T1{constructor(r,i){this.logger=r,this.core=i}}let N1=class extends Bi{constructor(r,i){super(),this.relayer=r,this.logger=i}},D1=class extends Bi{constructor(r){super()}},F1=class{constructor(r,i,n,o){this.core=r,this.logger=i,this.name=n}};class L1 extends Bi{constructor(r,i){super(),this.relayer=r,this.logger=i}}let $1=class extends Bi{constructor(r,i){super(),this.core=r,this.logger=i}},M1=class{constructor(r,i){this.projectId=r,this.logger=i}},j1=class{constructor(r){this.opts=r,this.protocol="wc",this.version=2}},z1=class{constructor(r){this.client=r}};var mc={},Gl={};(function(c){Object.defineProperty(c,"__esModule",{value:!0});var r=sm,i=Dl;c.DIGEST_LENGTH=64,c.BLOCK_SIZE=128;var n=function(){function v(){this.digestLength=c.DIGEST_LENGTH,this.blockSize=c.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return v.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},v.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},v.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._tempHi),i.wipe(this._tempLo),this.reset()},v.prototype.update=function(b,m){if(m===void 0&&(m=b.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var S=0;if(this._bytesHashed+=m,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=b[S++],m--;this._bufferLength===this.blockSize&&(l(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(m>=this.blockSize&&(S=l(this._tempHi,this._tempLo,this._stateHi,this._stateLo,b,S,m),m%=this.blockSize);m>0;)this._buffer[this._bufferLength++]=b[S++],m--;return this},v.prototype.finish=function(b){if(!this._finished){var m=this._bytesHashed,S=this._bufferLength,O=m/536870912|0,F=m<<3,z=m%128<112?128:256;this._buffer[S]=128;for(var R=S+1;R0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},v.prototype.restoreState=function(b){return this._stateHi.set(b.stateHi),this._stateLo.set(b.stateLo),this._bufferLength=b.bufferLength,b.buffer&&this._buffer.set(b.buffer),this._bytesHashed=b.bytesHashed,this._finished=!1,this},v.prototype.cleanSavedState=function(b){i.wipe(b.stateHi),i.wipe(b.stateLo),b.buffer&&i.wipe(b.buffer),b.bufferLength=0,b.bytesHashed=0},v}();c.SHA512=n;var o=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function l(v,b,m,S,O,F,z){for(var R=m[0],K=m[1],re=m[2],he=m[3],le=m[4],fe=m[5],pe=m[6],de=m[7],L=S[0],q=S[1],W=S[2],ve=S[3],ie=S[4],ue=S[5],Te=S[6],Ue=S[7],y,I,X,ce,V,B,k,G;z>=128;){for(var Je=0;Je<16;Je++){var He=8*Je+F;v[Je]=r.readUint32BE(O,He),b[Je]=r.readUint32BE(O,He+4)}for(var Je=0;Je<80;Je++){var jr=R,Ie=K,xt=re,D=he,N=le,C=fe,u=pe,E=de,ee=L,ge=q,be=W,Ne=ve,Fe=ie,Pe=ue,St=Te,mt=Ue;if(y=de,I=Ue,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=(le>>>14|ie<<32-14)^(le>>>18|ie<<32-18)^(ie>>>41-32|le<<32-(41-32)),I=(ie>>>14|le<<32-14)^(ie>>>18|le<<32-18)^(le>>>41-32|ie<<32-(41-32)),V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,y=le&fe^~le&pe,I=ie&ue^~ie&Te,V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,y=o[Je*2],I=o[Je*2+1],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,y=v[Je%16],I=b[Je%16],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,X=k&65535|G<<16,ce=V&65535|B<<16,y=X,I=ce,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=(R>>>28|L<<32-28)^(L>>>34-32|R<<32-(34-32))^(L>>>39-32|R<<32-(39-32)),I=(L>>>28|R<<32-28)^(R>>>34-32|L<<32-(34-32))^(R>>>39-32|L<<32-(39-32)),V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,y=R&K^R&re^K&re,I=L&q^L&W^q&W,V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,E=k&65535|G<<16,mt=V&65535|B<<16,y=D,I=Ne,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=X,I=ce,V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,D=k&65535|G<<16,Ne=V&65535|B<<16,K=jr,re=Ie,he=xt,le=D,fe=N,pe=C,de=u,R=E,q=ee,W=ge,ve=be,ie=Ne,ue=Fe,Te=Pe,Ue=St,L=mt,Je%16===15)for(var He=0;He<16;He++)y=v[He],I=b[He],V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=v[(He+9)%16],I=b[(He+9)%16],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,X=v[(He+1)%16],ce=b[(He+1)%16],y=(X>>>1|ce<<32-1)^(X>>>8|ce<<32-8)^X>>>7,I=(ce>>>1|X<<32-1)^(ce>>>8|X<<32-8)^(ce>>>7|X<<32-7),V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,X=v[(He+14)%16],ce=b[(He+14)%16],y=(X>>>19|ce<<32-19)^(ce>>>61-32|X<<32-(61-32))^X>>>6,I=(ce>>>19|X<<32-19)^(X>>>61-32|ce<<32-(61-32))^(ce>>>6|X<<32-6),V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,v[He]=k&65535|G<<16,b[He]=V&65535|B<<16}y=R,I=L,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=m[0],I=S[0],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[0]=R=k&65535|G<<16,S[0]=L=V&65535|B<<16,y=K,I=q,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=m[1],I=S[1],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[1]=K=k&65535|G<<16,S[1]=q=V&65535|B<<16,y=re,I=W,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=m[2],I=S[2],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[2]=re=k&65535|G<<16,S[2]=W=V&65535|B<<16,y=he,I=ve,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=m[3],I=S[3],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[3]=he=k&65535|G<<16,S[3]=ve=V&65535|B<<16,y=le,I=ie,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=m[4],I=S[4],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[4]=le=k&65535|G<<16,S[4]=ie=V&65535|B<<16,y=fe,I=ue,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=m[5],I=S[5],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[5]=fe=k&65535|G<<16,S[5]=ue=V&65535|B<<16,y=pe,I=Te,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=m[6],I=S[6],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[6]=pe=k&65535|G<<16,S[6]=Te=V&65535|B<<16,y=de,I=Ue,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=m[7],I=S[7],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[7]=de=k&65535|G<<16,S[7]=Ue=V&65535|B<<16,F+=128,z-=128}return F}function d(v){var b=new n;b.update(v);var m=b.digest();return b.clean(),m}c.hash=d})(Gl);(function(c){Object.defineProperty(c,"__esModule",{value:!0}),c.convertSecretKeyToX25519=c.convertPublicKeyToX25519=c.verify=c.sign=c.extractPublicKeyFromSecretKey=c.generateKeyPair=c.generateKeyPairFromSeed=c.SEED_LENGTH=c.SECRET_KEY_LENGTH=c.PUBLIC_KEY_LENGTH=c.SIGNATURE_LENGTH=void 0;const r=Fl,i=Gl,n=Dl;c.SIGNATURE_LENGTH=64,c.PUBLIC_KEY_LENGTH=32,c.SECRET_KEY_LENGTH=64,c.SEED_LENGTH=32;function o(D){const N=new Float64Array(16);if(D)for(let C=0;C>16&1),C[ge-1]&=65535;C[15]=u[15]-32767-(C[14]>>16&1);const ee=C[15]>>16&1;C[14]&=65535,K(u,C,1-ee)}for(let E=0;E<16;E++)D[2*E]=u[E]&255,D[2*E+1]=u[E]>>8}function he(D,N){let C=0;for(let u=0;u<32;u++)C|=D[u]^N[u];return(1&C-1>>>8)-1}function le(D,N){const C=new Uint8Array(32),u=new Uint8Array(32);return re(C,D),re(u,N),he(C,u)}function fe(D){const N=new Uint8Array(32);return re(N,D),N[0]&1}function pe(D,N){for(let C=0;C<16;C++)D[C]=N[2*C]+(N[2*C+1]<<8);D[15]&=32767}function de(D,N,C){for(let u=0;u<16;u++)D[u]=N[u]+C[u]}function L(D,N,C){for(let u=0;u<16;u++)D[u]=N[u]-C[u]}function q(D,N,C){let u,E,ee=0,ge=0,be=0,Ne=0,Fe=0,Pe=0,St=0,mt=0,nt=0,$e=0,Xe=0,Ze=0,ot=0,qe=0,Qe=0,De=0,ke=0,ut=0,je=0,Pt=0,Lt=0,Bt=0,Ht=0,jt=0,Wt=0,rr=0,zr=0,Jt=0,Gr=0,ci=0,xi=0,ht=C[0],rt=C[1],lt=C[2],ft=C[3],at=C[4],it=C[5],At=C[6],Ct=C[7],pt=C[8],Ot=C[9],dt=C[10],wt=C[11],gt=C[12],Ye=C[13],Rt=C[14],Tt=C[15];u=N[0],ee+=u*ht,ge+=u*rt,be+=u*lt,Ne+=u*ft,Fe+=u*at,Pe+=u*it,St+=u*At,mt+=u*Ct,nt+=u*pt,$e+=u*Ot,Xe+=u*dt,Ze+=u*wt,ot+=u*gt,qe+=u*Ye,Qe+=u*Rt,De+=u*Tt,u=N[1],ge+=u*ht,be+=u*rt,Ne+=u*lt,Fe+=u*ft,Pe+=u*at,St+=u*it,mt+=u*At,nt+=u*Ct,$e+=u*pt,Xe+=u*Ot,Ze+=u*dt,ot+=u*wt,qe+=u*gt,Qe+=u*Ye,De+=u*Rt,ke+=u*Tt,u=N[2],be+=u*ht,Ne+=u*rt,Fe+=u*lt,Pe+=u*ft,St+=u*at,mt+=u*it,nt+=u*At,$e+=u*Ct,Xe+=u*pt,Ze+=u*Ot,ot+=u*dt,qe+=u*wt,Qe+=u*gt,De+=u*Ye,ke+=u*Rt,ut+=u*Tt,u=N[3],Ne+=u*ht,Fe+=u*rt,Pe+=u*lt,St+=u*ft,mt+=u*at,nt+=u*it,$e+=u*At,Xe+=u*Ct,Ze+=u*pt,ot+=u*Ot,qe+=u*dt,Qe+=u*wt,De+=u*gt,ke+=u*Ye,ut+=u*Rt,je+=u*Tt,u=N[4],Fe+=u*ht,Pe+=u*rt,St+=u*lt,mt+=u*ft,nt+=u*at,$e+=u*it,Xe+=u*At,Ze+=u*Ct,ot+=u*pt,qe+=u*Ot,Qe+=u*dt,De+=u*wt,ke+=u*gt,ut+=u*Ye,je+=u*Rt,Pt+=u*Tt,u=N[5],Pe+=u*ht,St+=u*rt,mt+=u*lt,nt+=u*ft,$e+=u*at,Xe+=u*it,Ze+=u*At,ot+=u*Ct,qe+=u*pt,Qe+=u*Ot,De+=u*dt,ke+=u*wt,ut+=u*gt,je+=u*Ye,Pt+=u*Rt,Lt+=u*Tt,u=N[6],St+=u*ht,mt+=u*rt,nt+=u*lt,$e+=u*ft,Xe+=u*at,Ze+=u*it,ot+=u*At,qe+=u*Ct,Qe+=u*pt,De+=u*Ot,ke+=u*dt,ut+=u*wt,je+=u*gt,Pt+=u*Ye,Lt+=u*Rt,Bt+=u*Tt,u=N[7],mt+=u*ht,nt+=u*rt,$e+=u*lt,Xe+=u*ft,Ze+=u*at,ot+=u*it,qe+=u*At,Qe+=u*Ct,De+=u*pt,ke+=u*Ot,ut+=u*dt,je+=u*wt,Pt+=u*gt,Lt+=u*Ye,Bt+=u*Rt,Ht+=u*Tt,u=N[8],nt+=u*ht,$e+=u*rt,Xe+=u*lt,Ze+=u*ft,ot+=u*at,qe+=u*it,Qe+=u*At,De+=u*Ct,ke+=u*pt,ut+=u*Ot,je+=u*dt,Pt+=u*wt,Lt+=u*gt,Bt+=u*Ye,Ht+=u*Rt,jt+=u*Tt,u=N[9],$e+=u*ht,Xe+=u*rt,Ze+=u*lt,ot+=u*ft,qe+=u*at,Qe+=u*it,De+=u*At,ke+=u*Ct,ut+=u*pt,je+=u*Ot,Pt+=u*dt,Lt+=u*wt,Bt+=u*gt,Ht+=u*Ye,jt+=u*Rt,Wt+=u*Tt,u=N[10],Xe+=u*ht,Ze+=u*rt,ot+=u*lt,qe+=u*ft,Qe+=u*at,De+=u*it,ke+=u*At,ut+=u*Ct,je+=u*pt,Pt+=u*Ot,Lt+=u*dt,Bt+=u*wt,Ht+=u*gt,jt+=u*Ye,Wt+=u*Rt,rr+=u*Tt,u=N[11],Ze+=u*ht,ot+=u*rt,qe+=u*lt,Qe+=u*ft,De+=u*at,ke+=u*it,ut+=u*At,je+=u*Ct,Pt+=u*pt,Lt+=u*Ot,Bt+=u*dt,Ht+=u*wt,jt+=u*gt,Wt+=u*Ye,rr+=u*Rt,zr+=u*Tt,u=N[12],ot+=u*ht,qe+=u*rt,Qe+=u*lt,De+=u*ft,ke+=u*at,ut+=u*it,je+=u*At,Pt+=u*Ct,Lt+=u*pt,Bt+=u*Ot,Ht+=u*dt,jt+=u*wt,Wt+=u*gt,rr+=u*Ye,zr+=u*Rt,Jt+=u*Tt,u=N[13],qe+=u*ht,Qe+=u*rt,De+=u*lt,ke+=u*ft,ut+=u*at,je+=u*it,Pt+=u*At,Lt+=u*Ct,Bt+=u*pt,Ht+=u*Ot,jt+=u*dt,Wt+=u*wt,rr+=u*gt,zr+=u*Ye,Jt+=u*Rt,Gr+=u*Tt,u=N[14],Qe+=u*ht,De+=u*rt,ke+=u*lt,ut+=u*ft,je+=u*at,Pt+=u*it,Lt+=u*At,Bt+=u*Ct,Ht+=u*pt,jt+=u*Ot,Wt+=u*dt,rr+=u*wt,zr+=u*gt,Jt+=u*Ye,Gr+=u*Rt,ci+=u*Tt,u=N[15],De+=u*ht,ke+=u*rt,ut+=u*lt,je+=u*ft,Pt+=u*at,Lt+=u*it,Bt+=u*At,Ht+=u*Ct,jt+=u*pt,Wt+=u*Ot,rr+=u*dt,zr+=u*wt,Jt+=u*gt,Gr+=u*Ye,ci+=u*Rt,xi+=u*Tt,ee+=38*ke,ge+=38*ut,be+=38*je,Ne+=38*Pt,Fe+=38*Lt,Pe+=38*Bt,St+=38*Ht,mt+=38*jt,nt+=38*Wt,$e+=38*rr,Xe+=38*zr,Ze+=38*Jt,ot+=38*Gr,qe+=38*ci,Qe+=38*xi,E=1,u=ee+E+65535,E=Math.floor(u/65536),ee=u-E*65536,u=ge+E+65535,E=Math.floor(u/65536),ge=u-E*65536,u=be+E+65535,E=Math.floor(u/65536),be=u-E*65536,u=Ne+E+65535,E=Math.floor(u/65536),Ne=u-E*65536,u=Fe+E+65535,E=Math.floor(u/65536),Fe=u-E*65536,u=Pe+E+65535,E=Math.floor(u/65536),Pe=u-E*65536,u=St+E+65535,E=Math.floor(u/65536),St=u-E*65536,u=mt+E+65535,E=Math.floor(u/65536),mt=u-E*65536,u=nt+E+65535,E=Math.floor(u/65536),nt=u-E*65536,u=$e+E+65535,E=Math.floor(u/65536),$e=u-E*65536,u=Xe+E+65535,E=Math.floor(u/65536),Xe=u-E*65536,u=Ze+E+65535,E=Math.floor(u/65536),Ze=u-E*65536,u=ot+E+65535,E=Math.floor(u/65536),ot=u-E*65536,u=qe+E+65535,E=Math.floor(u/65536),qe=u-E*65536,u=Qe+E+65535,E=Math.floor(u/65536),Qe=u-E*65536,u=De+E+65535,E=Math.floor(u/65536),De=u-E*65536,ee+=E-1+37*(E-1),E=1,u=ee+E+65535,E=Math.floor(u/65536),ee=u-E*65536,u=ge+E+65535,E=Math.floor(u/65536),ge=u-E*65536,u=be+E+65535,E=Math.floor(u/65536),be=u-E*65536,u=Ne+E+65535,E=Math.floor(u/65536),Ne=u-E*65536,u=Fe+E+65535,E=Math.floor(u/65536),Fe=u-E*65536,u=Pe+E+65535,E=Math.floor(u/65536),Pe=u-E*65536,u=St+E+65535,E=Math.floor(u/65536),St=u-E*65536,u=mt+E+65535,E=Math.floor(u/65536),mt=u-E*65536,u=nt+E+65535,E=Math.floor(u/65536),nt=u-E*65536,u=$e+E+65535,E=Math.floor(u/65536),$e=u-E*65536,u=Xe+E+65535,E=Math.floor(u/65536),Xe=u-E*65536,u=Ze+E+65535,E=Math.floor(u/65536),Ze=u-E*65536,u=ot+E+65535,E=Math.floor(u/65536),ot=u-E*65536,u=qe+E+65535,E=Math.floor(u/65536),qe=u-E*65536,u=Qe+E+65535,E=Math.floor(u/65536),Qe=u-E*65536,u=De+E+65535,E=Math.floor(u/65536),De=u-E*65536,ee+=E-1+37*(E-1),D[0]=ee,D[1]=ge,D[2]=be,D[3]=Ne,D[4]=Fe,D[5]=Pe,D[6]=St,D[7]=mt,D[8]=nt,D[9]=$e,D[10]=Xe,D[11]=Ze,D[12]=ot,D[13]=qe,D[14]=Qe,D[15]=De}function W(D,N){q(D,N,N)}function ve(D,N){const C=o();let u;for(u=0;u<16;u++)C[u]=N[u];for(u=253;u>=0;u--)W(C,C),u!==2&&u!==4&&q(C,C,N);for(u=0;u<16;u++)D[u]=C[u]}function ie(D,N){const C=o();let u;for(u=0;u<16;u++)C[u]=N[u];for(u=250;u>=0;u--)W(C,C),u!==1&&q(C,C,N);for(u=0;u<16;u++)D[u]=C[u]}function ue(D,N){const C=o(),u=o(),E=o(),ee=o(),ge=o(),be=o(),Ne=o(),Fe=o(),Pe=o();L(C,D[1],D[0]),L(Pe,N[1],N[0]),q(C,C,Pe),de(u,D[0],D[1]),de(Pe,N[0],N[1]),q(u,u,Pe),q(E,D[3],N[3]),q(E,E,m),q(ee,D[2],N[2]),de(ee,ee,ee),L(ge,u,C),L(be,ee,E),de(Ne,ee,E),de(Fe,u,C),q(D[0],ge,be),q(D[1],Fe,Ne),q(D[2],Ne,be),q(D[3],ge,Fe)}function Te(D,N,C){for(let u=0;u<4;u++)K(D[u],N[u],C)}function Ue(D,N){const C=o(),u=o(),E=o();ve(E,N[2]),q(C,N[0],E),q(u,N[1],E),re(D,u),D[31]^=fe(C)<<7}function y(D,N,C){z(D[0],d),z(D[1],v),z(D[2],v),z(D[3],d);for(let u=255;u>=0;--u){const E=C[u/8|0]>>(u&7)&1;Te(D,N,E),ue(N,D),ue(D,D),Te(D,N,E)}}function I(D,N){const C=[o(),o(),o(),o()];z(C[0],S),z(C[1],O),z(C[2],v),q(C[3],S,O),y(D,C,N)}function X(D){if(D.length!==c.SEED_LENGTH)throw new Error(`ed25519: seed must be ${c.SEED_LENGTH} bytes`);const N=(0,i.hash)(D);N[0]&=248,N[31]&=127,N[31]|=64;const C=new Uint8Array(32),u=[o(),o(),o(),o()];I(u,N),Ue(C,u);const E=new Uint8Array(64);return E.set(D),E.set(C,32),{publicKey:C,secretKey:E}}c.generateKeyPairFromSeed=X;function ce(D){const N=(0,r.randomBytes)(32,D),C=X(N);return(0,n.wipe)(N),C}c.generateKeyPair=ce;function V(D){if(D.length!==c.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${c.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(D.subarray(32))}c.extractPublicKeyFromSecretKey=V;const B=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function k(D,N){let C,u,E,ee;for(u=63;u>=32;--u){for(C=0,E=u-32,ee=u-12;E>4)*B[E],C=N[E]>>8,N[E]&=255;for(E=0;E<32;E++)N[E]-=C*B[E];for(u=0;u<32;u++)N[u+1]+=N[u]>>8,D[u]=N[u]&255}function G(D){const N=new Float64Array(64);for(let C=0;C<64;C++)N[C]=D[C];for(let C=0;C<64;C++)D[C]=0;k(D,N)}function Je(D,N){const C=new Float64Array(64),u=[o(),o(),o(),o()],E=(0,i.hash)(D.subarray(0,32));E[0]&=248,E[31]&=127,E[31]|=64;const ee=new Uint8Array(64);ee.set(E.subarray(32),32);const ge=new i.SHA512;ge.update(ee.subarray(32)),ge.update(N);const be=ge.digest();ge.clean(),G(be),I(u,be),Ue(ee,u),ge.reset(),ge.update(ee.subarray(0,32)),ge.update(D.subarray(32)),ge.update(N);const Ne=ge.digest();G(Ne);for(let Fe=0;Fe<32;Fe++)C[Fe]=be[Fe];for(let Fe=0;Fe<32;Fe++)for(let Pe=0;Pe<32;Pe++)C[Fe+Pe]+=Ne[Fe]*E[Pe];return k(ee.subarray(32),C),ee}c.sign=Je;function He(D,N){const C=o(),u=o(),E=o(),ee=o(),ge=o(),be=o(),Ne=o();return z(D[2],v),pe(D[1],N),W(E,D[1]),q(ee,E,b),L(E,E,D[2]),de(ee,D[2],ee),W(ge,ee),W(be,ge),q(Ne,be,ge),q(C,Ne,E),q(C,C,ee),ie(C,C),q(C,C,E),q(C,C,ee),q(C,C,ee),q(D[0],C,ee),W(u,D[0]),q(u,u,ee),le(u,E)&&q(D[0],D[0],F),W(u,D[0]),q(u,u,ee),le(u,E)?-1:(fe(D[0])===N[31]>>7&&L(D[0],d,D[0]),q(D[3],D[0],D[1]),0)}function jr(D,N,C){const u=new Uint8Array(32),E=[o(),o(),o(),o()],ee=[o(),o(),o(),o()];if(C.length!==c.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${c.SIGNATURE_LENGTH} bytes`);if(He(ee,D))return!1;const ge=new i.SHA512;ge.update(C.subarray(0,32)),ge.update(D),ge.update(N);const be=ge.digest();return G(be),y(E,ee,be),I(ee,C.subarray(32)),ue(E,ee),Ue(u,E),!he(C,u)}c.verify=jr;function Ie(D){let N=[o(),o(),o(),o()];if(He(N,D))throw new Error("Ed25519: invalid public key");let C=o(),u=o(),E=N[1];de(C,v,E),L(u,v,E),ve(u,u),q(C,C,u);let ee=new Uint8Array(32);return re(ee,C),ee}c.convertPublicKeyToX25519=Ie;function xt(D){const N=(0,i.hash)(D.subarray(0,32));N[0]&=248,N[31]&=127,N[31]|=64;const C=new Uint8Array(N.subarray(0,32));return(0,n.wipe)(N),C}c.convertSecretKeyToX25519=xt})(mc);const U1="EdDSA",q1="JWT",Wl=".",Jl="base64url",B1="utf8",H1="utf8",k1=":",K1="did",V1="key",kh="base58btc",G1="z",W1="K36",J1=32;function uo(c){return fo(yc(Ui(c),B1),Jl)}function Yl(c){const r=yc(W1,kh),i=G1+fo(nm([r,c]),kh);return[K1,V1,i].join(k1)}function Y1(c){return fo(c,Jl)}function X1(c){return yc([uo(c.header),uo(c.payload)].join(Wl),H1)}function Z1(c){return[uo(c.header),uo(c.payload),Y1(c.signature)].join(Wl)}function Kh(c=Fl.randomBytes(J1)){return mc.generateKeyPairFromSeed(c)}async function Q1(c,r,i,n,o=ne.fromMiliseconds(Date.now())){const l={alg:U1,typ:q1},d=Yl(n.publicKey),v=o+i,b={iss:d,sub:c,aud:r,iat:o,exp:v},m=X1({header:l,payload:b}),S=mc.sign(n.secretKey,m);return Z1({header:l,payload:b,signature:S})}const ew="PARSE_ERROR",tw="INVALID_REQUEST",rw="METHOD_NOT_FOUND",iw="INVALID_PARAMS",Xl="INTERNAL_ERROR",wc="SERVER_ERROR",sw=[-32700,-32600,-32601,-32602,-32603],Hs={[ew]:{code:-32700,message:"Parse error"},[tw]:{code:-32600,message:"Invalid Request"},[rw]:{code:-32601,message:"Method not found"},[iw]:{code:-32602,message:"Invalid params"},[Xl]:{code:-32603,message:"Internal error"},[wc]:{code:-32e3,message:"Server error"}},Zl=wc;function nw(c){return sw.includes(c)}function Vh(c){return Object.keys(Hs).includes(c)?Hs[c]:Hs[Zl]}function ow(c){const r=Object.values(Hs).find(i=>i.code===c);return r||Hs[Zl]}function Ql(c,r,i){return c.message.includes("getaddrinfo ENOTFOUND")||c.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${i} RPC url at ${r}`):c}var ef={},ni={},Gh;function aw(){if(Gh)return ni;Gh=1,Object.defineProperty(ni,"__esModule",{value:!0}),ni.isBrowserCryptoAvailable=ni.getSubtleCrypto=ni.getBrowerCrypto=void 0;function c(){return(Mr===null||Mr===void 0?void 0:Mr.crypto)||(Mr===null||Mr===void 0?void 0:Mr.msCrypto)||{}}ni.getBrowerCrypto=c;function r(){const n=c();return n.subtle||n.webkitSubtle}ni.getSubtleCrypto=r;function i(){return!!c()&&!!r()}return ni.isBrowserCryptoAvailable=i,ni}var oi={},Wh;function cw(){if(Wh)return oi;Wh=1,Object.defineProperty(oi,"__esModule",{value:!0}),oi.isBrowser=oi.isNode=oi.isReactNative=void 0;function c(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}oi.isReactNative=c;function r(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}oi.isNode=r;function i(){return!c()&&!r()}return oi.isBrowser=i,oi}(function(c){Object.defineProperty(c,"__esModule",{value:!0});const r=ds;r.__exportStar(aw(),c),r.__exportStar(cw(),c)})(ef);function tf(c=3){const r=Date.now()*Math.pow(10,c),i=Math.floor(Math.random()*Math.pow(10,c));return r+i}function _c(c=6){return BigInt(tf(c))}function po(c,r,i){return{id:i||tf(),jsonrpc:"2.0",method:c,params:r}}function bc(c,r){return{id:c,jsonrpc:"2.0",result:r}}function go(c,r,i){return{id:c,jsonrpc:"2.0",error:uw(r,i)}}function uw(c,r){return typeof c>"u"?Vh(Xl):(typeof c=="string"&&(c=Object.assign(Object.assign({},Vh(wc)),{message:c})),typeof r<"u"&&(c.data=r),nw(c.code)&&(c=ow(c.code)),c)}class hw{}class lw extends hw{constructor(){super()}}class fw extends lw{constructor(r){super()}}const pw="^https?:",dw="^wss?:";function gw(c){const r=c.match(new RegExp(/^\w+:/,"gi"));if(!(!r||!r.length))return r[0]}function rf(c,r){const i=gw(c);return typeof i>"u"?!1:new RegExp(r).test(i)}function Jh(c){return rf(c,pw)}function Yh(c){return rf(c,dw)}function yw(c){return new RegExp("wss?://localhost(:d{2,5})?").test(c)}function sf(c){return typeof c=="object"&&"id"in c&&"jsonrpc"in c&&c.jsonrpc==="2.0"}function Ec(c){return sf(c)&&"method"in c}function yo(c){return sf(c)&&(ai(c)||$r(c))}function ai(c){return"result"in c}function $r(c){return"error"in c}class Ei extends fw{constructor(r){super(r),this.events=new Cr.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(r),this.connection.connected&&this.registerEventListeners()}async connect(r=this.connection){await this.open(r)}async disconnect(){await this.close()}on(r,i){this.events.on(r,i)}once(r,i){this.events.once(r,i)}off(r,i){this.events.off(r,i)}removeListener(r,i){this.events.removeListener(r,i)}async request(r,i){return this.requestStrict(po(r.method,r.params||[],r.id||_c().toString()),i)}async requestStrict(r,i){return new Promise(async(n,o)=>{if(!this.connection.connected)try{await this.open()}catch(l){o(l)}this.events.on(`${r.id}`,l=>{$r(l)?o(l.error):n(l.result)});try{await this.connection.send(r,i)}catch(l){o(l)}})}setConnection(r=this.connection){return r}onPayload(r){this.events.emit("payload",r),yo(r)?this.events.emit(`${r.id}`,r):this.events.emit("message",{type:r.method,data:r.params})}onClose(r){r&&r.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${r.code} ${r.reason?`(${r.reason})`:""}`)),this.events.emit("disconnect")}async open(r=this.connection){this.connection===r&&this.connection.connected||(this.connection.connected&&this.close(),typeof r=="string"&&(await this.connection.open(r),r=this.connection),this.connection=this.setConnection(r),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",r=>this.onPayload(r)),this.connection.on("close",r=>this.onClose(r)),this.connection.on("error",r=>this.events.emit("error",r)),this.connection.on("register_error",r=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const vw=()=>typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:require("ws"),mw=()=>typeof window<"u",Xh=c=>c.split("?")[0],Zh=10,ww=vw();class _w{constructor(r){if(this.url=r,this.events=new Cr.EventEmitter,this.registering=!1,!Yh(r))throw new Error(`Provided URL is not compatible with WebSocket connection: ${r}`);this.url=r}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(r,i){this.events.on(r,i)}once(r,i){this.events.once(r,i)}off(r,i){this.events.off(r,i)}removeListener(r,i){this.events.removeListener(r,i)}async open(r=this.url){await this.register(r)}async close(){return new Promise((r,i)=>{if(typeof this.socket>"u"){i(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),r()},this.socket.close()})}async send(r,i){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Ui(r))}catch(n){this.onError(r.id,n)}}register(r=this.url){if(!Yh(r))throw new Error(`Provided URL is not compatible with WebSocket connection: ${r}`);if(this.registering){const i=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=i||this.events.listenerCount("open")>=i)&&this.events.setMaxListeners(i+1),new Promise((n,o)=>{this.events.once("register_error",l=>{this.resetMaxListeners(),o(l)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return o(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=r,this.registering=!0,new Promise((i,n)=>{const o=ef.isReactNative()?void 0:{rejectUnauthorized:!yw(r)},l=new ww(r,[],o);mw()?l.onerror=d=>{const v=d;n(this.emitError(v.error))}:l.on("error",d=>{n(this.emitError(d))}),l.onopen=()=>{this.onOpen(l),i(l)}})}onOpen(r){r.onmessage=i=>this.onPayload(i),r.onclose=i=>this.onClose(i),this.socket=r,this.registering=!1,this.events.emit("open")}onClose(r){this.socket=void 0,this.registering=!1,this.events.emit("close",r)}onPayload(r){if(typeof r.data>"u")return;const i=typeof r.data=="string"?Ks(r.data):r.data;this.events.emit("payload",i)}onError(r,i){const n=this.parseError(i),o=n.message||n.toString(),l=go(r,o);this.events.emit("payload",l)}parseError(r,i=this.url){return Ql(r,Xh(i),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Zh&&this.events.setMaxListeners(Zh)}emitError(r){const i=this.parseError(new Error((r==null?void 0:r.message)||`WebSocket connection failed for host: ${Xh(this.url)}`));return this.events.emit("register_error",i),i}}var ho={exports:{}};ho.exports;(function(c,r){var i=200,n="__lodash_hash_undefined__",o=1,l=2,d=9007199254740991,v="[object Arguments]",b="[object Array]",m="[object AsyncFunction]",S="[object Boolean]",O="[object Date]",F="[object Error]",z="[object Function]",R="[object GeneratorFunction]",K="[object Map]",re="[object Number]",he="[object Null]",le="[object Object]",fe="[object Promise]",pe="[object Proxy]",de="[object RegExp]",L="[object Set]",q="[object String]",W="[object Symbol]",ve="[object Undefined]",ie="[object WeakMap]",ue="[object ArrayBuffer]",Te="[object DataView]",Ue="[object Float32Array]",y="[object Float64Array]",I="[object Int8Array]",X="[object Int16Array]",ce="[object Int32Array]",V="[object Uint8Array]",B="[object Uint8ClampedArray]",k="[object Uint16Array]",G="[object Uint32Array]",Je=/[\\^$.*+?()[\]{}|]/g,He=/^\[object .+?Constructor\]$/,jr=/^(?:0|[1-9]\d*)$/,Ie={};Ie[Ue]=Ie[y]=Ie[I]=Ie[X]=Ie[ce]=Ie[V]=Ie[B]=Ie[k]=Ie[G]=!0,Ie[v]=Ie[b]=Ie[ue]=Ie[S]=Ie[Te]=Ie[O]=Ie[F]=Ie[z]=Ie[K]=Ie[re]=Ie[le]=Ie[de]=Ie[L]=Ie[q]=Ie[ie]=!1;var xt=typeof Mr=="object"&&Mr&&Mr.Object===Object&&Mr,D=typeof self=="object"&&self&&self.Object===Object&&self,N=xt||D||Function("return this")(),C=r&&!r.nodeType&&r,u=C&&!0&&c&&!c.nodeType&&c,E=u&&u.exports===C,ee=E&&xt.process,ge=function(){try{return ee&&ee.binding&&ee.binding("util")}catch{}}(),be=ge&&ge.isTypedArray;function Ne(g,x){for(var U=-1,Y=g==null?0:g.length,Ve=0,me=[];++U-1}function Po(g,x){var U=this.__data__,Y=Si(U,g);return Y<0?(++this.size,U.push([g,x])):U[Y][1]=x,this}yr.prototype.clear=Eo,yr.prototype.delete=Io,yr.prototype.get=xo,yr.prototype.has=So,yr.prototype.set=Po;function Wr(g){var x=-1,U=g==null?0:g.length;for(this.clear();++xNt))return!1;var Ge=me.get(g);if(Ge&&me.get(x))return Ge==x;var _t=-1,ir=!0,Dt=U&l?new Vi:void 0;for(me.set(g,x),me.set(x,g);++_t-1&&g%1==0&&g-1&&g%1==0&&g<=d}function ln(g){var x=typeof g;return g!=null&&(x=="object"||x=="function")}function Ci(g){return g!=null&&typeof g=="object"}var fn=be?mt(be):Zs;function zo(g){return Mo(g)?Ys(g):Qs(g)}function Ke(){return[]}function Be(){return!1}c.exports=jo})(ho,ho.exports);var bw=ho.exports;const Ew=Ll(bw);function Iw(c,r){if(c.length>=255)throw new TypeError("Alphabet too long");for(var i=new Uint8Array(256),n=0;n>>0,pe=new Uint8Array(fe);he!==le;){for(var de=R[he],L=0,q=fe-1;(de!==0||L>>0,pe[q]=de%v>>>0,de=de/v>>>0;if(de!==0)throw new Error("Non-zero carry");re=L,he++}for(var W=fe-re;W!==fe&&pe[W]===0;)W++;for(var ve=b.repeat(K);W>>0,fe=new Uint8Array(le);R[K];){var pe=i[R.charCodeAt(K)];if(pe===255)return;for(var de=0,L=le-1;(pe!==0||de>>0,fe[L]=pe%256>>>0,pe=pe/256>>>0;if(pe!==0)throw new Error("Non-zero carry");he=de,K++}if(R[K]!==" "){for(var q=le-he;q!==le&&fe[q]===0;)q++;for(var W=new Uint8Array(re+(le-q)),ve=re;q!==le;)W[ve++]=fe[q++];return W}}}function z(R){var K=F(R);if(K)return K;throw new Error(`Non-${r} character`)}return{encode:O,decodeUnsafe:F,decode:z}}var xw=Iw,Sw=xw;const nf=c=>{if(c instanceof Uint8Array&&c.constructor.name==="Uint8Array")return c;if(c instanceof ArrayBuffer)return new Uint8Array(c);if(ArrayBuffer.isView(c))return new Uint8Array(c.buffer,c.byteOffset,c.byteLength);throw new Error("Unknown type, must be binary type")},Pw=c=>new TextEncoder().encode(c),Aw=c=>new TextDecoder().decode(c);class Cw{constructor(r,i,n){this.name=r,this.prefix=i,this.baseEncode=n}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}}class Ow{constructor(r,i,n){if(this.name=r,this.prefix=i,i.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=i.codePointAt(0),this.baseDecode=n}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return of(this,r)}}class Rw{constructor(r){this.decoders=r}or(r){return of(this,r)}decode(r){const i=r[0],n=this.decoders[i];if(n)return n.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const of=(c,r)=>new Rw({...c.decoders||{[c.prefix]:c},...r.decoders||{[r.prefix]:r}});class Tw{constructor(r,i,n,o){this.name=r,this.prefix=i,this.baseEncode=n,this.baseDecode=o,this.encoder=new Cw(r,i,n),this.decoder=new Ow(r,i,o)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}}const vo=({name:c,prefix:r,encode:i,decode:n})=>new Tw(c,r,i,n),Vs=({prefix:c,name:r,alphabet:i})=>{const{encode:n,decode:o}=Sw(i,r);return vo({prefix:c,name:r,encode:n,decode:l=>nf(o(l))})},Nw=(c,r,i,n)=>{const o={};for(let S=0;S=8&&(v-=8,d[m++]=255&b>>v)}if(v>=i||255&b<<8-v)throw new SyntaxError("Unexpected end of data");return d},Dw=(c,r,i)=>{const n=r[r.length-1]==="=",o=(1<i;)d-=i,l+=r[o&v>>d];if(d&&(l+=r[o&v<vo({prefix:r,name:c,encode(o){return Dw(o,n,i)},decode(o){return Nw(o,n,i,c)}}),Fw=vo({prefix:"\0",name:"identity",encode:c=>Aw(c),decode:c=>Pw(c)});var Lw=Object.freeze({__proto__:null,identity:Fw});const $w=Kt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Mw=Object.freeze({__proto__:null,base2:$w});const jw=Kt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var zw=Object.freeze({__proto__:null,base8:jw});const Uw=Vs({prefix:"9",name:"base10",alphabet:"0123456789"});var qw=Object.freeze({__proto__:null,base10:Uw});const Bw=Kt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Hw=Kt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var kw=Object.freeze({__proto__:null,base16:Bw,base16upper:Hw});const Kw=Kt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Vw=Kt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Gw=Kt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ww=Kt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Jw=Kt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Yw=Kt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Xw=Kt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Zw=Kt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Qw=Kt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var e_=Object.freeze({__proto__:null,base32:Kw,base32upper:Vw,base32pad:Gw,base32padupper:Ww,base32hex:Jw,base32hexupper:Yw,base32hexpad:Xw,base32hexpadupper:Zw,base32z:Qw});const t_=Vs({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),r_=Vs({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var i_=Object.freeze({__proto__:null,base36:t_,base36upper:r_});const s_=Vs({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),n_=Vs({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var o_=Object.freeze({__proto__:null,base58btc:s_,base58flickr:n_});const a_=Kt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),c_=Kt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),u_=Kt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),h_=Kt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var l_=Object.freeze({__proto__:null,base64:a_,base64pad:c_,base64url:u_,base64urlpad:h_});const af=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),f_=af.reduce((c,r,i)=>(c[i]=r,c),[]),p_=af.reduce((c,r,i)=>(c[r.codePointAt(0)]=i,c),[]);function d_(c){return c.reduce((r,i)=>(r+=f_[i],r),"")}function g_(c){const r=[];for(const i of c){const n=p_[i.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${i}`);r.push(n)}return new Uint8Array(r)}const y_=vo({prefix:"🚀",name:"base256emoji",encode:d_,decode:g_});var v_=Object.freeze({__proto__:null,base256emoji:y_}),m_=cf,Qh=128,w_=127,__=~w_,b_=Math.pow(2,31);function cf(c,r,i){r=r||[],i=i||0;for(var n=i;c>=b_;)r[i++]=c&255|Qh,c/=128;for(;c&__;)r[i++]=c&255|Qh,c>>>=7;return r[i]=c|0,cf.bytes=i-n+1,r}var E_=uc,I_=128,el=127;function uc(c,n){var i=0,n=n||0,o=0,l=n,d,v=c.length;do{if(l>=v)throw uc.bytes=0,new RangeError("Could not decode varint");d=c[l++],i+=o<28?(d&el)<=I_);return uc.bytes=l-n,i}var x_=Math.pow(2,7),S_=Math.pow(2,14),P_=Math.pow(2,21),A_=Math.pow(2,28),C_=Math.pow(2,35),O_=Math.pow(2,42),R_=Math.pow(2,49),T_=Math.pow(2,56),N_=Math.pow(2,63),D_=function(c){return c(uf.encode(c,r,i),r),rl=c=>uf.encodingLength(c),hc=(c,r)=>{const i=r.byteLength,n=rl(c),o=n+rl(i),l=new Uint8Array(o+i);return tl(c,l,0),tl(i,l,n),l.set(r,o),new L_(c,i,r,l)};class L_{constructor(r,i,n,o){this.code=r,this.size=i,this.digest=n,this.bytes=o}}const hf=({name:c,code:r,encode:i})=>new $_(c,r,i);class $_{constructor(r,i,n){this.name=r,this.code=i,this.encode=n}digest(r){if(r instanceof Uint8Array){const i=this.encode(r);return i instanceof Uint8Array?hc(this.code,i):i.then(n=>hc(this.code,n))}else throw Error("Unknown type, must be binary type")}}const lf=c=>async r=>new Uint8Array(await crypto.subtle.digest(c,r)),M_=hf({name:"sha2-256",code:18,encode:lf("SHA-256")}),j_=hf({name:"sha2-512",code:19,encode:lf("SHA-512")});var z_=Object.freeze({__proto__:null,sha256:M_,sha512:j_});const ff=0,U_="identity",pf=nf,q_=c=>hc(ff,pf(c)),B_={code:ff,name:U_,encode:pf,digest:q_};var H_=Object.freeze({__proto__:null,identity:B_});new TextEncoder,new TextDecoder;const il={...Lw,...Mw,...zw,...qw,...kw,...e_,...i_,...o_,...l_,...v_};({...z_,...H_});function df(c){return globalThis.Buffer!=null?new Uint8Array(c.buffer,c.byteOffset,c.byteLength):c}function k_(c=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?df(globalThis.Buffer.allocUnsafe(c)):new Uint8Array(c)}function gf(c,r,i,n){return{name:c,prefix:r,encoder:{name:c,prefix:r,encode:i},decoder:{decode:n}}}const sl=gf("utf8","u",c=>"u"+new TextDecoder("utf8").decode(c),c=>new TextEncoder().encode(c.substring(1))),Xa=gf("ascii","a",c=>{let r="a";for(let i=0;i{c=c.substring(1);const r=k_(c.length);for(let i=0;i{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,o)=>{this.isInitialized(),this.keychain.set(n,o),await this.persist()},this.get=n=>{this.isInitialized();const o=this.keychain.get(n);if(typeof o>"u"){const{message:l}=Q("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(l)}return o},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=r,this.logger=Re.generateChildLogger(i,this.name)}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(r){await this.core.storage.setItem(this.storageKey,zl(r))}async getKeyChain(){const r=await this.core.storage.getItem(this.storageKey);return typeof r<"u"?Ul(r):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}}class Eb{constructor(r,i,n){this.core=r,this.logger=i,this.name=Y_,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=o=>(this.isInitialized(),this.keychain.has(o)),this.getClientId=async()=>{this.isInitialized();const o=await this.getClientSeed(),l=Kh(o);return Yl(l.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const o=cm();return this.setPrivateKey(o.publicKey,o.privateKey)},this.signJWT=async o=>{this.isInitialized();const l=await this.getClientSeed(),d=Kh(l),v=oc();return await Q1(v,o,X_,d)},this.generateSharedKey=(o,l,d)=>{this.isInitialized();const v=this.getPrivateKey(o),b=um(v,l);return this.setSymKey(b,d)},this.setSymKey=async(o,l)=>{this.isInitialized();const d=l||hm(o);return await this.keychain.set(d,o),d},this.deleteKeyPair=async o=>{this.isInitialized(),await this.keychain.del(o)},this.deleteSymKey=async o=>{this.isInitialized(),await this.keychain.del(o)},this.encode=async(o,l,d)=>{this.isInitialized();const v=lm(d),b=Ui(l);if(Ah(v)){const F=v.senderPublicKey,z=v.receiverPublicKey;o=await this.generateSharedKey(F,z)}const m=this.getSymKey(o),{type:S,senderPublicKey:O}=v;return fm({type:S,symKey:m,message:b,senderPublicKey:O})},this.decode=async(o,l,d)=>{this.isInitialized();const v=pm(l,d);if(Ah(v)){const S=v.receiverPublicKey,O=v.senderPublicKey;o=await this.generateSharedKey(S,O)}const b=this.getSymKey(o),m=dm({symKey:b,encoded:l});return Ks(m)},this.getPayloadType=o=>{const l=Ch(o);return gm(l.type)},this.getPayloadSenderPublicKey=o=>{const l=Ch(o);return l.senderPublicKey?fo(l.senderPublicKey,ym):void 0},this.core=r,this.logger=Re.generateChildLogger(i,this.name),this.keychain=n||new bb(this.core,this.logger)}get context(){return Re.getLoggerContext(this.logger)}async setPrivateKey(r,i){return await this.keychain.set(r,i),r}getPrivateKey(r){return this.keychain.get(r)}async getClientSeed(){let r="";try{r=this.keychain.get(nl)}catch{r=oc(),await this.keychain.set(nl,r)}return V_(r,"base16")}getSymKey(r){return this.keychain.get(r)}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}}class Ib extends T1{constructor(r,i){super(r,i),this.logger=r,this.core=i,this.messages=new Map,this.name=eb,this.version=tb,this.initialized=!1,this.storagePrefix=bi,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,o)=>{this.isInitialized();const l=fs(o);let d=this.messages.get(n);return typeof d>"u"&&(d={}),typeof d[l]<"u"||(d[l]=o,this.messages.set(n,d),await this.persist()),l},this.get=n=>{this.isInitialized();let o=this.messages.get(n);return typeof o>"u"&&(o={}),o},this.has=(n,o)=>{this.isInitialized();const l=this.get(n),d=fs(o);return typeof l[d]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=Re.generateChildLogger(r,this.name),this.core=i}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(r){await this.core.storage.setItem(this.storageKey,zl(r))}async getRelayerMessages(){const r=await this.core.storage.getItem(this.storageKey);return typeof r<"u"?Ul(r):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}}class xb extends N1{constructor(r,i){super(r,i),this.relayer=r,this.logger=i,this.events=new Cr.EventEmitter,this.name=ib,this.queue=new Map,this.publishTimeout=ne.toMiliseconds(ne.TEN_SECONDS),this.queueTimeout=ne.toMiliseconds(ne.FIVE_SECONDS),this.needsTransportRestart=!1,this.publish=async(n,o,l)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:o,opts:l}});try{const d=(l==null?void 0:l.ttl)||rb,v=ac(l),b=(l==null?void 0:l.prompt)||!1,m=(l==null?void 0:l.tag)||0,S=(l==null?void 0:l.id)||_c().toString(),O={topic:n,message:o,opts:{ttl:d,relay:v,prompt:b,tag:m,id:S}},F=setTimeout(()=>this.queue.set(S,O),this.queueTimeout);try{await await co(this.rpcPublish(n,o,d,v,b,m,S),this.publishTimeout),clearTimeout(F),this.relayer.events.emit(vt.publish,O)}catch{this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0;return}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:o,opts:l}})}catch(d){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(d),d}},this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.relayer=r,this.logger=Re.generateChildLogger(i,this.name),this.registerEventListeners()}get context(){return Re.getLoggerContext(this.logger)}rpcPublish(r,i,n,o,l,d,v){var b,m,S,O;const F={method:io(o.protocol).publish,params:{topic:r,message:i,ttl:n,prompt:l,tag:d},id:v};return _i((b=F.params)==null?void 0:b.prompt)&&((m=F.params)==null||delete m.prompt),_i((S=F.params)==null?void 0:S.tag)&&((O=F.params)==null||delete O.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:F}),this.relayer.request(F)}onPublish(r){this.queue.delete(r)}checkQueue(){this.queue.forEach(async r=>{const{topic:i,message:n,opts:o}=r;await this.publish(i,n,o)})}registerEventListeners(){this.relayer.core.heartbeat.on(gs.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(vt.connection_stalled);return}this.checkQueue()}),this.relayer.on(vt.message_ack,r=>{this.onPublish(r.id.toString())})}}class Sb{constructor(){this.map=new Map,this.set=(r,i)=>{const n=this.get(r);this.exists(r,i)||this.map.set(r,[...n,i])},this.get=r=>this.map.get(r)||[],this.exists=(r,i)=>this.get(r).includes(i),this.delete=(r,i)=>{if(typeof i>"u"){this.map.delete(r);return}if(!this.map.has(r))return;const n=this.get(r);if(!this.exists(r,i))return;const o=n.filter(l=>l!==i);if(!o.length){this.map.delete(r);return}this.map.set(r,o)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var Pb=Object.defineProperty,Ab=Object.defineProperties,Cb=Object.getOwnPropertyDescriptors,cl=Object.getOwnPropertySymbols,Ob=Object.prototype.hasOwnProperty,Rb=Object.prototype.propertyIsEnumerable,ul=(c,r,i)=>r in c?Pb(c,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[r]=i,zs=(c,r)=>{for(var i in r||(r={}))Ob.call(r,i)&&ul(c,i,r[i]);if(cl)for(var i of cl(r))Rb.call(r,i)&&ul(c,i,r[i]);return c},Qa=(c,r)=>Ab(c,Cb(r));class Tb extends L1{constructor(r,i){super(r,i),this.relayer=r,this.logger=i,this.subscriptions=new Map,this.topicMap=new Sb,this.events=new Cr.EventEmitter,this.name=fb,this.version=pb,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=bi,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,o)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:o}});try{const l=ac(o),d={topic:n,relay:l};this.pending.set(n,d);const v=await this.rpcSubscribe(n,l);return this.onSubscribe(v,d),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:o}}),v}catch(l){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(l),l}},this.unsubscribe=async(n,o)=>{await this.restartToComplete(),this.isInitialized(),typeof(o==null?void 0:o.id)<"u"?await this.unsubscribeById(n,o.id,o):await this.unsubscribeByTopic(n,o)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((o,l)=>{const d=new ne.Watch;d.start(this.pendingSubscriptionWatchLabel);const v=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(v),d.stop(this.pendingSubscriptionWatchLabel),o(!0)),d.elapsed(this.pendingSubscriptionWatchLabel)>=db&&(clearInterval(v),d.stop(this.pendingSubscriptionWatchLabel),l(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1),this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=r,this.logger=Re.generateChildLogger(i,this.name),this.clientId=""}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(r,i){let n=!1;try{n=this.getSubscription(r).topic===i}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(r,i){const n=this.topicMap.get(r);await Promise.all(n.map(async o=>await this.unsubscribeById(r,o,i)))}async unsubscribeById(r,i,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:r,id:i,opts:n}});try{const o=ac(n);await this.rpcUnsubscribe(r,i,o);const l=tr("USER_DISCONNECTED",`${this.name}, ${r}`);await this.onUnsubscribe(r,i,l),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:r,id:i,opts:n}})}catch(o){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(o),o}}async rpcSubscribe(r,i){const n={method:io(i.protocol).subscribe,params:{topic:r}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await co(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(vt.connection_stalled)}return fs(r+this.clientId)}async rpcBatchSubscribe(r){if(!r.length)return;const i=r[0].relay,n={method:io(i.protocol).batchSubscribe,params:{topics:r.map(o=>o.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await co(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(vt.connection_stalled)}}rpcUnsubscribe(r,i,n){const o={method:io(n.protocol).unsubscribe,params:{topic:r,id:i}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:o}),this.relayer.request(o)}onSubscribe(r,i){this.setSubscription(r,Qa(zs({},i),{id:r})),this.pending.delete(i.topic)}onBatchSubscribe(r){r.length&&r.forEach(i=>{this.setSubscription(i.id,zs({},i)),this.pending.delete(i.topic)})}async onUnsubscribe(r,i,n){this.events.removeAllListeners(i),this.hasSubscription(i,r)&&this.deleteSubscription(i,n),await this.relayer.messages.del(r)}async setRelayerSubscriptions(r){await this.relayer.core.storage.setItem(this.storageKey,r)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(r,i){this.subscriptions.has(r)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:r,subscription:i}),this.addSubscription(r,i))}addSubscription(r,i){this.subscriptions.set(r,zs({},i)),this.topicMap.set(i.topic,r),this.events.emit(Vr.created,i)}getSubscription(r){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:r});const i=this.subscriptions.get(r);if(!i){const{message:n}=Q("NO_MATCHING_KEY",`${this.name}: ${r}`);throw new Error(n)}return i}deleteSubscription(r,i){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:r,reason:i});const n=this.getSubscription(r);this.subscriptions.delete(r),this.topicMap.delete(n.topic,r),this.events.emit(Vr.deleted,Qa(zs({},n),{reason:i}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Vr.sync)}async reset(){if(this.cached.length){const r=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let i=0;i"u"||!r.length)return;if(this.subscriptions.size){const{message:i}=Q("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(i),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(i)}this.cached=r,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(r){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(r)}}async batchSubscribe(r){if(!r.length)return;const i=await this.rpcBatchSubscribe(r);ps(i)&&this.onBatchSubscribe(i.map((n,o)=>Qa(zs({},r[o]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(this.relayer.transportExplicitlyClosed)return;const r=[];this.pending.forEach(i=>{r.push(i)}),await this.batchSubscribe(r)}registerEventListeners(){this.relayer.core.heartbeat.on(gs.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(vt.connect,async()=>{await this.onConnect()}),this.relayer.on(vt.disconnect,()=>{this.onDisconnect()}),this.events.on(Vr.created,async r=>{const i=Vr.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),await this.persist()}),this.events.on(Vr.deleted,async r=>{const i=Vr.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}async restartToComplete(){this.restartInProgress&&await new Promise(r=>{const i=setInterval(()=>{this.restartInProgress||(clearInterval(i),r())},this.pollingInterval)})}}var Nb=Object.defineProperty,hl=Object.getOwnPropertySymbols,Db=Object.prototype.hasOwnProperty,Fb=Object.prototype.propertyIsEnumerable,ll=(c,r,i)=>r in c?Nb(c,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[r]=i,Lb=(c,r)=>{for(var i in r||(r={}))Db.call(r,i)&&ll(c,i,r[i]);if(hl)for(var i of hl(r))Fb.call(r,i)&&ll(c,i,r[i]);return c};class $b extends D1{constructor(r){super(r),this.protocol="wc",this.version=2,this.events=new Cr.EventEmitter,this.name=nb,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=async i=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(i)}catch(n){throw this.logger.debug("Failed to Publish Request"),this.logger.error(n),n}},this.core=r.core,this.logger=typeof r.logger<"u"&&typeof r.logger!="string"?Re.generateChildLogger(r.logger,this.name):Re.pino(Re.getDefaultLoggerOptions({level:r.logger||sb})),this.messages=new Ib(this.logger,r.core),this.subscriber=new Tb(this,this.logger),this.publisher=new xb(this,this.logger),this.relayUrl=(r==null?void 0:r.relayUrl)||mf,this.projectId=r.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${ol}...`),await this.restartTransport(ol)}this.registerEventListeners(),this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},ub)}get context(){return Re.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(r,i,n){this.isInitialized(),await this.publisher.publish(r,i,n),await this.recordMessageEvent({topic:r,message:i,publishedAt:Date.now()})}async subscribe(r,i){var n;this.isInitialized();let o=((n=this.subscriber.topicMap.get(r))==null?void 0:n[0])||"";return o||(await Promise.all([new Promise(l=>{this.subscriber.once(Vr.created,d=>{d.topic===r&&l()})}),new Promise(async l=>{o=await this.subscriber.subscribe(r,i),l()})]),o)}async unsubscribe(r,i){this.isInitialized(),await this.subscriber.unsubscribe(r,i)}on(r,i){this.events.on(r,i)}once(r,i){this.events.once(r,i)}off(r,i){this.events.off(r,i)}removeListener(r,i){this.events.removeListener(r,i)}async transportClose(){this.transportExplicitlyClosed=!0,this.connected&&(await this.provider.disconnect(),this.events.emit(vt.transport_closed))}async transportOpen(r){if(this.transportExplicitlyClosed=!1,!this.reconnecting){this.relayUrl=r||this.relayUrl,this.reconnecting=!0;try{await Promise.all([new Promise(i=>{this.initialized||i(),this.subscriber.once(Vr.resubscribed,()=>{i()})}),await Promise.race([new Promise(async(i,n)=>{await co(this.provider.connect(),5e3,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(o=>n(o)).then(()=>i()).finally(()=>this.removeListener(vt.transport_closed,this.rejectTransportOpen))}),new Promise(i=>this.once(vt.transport_closed,this.rejectTransportOpen))])])}catch(i){this.logger.error(i);const n=i;if(!this.isConnectionStalled(n.message))throw i;this.events.emit(vt.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(r){this.transportExplicitlyClosed||this.reconnecting||(this.relayUrl=r||this.relayUrl,this.connected&&await Promise.all([new Promise(i=>{this.provider.once(Ms.disconnect,()=>{i()})}),this.transportClose()]),await this.createProvider(),await this.transportOpen())}isConnectionStalled(r){return this.staleConnectionErrors.some(i=>r.includes(i))}rejectTransportOpen(){throw new Error("Attempt to connect to relay via `transportOpen` has stalled. Retrying...")}async createProvider(){const r=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Ei(new _w(vm({sdkVersion:cb,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:r,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(r){const{topic:i,message:n}=r;await this.messages.set(i,n)}async shouldIgnoreMessageEvent(r){const{topic:i,message:n}=r;return await this.subscriber.isSubscribed(i)?this.messages.has(i,n):!0}async onProviderPayload(r){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:r}),Ec(r)){if(!r.method.endsWith(ob))return;const i=r.params,{topic:n,message:o,publishedAt:l}=i.data,d={topic:n,message:o,publishedAt:l};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(Lb({type:"event",event:i.id},d)),this.events.emit(i.id,d),await this.acknowledgePayload(r),await this.onMessageEvent(d)}else yo(r)&&this.events.emit(vt.message_ack,r)}async onMessageEvent(r){await this.shouldIgnoreMessageEvent(r)||(this.events.emit(vt.message,r),await this.recordMessageEvent(r))}async acknowledgePayload(r){const i=bc(r.id,!0);await this.provider.connection.send(i)}registerProviderListeners(){this.provider.on(Ms.payload,r=>this.onProviderPayload(r)),this.provider.on(Ms.connect,()=>{this.events.emit(vt.connect)}),this.provider.on(Ms.disconnect,()=>{this.onProviderDisconnect()}),this.provider.on(Ms.error,r=>{this.logger.error(r),this.events.emit(vt.error,r)})}registerEventListeners(){this.events.on(vt.connection_stalled,async()=>{await this.restartTransport()})}onProviderDisconnect(){this.events.emit(vt.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.restartTransport()},ne.toMiliseconds(ab))}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}async toEstablishConnection(){if(!this.connected){if(this.connecting)return await new Promise(r=>{const i=setInterval(()=>{this.connected&&(clearInterval(i),r())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var Mb=Object.defineProperty,fl=Object.getOwnPropertySymbols,jb=Object.prototype.hasOwnProperty,zb=Object.prototype.propertyIsEnumerable,pl=(c,r,i)=>r in c?Mb(c,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[r]=i,dl=(c,r)=>{for(var i in r||(r={}))jb.call(r,i)&&pl(c,i,r[i]);if(fl)for(var i of fl(r))zb.call(r,i)&&pl(c,i,r[i]);return c};class mo extends F1{constructor(r,i,n,o=bi,l=void 0){super(r,i,n,o),this.core=r,this.logger=i,this.name=n,this.map=new Map,this.version=hb,this.cached=[],this.initialized=!1,this.storagePrefix=bi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(d=>{this.getKey&&d!==null&&!_i(d)?this.map.set(this.getKey(d),d):om(d)?this.map.set(d.id,d):am(d)&&this.map.set(d.topic,d)}),this.cached=[],this.initialized=!0)},this.set=async(d,v)=>{this.isInitialized(),this.map.has(d)?await this.update(d,v):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:d,value:v}),this.map.set(d,v),await this.persist())},this.get=d=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:d}),this.getData(d)),this.getAll=d=>(this.isInitialized(),d?this.values.filter(v=>Object.keys(d).every(b=>Ew(v[b],d[b]))):this.values),this.update=async(d,v)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:d,update:v});const b=dl(dl({},this.getData(d)),v);this.map.set(d,b),await this.persist()},this.delete=async(d,v)=>{this.isInitialized(),this.map.has(d)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:d,reason:v}),this.map.delete(d),await this.persist())},this.logger=Re.generateChildLogger(i,this.name),this.storagePrefix=o,this.getKey=l}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(r){await this.core.storage.setItem(this.storageKey,r)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(r){const i=this.map.get(r);if(!i){const{message:n}=Q("NO_MATCHING_KEY",`${this.name}: ${r}`);throw this.logger.error(n),new Error(n)}return i}async persist(){await this.setDataStore(this.values)}async restore(){try{const r=await this.getDataStore();if(typeof r>"u"||!r.length)return;if(this.map.size){const{message:i}=Q("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(i),new Error(i)}this.cached=r,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(r){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(r)}}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}}class Ub{constructor(r,i){this.core=r,this.logger=i,this.name=gb,this.version=yb,this.events=new vc,this.initialized=!1,this.storagePrefix=bi,this.ignoredPayloadTypes=[$l],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async()=>{this.isInitialized();const n=oc(),o=await this.core.crypto.setSymKey(n),l=Lr(ne.FIVE_MINUTES),d={protocol:vf},v={topic:o,expiry:l,relay:d,active:!1},b=mm({protocol:this.core.protocol,version:this.core.version,topic:o,symKey:n,relay:d});return await this.pairings.set(o,v),await this.core.relayer.subscribe(o),this.core.expirer.set(o,l),{topic:o,uri:b}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:o,symKey:l,relay:d}=wm(n.uri);if(this.pairings.keys.includes(o))throw new Error(`Pairing already exists: ${o}`);if(this.core.crypto.hasKeys(o))throw new Error(`Keychain already exists: ${o}`);const v=Lr(ne.FIVE_MINUTES),b={topic:o,relay:d,expiry:v,active:!1};return await this.pairings.set(o,b),await this.core.crypto.setSymKey(l,o),await this.core.relayer.subscribe(o,{relay:d}),this.core.expirer.set(o,v),n.activatePairing&&await this.activate({topic:o}),b},this.activate=async({topic:n})=>{this.isInitialized();const o=Lr(ne.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:o}),this.core.expirer.set(n,o)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:o}=n;if(this.pairings.keys.includes(o)){const l=await this.sendRequest(o,"wc_pairingPing",{}),{done:d,resolve:v,reject:b}=hs();this.events.once(Ft("pairing_ping",l),({error:m})=>{m?b(m):v()}),await d()}},this.updateExpiry=async({topic:n,expiry:o})=>{this.isInitialized(),await this.pairings.update(n,{expiry:o})},this.updateMetadata=async({topic:n,metadata:o})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:o})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:o}=n;this.pairings.keys.includes(o)&&(await this.sendRequest(o,"wc_pairingDelete",tr("USER_DISCONNECTED")),await this.deletePairing(o))},this.sendRequest=async(n,o,l)=>{const d=po(o,l),v=await this.core.crypto.encode(n,d),b=js[o].req;return this.core.history.set(n,d),this.core.relayer.publish(n,v,b),d.id},this.sendResult=async(n,o,l)=>{const d=bc(n,l),v=await this.core.crypto.encode(o,d),b=await this.core.history.get(o,n),m=js[b.request.method].res;await this.core.relayer.publish(o,v,m),await this.core.history.resolve(d)},this.sendError=async(n,o,l)=>{const d=go(n,l),v=await this.core.crypto.encode(o,d),b=await this.core.history.get(o,n),m=js[b.request.method]?js[b.request.method].res:js.unregistered_method.res;await this.core.relayer.publish(o,v,m),await this.core.history.resolve(d)},this.deletePairing=async(n,o)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,tr("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),o?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(o=>wi(o.expiry));await Promise.all(n.map(o=>this.deletePairing(o.topic)))},this.onRelayEventRequest=n=>{const{topic:o,payload:l}=n,d=l.method;if(this.pairings.keys.includes(o))switch(d){case"wc_pairingPing":return this.onPairingPingRequest(o,l);case"wc_pairingDelete":return this.onPairingDeleteRequest(o,l);default:return this.onUnknownRpcMethodRequest(o,l)}},this.onRelayEventResponse=async n=>{const{topic:o,payload:l}=n,d=(await this.core.history.get(o,l.id)).request.method;if(this.pairings.keys.includes(o))switch(d){case"wc_pairingPing":return this.onPairingPingResponse(o,l);default:return this.onUnknownRpcMethodResponse(d)}},this.onPairingPingRequest=async(n,o)=>{const{id:l}=o;try{this.isValidPing({topic:n}),await this.sendResult(l,n,!0),this.events.emit("pairing_ping",{id:l,topic:n})}catch(d){await this.sendError(l,n,d),this.logger.error(d)}},this.onPairingPingResponse=(n,o)=>{const{id:l}=o;setTimeout(()=>{ai(o)?this.events.emit(Ft("pairing_ping",l),{}):$r(o)&&this.events.emit(Ft("pairing_ping",l),{error:o.error})},500)},this.onPairingDeleteRequest=async(n,o)=>{const{id:l}=o;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit("pairing_delete",{id:l,topic:n})}catch(d){await this.sendError(l,n,d),this.logger.error(d)}},this.onUnknownRpcMethodRequest=async(n,o)=>{const{id:l,method:d}=o;try{if(this.registeredMethods.includes(d))return;const v=tr("WC_METHOD_UNSUPPORTED",d);await this.sendError(l,n,v),this.logger.error(v)}catch(v){await this.sendError(l,n,v),this.logger.error(v)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(tr("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!ur(n)){const{message:o}=Q("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(o)}if(!_m(n.uri)){const{message:o}=Q("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(o)}},this.isValidPing=async n=>{if(!ur(n)){const{message:l}=Q("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(l)}const{topic:o}=n;await this.isValidPairingTopic(o)},this.isValidDisconnect=async n=>{if(!ur(n)){const{message:l}=Q("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(l)}const{topic:o}=n;await this.isValidPairingTopic(o)},this.isValidPairingTopic=async n=>{if(!ls(n,!1)){const{message:o}=Q("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(o)}if(!this.pairings.keys.includes(n)){const{message:o}=Q("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(o)}if(wi(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:o}=Q("EXPIRED",`pairing topic: ${n}`);throw new Error(o)}},this.core=r,this.logger=Re.generateChildLogger(i,this.name),this.pairings=new mo(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Re.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}registerRelayerEvents(){this.core.relayer.on(vt.message,async r=>{const{topic:i,message:n}=r;if(this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const o=await this.core.crypto.decode(i,n);Ec(o)?(this.core.history.set(i,o),this.onRelayEventRequest({topic:i,payload:o})):yo(o)&&(await this.core.history.resolve(o),await this.onRelayEventResponse({topic:i,payload:o}),this.core.history.delete(i,o.id))})}registerExpirerEvents(){this.core.expirer.on(Pr.expired,async r=>{const{topic:i}=Ml(r.target);i&&this.pairings.keys.includes(i)&&(await this.deletePairing(i,!0),this.events.emit("pairing_expire",{topic:i}))})}}class qb extends R1{constructor(r,i){super(r,i),this.core=r,this.logger=i,this.records=new Map,this.events=new Cr.EventEmitter,this.name=vb,this.version=mb,this.cached=[],this.initialized=!1,this.storagePrefix=bi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,o,l)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:o,chainId:l}),this.records.has(o.id))return;const d={id:o.id,topic:n,request:{method:o.method,params:o.params||null},chainId:l,expiry:Lr(ne.THIRTY_DAYS)};this.records.set(d.id,d),this.events.emit(Kr.created,d)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const o=await this.getRecord(n.id);typeof o.response>"u"&&(o.response=$r(n)?{error:n.error}:{result:n.result},this.records.set(o.id,o),this.events.emit(Kr.updated,o))},this.get=async(n,o)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:o}),await this.getRecord(o)),this.delete=(n,o)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:o}),this.values.forEach(l=>{if(l.topic===n){if(typeof o<"u"&&l.id!==o)return;this.records.delete(l.id),this.events.emit(Kr.deleted,l)}})},this.exists=async(n,o)=>(this.isInitialized(),this.records.has(o)?(await this.getRecord(o)).topic===n:!1),this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.logger=Re.generateChildLogger(i,this.name)}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const r=[];return this.values.forEach(i=>{if(typeof i.response<"u")return;const n={topic:i.topic,request:po(i.request.method,i.request.params,i.id),chainId:i.chainId};return r.push(n)}),r}async setJsonRpcRecords(r){await this.core.storage.setItem(this.storageKey,r)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(r){this.isInitialized();const i=this.records.get(r);if(!i){const{message:n}=Q("NO_MATCHING_KEY",`${this.name}: ${r}`);throw new Error(n)}return i}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Kr.sync)}async restore(){try{const r=await this.getJsonRpcRecords();if(typeof r>"u"||!r.length)return;if(this.records.size){const{message:i}=Q("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(i),new Error(i)}this.cached=r,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(r){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(r)}}registerEventListeners(){this.events.on(Kr.created,r=>{const i=Kr.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,record:r}),this.persist()}),this.events.on(Kr.updated,r=>{const i=Kr.updated;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,record:r}),this.persist()}),this.events.on(Kr.deleted,r=>{const i=Kr.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,record:r}),this.persist()}),this.core.heartbeat.on(gs.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(r=>{ne.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.delete(r.topic,r.id))})}catch(r){this.logger.warn(r)}}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}}class Bb extends $1{constructor(r,i){super(r,i),this.core=r,this.logger=i,this.expirations=new Map,this.events=new Cr.EventEmitter,this.name=wb,this.version=_b,this.cached=[],this.initialized=!1,this.storagePrefix=bi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const o=this.formatTarget(n);return typeof this.getExpiration(o)<"u"}catch{return!1}},this.set=(n,o)=>{this.isInitialized();const l=this.formatTarget(n),d={target:l,expiry:o};this.expirations.set(l,d),this.checkExpiry(l,d),this.events.emit(Pr.created,{target:l,expiration:d})},this.get=n=>{this.isInitialized();const o=this.formatTarget(n);return this.getExpiration(o)},this.del=n=>{if(this.isInitialized(),this.has(n)){const o=this.formatTarget(n),l=this.getExpiration(o);this.expirations.delete(o),this.events.emit(Pr.deleted,{target:o,expiration:l})}},this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.logger=Re.generateChildLogger(i,this.name)}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(r){if(typeof r=="string")return bm(r);if(typeof r=="number")return Em(r);const{message:i}=Q("UNKNOWN_TYPE",`Target type: ${typeof r}`);throw new Error(i)}async setExpirations(r){await this.core.storage.setItem(this.storageKey,r)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Pr.sync)}async restore(){try{const r=await this.getExpirations();if(typeof r>"u"||!r.length)return;if(this.expirations.size){const{message:i}=Q("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(i),new Error(i)}this.cached=r,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(r){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(r)}}getExpiration(r){const i=this.expirations.get(r);if(!i){const{message:n}=Q("NO_MATCHING_KEY",`${this.name}: ${r}`);throw this.logger.error(n),new Error(n)}return i}checkExpiry(r,i){const{expiry:n}=i;ne.toMiliseconds(n)-Date.now()<=0&&this.expire(r,i)}expire(r,i){this.expirations.delete(r),this.events.emit(Pr.expired,{target:r,expiration:i})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((r,i)=>this.checkExpiry(i,r))}registerEventListeners(){this.core.heartbeat.on(gs.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(Pr.created,r=>{const i=Pr.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),this.persist()}),this.events.on(Pr.expired,r=>{const i=Pr.expired;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),this.persist()}),this.events.on(Pr.deleted,r=>{const i=Pr.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),this.persist()})}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}}class Hb extends M1{constructor(r,i){super(r,i),this.projectId=r,this.logger=i,this.name=Za,this.initialized=!1,this.init=async n=>{Im()||!jl()||(this.verifyUrl=(n==null?void 0:n.verifyUrl)||al,await this.createIframe())},this.register=async n=>{var o;if(this.initialized||await this.init(),!!this.iframe)try{(o=this.iframe.contentWindow)==null||o.postMessage(n.attestationId,this.verifyUrl),this.logger.info(`postMessage sent: ${n.attestationId} ${this.verifyUrl}`)}catch{}},this.resolve=async n=>{var o;if(this.isDevEnv)return"";this.logger.info(`resolving attestation: ${n.attestationId}`);const l=this.startAbortTimer(ne.FIVE_SECONDS),d=await fetch(`${this.verifyUrl}/attestation/${n.attestationId}`,{signal:this.abortController.signal});return clearTimeout(l),d.status===200?(o=await d.json())==null?void 0:o.origin:""},this.createIframe=async()=>{try{await Promise.race([new Promise((n,o)=>{if(document.getElementById(Za))return n();const l=document.createElement("iframe");l.setAttribute("id",Za),l.setAttribute("src",`${this.verifyUrl}/${this.projectId}`),l.style.display="none",l.addEventListener("load",()=>{this.initialized=!0,n()}),l.addEventListener("error",d=>{o(d)}),document.body.append(l),this.iframe=l}),new Promise(n=>{setTimeout(()=>n("iframe load timeout"),ne.toMiliseconds(ne.ONE_SECOND/2))})])}catch(n){this.logger.error(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.error(n)}},this.logger=Re.generateChildLogger(i,this.name),this.verifyUrl=al,this.abortController=new AbortController,this.isDevEnv=xm()&&{}.IS_VITEST}get context(){return Re.getLoggerContext(this.logger)}startAbortTimer(r){return setTimeout(()=>this.abortController.abort(),ne.toMiliseconds(r))}}var kb=Object.defineProperty,gl=Object.getOwnPropertySymbols,Kb=Object.prototype.hasOwnProperty,Vb=Object.prototype.propertyIsEnumerable,yl=(c,r,i)=>r in c?kb(c,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[r]=i,vl=(c,r)=>{for(var i in r||(r={}))Kb.call(r,i)&&yl(c,i,r[i]);if(gl)for(var i of gl(r))Vb.call(r,i)&&yl(c,i,r[i]);return c};class xc extends O1{constructor(r){super(r),this.protocol=yf,this.version=G_,this.name=Ic,this.events=new Cr.EventEmitter,this.initialized=!1,this.on=(n,o)=>this.events.on(n,o),this.once=(n,o)=>this.events.once(n,o),this.off=(n,o)=>this.events.off(n,o),this.removeListener=(n,o)=>this.events.removeListener(n,o),this.projectId=r==null?void 0:r.projectId,this.relayUrl=(r==null?void 0:r.relayUrl)||mf;const i=typeof(r==null?void 0:r.logger)<"u"&&typeof(r==null?void 0:r.logger)!="string"?r.logger:Re.pino(Re.getDefaultLoggerOptions({level:(r==null?void 0:r.logger)||W_.logger}));this.logger=Re.generateChildLogger(i,this.name),this.heartbeat=new gs.HeartBeat,this.crypto=new Eb(this,this.logger,r==null?void 0:r.keychain),this.history=new qb(this,this.logger),this.expirer=new Bb(this,this.logger),this.storage=r!=null&&r.storage?r.storage:new _1(vl(vl({},J_),r==null?void 0:r.storageOptions)),this.relayer=new $b({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new Ub(this,this.logger),this.verify=new Hb(this.projectId||"",this.logger)}static async init(r){const i=new xc(r);await i.initialize();const n=await i.crypto.getClientId();return await i.storage.setItem(lb,n),i}get context(){return Re.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(r){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,r),this.logger.error(r.message),r}}}const Gb=xc,wf="wc",_f=2,bf="client",Sc=`${wf}@${_f}:${bf}:`,ec={name:bf,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},Wb="WALLETCONNECT_DEEPLINK_CHOICE",Jb="proposal",Ef="Proposal expired",Yb="session",eo=ne.SEVEN_DAYS,Xb="engine",Us={wc_sessionPropose:{req:{ttl:ne.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ne.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ne.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ne.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ne.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ne.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ne.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ne.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ne.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ne.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:ne.THIRTY_SECONDS,prompt:!1,tag:1115}}},tc={min:ne.FIVE_MINUTES,max:ne.SEVEN_DAYS},Zb="request",Qb=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var eE=Object.defineProperty,tE=Object.defineProperties,rE=Object.getOwnPropertyDescriptors,ml=Object.getOwnPropertySymbols,iE=Object.prototype.hasOwnProperty,sE=Object.prototype.propertyIsEnumerable,wl=(c,r,i)=>r in c?eE(c,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[r]=i,Sr=(c,r)=>{for(var i in r||(r={}))iE.call(r,i)&&wl(c,i,r[i]);if(ml)for(var i of ml(r))sE.call(r,i)&&wl(c,i,r[i]);return c},rc=(c,r)=>tE(c,rE(r));class nE extends z1{constructor(r){super(r),this.name=Xb,this.events=new vc,this.initialized=!1,this.ignoredPayloadTypes=[$l],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(Us)}),this.initialized=!0)},this.connect=async i=>{this.isInitialized();const n=rc(Sr({},i),{requiredNamespaces:i.requiredNamespaces||{},optionalNamespaces:i.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:o,requiredNamespaces:l,optionalNamespaces:d,sessionProperties:v,relays:b}=n;let m=o,S,O=!1;if(m&&(O=this.client.core.pairing.pairings.get(m).active),!m||!O){const{topic:fe,uri:pe}=await this.client.core.pairing.create();m=fe,S=pe}const F=await this.client.core.crypto.generateKeyPair(),z=Sr({requiredNamespaces:l,optionalNamespaces:d,relays:b??[{protocol:vf}],proposer:{publicKey:F,metadata:this.client.metadata}},v&&{sessionProperties:v}),{reject:R,resolve:K,done:re}=hs(ne.FIVE_MINUTES,Ef);if(this.events.once(Ft("session_connect"),async({error:fe,session:pe})=>{if(fe)R(fe);else if(pe){pe.self.publicKey=F;const de=rc(Sr({},pe),{requiredNamespaces:pe.requiredNamespaces,optionalNamespaces:pe.optionalNamespaces});await this.client.session.set(pe.topic,de),await this.setExpiry(pe.topic,pe.expiry),m&&await this.client.core.pairing.updateMetadata({topic:m,metadata:pe.peer.metadata}),K(de)}}),!m){const{message:fe}=Q("NO_MATCHING_KEY",`connect() pairing topic: ${m}`);throw new Error(fe)}const he=await this.sendRequest(m,"wc_sessionPropose",z),le=Lr(ne.FIVE_MINUTES);return await this.setProposal(he,Sr({id:he,expiry:le},z)),{uri:S,approval:re}},this.pair=async i=>(this.isInitialized(),await this.client.core.pairing.pair(i)),this.approve=async i=>{this.isInitialized(),await this.isValidApprove(i);const{id:n,relayProtocol:o,namespaces:l,sessionProperties:d}=i,v=this.client.proposal.get(n);let{pairingTopic:b,proposer:m,requiredNamespaces:S,optionalNamespaces:O}=v;b=b||"",so(S)||(S=Pm(l,"approve()"));const F=await this.client.core.crypto.generateKeyPair(),z=m.publicKey,R=await this.client.core.crypto.generateSharedKey(F,z);b&&n&&(await this.client.core.pairing.updateMetadata({topic:b,metadata:m.metadata}),await this.sendResult(n,b,{relay:{protocol:o??"irn"},responderPublicKey:F}),await this.client.proposal.delete(n,tr("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:b}));const K=Sr({relay:{protocol:o??"irn"},namespaces:l,requiredNamespaces:S,optionalNamespaces:O,pairingTopic:b,controller:{publicKey:F,metadata:this.client.metadata},expiry:Lr(eo)},d&&{sessionProperties:d});await this.client.core.relayer.subscribe(R),await this.sendRequest(R,"wc_sessionSettle",K);const re=rc(Sr({},K),{topic:R,pairingTopic:b,acknowledged:!1,self:K.controller,peer:{publicKey:m.publicKey,metadata:m.metadata},controller:F});return await this.client.session.set(R,re),await this.setExpiry(R,Lr(eo)),{topic:R,acknowledged:()=>new Promise(he=>setTimeout(()=>he(this.client.session.get(R)),500))}},this.reject=async i=>{this.isInitialized(),await this.isValidReject(i);const{id:n,reason:o}=i,{pairingTopic:l}=this.client.proposal.get(n);l&&(await this.sendError(n,l,o),await this.client.proposal.delete(n,tr("USER_DISCONNECTED")))},this.update=async i=>{this.isInitialized(),await this.isValidUpdate(i);const{topic:n,namespaces:o}=i,l=await this.sendRequest(n,"wc_sessionUpdate",{namespaces:o}),{done:d,resolve:v,reject:b}=hs();return this.events.once(Ft("session_update",l),({error:m})=>{m?b(m):v()}),await this.client.session.update(n,{namespaces:o}),{acknowledged:d}},this.extend=async i=>{this.isInitialized(),await this.isValidExtend(i);const{topic:n}=i,o=await this.sendRequest(n,"wc_sessionExtend",{}),{done:l,resolve:d,reject:v}=hs();return this.events.once(Ft("session_extend",o),({error:b})=>{b?v(b):d()}),await this.setExpiry(n,Lr(eo)),{acknowledged:l}},this.request=async i=>{this.isInitialized(),await this.isValidRequest(i);const{chainId:n,request:o,topic:l,expiry:d}=i,v=await this.sendRequest(l,"wc_sessionRequest",{request:o,chainId:n},d),{done:b,resolve:m,reject:S}=hs(d);this.events.once(Ft("session_request",v),({error:F,result:z})=>{F?S(F):m(z)}),this.client.events.emit("session_request_sent",{topic:l,request:o,chainId:n,id:v});const O=await this.client.core.storage.getItem(Wb);return Am({id:v,topic:l,wcDeepLink:O}),await b()},this.respond=async i=>{this.isInitialized(),await this.isValidRespond(i);const{topic:n,response:o}=i,{id:l}=o;ai(o)?await this.sendResult(l,n,o.result):$r(o)&&await this.sendError(l,n,o.error),this.deletePendingSessionRequest(i.response.id,{message:"fulfilled",code:0})},this.ping=async i=>{this.isInitialized(),await this.isValidPing(i);const{topic:n}=i;if(this.client.session.keys.includes(n)){const o=await this.sendRequest(n,"wc_sessionPing",{}),{done:l,resolve:d,reject:v}=hs();this.events.once(Ft("session_ping",o),({error:b})=>{b?v(b):d()}),await l()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async i=>{this.isInitialized(),await this.isValidEmit(i);const{topic:n,event:o,chainId:l}=i;await this.sendRequest(n,"wc_sessionEvent",{event:o,chainId:l})},this.disconnect=async i=>{this.isInitialized(),await this.isValidDisconnect(i);const{topic:n}=i;if(this.client.session.keys.includes(n)){const o=_c().toString();let l;const d=v=>{(v==null?void 0:v.id.toString())===o&&(this.client.core.relayer.events.removeListener(vt.message_ack,d),l())};await Promise.all([new Promise(v=>{l=v,this.client.core.relayer.on(vt.message_ack,d)}),this.sendRequest(n,"wc_sessionDelete",tr("USER_DISCONNECTED"),void 0,o)]),await this.deleteSession(n)}else await this.client.core.pairing.disconnect({topic:n})},this.find=i=>(this.isInitialized(),this.client.session.getAll().filter(n=>Cm(n,i))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async i=>{if(i.pairingTopic)try{const n=this.client.core.pairing.pairings.get(i.pairingTopic),o=this.client.core.pairing.pairings.getAll().filter(l=>{var d,v;return((d=l.peerMetadata)==null?void 0:d.url)&&((v=l.peerMetadata)==null?void 0:v.url)===i.peer.metadata.url&&l.topic&&l.topic!==n.topic});if(o.length===0)return;this.client.logger.info(`Cleaning up ${o.length} duplicate pairing(s)`),await Promise.all(o.map(l=>this.client.core.pairing.disconnect({topic:l.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async(i,n)=>{const{self:o}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),this.client.session.delete(i,tr("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(o.publicKey)&&await this.client.core.crypto.deleteKeyPair(o.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),n||this.client.core.expirer.del(i)},this.deleteProposal=async(i,n)=>{await Promise.all([this.client.proposal.delete(i,tr("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(i)])},this.deletePendingSessionRequest=async(i,n,o=!1)=>{await Promise.all([this.client.pendingRequest.delete(i,n),o?Promise.resolve():this.client.core.expirer.del(i)])},this.setExpiry=async(i,n)=>{this.client.session.keys.includes(i)&&await this.client.session.update(i,{expiry:n}),this.client.core.expirer.set(i,n)},this.setProposal=async(i,n)=>{await this.client.proposal.set(i,n),this.client.core.expirer.set(i,n.expiry)},this.setPendingSessionRequest=async i=>{const n=Us.wc_sessionRequest.req.ttl,{id:o,topic:l,params:d}=i;await this.client.pendingRequest.set(o,{id:o,topic:l,params:d}),n&&this.client.core.expirer.set(o,Lr(n))},this.sendRequest=async(i,n,o,l,d)=>{const v=po(n,o);if(jl()&&Qb.includes(n)){const S=fs(JSON.stringify(v));await this.client.core.verify.register({attestationId:S})}const b=await this.client.core.crypto.encode(i,v),m=Us[n].req;return l&&(m.ttl=l),d&&(m.id=d),this.client.core.history.set(i,v),this.client.core.relayer.publish(i,b,m),v.id},this.sendResult=async(i,n,o)=>{const l=bc(i,o),d=await this.client.core.crypto.encode(n,l),v=await this.client.core.history.get(n,i),b=Us[v.request.method].res;this.client.core.relayer.publish(n,d,b),await this.client.core.history.resolve(l)},this.sendError=async(i,n,o)=>{const l=go(i,o),d=await this.client.core.crypto.encode(n,l),v=await this.client.core.history.get(n,i),b=Us[v.request.method].res;this.client.core.relayer.publish(n,d,b),await this.client.core.history.resolve(l)},this.cleanup=async()=>{const i=[],n=[];this.client.session.getAll().forEach(o=>{wi(o.expiry)&&i.push(o.topic)}),this.client.proposal.getAll().forEach(o=>{wi(o.expiry)&&n.push(o.id)}),await Promise.all([...i.map(o=>this.deleteSession(o)),...n.map(o=>this.deleteProposal(o))])},this.onRelayEventRequest=i=>{const{topic:n,payload:o}=i,l=o.method;switch(l){case"wc_sessionPropose":return this.onSessionProposeRequest(n,o);case"wc_sessionSettle":return this.onSessionSettleRequest(n,o);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,o);case"wc_sessionExtend":return this.onSessionExtendRequest(n,o);case"wc_sessionPing":return this.onSessionPingRequest(n,o);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,o);case"wc_sessionRequest":return this.onSessionRequest(n,o);case"wc_sessionEvent":return this.onSessionEventRequest(n,o);default:return this.client.logger.info(`Unsupported request method ${l}`)}},this.onRelayEventResponse=async i=>{const{topic:n,payload:o}=i,l=(await this.client.core.history.get(n,o.id)).request.method;switch(l){case"wc_sessionPropose":return this.onSessionProposeResponse(n,o);case"wc_sessionSettle":return this.onSessionSettleResponse(n,o);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,o);case"wc_sessionExtend":return this.onSessionExtendResponse(n,o);case"wc_sessionPing":return this.onSessionPingResponse(n,o);case"wc_sessionRequest":return this.onSessionRequestResponse(n,o);default:return this.client.logger.info(`Unsupported response method ${l}`)}},this.onRelayEventUnknownPayload=i=>{const{topic:n}=i,{message:o}=Q("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(o)},this.onSessionProposeRequest=async(i,n)=>{const{params:o,id:l}=n;try{this.isValidConnect(Sr({},n.params));const d=Lr(ne.FIVE_MINUTES),v=Sr({id:l,pairingTopic:i,expiry:d},o);await this.setProposal(l,v);const b=fs(JSON.stringify(n)),m=await this.getVerifyContext(b,v.proposer.metadata);this.client.events.emit("session_proposal",{id:l,params:v,verifyContext:m})}catch(d){await this.sendError(l,i,d),this.client.logger.error(d)}},this.onSessionProposeResponse=async(i,n)=>{const{id:o}=n;if(ai(n)){const{result:l}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:l});const d=this.client.proposal.get(o);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:d});const v=d.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:v});const b=l.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:b});const m=await this.client.core.crypto.generateSharedKey(v,b);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:m});const S=await this.client.core.relayer.subscribe(m);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:S}),await this.client.core.pairing.activate({topic:i})}else $r(n)&&(await this.client.proposal.delete(o,tr("USER_DISCONNECTED")),this.events.emit(Ft("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(i,n)=>{const{id:o,params:l}=n;try{this.isValidSessionSettleRequest(l);const{relay:d,controller:v,expiry:b,namespaces:m,requiredNamespaces:S,optionalNamespaces:O,sessionProperties:F,pairingTopic:z}=n.params,R=Sr({topic:i,relay:d,expiry:b,namespaces:m,acknowledged:!0,pairingTopic:z,requiredNamespaces:S,optionalNamespaces:O,controller:v.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:v.publicKey,metadata:v.metadata}},F&&{sessionProperties:F});await this.sendResult(n.id,i,!0),this.events.emit(Ft("session_connect"),{session:R}),this.cleanupDuplicatePairings(R)}catch(d){await this.sendError(o,i,d),this.client.logger.error(d)}},this.onSessionSettleResponse=async(i,n)=>{const{id:o}=n;ai(n)?(await this.client.session.update(i,{acknowledged:!0}),this.events.emit(Ft("session_approve",o),{})):$r(n)&&(await this.client.session.delete(i,tr("USER_DISCONNECTED")),this.events.emit(Ft("session_approve",o),{error:n.error}))},this.onSessionUpdateRequest=async(i,n)=>{const{params:o,id:l}=n;try{this.isValidUpdate(Sr({topic:i},o)),await this.client.session.update(i,{namespaces:o.namespaces}),await this.sendResult(l,i,!0),this.client.events.emit("session_update",{id:l,topic:i,params:o})}catch(d){await this.sendError(l,i,d),this.client.logger.error(d)}},this.onSessionUpdateResponse=(i,n)=>{const{id:o}=n;ai(n)?this.events.emit(Ft("session_update",o),{}):$r(n)&&this.events.emit(Ft("session_update",o),{error:n.error})},this.onSessionExtendRequest=async(i,n)=>{const{id:o}=n;try{this.isValidExtend({topic:i}),await this.setExpiry(i,Lr(eo)),await this.sendResult(o,i,!0),this.client.events.emit("session_extend",{id:o,topic:i})}catch(l){await this.sendError(o,i,l),this.client.logger.error(l)}},this.onSessionExtendResponse=(i,n)=>{const{id:o}=n;ai(n)?this.events.emit(Ft("session_extend",o),{}):$r(n)&&this.events.emit(Ft("session_extend",o),{error:n.error})},this.onSessionPingRequest=async(i,n)=>{const{id:o}=n;try{this.isValidPing({topic:i}),await this.sendResult(o,i,!0),this.client.events.emit("session_ping",{id:o,topic:i})}catch(l){await this.sendError(o,i,l),this.client.logger.error(l)}},this.onSessionPingResponse=(i,n)=>{const{id:o}=n;setTimeout(()=>{ai(n)?this.events.emit(Ft("session_ping",o),{}):$r(n)&&this.events.emit(Ft("session_ping",o),{error:n.error})},500)},this.onSessionDeleteRequest=async(i,n)=>{const{id:o}=n;try{this.isValidDisconnect({topic:i,reason:n.params}),await Promise.all([new Promise(l=>{this.client.core.relayer.once(vt.publish,async()=>{l(await this.deleteSession(i))})}),this.sendResult(o,i,!0)]),this.client.events.emit("session_delete",{id:o,topic:i})}catch(l){this.client.logger.error(l)}},this.onSessionRequest=async(i,n)=>{const{id:o,params:l}=n;try{this.isValidRequest(Sr({topic:i},l)),await this.setPendingSessionRequest({id:o,topic:i,params:l});const d=fs(JSON.stringify(n)),v=this.client.session.get(i),b=await this.getVerifyContext(d,v.peer.metadata);this.client.events.emit("session_request",{id:o,topic:i,params:l,verifyContext:b})}catch(d){await this.sendError(o,i,d),this.client.logger.error(d)}},this.onSessionRequestResponse=(i,n)=>{const{id:o}=n;ai(n)?this.events.emit(Ft("session_request",o),{result:n.result}):$r(n)&&this.events.emit(Ft("session_request",o),{error:n.error})},this.onSessionEventRequest=async(i,n)=>{const{id:o,params:l}=n;try{this.isValidEmit(Sr({topic:i},l)),this.client.events.emit("session_event",{id:o,topic:i,params:l})}catch(d){await this.sendError(o,i,d),this.client.logger.error(d)}},this.isValidConnect=async i=>{if(!ur(i)){const{message:b}=Q("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(i)}`);throw new Error(b)}const{pairingTopic:n,requiredNamespaces:o,optionalNamespaces:l,sessionProperties:d,relays:v}=i;if(_i(n)||await this.isValidPairingTopic(n),!Om(v,!0)){const{message:b}=Q("MISSING_OR_INVALID",`connect() relays: ${v}`);throw new Error(b)}!_i(o)&&so(o)!==0&&this.validateNamespaces(o,"requiredNamespaces"),!_i(l)&&so(l)!==0&&this.validateNamespaces(l,"optionalNamespaces"),_i(d)||this.validateSessionProps(d,"sessionProperties")},this.validateNamespaces=(i,n)=>{const o=Rm(i,"connect()",n);if(o)throw new Error(o.message)},this.isValidApprove=async i=>{if(!ur(i))throw new Error(Q("MISSING_OR_INVALID",`approve() params: ${i}`).message);const{id:n,namespaces:o,relayProtocol:l,sessionProperties:d}=i;await this.isValidProposalId(n);const v=this.client.proposal.get(n),b=Ha(o,"approve()");if(b)throw new Error(b.message);const m=Oh(v.requiredNamespaces,o,"approve()");if(m)throw new Error(m.message);if(!ls(l,!0)){const{message:S}=Q("MISSING_OR_INVALID",`approve() relayProtocol: ${l}`);throw new Error(S)}_i(d)||this.validateSessionProps(d,"sessionProperties")},this.isValidReject=async i=>{if(!ur(i)){const{message:l}=Q("MISSING_OR_INVALID",`reject() params: ${i}`);throw new Error(l)}const{id:n,reason:o}=i;if(await this.isValidProposalId(n),!Tm(o)){const{message:l}=Q("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(o)}`);throw new Error(l)}},this.isValidSessionSettleRequest=i=>{if(!ur(i)){const{message:m}=Q("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${i}`);throw new Error(m)}const{relay:n,controller:o,namespaces:l,expiry:d}=i;if(!Nm(n)){const{message:m}=Q("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(m)}const v=Dm(o,"onSessionSettleRequest()");if(v)throw new Error(v.message);const b=Ha(l,"onSessionSettleRequest()");if(b)throw new Error(b.message);if(wi(d)){const{message:m}=Q("EXPIRED","onSessionSettleRequest()");throw new Error(m)}},this.isValidUpdate=async i=>{if(!ur(i)){const{message:b}=Q("MISSING_OR_INVALID",`update() params: ${i}`);throw new Error(b)}const{topic:n,namespaces:o}=i;await this.isValidSessionTopic(n);const l=this.client.session.get(n),d=Ha(o,"update()");if(d)throw new Error(d.message);const v=Oh(l.requiredNamespaces,o,"update()");if(v)throw new Error(v.message)},this.isValidExtend=async i=>{if(!ur(i)){const{message:o}=Q("MISSING_OR_INVALID",`extend() params: ${i}`);throw new Error(o)}const{topic:n}=i;await this.isValidSessionTopic(n)},this.isValidRequest=async i=>{if(!ur(i)){const{message:b}=Q("MISSING_OR_INVALID",`request() params: ${i}`);throw new Error(b)}const{topic:n,request:o,chainId:l,expiry:d}=i;await this.isValidSessionTopic(n);const{namespaces:v}=this.client.session.get(n);if(!Rh(v,l)){const{message:b}=Q("MISSING_OR_INVALID",`request() chainId: ${l}`);throw new Error(b)}if(!Fm(o)){const{message:b}=Q("MISSING_OR_INVALID",`request() ${JSON.stringify(o)}`);throw new Error(b)}if(!Lm(v,l,o.method)){const{message:b}=Q("MISSING_OR_INVALID",`request() method: ${o.method}`);throw new Error(b)}if(d&&!$m(d,tc)){const{message:b}=Q("MISSING_OR_INVALID",`request() expiry: ${d}. Expiry must be a number (in seconds) between ${tc.min} and ${tc.max}`);throw new Error(b)}},this.isValidRespond=async i=>{if(!ur(i)){const{message:l}=Q("MISSING_OR_INVALID",`respond() params: ${i}`);throw new Error(l)}const{topic:n,response:o}=i;if(await this.isValidSessionTopic(n),!Mm(o)){const{message:l}=Q("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(o)}`);throw new Error(l)}},this.isValidPing=async i=>{if(!ur(i)){const{message:o}=Q("MISSING_OR_INVALID",`ping() params: ${i}`);throw new Error(o)}const{topic:n}=i;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async i=>{if(!ur(i)){const{message:v}=Q("MISSING_OR_INVALID",`emit() params: ${i}`);throw new Error(v)}const{topic:n,event:o,chainId:l}=i;await this.isValidSessionTopic(n);const{namespaces:d}=this.client.session.get(n);if(!Rh(d,l)){const{message:v}=Q("MISSING_OR_INVALID",`emit() chainId: ${l}`);throw new Error(v)}if(!jm(o)){const{message:v}=Q("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(v)}if(!zm(d,l,o.name)){const{message:v}=Q("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(v)}},this.isValidDisconnect=async i=>{if(!ur(i)){const{message:o}=Q("MISSING_OR_INVALID",`disconnect() params: ${i}`);throw new Error(o)}const{topic:n}=i;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(i,n)=>{const o={verified:{verifyUrl:n.verifyUrl||"",validation:"UNKNOWN",origin:n.url||""}};try{const l=await this.client.core.verify.resolve({attestationId:i,verifyUrl:n.verifyUrl});l&&(o.verified.origin=l,o.verified.validation=l===n.url?"VALID":"INVALID")}catch(l){this.client.logger.error(l)}return this.client.logger.info(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(i,n)=>{Object.values(i).forEach(o=>{if(!ls(o,!1)){const{message:l}=Q("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(o)}`);throw new Error(l)}})}}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}registerRelayerEvents(){this.client.core.relayer.on(vt.message,async r=>{const{topic:i,message:n}=r;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const o=await this.client.core.crypto.decode(i,n);Ec(o)?(this.client.core.history.set(i,o),this.onRelayEventRequest({topic:i,payload:o})):yo(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:i,payload:o}),this.client.core.history.delete(i,o.id)):this.onRelayEventUnknownPayload({topic:i,payload:o})})}registerExpirerEvents(){this.client.core.expirer.on(Pr.expired,async r=>{const{topic:i,id:n}=Ml(r.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,Q("EXPIRED"),!0);i?this.client.session.keys.includes(i)&&(await this.deleteSession(i,!0),this.client.events.emit("session_expire",{topic:i})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}isValidPairingTopic(r){if(!ls(r,!1)){const{message:i}=Q("MISSING_OR_INVALID",`pairing topic should be a string: ${r}`);throw new Error(i)}if(!this.client.core.pairing.pairings.keys.includes(r)){const{message:i}=Q("NO_MATCHING_KEY",`pairing topic doesn't exist: ${r}`);throw new Error(i)}if(wi(this.client.core.pairing.pairings.get(r).expiry)){const{message:i}=Q("EXPIRED",`pairing topic: ${r}`);throw new Error(i)}}async isValidSessionTopic(r){if(!ls(r,!1)){const{message:i}=Q("MISSING_OR_INVALID",`session topic should be a string: ${r}`);throw new Error(i)}if(!this.client.session.keys.includes(r)){const{message:i}=Q("NO_MATCHING_KEY",`session topic doesn't exist: ${r}`);throw new Error(i)}if(wi(this.client.session.get(r).expiry)){await this.deleteSession(r);const{message:i}=Q("EXPIRED",`session topic: ${r}`);throw new Error(i)}}async isValidSessionOrPairingTopic(r){if(this.client.session.keys.includes(r))await this.isValidSessionTopic(r);else if(this.client.core.pairing.pairings.keys.includes(r))this.isValidPairingTopic(r);else if(ls(r,!1)){const{message:i}=Q("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${r}`);throw new Error(i)}else{const{message:i}=Q("MISSING_OR_INVALID",`session or pairing topic should be a string: ${r}`);throw new Error(i)}}async isValidProposalId(r){if(!Um(r)){const{message:i}=Q("MISSING_OR_INVALID",`proposal id should be a number: ${r}`);throw new Error(i)}if(!this.client.proposal.keys.includes(r)){const{message:i}=Q("NO_MATCHING_KEY",`proposal id doesn't exist: ${r}`);throw new Error(i)}if(wi(this.client.proposal.get(r).expiry)){await this.deleteProposal(r);const{message:i}=Q("EXPIRED",`proposal id: ${r}`);throw new Error(i)}}}class oE extends mo{constructor(r,i){super(r,i,Jb,Sc),this.core=r,this.logger=i}}class aE extends mo{constructor(r,i){super(r,i,Yb,Sc),this.core=r,this.logger=i}}class cE extends mo{constructor(r,i){super(r,i,Zb,Sc,n=>n.id),this.core=r,this.logger=i}}let uE=class If extends j1{constructor(r){super(r),this.protocol=wf,this.version=_f,this.name=ec.name,this.events=new Cr.EventEmitter,this.on=(n,o)=>this.events.on(n,o),this.once=(n,o)=>this.events.once(n,o),this.off=(n,o)=>this.events.off(n,o),this.removeListener=(n,o)=>this.events.removeListener(n,o),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(o){throw this.logger.error(o.message),o}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(o){throw this.logger.error(o.message),o}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(o){throw this.logger.error(o.message),o}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(o){throw this.logger.error(o.message),o}},this.update=async n=>{try{return await this.engine.update(n)}catch(o){throw this.logger.error(o.message),o}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(o){throw this.logger.error(o.message),o}},this.request=async n=>{try{return await this.engine.request(n)}catch(o){throw this.logger.error(o.message),o}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(o){throw this.logger.error(o.message),o}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(o){throw this.logger.error(o.message),o}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(o){throw this.logger.error(o.message),o}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(o){throw this.logger.error(o.message),o}},this.find=n=>{try{return this.engine.find(n)}catch(o){throw this.logger.error(o.message),o}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.name=(r==null?void 0:r.name)||ec.name,this.metadata=(r==null?void 0:r.metadata)||Sm();const i=typeof(r==null?void 0:r.logger)<"u"&&typeof(r==null?void 0:r.logger)!="string"?r.logger:Re.pino(Re.getDefaultLoggerOptions({level:(r==null?void 0:r.logger)||ec.logger}));this.core=(r==null?void 0:r.core)||new Gb(r),this.logger=Re.generateChildLogger(i,this.name),this.session=new aE(this.core,this.logger),this.proposal=new oE(this.core,this.logger),this.pendingRequest=new cE(this.core,this.logger),this.engine=new nE(this)}static async init(r){const i=new If(r);return await i.initialize(),i}get context(){return Re.getLoggerContext(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(r){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(r.message),r}}};var lc={exports:{}};(function(c,r){var i=typeof self<"u"?self:Mr,n=function(){function l(){this.fetch=!1,this.DOMException=i.DOMException}return l.prototype=i,new l}();(function(l){(function(d){var v={searchParams:"URLSearchParams"in l,iterable:"Symbol"in l&&"iterator"in Symbol,blob:"FileReader"in l&&"Blob"in l&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in l,arrayBuffer:"ArrayBuffer"in l};function b(y){return y&&DataView.prototype.isPrototypeOf(y)}if(v.arrayBuffer)var m=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],S=ArrayBuffer.isView||function(y){return y&&m.indexOf(Object.prototype.toString.call(y))>-1};function O(y){if(typeof y!="string"&&(y=String(y)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(y))throw new TypeError("Invalid character in header field name");return y.toLowerCase()}function F(y){return typeof y!="string"&&(y=String(y)),y}function z(y){var I={next:function(){var X=y.shift();return{done:X===void 0,value:X}}};return v.iterable&&(I[Symbol.iterator]=function(){return I}),I}function R(y){this.map={},y instanceof R?y.forEach(function(I,X){this.append(X,I)},this):Array.isArray(y)?y.forEach(function(I){this.append(I[0],I[1])},this):y&&Object.getOwnPropertyNames(y).forEach(function(I){this.append(I,y[I])},this)}R.prototype.append=function(y,I){y=O(y),I=F(I);var X=this.map[y];this.map[y]=X?X+", "+I:I},R.prototype.delete=function(y){delete this.map[O(y)]},R.prototype.get=function(y){return y=O(y),this.has(y)?this.map[y]:null},R.prototype.has=function(y){return this.map.hasOwnProperty(O(y))},R.prototype.set=function(y,I){this.map[O(y)]=F(I)},R.prototype.forEach=function(y,I){for(var X in this.map)this.map.hasOwnProperty(X)&&y.call(I,this.map[X],X,this)},R.prototype.keys=function(){var y=[];return this.forEach(function(I,X){y.push(X)}),z(y)},R.prototype.values=function(){var y=[];return this.forEach(function(I){y.push(I)}),z(y)},R.prototype.entries=function(){var y=[];return this.forEach(function(I,X){y.push([X,I])}),z(y)},v.iterable&&(R.prototype[Symbol.iterator]=R.prototype.entries);function K(y){if(y.bodyUsed)return Promise.reject(new TypeError("Already read"));y.bodyUsed=!0}function re(y){return new Promise(function(I,X){y.onload=function(){I(y.result)},y.onerror=function(){X(y.error)}})}function he(y){var I=new FileReader,X=re(I);return I.readAsArrayBuffer(y),X}function le(y){var I=new FileReader,X=re(I);return I.readAsText(y),X}function fe(y){for(var I=new Uint8Array(y),X=new Array(I.length),ce=0;ce-1?I:y}function W(y,I){I=I||{};var X=I.body;if(y instanceof W){if(y.bodyUsed)throw new TypeError("Already read");this.url=y.url,this.credentials=y.credentials,I.headers||(this.headers=new R(y.headers)),this.method=y.method,this.mode=y.mode,this.signal=y.signal,!X&&y._bodyInit!=null&&(X=y._bodyInit,y.bodyUsed=!0)}else this.url=String(y);if(this.credentials=I.credentials||this.credentials||"same-origin",(I.headers||!this.headers)&&(this.headers=new R(I.headers)),this.method=q(I.method||this.method||"GET"),this.mode=I.mode||this.mode||null,this.signal=I.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(X)}W.prototype.clone=function(){return new W(this,{body:this._bodyInit})};function ve(y){var I=new FormData;return y.trim().split("&").forEach(function(X){if(X){var ce=X.split("="),V=ce.shift().replace(/\+/g," "),B=ce.join("=").replace(/\+/g," ");I.append(decodeURIComponent(V),decodeURIComponent(B))}}),I}function ie(y){var I=new R,X=y.replace(/\r?\n[\t ]+/g," ");return X.split(/\r?\n/).forEach(function(ce){var V=ce.split(":"),B=V.shift().trim();if(B){var k=V.join(":").trim();I.append(B,k)}}),I}de.call(W.prototype);function ue(y,I){I||(I={}),this.type="default",this.status=I.status===void 0?200:I.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in I?I.statusText:"OK",this.headers=new R(I.headers),this.url=I.url||"",this._initBody(y)}de.call(ue.prototype),ue.prototype.clone=function(){return new ue(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new R(this.headers),url:this.url})},ue.error=function(){var y=new ue(null,{status:0,statusText:""});return y.type="error",y};var Te=[301,302,303,307,308];ue.redirect=function(y,I){if(Te.indexOf(I)===-1)throw new RangeError("Invalid status code");return new ue(null,{status:I,headers:{location:y}})},d.DOMException=l.DOMException;try{new d.DOMException}catch{d.DOMException=function(I,X){this.message=I,this.name=X;var ce=Error(I);this.stack=ce.stack},d.DOMException.prototype=Object.create(Error.prototype),d.DOMException.prototype.constructor=d.DOMException}function Ue(y,I){return new Promise(function(X,ce){var V=new W(y,I);if(V.signal&&V.signal.aborted)return ce(new d.DOMException("Aborted","AbortError"));var B=new XMLHttpRequest;function k(){B.abort()}B.onload=function(){var G={status:B.status,statusText:B.statusText,headers:ie(B.getAllResponseHeaders()||"")};G.url="responseURL"in B?B.responseURL:G.headers.get("X-Request-URL");var Je="response"in B?B.response:B.responseText;X(new ue(Je,G))},B.onerror=function(){ce(new TypeError("Network request failed"))},B.ontimeout=function(){ce(new TypeError("Network request failed"))},B.onabort=function(){ce(new d.DOMException("Aborted","AbortError"))},B.open(V.method,V.url,!0),V.credentials==="include"?B.withCredentials=!0:V.credentials==="omit"&&(B.withCredentials=!1),"responseType"in B&&v.blob&&(B.responseType="blob"),V.headers.forEach(function(G,Je){B.setRequestHeader(Je,G)}),V.signal&&(V.signal.addEventListener("abort",k),B.onreadystatechange=function(){B.readyState===4&&V.signal.removeEventListener("abort",k)}),B.send(typeof V._bodyInit>"u"?null:V._bodyInit)})}return Ue.polyfill=!0,l.fetch||(l.fetch=Ue,l.Headers=R,l.Request=W,l.Response=ue),d.Headers=R,d.Request=W,d.Response=ue,d.fetch=Ue,Object.defineProperty(d,"__esModule",{value:!0}),d})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var o=n;r=o.fetch,r.default=o.fetch,r.fetch=o.fetch,r.Headers=o.Headers,r.Request=o.Request,r.Response=o.Response,c.exports=r})(lc,lc.exports);var hE=lc.exports;const _l=Ll(hE),lE={Accept:"application/json","Content-Type":"application/json"},fE="POST",bl={headers:lE,method:fE},El=10;class Hi{constructor(r,i=!1){if(this.url=r,this.disableProviderPing=i,this.events=new Cr.EventEmitter,this.isAvailable=!1,this.registering=!1,!Jh(r))throw new Error(`Provided URL is not compatible with HTTP connection: ${r}`);this.url=r,this.disableProviderPing=i}get connected(){return this.isAvailable}get connecting(){return this.registering}on(r,i){this.events.on(r,i)}once(r,i){this.events.once(r,i)}off(r,i){this.events.off(r,i)}removeListener(r,i){this.events.removeListener(r,i)}async open(r=this.url){await this.register(r)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(r,i){this.isAvailable||await this.register();try{const n=Ui(r),l=await(await _l(this.url,Object.assign(Object.assign({},bl),{body:n}))).json();this.onPayload({data:l})}catch(n){this.onError(r.id,n)}}async register(r=this.url){if(!Jh(r))throw new Error(`Provided URL is not compatible with HTTP connection: ${r}`);if(this.registering){const i=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=i||this.events.listenerCount("open")>=i)&&this.events.setMaxListeners(i+1),new Promise((n,o)=>{this.events.once("register_error",l=>{this.resetMaxListeners(),o(l)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return o(new Error("HTTP connection is missing or invalid"));n()})})}this.url=r,this.registering=!0;try{if(!this.disableProviderPing){const i=Ui({id:1,jsonrpc:"2.0",method:"test",params:[]});await _l(r,Object.assign(Object.assign({},bl),{body:i}))}this.onOpen()}catch(i){const n=this.parseError(i);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(r){if(typeof r.data>"u")return;const i=typeof r.data=="string"?Ks(r.data):r.data;this.events.emit("payload",i)}onError(r,i){const n=this.parseError(i),o=n.message||n.toString(),l=go(r,o);this.events.emit("payload",l)}parseError(r,i=this.url){return Ql(r,i,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>El&&this.events.setMaxListeners(El)}}const Il="error",pE="wss://relay.walletconnect.com",dE="wc",gE="universal_provider",xl=`${dE}@2:${gE}:`,yE="https://rpc.walletconnect.com/v1",Ii={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var qs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},fc={exports:{}};/** +* @license +* Lodash +* Copyright OpenJS Foundation and other contributors +* Released under MIT license +* Based on Underscore.js 1.8.3 +* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +*/(function(c,r){(function(){var i,n="4.17.21",o=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",v="Invalid `variable` option passed into `_.template`",b="__lodash_hash_undefined__",m=500,S="__lodash_placeholder__",O=1,F=2,z=4,R=1,K=2,re=1,he=2,le=4,fe=8,pe=16,de=32,L=64,q=128,W=256,ve=512,ie=30,ue="...",Te=800,Ue=16,y=1,I=2,X=3,ce=1/0,V=9007199254740991,B=17976931348623157e292,k=0/0,G=4294967295,Je=G-1,He=G>>>1,jr=[["ary",q],["bind",re],["bindKey",he],["curry",fe],["curryRight",pe],["flip",ve],["partial",de],["partialRight",L],["rearg",W]],Ie="[object Arguments]",xt="[object Array]",D="[object AsyncFunction]",N="[object Boolean]",C="[object Date]",u="[object DOMException]",E="[object Error]",ee="[object Function]",ge="[object GeneratorFunction]",be="[object Map]",Ne="[object Number]",Fe="[object Null]",Pe="[object Object]",St="[object Promise]",mt="[object Proxy]",nt="[object RegExp]",$e="[object Set]",Xe="[object String]",Ze="[object Symbol]",ot="[object Undefined]",qe="[object WeakMap]",Qe="[object WeakSet]",De="[object ArrayBuffer]",ke="[object DataView]",ut="[object Float32Array]",je="[object Float64Array]",Pt="[object Int8Array]",Lt="[object Int16Array]",Bt="[object Int32Array]",Ht="[object Uint8Array]",jt="[object Uint8ClampedArray]",Wt="[object Uint16Array]",rr="[object Uint32Array]",zr=/\b__p \+= '';/g,Jt=/\b(__p \+=) '' \+/g,Gr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ci=/&(?:amp|lt|gt|quot|#39);/g,xi=/[&<>"']/g,ht=RegExp(ci.source),rt=RegExp(xi.source),lt=/<%-([\s\S]+?)%>/g,ft=/<%([\s\S]+?)%>/g,at=/<%=([\s\S]+?)%>/g,it=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,At=/^\w*$/,Ct=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pt=/[\\^$.*+?()[\]{}|]/g,Ot=RegExp(pt.source),dt=/^\s+/,wt=/\s/,gt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ye=/\{\n\/\* \[wrapped with (.+)\] \*/,Rt=/,? & /,Tt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,wo=/[()=,{}\[\]\/\s]/,_o=/\\(\\)?/g,bo=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yr=/\w*$/,Eo=/^[-+]0x[0-9a-f]+$/i,Io=/^0b[01]+$/i,xo=/^\[object .+?Constructor\]$/,So=/^0o[0-7]+$/i,Po=/^(?:0|[1-9]\d*)$/,Wr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ki=/($^)/,Ao=/['\n\r\u2028\u2029\\]/g,Ki="\\ud800-\\udfff",Co="\\u0300-\\u036f",Oo="\\ufe20-\\ufe2f",Vi="\\u20d0-\\u20ff",Gs=Co+Oo+Vi,Ws="\\u2700-\\u27bf",Or="a-z\\xdf-\\xf6\\xf8-\\xff",Ro="\\xac\\xb1\\xd7\\xf7",To="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",No="\\u2000-\\u206f",Do=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Js="A-Z\\xc0-\\xd6\\xd8-\\xde",Ys="\\ufe0e\\ufe0f",Si=Ro+To+No+Do,ys="['’]",Pi="["+Ki+"]",vs="["+Si+"]",Ai="["+Gs+"]",Xs="\\d+",Fo="["+Ws+"]",Zs="["+Or+"]",Qs="[^"+Ki+Si+Xs+Ws+Or+Js+"]",Gi="\\ud83c[\\udffb-\\udfff]",Lo="(?:"+Ai+"|"+Gi+")",en="[^"+Ki+"]",Wi="(?:\\ud83c[\\udde6-\\uddff]){2}",ui="[\\ud800-\\udbff][\\udc00-\\udfff]",hr="["+Js+"]",tn="\\u200d",rn="(?:"+Zs+"|"+Qs+")",Ur="(?:"+hr+"|"+Qs+")",sn="(?:"+ys+"(?:d|ll|m|re|s|t|ve))?",nn="(?:"+ys+"(?:D|LL|M|RE|S|T|VE))?",on=Lo+"?",an="["+Ys+"]?",$o="(?:"+tn+"(?:"+[en,Wi,ui].join("|")+")"+an+on+")*",Jr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",cn="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",un=an+on+$o,Ji="(?:"+[Fo,Wi,ui].join("|")+")"+un,Mo="(?:"+[en+Ai+"?",Ai,Wi,ui,Pi].join("|")+")",ms=RegExp(ys,"g"),jo=RegExp(Ai,"g"),Yi=RegExp(Gi+"(?="+Gi+")|"+Mo+un,"g"),hn=RegExp([hr+"?"+Zs+"+"+sn+"(?="+[vs,hr,"$"].join("|")+")",Ur+"+"+nn+"(?="+[vs,hr+rn,"$"].join("|")+")",hr+"?"+rn+"+"+sn,hr+"+"+nn,cn,Jr,Xs,Ji].join("|"),"g"),ln=RegExp("["+tn+Ki+Gs+Ys+"]"),Ci=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,fn=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],zo=-1,Ke={};Ke[ut]=Ke[je]=Ke[Pt]=Ke[Lt]=Ke[Bt]=Ke[Ht]=Ke[jt]=Ke[Wt]=Ke[rr]=!0,Ke[Ie]=Ke[xt]=Ke[De]=Ke[N]=Ke[ke]=Ke[C]=Ke[E]=Ke[ee]=Ke[be]=Ke[Ne]=Ke[Pe]=Ke[nt]=Ke[$e]=Ke[Xe]=Ke[qe]=!1;var Be={};Be[Ie]=Be[xt]=Be[De]=Be[ke]=Be[N]=Be[C]=Be[ut]=Be[je]=Be[Pt]=Be[Lt]=Be[Bt]=Be[be]=Be[Ne]=Be[Pe]=Be[nt]=Be[$e]=Be[Xe]=Be[Ze]=Be[Ht]=Be[jt]=Be[Wt]=Be[rr]=!0,Be[E]=Be[ee]=Be[qe]=!1;var g={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},x={"&":"&","<":"<",">":">",'"':""","'":"'"},U={"&":"&","<":"<",">":">",""":'"',"'":"'"},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ve=parseFloat,me=parseInt,et=typeof qs=="object"&&qs&&qs.Object===Object&&qs,Nt=typeof self=="object"&&self&&self.Object===Object&&self,Ce=et||Nt||Function("return this")(),Ge=r&&!r.nodeType&&r,_t=Ge&&!0&&c&&!c.nodeType&&c,ir=_t&&_t.exports===Ge,Dt=ir&&et.process,tt=function(){try{var P=_t&&_t.require&&_t.require("util").types;return P||Dt&&Dt.binding&&Dt.binding("util")}catch{}}(),Yt=tt&&tt.isArrayBuffer,Rr=tt&&tt.isDate,vr=tt&&tt.isMap,qr=tt&&tt.isRegExp,ws=tt&&tt.isSet,Oi=tt&&tt.isTypedArray;function zt(P,$,T){switch(T.length){case 0:return P.call($);case 1:return P.call($,T[0]);case 2:return P.call($,T[0],T[1]);case 3:return P.call($,T[0],T[1],T[2])}return P.apply($,T)}function Pf(P,$,T,Z){for(var ye=-1,Le=P==null?0:P.length;++ye-1}function Uo(P,$,T){for(var Z=-1,ye=P==null?0:P.length;++Z-1;);return T}function Lc(P,$){for(var T=P.length;T--&&Xi($,P[T],0)>-1;);return T}function Lf(P,$){for(var T=P.length,Z=0;T--;)P[T]===$&&++Z;return Z}var $f=ko(g),Mf=ko(x);function jf(P){return"\\"+Y[P]}function zf(P,$){return P==null?i:P[$]}function Zi(P){return ln.test(P)}function Uf(P){return Ci.test(P)}function qf(P){for(var $,T=[];!($=P.next()).done;)T.push($.value);return T}function Wo(P){var $=-1,T=Array(P.size);return P.forEach(function(Z,ye){T[++$]=[ye,Z]}),T}function $c(P,$){return function(T){return P($(T))}}function fi(P,$){for(var T=-1,Z=P.length,ye=0,Le=[];++T-1}function Cp(e,t){var s=this.__data__,a=Rn(s,e);return a<0?(++this.size,s.push([e,t])):s[a][1]=t,this}Yr.prototype.clear=xp,Yr.prototype.delete=Sp,Yr.prototype.get=Pp,Yr.prototype.has=Ap,Yr.prototype.set=Cp;function Xr(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t=t?e:t)),e}function br(e,t,s,a,h,p){var w,_=t&O,A=t&F,M=t&z;if(s&&(w=h?s(e,a,h,p):s(e)),w!==i)return w;if(!ct(e))return e;var j=we(e);if(j){if(w=Nd(e),!_)return sr(e,w)}else{var H=Gt(e),J=H==ee||H==ge;if(mi(e))return mu(e,_);if(H==Pe||H==Ie||J&&!h){if(w=A||J?{}:Mu(e),!_)return A?bd(e,kp(w,e)):_d(e,Wc(w,e))}else{if(!Be[H])return h?e:{};w=Dd(e,H,_)}}p||(p=new Nr);var te=p.get(e);if(te)return te;p.set(e,w),fh(e)?e.forEach(function(ae){w.add(br(ae,t,s,ae,e,p))}):hh(e)&&e.forEach(function(ae,Se){w.set(Se,br(ae,t,s,Se,e,p))});var oe=M?A?_a:wa:A?or:Ut,Ee=j?i:oe(e);return mr(Ee||e,function(ae,Se){Ee&&(Se=ae,ae=e[Se]),Ps(w,Se,br(ae,t,s,Se,e,p))}),w}function Kp(e){var t=Ut(e);return function(s){return Jc(s,e,t)}}function Jc(e,t,s){var a=s.length;if(e==null)return!a;for(e=We(e);a--;){var h=s[a],p=t[h],w=e[h];if(w===i&&!(h in e)||!p(w))return!1}return!0}function Yc(e,t,s){if(typeof e!="function")throw new wr(d);return Ds(function(){e.apply(i,s)},t)}function As(e,t,s,a){var h=-1,p=pn,w=!0,_=e.length,A=[],M=t.length;if(!_)return A;s&&(t=st(t,lr(s))),a?(p=Uo,w=!1):t.length>=o&&(p=_s,w=!1,t=new Ni(t));e:for(;++h<_;){var j=e[h],H=s==null?j:s(j);if(j=a||j!==0?j:0,w&&H===H){for(var J=M;J--;)if(t[J]===H)continue e;A.push(j)}else p(t,H,a)||A.push(j)}return A}var di=Iu(Br),Xc=Iu(ra,!0);function Vp(e,t){var s=!0;return di(e,function(a,h,p){return s=!!t(a,h,p),s}),s}function Tn(e,t,s){for(var a=-1,h=e.length;++ah?0:h+s),a=a===i||a>h?h:_e(a),a<0&&(a+=h),a=s>a?0:dh(a);s0&&s(_)?t>1?kt(_,t-1,s,a,h):li(h,_):a||(h[h.length]=_)}return h}var ta=xu(),Qc=xu(!0);function Br(e,t){return e&&ta(e,t,Ut)}function ra(e,t){return e&&Qc(e,t,Ut)}function Nn(e,t){return hi(t,function(s){return ri(e[s])})}function Fi(e,t){t=yi(t,e);for(var s=0,a=t.length;e!=null&&st}function Wp(e,t){return e!=null&&ze.call(e,t)}function Jp(e,t){return e!=null&&t in We(e)}function Yp(e,t,s){return e>=Vt(t,s)&&e=120&&j.length>=120)?new Ni(w&&j):i}j=e[0];var H=-1,J=_[0];e:for(;++H-1;)_!==e&&In.call(_,A,1),In.call(e,A,1);return e}function hu(e,t){for(var s=e?t.length:0,a=s-1;s--;){var h=t[s];if(s==a||h!==p){var p=h;ti(h)?In.call(e,h,1):fa(e,h)}}return e}function ua(e,t){return e+Pn(kc()*(t-e+1))}function ud(e,t,s,a){for(var h=-1,p=Mt(Sn((t-e)/(s||1)),0),w=T(p);p--;)w[a?p:++h]=e,e+=s;return w}function ha(e,t){var s="";if(!e||t<1||t>V)return s;do t%2&&(s+=e),t=Pn(t/2),t&&(e+=e);while(t);return s}function xe(e,t){return Aa(Uu(e,t,ar),e+"")}function hd(e){return Gc(us(e))}function ld(e,t){var s=us(e);return Hn(s,Di(t,0,s.length))}function Rs(e,t,s,a){if(!ct(e))return e;t=yi(t,e);for(var h=-1,p=t.length,w=p-1,_=e;_!=null&&++hh?0:h+t),s=s>h?h:s,s<0&&(s+=h),h=t>s?0:s-t>>>0,t>>>=0;for(var p=T(h);++a>>1,w=e[p];w!==null&&!pr(w)&&(s?w<=t:w=o){var M=t?null:Sd(e);if(M)return gn(M);w=!1,h=_s,A=new Ni}else A=t?[]:_;e:for(;++a=a?e:Er(e,t,s)}var vu=rp||function(e){return Ce.clearTimeout(e)};function mu(e,t){if(t)return e.slice();var s=e.length,a=zc?zc(s):new e.constructor(s);return e.copy(a),a}function ya(e){var t=new e.constructor(e.byteLength);return new bn(t).set(new bn(e)),t}function yd(e,t){var s=t?ya(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function vd(e){var t=new e.constructor(e.source,yr.exec(e));return t.lastIndex=e.lastIndex,t}function md(e){return Ss?We(Ss.call(e)):{}}function wu(e,t){var s=t?ya(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function _u(e,t){if(e!==t){var s=e!==i,a=e===null,h=e===e,p=pr(e),w=t!==i,_=t===null,A=t===t,M=pr(t);if(!_&&!M&&!p&&e>t||p&&w&&A&&!_&&!M||a&&w&&A||!s&&A||!h)return 1;if(!a&&!p&&!M&&e=_)return A;var M=s[a];return A*(M=="desc"?-1:1)}}return e.index-t.index}function bu(e,t,s,a){for(var h=-1,p=e.length,w=s.length,_=-1,A=t.length,M=Mt(p-w,0),j=T(A+M),H=!a;++_1?s[h-1]:i,w=h>2?s[2]:i;for(p=e.length>3&&typeof p=="function"?(h--,p):i,w&&Zt(s[0],s[1],w)&&(p=h<3?i:p,h=1),t=We(t);++a-1?h[p?t[w]:w]:i}}function Au(e){return ei(function(t){var s=t.length,a=s,h=_r.prototype.thru;for(e&&t.reverse();a--;){var p=t[a];if(typeof p!="function")throw new wr(d);if(h&&!w&&qn(p)=="wrapper")var w=new _r([],!0)}for(a=w?a:s;++a1&&Oe.reverse(),j&&A_))return!1;var M=p.get(e),j=p.get(t);if(M&&j)return M==t&&j==e;var H=-1,J=!0,te=s&K?new Ni:i;for(p.set(e,t),p.set(t,e);++H<_;){var oe=e[H],Ee=t[H];if(a)var ae=w?a(Ee,oe,H,t,e,p):a(oe,Ee,H,e,t,p);if(ae!==i){if(ae)continue;J=!1;break}if(te){if(!Bo(t,function(Se,Oe){if(!_s(te,Oe)&&(oe===Se||h(oe,Se,s,a,p)))return te.push(Oe)})){J=!1;break}}else if(!(oe===Ee||h(oe,Ee,s,a,p))){J=!1;break}}return p.delete(e),p.delete(t),J}function Ad(e,t,s,a,h,p,w){switch(s){case ke:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case De:return!(e.byteLength!=t.byteLength||!p(new bn(e),new bn(t)));case N:case C:case Ne:return Dr(+e,+t);case E:return e.name==t.name&&e.message==t.message;case nt:case Xe:return e==t+"";case be:var _=Wo;case $e:var A=a&R;if(_||(_=gn),e.size!=t.size&&!A)return!1;var M=w.get(e);if(M)return M==t;a|=K,w.set(e,t);var j=Fu(_(e),_(t),a,h,p,w);return w.delete(e),j;case Ze:if(Ss)return Ss.call(e)==Ss.call(t)}return!1}function Cd(e,t,s,a,h,p){var w=s&R,_=wa(e),A=_.length,M=wa(t),j=M.length;if(A!=j&&!w)return!1;for(var H=A;H--;){var J=_[H];if(!(w?J in t:ze.call(t,J)))return!1}var te=p.get(e),oe=p.get(t);if(te&&oe)return te==t&&oe==e;var Ee=!0;p.set(e,t),p.set(t,e);for(var ae=w;++H1?"& ":"")+t[a],t=t.join(s>2?", ":" "),e.replace(gt,`{ +/* [wrapped with `+t+`] */ +`)}function Ld(e){return we(e)||Mi(e)||!!(Bc&&e&&e[Bc])}function ti(e,t){var s=typeof e;return t=t??V,!!t&&(s=="number"||s!="symbol"&&Po.test(e))&&e>-1&&e%1==0&&e0){if(++t>=Te)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Hn(e,t){var s=-1,a=e.length,h=a-1;for(t=t===i?a:t;++s1?e[t-1]:i;return s=typeof s=="function"?(e.pop(),s):i,Zu(e,s)});function Qu(e){var t=f(e);return t.__chain__=!0,t}function Vg(e,t){return t(e),e}function kn(e,t){return t(e)}var Gg=ei(function(e){var t=e.length,s=t?e[0]:0,a=this.__wrapped__,h=function(p){return ea(p,e)};return t>1||this.__actions__.length||!(a instanceof Ae)||!ti(s)?this.thru(h):(a=a.slice(s,+s+(t?1:0)),a.__actions__.push({func:kn,args:[h],thisArg:i}),new _r(a,this.__chain__).thru(function(p){return t&&!p.length&&p.push(i),p}))});function Wg(){return Qu(this)}function Jg(){return new _r(this.value(),this.__chain__)}function Yg(){this.__values__===i&&(this.__values__=ph(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function Xg(){return this}function Zg(e){for(var t,s=this;s instanceof On;){var a=Vu(s);a.__index__=0,a.__values__=i,t?h.__wrapped__=a:t=a;var h=a;s=s.__wrapped__}return h.__wrapped__=e,t}function Qg(){var e=this.__wrapped__;if(e instanceof Ae){var t=e;return this.__actions__.length&&(t=new Ae(this)),t=t.reverse(),t.__actions__.push({func:kn,args:[Ca],thisArg:i}),new _r(t,this.__chain__)}return this.thru(Ca)}function ey(){return gu(this.__wrapped__,this.__actions__)}var ty=$n(function(e,t,s){ze.call(e,s)?++e[s]:Zr(e,s,1)});function ry(e,t,s){var a=we(e)?Cc:Vp;return s&&Zt(e,t,s)&&(t=i),a(e,se(t,3))}function iy(e,t){var s=we(e)?hi:Zc;return s(e,se(t,3))}var sy=Pu(Gu),ny=Pu(Wu);function oy(e,t){return kt(Kn(e,t),1)}function ay(e,t){return kt(Kn(e,t),ce)}function cy(e,t,s){return s=s===i?1:_e(s),kt(Kn(e,t),s)}function eh(e,t){var s=we(e)?mr:di;return s(e,se(t,3))}function th(e,t){var s=we(e)?Af:Xc;return s(e,se(t,3))}var uy=$n(function(e,t,s){ze.call(e,s)?e[s].push(t):Zr(e,s,[t])});function hy(e,t,s,a){e=nr(e)?e:us(e),s=s&&!a?_e(s):0;var h=e.length;return s<0&&(s=Mt(h+s,0)),Yn(e)?s<=h&&e.indexOf(t,s)>-1:!!h&&Xi(e,t,s)>-1}var ly=xe(function(e,t,s){var a=-1,h=typeof t=="function",p=nr(e)?T(e.length):[];return di(e,function(w){p[++a]=h?zt(t,w,s):Cs(w,t,s)}),p}),fy=$n(function(e,t,s){Zr(e,s,t)});function Kn(e,t){var s=we(e)?st:su;return s(e,se(t,3))}function py(e,t,s,a){return e==null?[]:(we(t)||(t=t==null?[]:[t]),s=a?i:s,we(s)||(s=s==null?[]:[s]),cu(e,t,s))}var dy=$n(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function gy(e,t,s){var a=we(e)?qo:Nc,h=arguments.length<3;return a(e,se(t,4),s,h,di)}function yy(e,t,s){var a=we(e)?Cf:Nc,h=arguments.length<3;return a(e,se(t,4),s,h,Xc)}function vy(e,t){var s=we(e)?hi:Zc;return s(e,Wn(se(t,3)))}function my(e){var t=we(e)?Gc:hd;return t(e)}function wy(e,t,s){(s?Zt(e,t,s):t===i)?t=1:t=_e(t);var a=we(e)?qp:ld;return a(e,t)}function _y(e){var t=we(e)?Bp:pd;return t(e)}function by(e){if(e==null)return 0;if(nr(e))return Yn(e)?Qi(e):e.length;var t=Gt(e);return t==be||t==$e?e.size:oa(e).length}function Ey(e,t,s){var a=we(e)?Bo:dd;return s&&Zt(e,t,s)&&(t=i),a(e,se(t,3))}var Iy=xe(function(e,t){if(e==null)return[];var s=t.length;return s>1&&Zt(e,t[0],t[1])?t=[]:s>2&&Zt(t[0],t[1],t[2])&&(t=[t[0]]),cu(e,kt(t,1),[])}),Vn=ip||function(){return Ce.Date.now()};function xy(e,t){if(typeof t!="function")throw new wr(d);return e=_e(e),function(){if(--e<1)return t.apply(this,arguments)}}function rh(e,t,s){return t=s?i:t,t=e&&t==null?e.length:t,Qr(e,q,i,i,i,i,t)}function ih(e,t){var s;if(typeof t!="function")throw new wr(d);return e=_e(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=i),s}}var Ra=xe(function(e,t,s){var a=re;if(s.length){var h=fi(s,as(Ra));a|=de}return Qr(e,a,t,s,h)}),sh=xe(function(e,t,s){var a=re|he;if(s.length){var h=fi(s,as(sh));a|=de}return Qr(t,a,e,s,h)});function nh(e,t,s){t=s?i:t;var a=Qr(e,fe,i,i,i,i,i,t);return a.placeholder=nh.placeholder,a}function oh(e,t,s){t=s?i:t;var a=Qr(e,pe,i,i,i,i,i,t);return a.placeholder=oh.placeholder,a}function ah(e,t,s){var a,h,p,w,_,A,M=0,j=!1,H=!1,J=!0;if(typeof e!="function")throw new wr(d);t=xr(t)||0,ct(s)&&(j=!!s.leading,H="maxWait"in s,p=H?Mt(xr(s.maxWait)||0,t):p,J="trailing"in s?!!s.trailing:J);function te(Et){var Fr=a,si=h;return a=h=i,M=Et,w=e.apply(si,Fr),w}function oe(Et){return M=Et,_=Ds(Se,t),j?te(Et):w}function Ee(Et){var Fr=Et-A,si=Et-M,Ph=t-Fr;return H?Vt(Ph,p-si):Ph}function ae(Et){var Fr=Et-A,si=Et-M;return A===i||Fr>=t||Fr<0||H&&si>=p}function Se(){var Et=Vn();if(ae(Et))return Oe(Et);_=Ds(Se,Ee(Et))}function Oe(Et){return _=i,J&&a?te(Et):(a=h=i,w)}function dr(){_!==i&&vu(_),M=0,a=A=h=_=i}function Qt(){return _===i?w:Oe(Vn())}function gr(){var Et=Vn(),Fr=ae(Et);if(a=arguments,h=this,A=Et,Fr){if(_===i)return oe(A);if(H)return vu(_),_=Ds(Se,t),te(A)}return _===i&&(_=Ds(Se,t)),w}return gr.cancel=dr,gr.flush=Qt,gr}var Sy=xe(function(e,t){return Yc(e,1,t)}),Py=xe(function(e,t,s){return Yc(e,xr(t)||0,s)});function Ay(e){return Qr(e,ve)}function Gn(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new wr(d);var s=function(){var a=arguments,h=t?t.apply(this,a):a[0],p=s.cache;if(p.has(h))return p.get(h);var w=e.apply(this,a);return s.cache=p.set(h,w)||p,w};return s.cache=new(Gn.Cache||Xr),s}Gn.Cache=Xr;function Wn(e){if(typeof e!="function")throw new wr(d);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Cy(e){return ih(2,e)}var Oy=gd(function(e,t){t=t.length==1&&we(t[0])?st(t[0],lr(se())):st(kt(t,1),lr(se()));var s=t.length;return xe(function(a){for(var h=-1,p=Vt(a.length,s);++h=t}),Mi=tu(function(){return arguments}())?tu:function(e){return yt(e)&&ze.call(e,"callee")&&!qc.call(e,"callee")},we=T.isArray,ky=Yt?lr(Yt):Zp;function nr(e){return e!=null&&Jn(e.length)&&!ri(e)}function bt(e){return yt(e)&&nr(e)}function Ky(e){return e===!0||e===!1||yt(e)&&Xt(e)==N}var mi=np||Ba,Vy=Rr?lr(Rr):Qp;function Gy(e){return yt(e)&&e.nodeType===1&&!Fs(e)}function Wy(e){if(e==null)return!0;if(nr(e)&&(we(e)||typeof e=="string"||typeof e.splice=="function"||mi(e)||cs(e)||Mi(e)))return!e.length;var t=Gt(e);if(t==be||t==$e)return!e.size;if(Ns(e))return!oa(e).length;for(var s in e)if(ze.call(e,s))return!1;return!0}function Jy(e,t){return Os(e,t)}function Yy(e,t,s){s=typeof s=="function"?s:i;var a=s?s(e,t):i;return a===i?Os(e,t,i,s):!!a}function Na(e){if(!yt(e))return!1;var t=Xt(e);return t==E||t==u||typeof e.message=="string"&&typeof e.name=="string"&&!Fs(e)}function Xy(e){return typeof e=="number"&&Hc(e)}function ri(e){if(!ct(e))return!1;var t=Xt(e);return t==ee||t==ge||t==D||t==mt}function uh(e){return typeof e=="number"&&e==_e(e)}function Jn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=V}function ct(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function yt(e){return e!=null&&typeof e=="object"}var hh=vr?lr(vr):td;function Zy(e,t){return e===t||na(e,t,Ea(t))}function Qy(e,t,s){return s=typeof s=="function"?s:i,na(e,t,Ea(t),s)}function e0(e){return lh(e)&&e!=+e}function t0(e){if(jd(e))throw new ye(l);return ru(e)}function r0(e){return e===null}function i0(e){return e==null}function lh(e){return typeof e=="number"||yt(e)&&Xt(e)==Ne}function Fs(e){if(!yt(e)||Xt(e)!=Pe)return!1;var t=En(e);if(t===null)return!0;var s=ze.call(t,"constructor")&&t.constructor;return typeof s=="function"&&s instanceof s&&mn.call(s)==Qf}var Da=qr?lr(qr):rd;function s0(e){return uh(e)&&e>=-V&&e<=V}var fh=ws?lr(ws):id;function Yn(e){return typeof e=="string"||!we(e)&&yt(e)&&Xt(e)==Xe}function pr(e){return typeof e=="symbol"||yt(e)&&Xt(e)==Ze}var cs=Oi?lr(Oi):sd;function n0(e){return e===i}function o0(e){return yt(e)&&Gt(e)==qe}function a0(e){return yt(e)&&Xt(e)==Qe}var c0=Un(aa),u0=Un(function(e,t){return e<=t});function ph(e){if(!e)return[];if(nr(e))return Yn(e)?Tr(e):sr(e);if(bs&&e[bs])return qf(e[bs]());var t=Gt(e),s=t==be?Wo:t==$e?gn:us;return s(e)}function ii(e){if(!e)return e===0?e:0;if(e=xr(e),e===ce||e===-ce){var t=e<0?-1:1;return t*B}return e===e?e:0}function _e(e){var t=ii(e),s=t%1;return t===t?s?t-s:t:0}function dh(e){return e?Di(_e(e),0,G):0}function xr(e){if(typeof e=="number")return e;if(pr(e))return k;if(ct(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ct(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Dc(e);var s=Io.test(e);return s||So.test(e)?me(e.slice(2),s?2:8):Eo.test(e)?k:+e}function gh(e){return Hr(e,or(e))}function h0(e){return e?Di(_e(e),-V,V):e===0?e:0}function Me(e){return e==null?"":fr(e)}var l0=ns(function(e,t){if(Ns(t)||nr(t)){Hr(t,Ut(t),e);return}for(var s in t)ze.call(t,s)&&Ps(e,s,t[s])}),yh=ns(function(e,t){Hr(t,or(t),e)}),Xn=ns(function(e,t,s,a){Hr(t,or(t),e,a)}),f0=ns(function(e,t,s,a){Hr(t,Ut(t),e,a)}),p0=ei(ea);function d0(e,t){var s=ss(e);return t==null?s:Wc(s,t)}var g0=xe(function(e,t){e=We(e);var s=-1,a=t.length,h=a>2?t[2]:i;for(h&&Zt(t[0],t[1],h)&&(a=1);++s1),p}),Hr(e,_a(e),s),a&&(s=br(s,O|F|z,Pd));for(var h=t.length;h--;)fa(s,t[h]);return s});function D0(e,t){return mh(e,Wn(se(t)))}var F0=ei(function(e,t){return e==null?{}:ad(e,t)});function mh(e,t){if(e==null)return{};var s=st(_a(e),function(a){return[a]});return t=se(t),uu(e,s,function(a,h){return t(a,h[0])})}function L0(e,t,s){t=yi(t,e);var a=-1,h=t.length;for(h||(h=1,e=i);++at){var a=e;e=t,t=a}if(s||e%1||t%1){var h=kc();return Vt(e+h*(t-e+Ve("1e-"+((h+"").length-1))),t)}return ua(e,t)}var V0=os(function(e,t,s){return t=t.toLowerCase(),e+(s?bh(t):t)});function bh(e){return $a(Me(e).toLowerCase())}function Eh(e){return e=Me(e),e&&e.replace(Wr,$f).replace(jo,"")}function G0(e,t,s){e=Me(e),t=fr(t);var a=e.length;s=s===i?a:Di(_e(s),0,a);var h=s;return s-=t.length,s>=0&&e.slice(s,h)==t}function W0(e){return e=Me(e),e&&rt.test(e)?e.replace(xi,Mf):e}function J0(e){return e=Me(e),e&&Ot.test(e)?e.replace(pt,"\\$&"):e}var Y0=os(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),X0=os(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),Z0=Su("toLowerCase");function Q0(e,t,s){e=Me(e),t=_e(t);var a=t?Qi(e):0;if(!t||a>=t)return e;var h=(t-a)/2;return zn(Pn(h),s)+e+zn(Sn(h),s)}function ev(e,t,s){e=Me(e),t=_e(t);var a=t?Qi(e):0;return t&&a>>0,s?(e=Me(e),e&&(typeof t=="string"||t!=null&&!Da(t))&&(t=fr(t),!t&&Zi(e))?vi(Tr(e),0,s):e.split(t,s)):[]}var av=os(function(e,t,s){return e+(s?" ":"")+$a(t)});function cv(e,t,s){return e=Me(e),s=s==null?0:Di(_e(s),0,e.length),t=fr(t),e.slice(s,s+t.length)==t}function uv(e,t,s){var a=f.templateSettings;s&&Zt(e,t,s)&&(t=i),e=Me(e),t=Xn({},t,a,Nu);var h=Xn({},t.imports,a.imports,Nu),p=Ut(h),w=Go(h,p),_,A,M=0,j=t.interpolate||ki,H="__p += '",J=Jo((t.escape||ki).source+"|"+j.source+"|"+(j===at?bo:ki).source+"|"+(t.evaluate||ki).source+"|$","g"),te="//# sourceURL="+(ze.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++zo+"]")+` +`;e.replace(J,function(ae,Se,Oe,dr,Qt,gr){return Oe||(Oe=dr),H+=e.slice(M,gr).replace(Ao,jf),Se&&(_=!0,H+=`' + +__e(`+Se+`) + +'`),Qt&&(A=!0,H+=`'; +`+Qt+`; +__p += '`),Oe&&(H+=`' + +((__t = (`+Oe+`)) == null ? '' : __t) + +'`),M=gr+ae.length,ae}),H+=`'; +`;var oe=ze.call(t,"variable")&&t.variable;if(!oe)H=`with (obj) { +`+H+` +} +`;else if(wo.test(oe))throw new ye(v);H=(A?H.replace(zr,""):H).replace(Jt,"$1").replace(Gr,"$1;"),H="function("+(oe||"obj")+`) { +`+(oe?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(_?", __e = _.escape":"")+(A?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+H+`return __p +}`;var Ee=xh(function(){return Le(p,te+"return "+H).apply(i,w)});if(Ee.source=H,Na(Ee))throw Ee;return Ee}function hv(e){return Me(e).toLowerCase()}function lv(e){return Me(e).toUpperCase()}function fv(e,t,s){if(e=Me(e),e&&(s||t===i))return Dc(e);if(!e||!(t=fr(t)))return e;var a=Tr(e),h=Tr(t),p=Fc(a,h),w=Lc(a,h)+1;return vi(a,p,w).join("")}function pv(e,t,s){if(e=Me(e),e&&(s||t===i))return e.slice(0,Mc(e)+1);if(!e||!(t=fr(t)))return e;var a=Tr(e),h=Lc(a,Tr(t))+1;return vi(a,0,h).join("")}function dv(e,t,s){if(e=Me(e),e&&(s||t===i))return e.replace(dt,"");if(!e||!(t=fr(t)))return e;var a=Tr(e),h=Fc(a,Tr(t));return vi(a,h).join("")}function gv(e,t){var s=ie,a=ue;if(ct(t)){var h="separator"in t?t.separator:h;s="length"in t?_e(t.length):s,a="omission"in t?fr(t.omission):a}e=Me(e);var p=e.length;if(Zi(e)){var w=Tr(e);p=w.length}if(s>=p)return e;var _=s-Qi(a);if(_<1)return a;var A=w?vi(w,0,_).join(""):e.slice(0,_);if(h===i)return A+a;if(w&&(_+=A.length-_),Da(h)){if(e.slice(_).search(h)){var M,j=A;for(h.global||(h=Jo(h.source,Me(yr.exec(h))+"g")),h.lastIndex=0;M=h.exec(j);)var H=M.index;A=A.slice(0,H===i?_:H)}}else if(e.indexOf(fr(h),_)!=_){var J=A.lastIndexOf(h);J>-1&&(A=A.slice(0,J))}return A+a}function yv(e){return e=Me(e),e&&ht.test(e)?e.replace(ci,Kf):e}var vv=os(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),$a=Su("toUpperCase");function Ih(e,t,s){return e=Me(e),t=s?i:t,t===i?Uf(e)?Wf(e):Tf(e):e.match(t)||[]}var xh=xe(function(e,t){try{return zt(e,i,t)}catch(s){return Na(s)?s:new ye(s)}}),mv=ei(function(e,t){return mr(t,function(s){s=kr(s),Zr(e,s,Ra(e[s],e))}),e});function wv(e){var t=e==null?0:e.length,s=se();return e=t?st(e,function(a){if(typeof a[1]!="function")throw new wr(d);return[s(a[0]),a[1]]}):[],xe(function(a){for(var h=-1;++hV)return[];var s=G,a=Vt(e,G);t=se(t),e-=G;for(var h=Vo(a,t);++s0||t<0)?new Ae(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==i&&(t=_e(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},Ae.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ae.prototype.toArray=function(){return this.take(G)},Br(Ae.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),h=f[a?"take"+(t=="last"?"Right":""):t],p=a||/^find/.test(t);h&&(f.prototype[t]=function(){var w=this.__wrapped__,_=a?[1]:arguments,A=w instanceof Ae,M=_[0],j=A||we(w),H=function(Se){var Oe=h.apply(f,li([Se],_));return a&&J?Oe[0]:Oe};j&&s&&typeof M=="function"&&M.length!=1&&(A=j=!1);var J=this.__chain__,te=!!this.__actions__.length,oe=p&&!J,Ee=A&&!te;if(!p&&j){w=Ee?w:new Ae(this);var ae=e.apply(w,_);return ae.__actions__.push({func:kn,args:[H],thisArg:i}),new _r(ae,J)}return oe&&Ee?e.apply(this,_):(ae=this.thru(H),oe?a?ae.value()[0]:ae.value():ae)})}),mr(["pop","push","shift","sort","splice","unshift"],function(e){var t=yn[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",a=/^(?:pop|shift)$/.test(e);f.prototype[e]=function(){var h=arguments;if(a&&!this.__chain__){var p=this.value();return t.apply(we(p)?p:[],h)}return this[s](function(w){return t.apply(we(w)?w:[],h)})}}),Br(Ae.prototype,function(e,t){var s=f[t];if(s){var a=s.name+"";ze.call(is,a)||(is[a]=[]),is[a].push({name:t,func:s})}}),is[Mn(i,he).name]=[{name:"wrapper",func:i}],Ae.prototype.clone=yp,Ae.prototype.reverse=vp,Ae.prototype.value=mp,f.prototype.at=Gg,f.prototype.chain=Wg,f.prototype.commit=Jg,f.prototype.next=Yg,f.prototype.plant=Zg,f.prototype.reverse=Qg,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=ey,f.prototype.first=f.prototype.head,bs&&(f.prototype[bs]=Xg),f},es=Jf();_t?((_t.exports=es)._=es,Ge._=es):Ce._=es}).call(qs)})(fc,fc.exports);var vE=Object.defineProperty,mE=Object.defineProperties,wE=Object.getOwnPropertyDescriptors,Sl=Object.getOwnPropertySymbols,_E=Object.prototype.hasOwnProperty,bE=Object.prototype.propertyIsEnumerable,Pl=(c,r,i)=>r in c?vE(c,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[r]=i,to=(c,r)=>{for(var i in r||(r={}))_E.call(r,i)&&Pl(c,i,r[i]);if(Sl)for(var i of Sl(r))bE.call(r,i)&&Pl(c,i,r[i]);return c},EE=(c,r)=>mE(c,wE(r));function Ar(c,r,i){let n;const o=pc(c);return r.rpcMap&&(n=r.rpcMap[o]),n||(n=`${yE}?chainId=eip155:${o}&projectId=${i}`),n}function pc(c){return c.includes("eip155")?Number(c.split(":")[1]):Number(c)}function xf(c){return c.map(r=>`${r.split(":")[0]}:${r.split(":")[1]}`)}function IE(c,r){const i=Object.keys(r.namespaces).filter(o=>o.includes(c));if(!i.length)return[];const n=[];return i.forEach(o=>{const l=r.namespaces[o].accounts;n.push(...l)}),n}function xE(c={},r={}){const i=Al(c),n=Al(r);return fc.exports.merge(i,n)}function Al(c){var r,i,n,o;const l={};if(!so(c))return l;for(const[d,v]of Object.entries(c)){const b=ql(d)?[d]:v.chains,m=v.methods||[],S=v.events||[],O=v.rpcMap||{},F=no(d);l[F]=EE(to(to({},l[F]),v),{chains:ka(b,(r=l[F])==null?void 0:r.chains),methods:ka(m,(i=l[F])==null?void 0:i.methods),events:ka(S,(n=l[F])==null?void 0:n.events),rpcMap:to(to({},O),(o=l[F])==null?void 0:o.rpcMap)})}return l}function SE(c){return c.includes(":")?c.split(":")[2]:c}function PE(c){const r={};for(const[i,n]of Object.entries(c)){const o=n.methods||[],l=n.events||[],d=n.accounts||[],v=ql(i)?[i]:n.chains?n.chains:xf(n.accounts);r[i]={chains:v,methods:o,events:l,accounts:d}}return r}const Sf={},It=c=>Sf[c],ic=(c,r)=>{Sf[c]=r};class AE{constructor(r){this.name="polkadot",this.namespace=r.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(r){this.namespace=Object.assign(this.namespace,r)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const r=this.namespace.chains[0];if(!r)throw new Error("ChainId not found");return r.split(":")[1]}request(r){return this.namespace.methods.includes(r.request.method)?this.client.request(r):this.getHttpProvider().request(r.request)}setDefaultChain(r,i){if(this.chainId=r,!this.httpProviders[r]){const n=i||Ar(`${this.name}:${r}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${r}`);this.setHttpProvider(r,n)}this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const r=this.namespace.accounts;return r?r.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2])||[]:[]}createHttpProviders(){const r={};return this.namespace.chains.forEach(i=>{var n;r[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[i])}),r}getHttpProvider(){const r=`${this.name}:${this.chainId}`,i=this.httpProviders[r];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${r} not found`);return i}setHttpProvider(r,i){const n=this.createHttpProvider(r,i);n&&(this.httpProviders[r]=n)}createHttpProvider(r,i){const n=i||Ar(r,this.namespace);return typeof n>"u"?void 0:new Ei(new Hi(n,It("disableProviderPing")))}}class CE{constructor(r){this.name="eip155",this.namespace=r.namespace,this.events=It("events"),this.client=It("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(r){switch(r.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(r);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(r.request.method)?await this.client.request(r):this.getHttpProvider().request(r.request)}updateNamespace(r){this.namespace=Object.assign(this.namespace,r)}setDefaultChain(r,i){const n=pc(r);if(!this.httpProviders[n]){const o=i||Ar(`${this.name}:${n}`,this.namespace,this.client.core.projectId);if(!o)throw new Error(`No RPC url provided for chainId: ${n}`);this.setHttpProvider(n,o)}this.chainId=n,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${n}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const r=this.namespace.chains[0];if(!r)throw new Error("ChainId not found");return r.split(":")[1]}createHttpProvider(r,i){const n=i||Ar(`${this.name}:${r}`,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Ei(new Hi(n,It("disableProviderPing")))}setHttpProvider(r,i){const n=this.createHttpProvider(r,i);n&&(this.httpProviders[r]=n)}createHttpProviders(){const r={};return this.namespace.chains.forEach(i=>{var n;const o=pc(i);r[o]=this.createHttpProvider(o,(n=this.namespace.rpcMap)==null?void 0:n[i])}),r}getAccounts(){const r=this.namespace.accounts;return r?[...new Set(r.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}getHttpProvider(){const r=this.chainId,i=this.httpProviders[r];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${r} not found`);return i}async handleSwitchChain(r){var i,n;let o=r.request.params?(i=r.request.params[0])==null?void 0:i.chainId:"0x0";o=o.startsWith("0x")?o:`0x${o}`;const l=parseInt(o,16);if(this.isChainApproved(l))this.setDefaultChain(`${l}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:r.topic,request:{method:r.request.method,params:[{chainId:o}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${l}`);else throw new Error(`Failed to switch to chain 'eip155:${l}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(r){return this.namespace.chains.includes(`${this.name}:${r}`)}}class OE{constructor(r){this.name="solana",this.namespace=r.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(r){this.namespace=Object.assign(this.namespace,r)}requestAccounts(){return this.getAccounts()}request(r){return this.namespace.methods.includes(r.request.method)?this.client.request(r):this.getHttpProvider().request(r.request)}setDefaultChain(r,i){if(!this.httpProviders[r]){const n=i||Ar(`${this.name}:${r}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${r}`);this.setHttpProvider(r,n)}this.chainId=r,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const r=this.namespace.chains[0];if(!r)throw new Error("ChainId not found");return r.split(":")[1]}getAccounts(){const r=this.namespace.accounts;return r?[...new Set(r.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const r={};return this.namespace.chains.forEach(i=>{var n;r[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[i])}),r}getHttpProvider(){const r=`${this.name}:${this.chainId}`,i=this.httpProviders[r];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${r} not found`);return i}setHttpProvider(r,i){const n=this.createHttpProvider(r,i);n&&(this.httpProviders[r]=n)}createHttpProvider(r,i){const n=i||Ar(r,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Ei(new Hi(n,It("disableProviderPing")))}}class RE{constructor(r){this.name="cosmos",this.namespace=r.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(r){this.namespace=Object.assign(this.namespace,r)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const r=this.namespace.chains[0];if(!r)throw new Error("ChainId not found");return r.split(":")[1]}request(r){return this.namespace.methods.includes(r.request.method)?this.client.request(r):this.getHttpProvider().request(r.request)}setDefaultChain(r,i){if(this.chainId=r,!this.httpProviders[r]){const n=i||Ar(`${this.name}:${r}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${r}`);this.setHttpProvider(r,n)}this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const r=this.namespace.accounts;return r?[...new Set(r.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const r={};return this.namespace.chains.forEach(i=>{var n;r[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[i])}),r}getHttpProvider(){const r=`${this.name}:${this.chainId}`,i=this.httpProviders[r];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${r} not found`);return i}setHttpProvider(r,i){const n=this.createHttpProvider(r,i);n&&(this.httpProviders[r]=n)}createHttpProvider(r,i){const n=i||Ar(r,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Ei(new Hi(n,It("disableProviderPing")))}}class TE{constructor(r){this.name="cip34",this.namespace=r.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(r){this.namespace=Object.assign(this.namespace,r)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const r=this.namespace.chains[0];if(!r)throw new Error("ChainId not found");return r.split(":")[1]}request(r){return this.namespace.methods.includes(r.request.method)?this.client.request(r):this.getHttpProvider().request(r.request)}setDefaultChain(r,i){if(this.chainId=r,!this.httpProviders[r]){const n=i||this.getCardanoRPCUrl(r);if(!n)throw new Error(`No RPC url provided for chainId: ${r}`);this.setHttpProvider(r,n)}this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const r=this.namespace.accounts;return r?[...new Set(r.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const r={};return this.namespace.chains.forEach(i=>{const n=this.getCardanoRPCUrl(i);r[i]=this.createHttpProvider(i,n)}),r}getHttpProvider(){const r=`${this.name}:${this.chainId}`,i=this.httpProviders[r];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${r} not found`);return i}getCardanoRPCUrl(r){const i=this.namespace.rpcMap;if(i)return i[r]}setHttpProvider(r,i){const n=this.createHttpProvider(r,i);n&&(this.httpProviders[r]=n)}createHttpProvider(r,i){const n=i||this.getCardanoRPCUrl(r);return typeof n>"u"?void 0:new Ei(new Hi(n,It("disableProviderPing")))}}class NE{constructor(r){this.name="elrond",this.namespace=r.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(r){this.namespace=Object.assign(this.namespace,r)}requestAccounts(){return this.getAccounts()}request(r){return this.namespace.methods.includes(r.request.method)?this.client.request(r):this.getHttpProvider().request(r.request)}setDefaultChain(r,i){if(!this.httpProviders[r]){const n=i||Ar(`${this.name}:${r}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${r}`);this.setHttpProvider(r,n)}this.chainId=r,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const r=this.namespace.chains[0];if(!r)throw new Error("ChainId not found");return r.split(":")[1]}getAccounts(){const r=this.namespace.accounts;return r?[...new Set(r.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const r={};return this.namespace.chains.forEach(i=>{var n;r[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[i])}),r}getHttpProvider(){const r=`${this.name}:${this.chainId}`,i=this.httpProviders[r];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${r} not found`);return i}setHttpProvider(r,i){const n=this.createHttpProvider(r,i);n&&(this.httpProviders[r]=n)}createHttpProvider(r,i){const n=i||Ar(r,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Ei(new Hi(n,It("disableProviderPing")))}}class DE{constructor(r){this.name="multiversx",this.namespace=r.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(r){this.namespace=Object.assign(this.namespace,r)}requestAccounts(){return this.getAccounts()}request(r){return this.namespace.methods.includes(r.request.method)?this.client.request(r):this.getHttpProvider().request(r.request)}setDefaultChain(r,i){if(!this.httpProviders[r]){const n=i||Ar(`${this.name}:${r}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${r}`);this.setHttpProvider(r,n)}this.chainId=r,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const r=this.namespace.chains[0];if(!r)throw new Error("ChainId not found");return r.split(":")[1]}getAccounts(){const r=this.namespace.accounts;return r?[...new Set(r.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const r={};return this.namespace.chains.forEach(i=>{var n;r[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[i])}),r}getHttpProvider(){const r=`${this.name}:${this.chainId}`,i=this.httpProviders[r];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${r} not found`);return i}setHttpProvider(r,i){const n=this.createHttpProvider(r,i);n&&(this.httpProviders[r]=n)}createHttpProvider(r,i){const n=i||Ar(r,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Ei(new Hi(n,It("disableProviderPing")))}}var FE=Object.defineProperty,LE=Object.defineProperties,$E=Object.getOwnPropertyDescriptors,Cl=Object.getOwnPropertySymbols,ME=Object.prototype.hasOwnProperty,jE=Object.prototype.propertyIsEnumerable,Ol=(c,r,i)=>r in c?FE(c,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[r]=i,ro=(c,r)=>{for(var i in r||(r={}))ME.call(r,i)&&Ol(c,i,r[i]);if(Cl)for(var i of Cl(r))jE.call(r,i)&&Ol(c,i,r[i]);return c},sc=(c,r)=>LE(c,$E(r));class Pc{constructor(r){this.events=new vc,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=r,this.logger=typeof(r==null?void 0:r.logger)<"u"&&typeof(r==null?void 0:r.logger)!="string"?r.logger:Re.pino(Re.getDefaultLoggerOptions({level:(r==null?void 0:r.logger)||Il})),this.disableProviderPing=(r==null?void 0:r.disableProviderPing)||!1}static async init(r){const i=new Pc(r);return await i.initialize(),i}async request(r,i){const[n,o]=this.validateChain(i);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:ro({},r),chainId:`${n}:${o}`,topic:this.session.topic})}sendAsync(r,i,n){this.request(r,n).then(o=>i(null,o)).catch(o=>i(o,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var r;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(r=this.session)==null?void 0:r.topic,reason:tr("USER_DISCONNECTED")}),await this.cleanup()}async connect(r){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(r),await this.cleanupPendingPairings(),!r.skipPairing)return await this.pair(r.pairingTopic)}on(r,i){this.events.on(r,i)}once(r,i){this.events.once(r,i)}removeListener(r,i){this.events.removeListener(r,i)}off(r,i){this.events.off(r,i)}get isWalletConnect(){return!0}async pair(r){this.shouldAbortPairingAttempt=!1;let i=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(i>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:o}=await this.client.connect({pairingTopic:r,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await o().then(l=>{this.session=l,this.namespaces||(this.namespaces=PE(l.namespaces),this.persist("namespaces",this.namespaces))}).catch(l=>{if(l.message!==Ef)throw l;i++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(r,i){try{if(!this.session)return;const[n,o]=this.validateChain(r);this.getProvider(n).setDefaultChain(o,i)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(r={}){this.logger.info("Cleaning up inactive pairings...");const i=this.client.pairing.getAll();if(ps(i)){for(const n of i)r.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${i.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const r=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[r]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await uE.init({logger:this.providerOpts.logger||Il,relayUrl:this.providerOpts.relayUrl||pE,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const r=[...new Set(Object.keys(this.session.namespaces).map(i=>no(i)))];ic("client",this.client),ic("events",this.events),ic("disableProviderPing",this.disableProviderPing),r.forEach(i=>{if(!this.session)return;const n=IE(i,this.session),o=xf(n),l=xE(this.namespaces,this.optionalNamespaces),d=sc(ro({},l[i]),{accounts:n,chains:o});switch(i){case"eip155":this.rpcProviders[i]=new CE({namespace:d});break;case"solana":this.rpcProviders[i]=new OE({namespace:d});break;case"cosmos":this.rpcProviders[i]=new RE({namespace:d});break;case"polkadot":this.rpcProviders[i]=new AE({namespace:d});break;case"cip34":this.rpcProviders[i]=new TE({namespace:d});break;case"elrond":this.rpcProviders[i]=new NE({namespace:d});break;case"multiversx":this.rpcProviders[i]=new DE({namespace:d});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",r=>{this.events.emit("session_ping",r)}),this.client.on("session_event",r=>{const{params:i}=r,{event:n}=i;if(n.name==="accountsChanged"){const o=n.data;o&&ps(o)&&this.events.emit("accountsChanged",o.map(SE))}else n.name==="chainChanged"?this.onChainChanged(i.chainId):this.events.emit(n.name,n.data);this.events.emit("session_event",r)}),this.client.on("session_update",({topic:r,params:i})=>{var n;const{namespaces:o}=i,l=(n=this.client)==null?void 0:n.session.get(r);this.session=sc(ro({},l),{namespaces:o}),this.onSessionUpdate(),this.events.emit("session_update",{topic:r,params:i})}),this.client.on("session_delete",async r=>{await this.cleanup(),this.events.emit("session_delete",r),this.events.emit("disconnect",sc(ro({},tr("USER_DISCONNECTED")),{data:r.topic}))}),this.on(Ii.DEFAULT_CHAIN_CHANGED,r=>{this.onChainChanged(r,!0)})}getProvider(r){if(!this.rpcProviders[r])throw new Error(`Provider not found: ${r}`);return this.rpcProviders[r]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(r=>{var i;this.getProvider(r).updateNamespace((i=this.session)==null?void 0:i.namespaces[r])})}setNamespaces(r){const{namespaces:i,optionalNamespaces:n,sessionProperties:o}=r;i&&Object.keys(i).length&&(this.namespaces=i),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=o,this.persist("namespaces",i),this.persist("optionalNamespaces",n)}validateChain(r){const[i,n]=(r==null?void 0:r.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[i,n];if(i&&!Object.keys(this.namespaces||{}).map(d=>no(d)).includes(i))throw new Error(`Namespace '${i}' is not configured. Please call connect() first with namespace config.`);if(i&&n)return[i,n];const o=no(Object.keys(this.namespaces)[0]),l=this.rpcProviders[o].getDefaultChain();return[o,l]}async requestAccounts(){const[r]=this.validateChain();return await this.getProvider(r).requestAccounts()}onChainChanged(r,i=!1){var n;if(!this.namespaces)return;const[o,l]=this.validateChain(r);i||this.getProvider(o).setDefaultChain(l),((n=this.namespaces[o])!=null?n:this.namespaces[`${o}:${l}`]).defaultChain=l,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",l)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(r,i){this.client.core.storage.setItem(`${xl}/${r}`,i)}async getFromStore(r){return await this.client.core.storage.getItem(`${xl}/${r}`)}}const zE=Pc,UE="wc",qE="ethereum_provider",BE=`${UE}@2:${qE}:`,HE="https://rpc.walletconnect.com/v1/",dc=["eth_sendTransaction","personal_sign"],kE=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],gc=["chainChanged","accountsChanged"],KE=["message","disconnect","connect"];var VE=Object.defineProperty,GE=Object.defineProperties,WE=Object.getOwnPropertyDescriptors,Rl=Object.getOwnPropertySymbols,JE=Object.prototype.hasOwnProperty,YE=Object.prototype.propertyIsEnumerable,Tl=(c,r,i)=>r in c?VE(c,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[r]=i,Bs=(c,r)=>{for(var i in r||(r={}))JE.call(r,i)&&Tl(c,i,r[i]);if(Rl)for(var i of Rl(r))YE.call(r,i)&&Tl(c,i,r[i]);return c},Nl=(c,r)=>GE(c,WE(r));function lo(c){return Number(c[0].split(":")[1])}function nc(c){return`0x${c.toString(16)}`}function XE(c){const{chains:r,optionalChains:i,methods:n,optionalMethods:o,events:l,optionalEvents:d,rpcMap:v}=c;if(!ps(r))throw new Error("Invalid chains");const b={chains:r,methods:n||dc,events:l||gc,rpcMap:Bs({},r.length?{[lo(r)]:v[lo(r)]}:{})},m=l==null?void 0:l.filter(z=>!gc.includes(z)),S=n==null?void 0:n.filter(z=>!dc.includes(z));if(!i&&!d&&!o&&!(m!=null&&m.length)&&!(S!=null&&S.length))return{required:r.length?b:void 0};const O=(m==null?void 0:m.length)&&(S==null?void 0:S.length)||!i,F={chains:[...new Set(O?b.chains.concat(i||[]):i)],methods:[...new Set(b.methods.concat(o!=null&&o.length?o:kE))],events:[...new Set(b.events.concat(d||KE))],rpcMap:v};return{required:r.length?b:void 0,optional:i.length?F:void 0}}class Ac{constructor(){this.events=new Cr.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=BE,this.on=(r,i)=>(this.events.on(r,i),this),this.once=(r,i)=>(this.events.once(r,i),this),this.removeListener=(r,i)=>(this.events.removeListener(r,i),this),this.off=(r,i)=>(this.events.off(r,i),this),this.parseAccount=r=>this.isCompatibleChainId(r)?this.parseAccountId(r).address:r,this.signer={},this.rpc={}}static async init(r){const i=new Ac;return await i.initialize(r),i}async request(r){return await this.signer.request(r,this.formatChainId(this.chainId))}sendAsync(r,i){this.signer.sendAsync(r,i,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(r){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(r);const{required:i,optional:n}=XE(this.rpc);try{const o=await new Promise(async(d,v)=>{var b;this.rpc.showQrModal&&((b=this.modal)==null||b.subscribeModal(m=>{!m.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),v(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Nl(Bs({namespaces:Bs({},i&&{[this.namespace]:i})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:r==null?void 0:r.pairingTopic})).then(m=>{d(m)}).catch(m=>{v(new Error(m.message))})});if(!o)return;this.setChainIds(this.rpc.chains);const l=qm(o.namespaces,[this.namespace]);this.setAccounts(l),this.events.emit("connect",{chainId:nc(this.chainId)})}catch(o){throw this.signer.logger.error(o),o}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",r=>{const{params:i}=r,{event:n}=i;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",r)}),this.signer.on("chainChanged",r=>{const i=parseInt(r);this.chainId=i,this.events.emit("chainChanged",nc(this.chainId)),this.persist()}),this.signer.on("session_update",r=>{this.events.emit("session_update",r)}),this.signer.on("session_delete",r=>{this.reset(),this.events.emit("session_delete",r),this.events.emit("disconnect",Nl(Bs({},tr("USER_DISCONNECTED")),{data:r.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",r=>{var i,n;this.rpc.showQrModal&&((i=this.modal)==null||i.closeModal(),(n=this.modal)==null||n.openModal({uri:r})),this.events.emit("display_uri",r)})}switchEthereumChain(r){this.request({method:"wallet_switchEthereumChain",params:[{chainId:r.toString(16)}]})}isCompatibleChainId(r){return typeof r=="string"?r.startsWith(`${this.namespace}:`):!1}formatChainId(r){return`${this.namespace}:${r}`}parseChainId(r){return Number(r.split(":")[1])}setChainIds(r){const i=r.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));i.length&&(this.chainId=i[0],this.events.emit("chainChanged",nc(this.chainId)),this.persist())}setChainId(r){if(this.isCompatibleChainId(r)){const i=this.parseChainId(r);this.chainId=i,this.switchEthereumChain(i)}}parseAccountId(r){const[i,n,o]=r.split(":");return{chainId:`${i}:${n}`,address:o}}setAccounts(r){this.accounts=r.filter(i=>this.parseChainId(this.parseAccountId(i).chainId)===this.chainId).map(i=>this.parseAccountId(i).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(r){var i,n;const o=(i=r==null?void 0:r.chains)!=null?i:[],l=(n=r==null?void 0:r.optionalChains)!=null?n:[],d=o.concat(l);if(!d.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const v=o.length?(r==null?void 0:r.methods)||dc:[],b=o.length?(r==null?void 0:r.events)||gc:[],m=(r==null?void 0:r.optionalMethods)||[],S=(r==null?void 0:r.optionalEvents)||[],O=(r==null?void 0:r.rpcMap)||this.buildRpcMap(d,r.projectId),F=(r==null?void 0:r.qrModalOptions)||void 0;return{chains:o==null?void 0:o.map(z=>this.formatChainId(z)),optionalChains:l.map(z=>this.formatChainId(z)),methods:v,events:b,optionalMethods:m,optionalEvents:S,rpcMap:O,showQrModal:!!(r!=null&&r.showQrModal),qrModalOptions:F,projectId:r.projectId,metadata:r.metadata}}buildRpcMap(r,i){const n={};return r.forEach(o=>{n[o]=this.getRpcUrl(o,i)}),n}async initialize(r){if(this.rpc=this.getRpcConfig(r),this.chainId=this.rpc.chains.length?lo(this.rpc.chains):lo(this.rpc.optionalChains),this.signer=await zE.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:r.disableProviderPing,relayUrl:r.relayUrl,storageOptions:r.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let i;try{const{WalletConnectModal:n}=await Bm(()=>import("./index-e4b650d6.js").then(o=>o.a),["./index-e4b650d6.js","./index-da732aeb.js","./index-f4824932.css","./index-cc134824.js"],import.meta.url);i=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(i)try{this.modal=new i(Bs({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(r){if(!r)return;const{chains:i,optionalChains:n,rpcMap:o}=r;i&&ps(i)&&(this.rpc.chains=i.map(l=>this.formatChainId(l)),i.forEach(l=>{this.rpc.rpcMap[l]=(o==null?void 0:o[l])||this.getRpcUrl(l)})),n&&ps(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(l=>this.formatChainId(l)),n.forEach(l=>{this.rpc.rpcMap[l]=(o==null?void 0:o[l])||this.getRpcUrl(l)}))}getRpcUrl(r,i){var n;return((n=this.rpc.rpcMap)==null?void 0:n[r])||`${HE}?chainId=eip155:${r}&projectId=${i||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const r=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),i=this.session.namespaces[`${this.namespace}:${r}`]?this.session.namespaces[`${this.namespace}:${r}`]:this.session.namespaces[this.namespace];this.setChainIds(r?[this.formatChainId(r)]:i==null?void 0:i.accounts),this.setAccounts(i==null?void 0:i.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(r){return typeof r=="string"||r instanceof String?[this.parseAccount(r)]:r.map(i=>this.parseAccount(i))}}const lI=Ac;export{lI as EthereumProvider,KE as OPTIONAL_EVENTS,kE as OPTIONAL_METHODS,gc as REQUIRED_EVENTS,dc as REQUIRED_METHODS,Ac as default}; diff --git a/index.html b/index.html index c2efb24b..43262312 100644 --- a/index.html +++ b/index.html @@ -24,7 +24,7 @@ Learn how to configure a non-root public URL by running `npm run build`. --> Sequence Kit Demo - +