@fileverse-dev/ddoc 1.7.4 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +2 -2
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -512,7 +512,7 @@ ${n.innerHTML}
|
|
|
512
512
|
`),t.text(e.textContent,!1),t.ensureNewLine(),t.write("```"),t.closeBlock(e)},parse:{setup(t){var e;t.set({langPrefix:(e=this.options.languageClassPrefix)!==null&&e!==void 0?e:"language-"})},updateDOM(t){t.innerHTML=t.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),n4=Ye.create({name:"hardBreak"}).extend({addStorage(){return{markdown:{serialize(t,e,n,r){for(let s=r+1;s<n.childCount;s++)if(n.child(s).type!=e.type){t.write(t.inTable?Hg.storage.markdown.serialize.call(this,t,e,n):`\\
|
|
513
513
|
`);return}},parse:{}}}}}),Cte=Ye.create({name:"heading"}).extend({addStorage(){return{markdown:{serialize:li.nodes.heading,parse:{}}}}}),Ste=Ye.create({name:"horizontalRule"}).extend({addStorage(){return{markdown:{serialize:li.nodes.horizontal_rule,parse:{}}}}}),Tte=Ye.create({name:"image"}).extend({addStorage(){return{markdown:{serialize:li.nodes.image,parse:{}}}}}),Dte=Ye.create({name:"listItem"}).extend({addStorage(){return{markdown:{serialize:li.nodes.list_item,parse:{}}}}}),Ote=Ye.create({name:"orderedList"});function _te(t,e,n){let r=0;for(;n-r>0&&e.child(n-r-1).type.name===t.type.name;r++);return r}const Mte=Ote.extend({addStorage(){return{markdown:{serialize(t,e,n,r){const s=e.attrs.start||1,i=String(s+e.childCount-1).length,o=t.repeat(" ",i+2),l=_te(e,n,r)%2?") ":". ";t.renderList(e,o,u=>{const c=String(s+u);return t.repeat(" ",i-c.length)+c+l})},parse:{}}}}}),Nte=Ye.create({name:"paragraph"}).extend({addStorage(){return{markdown:{serialize:li.nodes.paragraph,parse:{}}}}});function wx(t){var e,n;return(e=t==null||(n=t.content)===null||n===void 0?void 0:n.content)!==null&&e!==void 0?e:[]}const Rte=Ye.create({name:"table"}).extend({addStorage(){return{markdown:{serialize(t,e,n){if(!Pte(e)){Hg.storage.markdown.serialize.call(this,t,e,n);return}t.inTable=!0,e.forEach((r,s,i)=>{if(t.write("| "),r.forEach((o,a,l)=>{l&&t.write(" | ");const u=o.firstChild;u.textContent.trim()&&t.renderInline(u)}),t.write(" |"),t.ensureNewLine(),!i){const o=Array.from({length:r.childCount}).map(()=>"---").join(" | ");t.write(`| ${o} |`),t.ensureNewLine()}}),t.closeBlock(e),t.inTable=!1},parse:{}}}}});function r4(t){return t.attrs.colspan>1||t.attrs.rowspan>1}function Pte(t){const e=wx(t),n=e[0],r=e.slice(1);return!(wx(n).some(s=>s.type.name!=="tableHeader"||r4(s)||s.childCount>1)||r.some(s=>wx(s).some(i=>i.type.name==="tableHeader"||r4(i)||i.childCount>1)))}const Ite=Ye.create({name:"taskItem"}).extend({addStorage(){return{markdown:{serialize(t,e){const n=e.attrs.checked?"[x]":"[ ]";t.write(`${n} `),t.renderContent(e)},parse:{updateDOM(t){[...t.querySelectorAll(".task-list-item")].forEach(e=>{const n=e.querySelector("input");e.setAttribute("data-type","taskItem"),n&&(e.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),Lte=Ye.create({name:"taskList"}).extend({addStorage(){return{markdown:{serialize:t4.storage.markdown.serialize,parse:{setup(t){t.use(cte)},updateDOM(t){[...t.querySelectorAll(".contains-task-list")].forEach(e=>{e.setAttribute("data-type","taskList")})}}}}}}),Bte=Ye.create({name:"text"}).extend({addStorage(){return{markdown:{serialize(t,e){t.text(bte(e.text))},parse:{}}}}}),Fte=Yt.create({name:"bold"}).extend({addStorage(){return{markdown:{serialize:li.marks.strong,parse:{}}}}}),jte=Yt.create({name:"code"}).extend({addStorage(){return{markdown:{serialize:li.marks.code,parse:{}}}}}),Ute=Yt.create({name:"italic"}).extend({addStorage(){return{markdown:{serialize:li.marks.em,parse:{}}}}}),Vte=Yt.create({name:"link"}).extend({addStorage(){return{markdown:{serialize:li.marks.link,parse:{}}}}}),Hte=Yt.create({name:"strike"}).extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),zte=[kte,t4,Ete,n4,Cte,Ste,Hg,Tte,Dte,Mte,Nte,Rte,Ite,Lte,Bte,Fte,jte,Z6,Ute,Vte,Hte];function zg(t){var e,n;const r=(e=t.storage)===null||e===void 0?void 0:e.markdown,s=(n=zte.find(i=>i.name===t.name))===null||n===void 0?void 0:n.storage.markdown;return r||s?{...s,...r}:null}class $te{constructor(e){Vg(this,"editor",null),this.editor=e}serialize(e){const n=new yte(this.nodes,this.marks,{hardBreakNodeName:n4.name});return n.renderContent(e),n.out}get nodes(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(Hg)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&e!==void 0?e:[])}}get marks(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(Z6)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&e!==void 0?e:[])}}serializeNode(e){var n;return(n=zg(e))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:e.options})}serializeMark(e){var n;const r=(n=zg(e))===null||n===void 0?void 0:n.serialize;return r?{...r,open:typeof r.open=="function"?r.open.bind({editor:this.editor,options:e.options}):r.open,close:typeof r.close=="function"?r.close.bind({editor:this.editor,options:e.options}):r.close}:null}}class Gte{constructor(e,n){Vg(this,"editor",null),Vg(this,"md",null);let{html:r,linkify:s,breaks:i}=n;this.editor=e,this.md=this.withPatchedRenderer(cr({html:r,linkify:s,breaks:i}))}parse(e){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof e=="string"){this.editor.extensionManager.extensions.forEach(i=>{var o;return(o=zg(i))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.setup)===null||o===void 0?void 0:o.call({editor:this.editor,options:i.options},this.md)});const r=this.md.render(e),s=bx(r);return this.editor.extensionManager.extensions.forEach(i=>{var o;return(o=zg(i))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.updateDOM)===null||o===void 0?void 0:o.call({editor:this.editor,options:i.options},s)}),this.normalizeDOM(s,{inline:n,content:e}),s.innerHTML}return e}normalizeDOM(e,n){let{inline:r,content:s}=n;return this.normalizeBlocks(e),e.querySelectorAll("*").forEach(i=>{var o;((o=i.nextSibling)===null||o===void 0?void 0:o.nodeType)===Node.TEXT_NODE&&!i.closest("pre")&&(i.nextSibling.textContent=i.nextSibling.textContent.replace(/^\n/,""))}),r&&this.normalizeInline(e,s),e}normalizeBlocks(e){const r=Object.values(this.editor.schema.nodes).filter(s=>s.isBlock).map(s=>{var i;return(i=s.spec.parseDOM)===null||i===void 0?void 0:i.map(o=>o.tag)}).flat().filter(Boolean).join(",");r&&[...e.querySelectorAll(r)].forEach(s=>{s.parentElement.matches("p")&&wte(s)})}normalizeInline(e,n){var r;if((r=e.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var s,i,o,a;const l=e.firstElementChild,{nextElementSibling:u}=l,c=(s=(i=n.match(/^\s+/))===null||i===void 0?void 0:i[0])!==null&&s!==void 0?s:"",f=u?"":(o=(a=n.match(/\s+$/))===null||a===void 0?void 0:a[0])!==null&&o!==void 0?o:"";if(n.match(/^\n\n/)){l.innerHTML=`${l.innerHTML}${f}`;return}Ate(l),e.innerHTML=`${c}${e.innerHTML}${f}`}}withPatchedRenderer(e){const n=r=>function(){const s=r(...arguments);return s===`
|
|
514
514
|
`?s:s[s.length-1]===`
|
|
515
|
-
`?s.slice(0,-1):s};return e.renderer.rules.hardbreak=n(e.renderer.rules.hardbreak),e.renderer.rules.softbreak=n(e.renderer.rules.softbreak),e.renderer.rules.fence=n(e.renderer.rules.fence),e.renderer.rules.code_block=n(e.renderer.rules.code_block),e.renderer.renderToken=n(e.renderer.renderToken.bind(e.renderer)),e}}const Wte=wt.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new bt({key:new _t("markdownClipboard"),props:{clipboardTextParser:(t,e,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(t,{inline:!0});return Up.fromSchema(this.editor.schema).parseSlice(bx(r),{preserveWhitespace:!0,context:e})},clipboardTextSerializer:t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null}})]}}),Kte=wt.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const t=B7.Commands.config.addCommands();return{setContent:(e,n,r)=>s=>t.setContent(s.editor.storage.markdown.parser.parse(e),n,r)(s),insertContentAt:(e,n,r)=>s=>t.insertContentAt(e,s.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(s)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new Gte(this.editor,this.options),serializer:new $te(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[hte.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),Wte.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),qte=[Nq,_q.configure({strike:{HTMLAttributes:{class:"select-text pointer-events-auto"}},bold:{HTMLAttributes:{class:"select-text pointer-events-auto"}},italic:{HTMLAttributes:{class:"select-text pointer-events-auto"}},heading:{HTMLAttributes:{class:"select-text pointer-events-auto"}},paragraph:{HTMLAttributes:{class:"select-text pointer-events-auto"}},orderedList:{HTMLAttributes:{class:"flex flex-col items-start list-decimal list-outside space-y-4 ml-6"}},blockquote:{HTMLAttributes:{class:"rounded-lg bg-[#E8EBEC] p-5 font-serif italic text-black"}},codeBlock:{HTMLAttributes:{class:"rounded-lg bg-transparent border border-[#DDE2E4] p-5 font-mono font-medium text-black"},exitOnArrowDown:!0},code:{HTMLAttributes:{class:"rounded bg-transparent p-1.5 font-mono font-medium text-black text-sm",spellcheck:"false"}},history:!1,gapcursor:!1,dropcursor:!1,document:!1,horizontalRule:!1,bulletList:!1,listItem:!1}),hM.configure({depth:10,newGroupDelay:100}),Rq.configure({types:["heading","paragraph"]}),hQ,sQ.extend({exitable:!0}).configure({HTMLAttributes:{class:"text-blue-500 font-bold transition-colors cursor-pointer select-text pointer-events-auto"},openOnClick:!0,autolink:!1}),iQ.configure({placeholder:()=>"",includeChildren:!0,showOnlyCurrent:!0}),lQ.configure({multicolor:!0}),dQ.configure({HTMLAttributes:{class:"select-text pointer-events-auto"}}),Mq,gQ,uQ.configure({HTMLAttributes:{class:"not-prose space-y-4 !ml-0"}}),fQ.configure({HTMLAttributes:{class:"flex items-start"},nested:!0}),rM.configure({HTMLAttributes:{class:"space-y-4 !ml-6"}}),mM.configure({HTMLAttributes:{class:"leading-normal"}}),iM.configure({width:3,color:"#d1d5db"}),oM,QJ,dX,fX,...cX,CQ.configure({uploadFn:yV}),mQ,yQ,vQ,pX,pQ,Kte.configure({html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!0,breaks:!0,transformPastedText:!0,transformCopiedText:!1})],Qte="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAOCAYAAAD0f5bSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAE/SURBVHgBhVJBTsJQEH3zMcElR+gRuIF6gwYPAOwkLoQTUE6ArEA3xbWJ4gnQE8gNwBuwhMR2fPNLk9o0ZZImM/P/e39e3wgqojPXXiPFJnFovw1kWT53xSKca3C70LXlr/eySYFdZ6Fb61eCePnBCb6VF3P21UA+WX+wv+086fgfyMbh4aPlqWJSZH2/k6EINlBEJI6tdxHG2tIDrsUqxYzsO5Qi+UXfNfwUPT7w49wRU1EyZWNFqIgV9REw84Wga+P1Uj7PsW5QE9pEZMT8Aq+JQmNcYl8HwgEtEvf9fc3RR4zrMCRe84WA6dJRz8upPwyftV0FOP3ugHqu0iZGzsSbF3bYUMRlgDdWMcyE4WvVl73XRC9CNiaqaHMDpkUQrYh8kmKUmy5lVpvdBNs2mOk0tptk9a5AVKHhzML+AZaSjR/r++n9AAAAAElFTkSuQmCC",Jte="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEjSURBVHgBjZJBToNQEIb/NzTeoMbGjTeoN5Au1S7wBrqwyk5OoD1B46pRF9UbsEBc9nmEHsI08QhGZnxMpaGUEv4EwoP/mxnyj0GNTp++AoPORA+Gx+mo91r1mOJh+LL0WYwDqC8i/obJGCuSfRJ1bHLdtWtQIaY5WoiYBknYtZQfmOGjpTIvC7TAahTvpMksmUQCvK0A6itzNl1egmi2k2K+2gPsD+mvHGkh4MIVoPuSLYbIYxOk3YAJVRuktwd3DhjvggqRB0Slc3D+/D1Lw95DE5Rnq3E487ySXeyu4zooz/R9tD/QUYV5Ufke1HbKvW4RdFS9icRoKeKO1c7Fi+HUbQ/BzzPdXjmxDCy8TOIk7G2CZf1nqzEJfqOPm8Otif4AFnp3K1F5HHAAAAAASUVORK5CYII=",Yte=t=>{const e=document.createElement("span");e.classList.add("collaboration-cursor__caret"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");return n.classList.add("collaboration-cursor__label"),n.setAttribute("style",`background-color: ${t.color}`),n.insertBefore(document.createTextNode(t.name),null),e.insertBefore(n,null),e},Xte=t=>{const e=document.createElement("span");e.classList.add("custom-cursor__caret"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");n.classList.add("custom-cursor__label-container"),n.setAttribute("style",`border: 1px solid ${t.color}`);const r=document.createElement("img");r.src=Qte,r.classList.add("custom-cursor__icon");const s=document.createElement("div");s.classList.add("custom-cursor__label");const i=document.createElement("span");i.classList.add("custom-cursor__text"),i.textContent=t.name;const o=document.createElement("img");return o.src=Jte,o.classList.add("custom-cursor__badge"),s.appendChild(i),n.appendChild(r),n.appendChild(s),n.appendChild(o),e.appendChild(n),e},Zte=t=>t.isEns?Xte(t):Yte(t),ene="6.13.1";function tne(t,e,n){const r=e.split("|").map(i=>i.trim());for(let i=0;i<r.length;i++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const s=new Error(`invalid value for type ${e}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${n}`,s.value=t,s}async function Nn(t){const e=Object.keys(t);return(await Promise.all(e.map(r=>Promise.resolve(t[r])))).reduce((r,s,i)=>(r[e[i]]=s,r),{})}function Oe(t,e,n){for(let r in e){let s=e[r];const i=n?n[r]:null;i&&tne(s,i,r),Object.defineProperty(t,r,{enumerable:!0,value:s,writable:!1})}}function Ec(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(Ec).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r<t.length;r++)n+=e[t[r]>>4],n+=e[t[r]&15];return n}if(typeof t=="object"&&typeof t.toJSON=="function")return Ec(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(n=>`${Ec(n)}: ${Ec(t[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function gn(t,e){return t&&t.code===e}function Ax(t){return gn(t,"CALL_EXCEPTION")}function Nt(t,e,n){let r=t;{const i=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${Ec(n)}`);for(const o in n){if(o==="shortMessage")continue;const a=n[o];i.push(o+"="+Ec(a))}}i.push(`code=${e}`),i.push(`version=${ene}`),i.length&&(t+=" ("+i.join(", ")+")")}let s;switch(e){case"INVALID_ARGUMENT":s=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(t);break;default:s=new Error(t)}return Oe(s,{code:e}),n&&Object.assign(s,n),s.shortMessage==null&&Oe(s,{shortMessage:r}),s}function ee(t,e,n,r){if(!t)throw Nt(e,n,r)}function $(t,e,n,r){ee(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function s4(t,e,n){n==null&&(n=""),n&&(n=": "+n),ee(t>=e,"missing arguemnt"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),ee(t<=e,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function $g(t,e,n){if(n==null&&(n=""),t!==e){let r=n,s="new";n&&(r+=".",s+=" "+n),ee(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}function i4(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((t.length-2)/2);let s=2;for(let i=0;i<r.length;i++)r[i]=parseInt(t.substring(s,s+2),16),s+=2;return r}$(!1,"invalid BytesLike value",e||"value",t)}function ct(t,e){return i4(t,e,!1)}function Gn(t,e){return i4(t,e,!0)}function St(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&t.length!==2+2*e||e===!0&&t.length%2!==0)}function vx(t){return St(t,!0)||t instanceof Uint8Array}const o4="0123456789abcdef";function we(t){const e=ct(t);let n="0x";for(let r=0;r<e.length;r++){const s=e[r];n+=o4[(s&240)>>4]+o4[s&15]}return n}function $t(t){return"0x"+t.map(e=>we(e).substring(2)).join("")}function Cc(t){return St(t,!0)?(t.length-2)/2:ct(t).length}function Ht(t,e,n){const r=ct(t);return n!=null&&n>r.length&&ee(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),we(r.slice(e??0,n??r.length))}function a4(t,e,n){const r=ct(t);ee(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const s=new Uint8Array(e);return s.fill(0),n?s.set(r,e-r.length):s.set(r,0),we(s)}function xl(t,e){return a4(t,e,!0)}function nne(t,e){return a4(t,e,!1)}const Gg=BigInt(0),Es=BigInt(1),Sc=9007199254740991;function rne(t,e){const n=Wg(t,"value"),r=BigInt(Qe(e,"width"));if(ee(n>>r===Gg,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-Es){const s=(Es<<r)-Es;return-((~n&s)+Es)}return n}function l4(t,e){let n=xe(t,"value");const r=BigInt(Qe(e,"width")),s=Es<<r-Es;if(n<Gg){n=-n,ee(n<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});const i=(Es<<r)-Es;return(~n&i)+Es}else ee(n<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});return n}function Oh(t,e){const n=Wg(t,"value"),r=BigInt(Qe(e,"bits"));return n&(Es<<r)-Es}function xe(t,e){switch(typeof t){case"bigint":return t;case"number":return $(Number.isInteger(t),"underflow",e||"value",t),$(t>=-Sc&&t<=Sc,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(n){$(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}$(!1,"invalid BigNumberish value",e||"value",t)}function Wg(t,e){const n=xe(t,e);return ee(n>=Gg,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const u4="0123456789abcdef";function xx(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=u4[n>>4],e+=u4[n&15];return BigInt(e)}return xe(t)}function Qe(t,e){switch(typeof t){case"bigint":return $(t>=-Sc&&t<=Sc,"overflow",e||"value",t),Number(t);case"number":return $(Number.isInteger(t),"underflow",e||"value",t),$(t>=-Sc&&t<=Sc,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Qe(BigInt(t),e)}catch(n){$(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}$(!1,"invalid numeric value",e||"value",t)}function sne(t){return Qe(xx(t))}function Xo(t,e){let r=Wg(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const s=Qe(e,"width");for(ee(s*2>=r.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length<s*2;)r="0"+r}return"0x"+r}function Wn(t){const e=Wg(t,"value");if(e===Gg)return new Uint8Array([]);let n=e.toString(16);n.length%2&&(n="0"+n);const r=new Uint8Array(n.length/2);for(let s=0;s<r.length;s++){const i=s*2;r[s]=parseInt(n.substring(i,i+2),16)}return r}function kl(t){let e=we(vx(t)?t:Wn(t)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const c4="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";BigInt(0);const f4=BigInt(58);function ine(t){const e=ct(t);let n=xx(e),r="";for(;n;)r=c4[Number(n%f4)]+r,n/=f4;for(let s=0;s<e.length&&!e[s];s++)r=c4[0]+r;return r}function one(t){t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return ct(e)}function ane(t){const e=ct(t);let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}class d4{constructor(e,n,r){W(this,"filter");W(this,"emitter");J(this,ef);I(this,ef,n),Oe(this,{emitter:e,filter:r})}async removeListener(){T(this,ef)!=null&&await this.emitter.off(this.filter,T(this,ef))}}ef=new WeakMap;function lne(t,e,n,r,s){$(!1,`invalid codepoint at offset ${e}; ${t}`,"bytes",n)}function h4(t,e,n,r,s){if(t==="BAD_PREFIX"||t==="UNEXPECTED_CONTINUE"){let i=0;for(let o=e+1;o<n.length&&n[o]>>6===2;o++)i++;return i}return t==="OVERRUN"?n.length-e-1:0}function une(t,e,n,r,s){return t==="OVERLONG"?($(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),r.push(s),0):(r.push(65533),h4(t,e,n))}const cne=Object.freeze({error:lne,ignore:h4,replace:une});function fne(t,e){e==null&&(e=cne.error);const n=ct(t,"bytes"),r=[];let s=0;for(;s<n.length;){const i=n[s++];if(!(i>>7)){r.push(i);continue}let o=null,a=null;if((i&224)===192)o=1,a=127;else if((i&240)===224)o=2,a=2047;else if((i&248)===240)o=3,a=65535;else{(i&192)===128?s+=e("UNEXPECTED_CONTINUE",s-1,n,r):s+=e("BAD_PREFIX",s-1,n,r);continue}if(s-1+o>=n.length){s+=e("OVERRUN",s-1,n,r);continue}let l=i&(1<<8-o-1)-1;for(let u=0;u<o;u++){let c=n[s];if((c&192)!=128){s+=e("MISSING_CONTINUE",s,n,r),l=null;break}l=l<<6|c&63,s++}if(l!==null){if(l>1114111){s+=e("OUT_OF_RANGE",s-1-o,n,r,l);continue}if(l>=55296&&l<=57343){s+=e("UTF16_SURROGATE",s-1-o,n,r,l);continue}if(l<=a){s+=e("OVERLONG",s-1-o,n,r,l);continue}r.push(l)}}return r}function Vi(t,e){$(typeof t=="string","invalid string value","str",t);let n=[];for(let r=0;r<t.length;r++){const s=t.charCodeAt(r);if(s<128)n.push(s);else if(s<2048)n.push(s>>6|192),n.push(s&63|128);else if((s&64512)==55296){r++;const i=t.charCodeAt(r);$(r<t.length&&(i&64512)===56320,"invalid surrogate pair","str",t);const o=65536+((s&1023)<<10)+(i&1023);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(s>>12|224),n.push(s>>6&63|128),n.push(s&63|128)}return new Uint8Array(n)}function dne(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Tc(t,e){return dne(fne(t,e))}function p4(t){async function e(n,r){ee(r==null||!r.cancelled,"request cancelled before sending","CANCELLED");const s=n.url.split(":")[0].toLowerCase();ee(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),ee(s==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let i=null;const o=new AbortController,a=setTimeout(()=>{i=Nt("request timeout","TIMEOUT"),o.abort()},n.timeout);r&&r.addListener(()=>{i=Nt("request cancelled","CANCELLED"),o.abort()});const l={method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:o.signal};let u;try{u=await fetch(n.url,l)}catch(h){throw clearTimeout(a),i||h}clearTimeout(a);const c={};u.headers.forEach((h,p)=>{c[p.toLowerCase()]=h});const f=await u.arrayBuffer(),d=f==null?null:new Uint8Array(f);return{statusCode:u.status,statusMessage:u.statusText,headers:c,body:d}}return e}const hne=12,pne=250;let m4=p4();const mne=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),gne=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let kx=!1;async function g4(t,e){try{const n=t.match(mne);if(!n)throw new Error("invalid data");return new Zo(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?one(n[3]):bne(n[3]))}catch{return new Zo(599,"BAD REQUEST (invalid data: URI)",{},null,new Kn(t))}}function y4(t){async function e(n,r){try{const s=n.match(gne);if(!s)throw new Error("invalid link");return new Kn(`${t}${s[2]}`)}catch{return new Zo(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Kn(n))}}return e}const Kg={data:g4,ipfs:y4("https://gateway.ipfs.io/ipfs/")},b4=new WeakMap;class yne{constructor(e){J(this,$l);J(this,ha);I(this,$l,[]),I(this,ha,!1),b4.set(e,()=>{if(!T(this,ha)){I(this,ha,!0);for(const n of T(this,$l))setTimeout(()=>{n()},0);I(this,$l,[])}})}addListener(e){ee(!T(this,ha),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),T(this,$l).push(e)}get cancelled(){return T(this,ha)}checkSignal(){ee(!this.cancelled,"cancelled","CANCELLED",{})}}$l=new WeakMap,ha=new WeakMap;function qg(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}const sb=class sb{constructor(e){J(this,ql);J(this,tf);J(this,nf);J(this,Os);J(this,ro);J(this,rf);J(this,sf);J(this,wn);J(this,Ir);J(this,so);J(this,Gl);J(this,Wl);J(this,Kl);J(this,hi);J(this,_s);J(this,pa);I(this,sf,String(e)),I(this,tf,!1),I(this,nf,!0),I(this,Os,{}),I(this,ro,""),I(this,rf,3e5),I(this,_s,{slotInterval:pne,maxAttempts:hne}),I(this,pa,null)}get url(){return T(this,sf)}set url(e){I(this,sf,String(e))}get body(){return T(this,wn)==null?null:new Uint8Array(T(this,wn))}set body(e){if(e==null)I(this,wn,void 0),I(this,Ir,void 0);else if(typeof e=="string")I(this,wn,Vi(e)),I(this,Ir,"text/plain");else if(e instanceof Uint8Array)I(this,wn,e),I(this,Ir,"application/octet-stream");else if(typeof e=="object")I(this,wn,Vi(JSON.stringify(e))),I(this,Ir,"application/json");else throw new Error("invalid body")}hasBody(){return T(this,wn)!=null}get method(){return T(this,ro)?T(this,ro):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),I(this,ro,String(e).toUpperCase())}get headers(){const e=Object.assign({},T(this,Os));return T(this,so)&&(e.authorization=`Basic ${ane(Vi(T(this,so)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&T(this,Ir)&&(e["content-type"]=T(this,Ir)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,n){T(this,Os)[String(e).toLowerCase()]=String(n)}clearHeaders(){I(this,Os,{})}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r<n.length){const s=n[r++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return T(this,so)||null}setCredentials(e,n){$(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),I(this,so,`${e}:${n}`)}get allowGzip(){return T(this,nf)}set allowGzip(e){I(this,nf,!!e)}get allowInsecureAuthentication(){return!!T(this,tf)}set allowInsecureAuthentication(e){I(this,tf,!!e)}get timeout(){return T(this,rf)}set timeout(e){$(e>=0,"timeout must be non-zero","timeout",e),I(this,rf,e)}get preflightFunc(){return T(this,Gl)||null}set preflightFunc(e){I(this,Gl,e)}get processFunc(){return T(this,Wl)||null}set processFunc(e){I(this,Wl,e)}get retryFunc(){return T(this,Kl)||null}set retryFunc(e){I(this,Kl,e)}get getUrlFunc(){return T(this,pa)||m4}set getUrlFunc(e){I(this,pa,e)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${T(this,wn)?we(T(this,wn)):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(T(this,_s).slotInterval=e.slotInterval),e.maxAttempts!=null&&(T(this,_s).maxAttempts=e.maxAttempts)}send(){return ee(T(this,hi)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),I(this,hi,new yne(this)),fe(this,ql,Op).call(this,0,w4()+this.timeout,0,this,new Zo(0,"",{},null,this))}cancel(){ee(T(this,hi)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=b4.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const n=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();ee(this.method==="GET"&&(n!=="https"||r!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const s=new sb(e);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,I(s,Os,Object.assign({},T(this,Os))),T(this,wn)&&I(s,wn,new Uint8Array(T(this,wn))),I(s,Ir,T(this,Ir)),s}clone(){const e=new sb(this.url);return I(e,ro,T(this,ro)),T(this,wn)&&I(e,wn,T(this,wn)),I(e,Ir,T(this,Ir)),I(e,Os,Object.assign({},T(this,Os))),I(e,so,T(this,so)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),I(e,Gl,T(this,Gl)),I(e,Wl,T(this,Wl)),I(e,Kl,T(this,Kl)),I(e,_s,Object.assign({},T(this,_s))),I(e,pa,T(this,pa)),e}static lockConfig(){kx=!0}static getGateway(e){return Kg[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(kx)throw new Error("gateways locked");Kg[e]=n}static registerGetUrl(e){if(kx)throw new Error("gateways locked");m4=e}static createGetUrlFunc(e){return p4()}static createDataGateway(){return g4}static createIpfsGatewayFunc(e){return y4(e)}};tf=new WeakMap,nf=new WeakMap,Os=new WeakMap,ro=new WeakMap,rf=new WeakMap,sf=new WeakMap,wn=new WeakMap,Ir=new WeakMap,so=new WeakMap,Gl=new WeakMap,Wl=new WeakMap,Kl=new WeakMap,hi=new WeakMap,_s=new WeakMap,pa=new WeakMap,ql=new WeakSet,Op=async function(e,n,r,s,i){var c,f,d;if(e>=T(this,_s).maxAttempts)return i.makeServerError("exceeded maximum retry limit");ee(w4()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),r>0&&await wne(r);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in Kg){const h=await Kg[a](o.url,qg(T(s,hi)));if(h instanceof Zo){let p=h;if(this.processFunc){qg(T(s,hi));try{p=await this.processFunc(o,p)}catch(m){(m.throttle==null||typeof m.stall!="number")&&p.makeServerError("error in post-processing function",m).assertOk()}}return p}o=h}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,qg(T(s,hi)));let u=new Zo(l.statusCode,l.statusMessage,l.headers,l.body,s);if(u.statusCode===301||u.statusCode===302){try{const h=u.headers.location||"";return fe(c=o.redirect(h),ql,Op).call(c,e+1,n,0,s,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,u,e))){const h=u.headers["retry-after"];let p=T(this,_s).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof h=="string"&&h.match(/^[1-9][0-9]*$/)&&(p=parseInt(h)),fe(f=o.clone(),ql,Op).call(f,e+1,n,p,s,u)}if(this.processFunc){qg(T(s,hi));try{u=await this.processFunc(o,u)}catch(h){(h.throttle==null||typeof h.stall!="number")&&u.makeServerError("error in post-processing function",h).assertOk();let p=T(this,_s).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return h.stall>=0&&(p=h.stall),fe(d=o.clone(),ql,Op).call(d,e+1,n,p,s,u)}}return u};let Kn=sb;const Hk=class Hk{constructor(e,n,r,s,i){J(this,hp);J(this,pp);J(this,mp);J(this,Lr);J(this,of);J(this,Ql);I(this,hp,e),I(this,pp,n),I(this,mp,Object.keys(r).reduce((o,a)=>(o[a.toLowerCase()]=String(r[a]),o),{})),I(this,Lr,s==null?null:new Uint8Array(s)),I(this,of,i||null),I(this,Ql,{message:""})}toString(){return`<FetchResponse status=${this.statusCode} body=${T(this,Lr)?we(T(this,Lr)):"null"}>`}get statusCode(){return T(this,hp)}get statusMessage(){return T(this,pp)}get headers(){return Object.assign({},T(this,mp))}get body(){return T(this,Lr)==null?null:new Uint8Array(T(this,Lr))}get bodyText(){try{return T(this,Lr)==null?"":Tc(T(this,Lr))}catch{ee(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{ee(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r<n.length){const s=n[r++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}makeServerError(e,n){let r;e?r=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,r=`CLIENT ESCALATED SERVER ERROR (${e})`);const s=new Hk(599,r,this.headers,this.body,T(this,of)||void 0);return I(s,Ql,{message:e,error:n}),s}throwThrottleError(e,n){n==null?n=-1:$(Number.isInteger(n)&&n>=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw Oe(r,{stall:n,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return T(this,Lr)!=null}get request(){return T(this,of)}ok(){return T(this,Ql).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:n}=T(this,Ql);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let s=null;try{T(this,Lr)&&(s=Tc(T(this,Lr)))}catch{}ee(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n,info:{requestUrl:r,responseBody:s,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};hp=new WeakMap,pp=new WeakMap,mp=new WeakMap,Lr=new WeakMap,of=new WeakMap,Ql=new WeakMap;let Zo=Hk;function w4(){return new Date().getTime()}function bne(t){return Vi(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function wne(t){return new Promise(e=>setTimeout(e,t))}function Ane(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function A4(t,e,n){let r=0;for(let s=0;s<n;s++)r=r*256+t[e+s];return r}function v4(t,e,n,r){const s=[];for(;n<e+1+r;){const i=x4(t,n);s.push(i.result),n+=i.consumed,ee(n<=e+1+r,"child data too short","BUFFER_OVERRUN",{buffer:t,length:r,offset:e})}return{consumed:1+r,result:s}}function x4(t,e){ee(t.length!==0,"data too short","BUFFER_OVERRUN",{buffer:t,length:0,offset:1});const n=r=>{ee(r<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:r})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const s=A4(t,e+1,r);return n(e+1+r+s),v4(t,e,e+1+r,r+s)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),v4(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const s=A4(t,e+1,r);n(e+1+r+s);const i=we(t.slice(e+1+r,e+1+r+s));return{consumed:1+r+s,result:i}}else if(t[e]>=128){const r=t[e]-128;n(e+1+r);const s=we(t.slice(e+1,e+1+r));return{consumed:1+r,result:s}}return{consumed:1,result:Ane(t[e])}}function Qg(t){const e=ct(t,"data"),n=x4(e,0);return $(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function k4(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function E4(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(i){r=r.concat(E4(i))}),r.length<=55)return r.unshift(192+r.length),r;const s=k4(r.length);return s.unshift(247+s.length),s.concat(r)}const e=Array.prototype.slice.call(ct(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=k4(e.length);return n.unshift(183+n.length),n.concat(e)}const C4="0123456789abcdef";function El(t){let e="0x";for(const n of E4(t))e+=C4[n>>4],e+=C4[n&15];return e}const qn=32,Ex=new Uint8Array(qn),vne=["then"],Jg={},S4=new WeakMap;function Cl(t){return S4.get(t)}function T4(t,e){S4.set(t,e)}function _h(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw n.error=e,n}function Cx(t,e,n){return t.indexOf(null)>=0?e.map((r,s)=>r instanceof Dc?Cx(Cl(r),r,n):r):t.reduce((r,s,i)=>{let o=e.getValue(s);return s in r||(n&&o instanceof Dc&&(o=Cx(Cl(o),o,n)),r[s]=o),r},{})}const lf=class lf extends Array{constructor(...n){const r=n[0];let s=n[1],i=(n[2]||[]).slice(),o=!0;r!==Jg&&(s=n,i=[],o=!1);super(s.length);J(this,af);s.forEach((u,c)=>{this[c]=u});const a=i.reduce((u,c)=>(typeof c=="string"&&u.set(c,(u.get(c)||0)+1),u),new Map);if(T4(this,Object.freeze(s.map((u,c)=>{const f=i[c];return f!=null&&a.get(f)===1?f:null}))),I(this,af,[]),T(this,af)==null&&T(this,af),!o)return;Object.freeze(this);const l=new Proxy(this,{get:(u,c,f)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const h=Qe(c,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");const p=u[h];return p instanceof Error&&_h(`index ${h}`,p),p}if(vne.indexOf(c)>=0)return Reflect.get(u,c,f);const d=u[c];if(d instanceof Function)return function(...h){return d.apply(this===f?u:this,h)};if(!(c in u))return u.getValue.apply(this===f?u:this,[c])}return Reflect.get(u,c,f)}});return T4(l,Cl(this)),l}toArray(n){const r=[];return this.forEach((s,i)=>{s instanceof Error&&_h(`index ${i}`,s),n&&s instanceof lf&&(s=s.toArray(n)),r.push(s)}),r}toObject(n){const r=Cl(this);return r.reduce((s,i,o)=>(ee(i!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),Cx(r,this,n)),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const s=Cl(this),i=[],o=[];for(let a=n;a<r;a++)i.push(this[a]),o.push(s[a]);return new lf(Jg,i,o)}filter(n,r){const s=Cl(this),i=[],o=[];for(let a=0;a<this.length;a++){const l=this[a];l instanceof Error&&_h(`index ${a}`,l),n.call(r,l,a,this)&&(i.push(l),o.push(s[a]))}return new lf(Jg,i,o)}map(n,r){const s=[];for(let i=0;i<this.length;i++){const o=this[i];o instanceof Error&&_h(`index ${i}`,o),s.push(n.call(r,o,i,this))}return s}getValue(n){const r=Cl(this).indexOf(n);if(r===-1)return;const s=this[r];return s instanceof Error&&_h(`property ${JSON.stringify(n)}`,s.error),s}static fromItems(n,r){return new lf(Jg,n,r)}};af=new WeakMap;let Dc=lf;function D4(t){let e=Wn(t);return ee(e.length<=qn,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:qn,offset:e.length}),e.length!==qn&&(e=Gn($t([Ex.slice(e.length%qn),e]))),e}class Hi{constructor(e,n,r,s){W(this,"name");W(this,"type");W(this,"localName");W(this,"dynamic");Oe(this,{name:e,type:n,localName:r,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,n){$(!1,e,this.localName,n)}}class Sx{constructor(){J(this,uf);J(this,io);J(this,Jl);I(this,io,[]),I(this,Jl,0)}get data(){return $t(T(this,io))}get length(){return T(this,Jl)}appendWriter(e){return fe(this,uf,fb).call(this,Gn(e.data))}writeBytes(e){let n=Gn(e);const r=n.length%qn;return r&&(n=Gn($t([n,Ex.slice(r)]))),fe(this,uf,fb).call(this,n)}writeValue(e){return fe(this,uf,fb).call(this,D4(e))}writeUpdatableValue(){const e=T(this,io).length;return T(this,io).push(Ex),I(this,Jl,T(this,Jl)+qn),n=>{T(this,io)[e]=D4(n)}}}io=new WeakMap,Jl=new WeakMap,uf=new WeakSet,fb=function(e){return T(this,io).push(e),I(this,Jl,T(this,Jl)+e.length),e.length};const zk=class zk{constructor(e,n,r){J(this,Zl);W(this,"allowLoose");J(this,pr);J(this,Br);J(this,Yl);J(this,Xl);J(this,ma);Oe(this,{allowLoose:!!n}),I(this,pr,Gn(e)),I(this,Yl,0),I(this,Xl,null),I(this,ma,r??1024),I(this,Br,0)}get data(){return we(T(this,pr))}get dataLength(){return T(this,pr).length}get consumed(){return T(this,Br)}get bytes(){return new Uint8Array(T(this,pr))}subReader(e){const n=new zk(T(this,pr).slice(T(this,Br)+e),this.allowLoose,T(this,ma));return I(n,Xl,this),n}readBytes(e,n){let r=fe(this,Zl,qL).call(this,0,e,!!n);return fe(this,Zl,Xk).call(this,e),I(this,Br,T(this,Br)+r.length),r.slice(0,e)}readValue(){return xx(this.readBytes(qn))}readIndex(){return sne(this.readBytes(qn))}};pr=new WeakMap,Br=new WeakMap,Yl=new WeakMap,Xl=new WeakMap,ma=new WeakMap,Zl=new WeakSet,Xk=function(e){var n;if(T(this,Xl))return fe(n=T(this,Xl),Zl,Xk).call(n,e);I(this,Yl,T(this,Yl)+e),ee(T(this,ma)<1||T(this,Yl)<=T(this,ma)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${T(this,ma)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Gn(T(this,pr)),offset:T(this,Br),length:e,info:{bytesRead:T(this,Yl),dataLength:this.dataLength}})},qL=function(e,n,r){let s=Math.ceil(n/qn)*qn;return T(this,Br)+s>T(this,pr).length&&(this.allowLoose&&r&&T(this,Br)+n<=T(this,pr).length?s=n:ee(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Gn(T(this,pr)),length:T(this,pr).length,offset:T(this,Br)+s})),T(this,pr).slice(T(this,Br),T(this,Br)+s)};let Tx=zk;function Yg(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function Dx(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 xne(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Yg(t.outputLen),Yg(t.blockLen)}function Oc(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 O4(t,e){Dx(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const Ox=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _4=t=>t instanceof Uint8Array,kne=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),_x=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ui=(t,e)=>t<<32-e|t>>>e;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");function Ene(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Xg(t){if(typeof t=="string"&&(t=Ene(t)),!_4(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function Cne(...t){const e=new Uint8Array(t.reduce((r,s)=>r+s.length,0));let n=0;return t.forEach(r=>{if(!_4(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}class Mx{clone(){return this._cloneInto()}}function Nx(t){const e=r=>t().update(Xg(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function Sne(t=32){if(Ox&&typeof Ox.getRandomValues=="function")return Ox.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class M4 extends Mx{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,xne(e);const r=Xg(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(r.length>s?e.create().update(r).digest():r);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),i.fill(0)}update(e){return Oc(this),this.iHash.update(e),this}digestInto(e){Oc(this),Dx(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:i,blockLen:o,outputLen:a}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const N4=(t,e,n)=>new M4(t,e).update(n).digest();N4.create=(t,e)=>new M4(t,e);function Tne(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(n>>s&i),a=Number(n&i),l=r?4:0,u=r?0:4;t.setUint32(e+l,o,r),t.setUint32(e+u,a,r)}class R4 extends Mx{constructor(e,n,r,s){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=_x(this.buffer)}update(e){Oc(this);const{view:n,buffer:r,blockLen:s}=this;e=Xg(e);const i=e.length;for(let o=0;o<i;){const a=Math.min(s-this.pos,i-o);if(a===s){const l=_x(e);for(;s<=i-o;o+=s)this.process(l,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Oc(this),O4(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:i}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let f=o;f<s;f++)n[f]=0;Tne(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=_x(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,c=this.get();if(u>c.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)a.setUint32(4*f,c[f],i)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:i,destroyed:o,pos:a}=this;return e.length=s,e.pos=a,e.finished=i,e.destroyed=o,s%n&&e.buffer.set(r),e}}const Dne=(t,e,n)=>t&e^~t&n,One=(t,e,n)=>t&e^t&n^e&n,_ne=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ea=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ta=new Uint32Array(64);class Mne extends R4{constructor(){super(64,32,8,!1),this.A=ea[0]|0,this.B=ea[1]|0,this.C=ea[2]|0,this.D=ea[3]|0,this.E=ea[4]|0,this.F=ea[5]|0,this.G=ea[6]|0,this.H=ea[7]|0}get(){const{A:e,B:n,C:r,D:s,E:i,F:o,G:a,H:l}=this;return[e,n,r,s,i,o,a,l]}set(e,n,r,s,i,o,a,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)ta[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const d=ta[f-15],h=ta[f-2],p=ui(d,7)^ui(d,18)^d>>>3,m=ui(h,17)^ui(h,19)^h>>>10;ta[f]=m+ta[f-7]+p+ta[f-16]|0}let{A:r,B:s,C:i,D:o,E:a,F:l,G:u,H:c}=this;for(let f=0;f<64;f++){const d=ui(a,6)^ui(a,11)^ui(a,25),h=c+d+Dne(a,l,u)+_ne[f]+ta[f]|0,m=(ui(r,2)^ui(r,13)^ui(r,22))+One(r,s,i)|0;c=u,u=l,l=a,a=o+h|0,o=i,i=s,s=r,r=h+m|0}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,s,i,o,a,l,u,c)}roundClean(){ta.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const P4=Nx(()=>new Mne),Zg=BigInt(2**32-1),Rx=BigInt(32);function I4(t,e=!1){return e?{h:Number(t&Zg),l:Number(t>>Rx&Zg)}:{h:Number(t>>Rx&Zg)|0,l:Number(t&Zg)|0}}function L4(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let s=0;s<t.length;s++){const{h:i,l:o}=I4(t[s],e);[n[s],r[s]]=[i,o]}return[n,r]}const Nne=(t,e)=>BigInt(t>>>0)<<Rx|BigInt(e>>>0),Rne=(t,e,n)=>t>>>n,Pne=(t,e,n)=>t<<32-n|e>>>n,Ine=(t,e,n)=>t>>>n|e<<32-n,Lne=(t,e,n)=>t<<32-n|e>>>n,Bne=(t,e,n)=>t<<64-n|e>>>n-32,Fne=(t,e,n)=>t>>>n-32|e<<64-n,jne=(t,e)=>e,Une=(t,e)=>t,B4=(t,e,n)=>t<<n|e>>>32-n,F4=(t,e,n)=>e<<n|t>>>32-n,j4=(t,e,n)=>e<<n-32|t>>>64-n,U4=(t,e,n)=>t<<n-32|e>>>64-n;function Vne(t,e,n,r){const s=(e>>>0)+(r>>>0);return{h:t+n+(s/2**32|0)|0,l:s|0}}const Ze={fromBig:I4,split:L4,toBig:Nne,shrSH:Rne,shrSL:Pne,rotrSH:Ine,rotrSL:Lne,rotrBH:Bne,rotrBL:Fne,rotr32H:jne,rotr32L:Une,rotlSH:B4,rotlSL:F4,rotlBH:j4,rotlBL:U4,add:Vne,add3L:(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),add3H:(t,e,n,r)=>e+n+r+(t/2**32|0)|0,add4L:(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),add4H:(t,e,n,r,s)=>e+n+r+s+(t/2**32|0)|0,add5H:(t,e,n,r,s,i)=>e+n+r+s+i+(t/2**32|0)|0,add5L:(t,e,n,r,s)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(s>>>0)},[Hne,zne]=Ze.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),na=new Uint32Array(80),ra=new Uint32Array(80);class $ne extends R4{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:r,Bl:s,Ch:i,Cl:o,Dh:a,Dl:l,Eh:u,El:c,Fh:f,Fl:d,Gh:h,Gl:p,Hh:m,Hl:g}=this;return[e,n,r,s,i,o,a,l,u,c,f,d,h,p,m,g]}set(e,n,r,s,i,o,a,l,u,c,f,d,h,p,m,g){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=s|0,this.Ch=i|0,this.Cl=o|0,this.Dh=a|0,this.Dl=l|0,this.Eh=u|0,this.El=c|0,this.Fh=f|0,this.Fl=d|0,this.Gh=h|0,this.Gl=p|0,this.Hh=m|0,this.Hl=g|0}process(e,n){for(let w=0;w<16;w++,n+=4)na[w]=e.getUint32(n),ra[w]=e.getUint32(n+=4);for(let w=16;w<80;w++){const A=na[w-15]|0,x=ra[w-15]|0,k=Ze.rotrSH(A,x,1)^Ze.rotrSH(A,x,8)^Ze.shrSH(A,x,7),C=Ze.rotrSL(A,x,1)^Ze.rotrSL(A,x,8)^Ze.shrSL(A,x,7),O=na[w-2]|0,_=ra[w-2]|0,D=Ze.rotrSH(O,_,19)^Ze.rotrBH(O,_,61)^Ze.shrSH(O,_,6),R=Ze.rotrSL(O,_,19)^Ze.rotrBL(O,_,61)^Ze.shrSL(O,_,6),L=Ze.add4L(C,R,ra[w-7],ra[w-16]),F=Ze.add4H(L,k,D,na[w-7],na[w-16]);na[w]=F|0,ra[w]=L|0}let{Ah:r,Al:s,Bh:i,Bl:o,Ch:a,Cl:l,Dh:u,Dl:c,Eh:f,El:d,Fh:h,Fl:p,Gh:m,Gl:g,Hh:y,Hl:v}=this;for(let w=0;w<80;w++){const A=Ze.rotrSH(f,d,14)^Ze.rotrSH(f,d,18)^Ze.rotrBH(f,d,41),x=Ze.rotrSL(f,d,14)^Ze.rotrSL(f,d,18)^Ze.rotrBL(f,d,41),k=f&h^~f&m,C=d&p^~d&g,O=Ze.add5L(v,x,C,zne[w],ra[w]),_=Ze.add5H(O,y,A,k,Hne[w],na[w]),D=O|0,R=Ze.rotrSH(r,s,28)^Ze.rotrBH(r,s,34)^Ze.rotrBH(r,s,39),L=Ze.rotrSL(r,s,28)^Ze.rotrBL(r,s,34)^Ze.rotrBL(r,s,39),F=r&i^r&a^i&a,G=s&o^s&l^o&l;y=m|0,v=g|0,m=h|0,g=p|0,h=f|0,p=d|0,{h:f,l:d}=Ze.add(u|0,c|0,_|0,D|0),u=a|0,c=l|0,a=i|0,l=o|0,i=r|0,o=s|0;const B=Ze.add3L(D,L,G);r=Ze.add3H(B,_,R,F),s=B|0}({h:r,l:s}=Ze.add(this.Ah|0,this.Al|0,r|0,s|0)),{h:i,l:o}=Ze.add(this.Bh|0,this.Bl|0,i|0,o|0),{h:a,l}=Ze.add(this.Ch|0,this.Cl|0,a|0,l|0),{h:u,l:c}=Ze.add(this.Dh|0,this.Dl|0,u|0,c|0),{h:f,l:d}=Ze.add(this.Eh|0,this.El|0,f|0,d|0),{h,l:p}=Ze.add(this.Fh|0,this.Fl|0,h|0,p|0),{h:m,l:g}=Ze.add(this.Gh|0,this.Gl|0,m|0,g|0),{h:y,l:v}=Ze.add(this.Hh|0,this.Hl|0,y|0,v|0),this.set(r,s,i,o,a,l,u,c,f,d,h,p,m,g,y,v)}roundClean(){na.fill(0),ra.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Gne=Nx(()=>new $ne);function Wne(){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 V4=Wne();V4.crypto||V4.msCrypto;function Kne(t){switch(t){case"sha256":return P4.create();case"sha512":return Gne.create()}$(!1,"invalid hashing algorithm name","algorithm",t)}const[H4,z4,$4]=[[],[],[]],qne=BigInt(0),Mh=BigInt(1),Qne=BigInt(2),Jne=BigInt(7),Yne=BigInt(256),Xne=BigInt(113);for(let t=0,e=Mh,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],H4.push(2*(5*r+n)),z4.push((t+1)*(t+2)/2%64);let s=qne;for(let i=0;i<7;i++)e=(e<<Mh^(e>>Jne)*Xne)%Yne,e&Qne&&(s^=Mh<<(Mh<<BigInt(i))-Mh);$4.push(s)}const[Zne,ere]=L4($4,!0),G4=(t,e,n)=>n>32?j4(t,e,n):B4(t,e,n),W4=(t,e,n)=>n>32?U4(t,e,n):F4(t,e,n);function tre(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[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,l=(o+2)%10,u=n[l],c=n[l+1],f=G4(u,c,1)^n[a],d=W4(u,c,1)^n[a+1];for(let h=0;h<50;h+=10)t[o+h]^=f,t[o+h+1]^=d}let s=t[2],i=t[3];for(let o=0;o<24;o++){const a=z4[o],l=G4(s,i,a),u=W4(s,i,a),c=H4[o];s=t[c],i=t[c+1],t[c]=l,t[c+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=Zne[r],t[1]^=ere[r]}n.fill(0)}class Px extends Mx{constructor(e,n,r,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Yg(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=kne(this.state)}keccak(){tre(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Oc(this);const{blockLen:n,state:r}=this;e=Xg(e);const s=e.length;for(let i=0;i<s;){const o=Math.min(n-this.pos,s-i);for(let a=0;a<o;a++)r[this.pos++]^=e[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:s}=this;e[r]^=n,n&128&&r===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){Oc(this,!1),Dx(e),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,i=e.length;s<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-s);e.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=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 Yg(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(O4(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:n,suffix:r,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new Px(n,r,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}}const nre=((t,e,n)=>Nx(()=>new Px(e,t,n)))(1,136,256/8);let K4=!1;const q4=function(t){return nre(t)};let Q4=q4;function en(t){const e=ct(t,"data");return we(Q4(e))}en._=q4,en.lock=function(){K4=!0},en.register=function(t){if(K4)throw new TypeError("keccak256 is locked");Q4=t},Object.freeze(en);const J4=function(t){return Kne("sha256").update(t).digest()};let Y4=J4,X4=!1;function _c(t){const e=ct(t,"data");return we(Y4(e))}_c._=J4,_c.lock=function(){X4=!0},_c.register=function(t){if(X4)throw new Error("sha256 is locked");Y4=t},Object.freeze(_c),Object.freeze(_c);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Z4=BigInt(0),ey=BigInt(1),rre=BigInt(2),ty=t=>t instanceof Uint8Array,sre=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Mc(t){if(!ty(t))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=sre[t[n]];return e}function eR(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function Ix(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function Nc(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(e/2);for(let r=0;r<n.length;r++){const s=r*2,i=t.slice(s,s+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");n[r]=o}return n}function Sl(t){return Ix(Mc(t))}function Lx(t){if(!ty(t))throw new Error("Uint8Array expected");return Ix(Mc(Uint8Array.from(t).reverse()))}function Rc(t,e){return Nc(t.toString(16).padStart(e*2,"0"))}function Bx(t,e){return Rc(t,e).reverse()}function ire(t){return Nc(eR(t))}function Cs(t,e,n){let r;if(typeof e=="string")try{r=Nc(e)}catch(i){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${i}`)}else if(ty(e))r=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(`${t} expected ${n} bytes, got ${s}`);return r}function Nh(...t){const e=new Uint8Array(t.reduce((r,s)=>r+s.length,0));let n=0;return t.forEach(r=>{if(!ty(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function ore(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function are(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function lre(t){let e;for(e=0;t>Z4;t>>=ey,e+=1);return e}function ure(t,e){return t>>BigInt(e)&ey}const cre=(t,e,n)=>t|(n?ey:Z4)<<BigInt(e),Fx=t=>(rre<<BigInt(t-1))-ey,jx=t=>new Uint8Array(t),tR=t=>Uint8Array.from(t);function nR(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=jx(t),s=jx(t),i=0;const o=()=>{r.fill(1),s.fill(0),i=0},a=(...f)=>n(s,r,...f),l=(f=jx())=>{s=a(tR([0]),f),r=a(),f.length!==0&&(s=a(tR([1]),f),r=a())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f<e;){r=a();const h=r.slice();d.push(h),f+=r.length}return Nh(...d)};return(f,d)=>{o(),l(f);let h;for(;!(h=d(u()));)l();return o(),h}}const fre={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Rh(t,e,n={}){const r=(s,i,o)=>{const a=fre[i];if(typeof a!="function")throw new Error(`Invalid validator "${i}", expected function`);const l=t[s];if(!(o&&l===void 0)&&!a(l,t))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${i}`)};for(const[s,i]of Object.entries(e))r(s,i,!1);for(const[s,i]of Object.entries(n))r(s,i,!0);return t}const dre=Object.freeze(Object.defineProperty({__proto__:null,bitGet:ure,bitLen:lre,bitMask:Fx,bitSet:cre,bytesToHex:Mc,bytesToNumberBE:Sl,bytesToNumberLE:Lx,concatBytes:Nh,createHmacDrbg:nR,ensureBytes:Cs,equalBytes:ore,hexToBytes:Nc,hexToNumber:Ix,numberToBytesBE:Rc,numberToBytesLE:Bx,numberToHexUnpadded:eR,numberToVarBytesBE:ire,utf8ToBytes:are,validateObject:Rh},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const yn=BigInt(0),Gt=BigInt(1),Tl=BigInt(2),hre=BigInt(3),Ux=BigInt(4),rR=BigInt(5),sR=BigInt(8);BigInt(9),BigInt(16);function fr(t,e){const n=t%e;return n>=yn?n:e+n}function pre(t,e,n){if(n<=yn||e<yn)throw new Error("Expected power/modulo > 0");if(n===Gt)return yn;let r=Gt;for(;e>yn;)e&Gt&&(r=r*t%n),t=t*t%n,e>>=Gt;return r}function Xr(t,e,n){let r=t;for(;e-- >yn;)r*=r,r%=n;return r}function Vx(t,e){if(t===yn||e<=yn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=fr(t,e),r=e,s=yn,i=Gt;for(;n!==yn;){const a=r/n,l=r%n,u=s-i*a;r=n,n=l,s=i,i=u}if(r!==Gt)throw new Error("invert: does not exist");return fr(s,e)}function mre(t){const e=(t-Gt)/Tl;let n,r,s;for(n=t-Gt,r=0;n%Tl===yn;n/=Tl,r++);for(s=Tl;s<t&&pre(s,e,t)!==t-Gt;s++);if(r===1){const o=(t+Gt)/Ux;return function(l,u){const c=l.pow(u,o);if(!l.eql(l.sqr(c),u))throw new Error("Cannot find square root");return c}}const i=(n+Gt)/Tl;return function(a,l){if(a.pow(l,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=r,c=a.pow(a.mul(a.ONE,s),n),f=a.pow(l,i),d=a.pow(l,n);for(;!a.eql(d,a.ONE);){if(a.eql(d,a.ZERO))return a.ZERO;let h=1;for(let m=a.sqr(d);h<u&&!a.eql(m,a.ONE);h++)m=a.sqr(m);const p=a.pow(c,Gt<<BigInt(u-h-1));c=a.sqr(p),f=a.mul(f,p),d=a.mul(d,c),u=h}return f}}function gre(t){if(t%Ux===hre){const e=(t+Gt)/Ux;return function(r,s){const i=r.pow(s,e);if(!r.eql(r.sqr(i),s))throw new Error("Cannot find square root");return i}}if(t%sR===rR){const e=(t-rR)/sR;return function(r,s){const i=r.mul(s,Tl),o=r.pow(i,e),a=r.mul(s,o),l=r.mul(r.mul(a,Tl),o),u=r.mul(a,r.sub(l,r.ONE));if(!r.eql(r.sqr(u),s))throw new Error("Cannot find square root");return u}}return mre(t)}const yre=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function bre(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=yre.reduce((r,s)=>(r[s]="function",r),e);return Rh(t,n)}function wre(t,e,n){if(n<yn)throw new Error("Expected power > 0");if(n===yn)return t.ONE;if(n===Gt)return e;let r=t.ONE,s=e;for(;n>yn;)n&Gt&&(r=t.mul(r,s)),s=t.sqr(s),n>>=Gt;return r}function Are(t,e){const n=new Array(e.length),r=e.reduce((i,o,a)=>t.is0(o)?i:(n[a]=i,t.mul(i,o)),t.ONE),s=t.inv(r);return e.reduceRight((i,o,a)=>t.is0(o)?i:(n[a]=t.mul(i,n[a]),t.mul(i,o)),s),n}function iR(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function vre(t,e,n=!1,r={}){if(t<=yn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:s,nByteLength:i}=iR(t,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=gre(t),a=Object.freeze({ORDER:t,BITS:s,BYTES:i,MASK:Fx(s),ZERO:yn,ONE:Gt,create:l=>fr(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return yn<=l&&l<t},is0:l=>l===yn,isOdd:l=>(l&Gt)===Gt,neg:l=>fr(-l,t),eql:(l,u)=>l===u,sqr:l=>fr(l*l,t),add:(l,u)=>fr(l+u,t),sub:(l,u)=>fr(l-u,t),mul:(l,u)=>fr(l*u,t),pow:(l,u)=>wre(a,l,u),div:(l,u)=>fr(l*Vx(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Vx(l,t),sqrt:r.sqrt||(l=>o(a,l)),invertBatch:l=>Are(a,l),cmov:(l,u,c)=>c?u:l,toBytes:l=>n?Bx(l,i):Rc(l,i),fromBytes:l=>{if(l.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${l.length}`);return n?Lx(l):Sl(l)}});return Object.freeze(a)}function oR(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function aR(t){const e=oR(t);return e+Math.ceil(e/2)}function xre(t,e,n=!1){const r=t.length,s=oR(e),i=aR(e);if(r<16||r<i||r>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);const o=n?Sl(t):Lx(t),a=fr(o,e-Gt)+Gt;return n?Bx(a,s):Rc(a,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const kre=BigInt(0),Hx=BigInt(1);function Ere(t,e){const n=(s,i)=>{const o=i.negate();return s?o:i},r=s=>{const i=Math.ceil(e/s)+1,o=2**(s-1);return{windows:i,windowSize:o}};return{constTimeNegate:n,unsafeLadder(s,i){let o=t.ZERO,a=s;for(;i>kre;)i&Hx&&(o=o.add(a)),a=a.double(),i>>=Hx;return o},precomputeWindow(s,i){const{windows:o,windowSize:a}=r(i),l=[];let u=s,c=u;for(let f=0;f<o;f++){c=u,l.push(c);for(let d=1;d<a;d++)c=c.add(u),l.push(c);u=c.double()}return l},wNAF(s,i,o){const{windows:a,windowSize:l}=r(s);let u=t.ZERO,c=t.BASE;const f=BigInt(2**s-1),d=2**s,h=BigInt(s);for(let p=0;p<a;p++){const m=p*l;let g=Number(o&f);o>>=h,g>l&&(g-=d,o+=Hx);const y=m,v=m+Math.abs(g)-1,w=p%2!==0,A=g<0;g===0?c=c.add(n(w,i[y])):u=u.add(n(A,i[v]))}return{p:u,f:c}},wNAFCached(s,i,o,a){const l=s._WINDOW_SIZE||1;let u=i.get(s);return u||(u=this.precomputeWindow(s,l),l!==1&&i.set(s,a(u))),this.wNAF(l,u,o)}}}function lR(t){return bre(t.Fp),Rh(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...iR(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Cre(t){const e=lR(t);Rh(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=e;if(n){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:Sre,hexToBytes:Tre}=dre,Dl={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Dl;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:Sre(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=Dl,n=typeof t=="string"?Tre(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:s,l:i}=Dl._parseInt(n.subarray(2)),{d:o,l:a}=Dl._parseInt(i);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const c=u.toString(16);return c.length&1?`0${c}`:c},r=e(n(t.s)),s=e(n(t.r)),i=r.length/2,o=s.length/2,a=n(i),l=n(o);return`30${n(o+i+4)}02${l}${s}02${a}${r}`}},zi=BigInt(0),Zr=BigInt(1);BigInt(2);const uR=BigInt(3);BigInt(4);function Dre(t){const e=Cre(t),{Fp:n}=e,r=e.toBytes||((p,m,g)=>{const y=m.toAffine();return Nh(Uint8Array.from([4]),n.toBytes(y.x),n.toBytes(y.y))}),s=e.fromBytes||(p=>{const m=p.subarray(1),g=n.fromBytes(m.subarray(0,n.BYTES)),y=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x:g,y}});function i(p){const{a:m,b:g}=e,y=n.sqr(p),v=n.mul(y,p);return n.add(n.add(v,n.mul(p,m)),g)}if(!n.eql(n.sqr(e.Gy),i(e.Gx)))throw new Error("bad generator point: equation left != right");function o(p){return typeof p=="bigint"&&zi<p&&p<e.n}function a(p){if(!o(p))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function l(p){const{allowedPrivateKeyLengths:m,nByteLength:g,wrapPrivateKey:y,n:v}=e;if(m&&typeof p!="bigint"){if(p instanceof Uint8Array&&(p=Mc(p)),typeof p!="string"||!m.includes(p.length))throw new Error("Invalid key");p=p.padStart(g*2,"0")}let w;try{w=typeof p=="bigint"?p:Sl(Cs("private key",p,g))}catch{throw new Error(`private key must be ${g} bytes, hex or bigint, not ${typeof p}`)}return y&&(w=fr(w,v)),a(w),w}const u=new Map;function c(p){if(!(p instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(m,g,y){if(this.px=m,this.py=g,this.pz=y,m==null||!n.isValid(m))throw new Error("x required");if(g==null||!n.isValid(g))throw new Error("y required");if(y==null||!n.isValid(y))throw new Error("z required")}static fromAffine(m){const{x:g,y}=m||{};if(!m||!n.isValid(g)||!n.isValid(y))throw new Error("invalid affine point");if(m instanceof f)throw new Error("projective point not allowed");const v=w=>n.eql(w,n.ZERO);return v(g)&&v(y)?f.ZERO:new f(g,y,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const g=n.invertBatch(m.map(y=>y.pz));return m.map((y,v)=>y.toAffine(g[v])).map(f.fromAffine)}static fromHex(m){const g=f.fromAffine(s(Cs("pointHex",m)));return g.assertValidity(),g}static fromPrivateKey(m){return f.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:m,y:g}=this.toAffine();if(!n.isValid(m)||!n.isValid(g))throw new Error("bad point: x or y not FE");const y=n.sqr(g),v=i(m);if(!n.eql(y,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){c(m);const{px:g,py:y,pz:v}=this,{px:w,py:A,pz:x}=m,k=n.eql(n.mul(g,x),n.mul(w,v)),C=n.eql(n.mul(y,x),n.mul(A,v));return k&&C}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b:g}=e,y=n.mul(g,uR),{px:v,py:w,pz:A}=this;let x=n.ZERO,k=n.ZERO,C=n.ZERO,O=n.mul(v,v),_=n.mul(w,w),D=n.mul(A,A),R=n.mul(v,w);return R=n.add(R,R),C=n.mul(v,A),C=n.add(C,C),x=n.mul(m,C),k=n.mul(y,D),k=n.add(x,k),x=n.sub(_,k),k=n.add(_,k),k=n.mul(x,k),x=n.mul(R,x),C=n.mul(y,C),D=n.mul(m,D),R=n.sub(O,D),R=n.mul(m,R),R=n.add(R,C),C=n.add(O,O),O=n.add(C,O),O=n.add(O,D),O=n.mul(O,R),k=n.add(k,O),D=n.mul(w,A),D=n.add(D,D),O=n.mul(D,R),x=n.sub(x,O),C=n.mul(D,_),C=n.add(C,C),C=n.add(C,C),new f(x,k,C)}add(m){c(m);const{px:g,py:y,pz:v}=this,{px:w,py:A,pz:x}=m;let k=n.ZERO,C=n.ZERO,O=n.ZERO;const _=e.a,D=n.mul(e.b,uR);let R=n.mul(g,w),L=n.mul(y,A),F=n.mul(v,x),G=n.add(g,y),B=n.add(w,A);G=n.mul(G,B),B=n.add(R,L),G=n.sub(G,B),B=n.add(g,v);let H=n.add(w,x);return B=n.mul(B,H),H=n.add(R,F),B=n.sub(B,H),H=n.add(y,v),k=n.add(A,x),H=n.mul(H,k),k=n.add(L,F),H=n.sub(H,k),O=n.mul(_,B),k=n.mul(D,F),O=n.add(k,O),k=n.sub(L,O),O=n.add(L,O),C=n.mul(k,O),L=n.add(R,R),L=n.add(L,R),F=n.mul(_,F),B=n.mul(D,B),L=n.add(L,F),F=n.sub(R,F),F=n.mul(_,F),B=n.add(B,F),R=n.mul(L,B),C=n.add(C,R),R=n.mul(H,B),k=n.mul(G,k),k=n.sub(k,R),R=n.mul(G,L),O=n.mul(H,O),O=n.add(O,R),new f(k,C,O)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return h.wNAFCached(this,u,m,g=>{const y=n.invertBatch(g.map(v=>v.pz));return g.map((v,w)=>v.toAffine(y[w])).map(f.fromAffine)})}multiplyUnsafe(m){const g=f.ZERO;if(m===zi)return g;if(a(m),m===Zr)return this;const{endo:y}=e;if(!y)return h.unsafeLadder(this,m);let{k1neg:v,k1:w,k2neg:A,k2:x}=y.splitScalar(m),k=g,C=g,O=this;for(;w>zi||x>zi;)w&Zr&&(k=k.add(O)),x&Zr&&(C=C.add(O)),O=O.double(),w>>=Zr,x>>=Zr;return v&&(k=k.negate()),A&&(C=C.negate()),C=new f(n.mul(C.px,y.beta),C.py,C.pz),k.add(C)}multiply(m){a(m);let g=m,y,v;const{endo:w}=e;if(w){const{k1neg:A,k1:x,k2neg:k,k2:C}=w.splitScalar(g);let{p:O,f:_}=this.wNAF(x),{p:D,f:R}=this.wNAF(C);O=h.constTimeNegate(A,O),D=h.constTimeNegate(k,D),D=new f(n.mul(D.px,w.beta),D.py,D.pz),y=O.add(D),v=_.add(R)}else{const{p:A,f:x}=this.wNAF(g);y=A,v=x}return f.normalizeZ([y,v])[0]}multiplyAndAddUnsafe(m,g,y){const v=f.BASE,w=(x,k)=>k===zi||k===Zr||!x.equals(v)?x.multiplyUnsafe(k):x.multiply(k),A=w(this,g).add(w(m,y));return A.is0()?void 0:A}toAffine(m){const{px:g,py:y,pz:v}=this,w=this.is0();m==null&&(m=w?n.ONE:n.inv(v));const A=n.mul(g,m),x=n.mul(y,m),k=n.mul(v,m);if(w)return{x:n.ZERO,y:n.ZERO};if(!n.eql(k,n.ONE))throw new Error("invZ was invalid");return{x:A,y:x}}isTorsionFree(){const{h:m,isTorsionFree:g}=e;if(m===Zr)return!0;if(g)return g(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:g}=e;return m===Zr?this:g?g(f,this):this.multiplyUnsafe(e.h)}toRawBytes(m=!0){return this.assertValidity(),r(f,this,m)}toHex(m=!0){return Mc(this.toRawBytes(m))}}f.BASE=new f(e.Gx,e.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const d=e.nBitLength,h=Ere(f,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:i,isWithinCurveOrder:o}}function Ore(t){const e=lR(t);return Rh(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function _re(t){const e=Ore(t),{Fp:n,n:r}=e,s=n.BYTES+1,i=2*n.BYTES+1;function o(B){return zi<B&&B<n.ORDER}function a(B){return fr(B,r)}function l(B){return Vx(B,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:f,isWithinCurveOrder:d}=Dre({...e,toBytes(B,H,Q){const te=H.toAffine(),Z=n.toBytes(te.x),pe=Nh;return Q?pe(Uint8Array.from([H.hasEvenY()?2:3]),Z):pe(Uint8Array.from([4]),Z,n.toBytes(te.y))},fromBytes(B){const H=B.length,Q=B[0],te=B.subarray(1);if(H===s&&(Q===2||Q===3)){const Z=Sl(te);if(!o(Z))throw new Error("Point is not on curve");const pe=f(Z);let Ee=n.sqrt(pe);const Re=(Ee&Zr)===Zr;return(Q&1)===1!==Re&&(Ee=n.neg(Ee)),{x:Z,y:Ee}}else if(H===i&&Q===4){const Z=n.fromBytes(te.subarray(0,n.BYTES)),pe=n.fromBytes(te.subarray(n.BYTES,2*n.BYTES));return{x:Z,y:pe}}else throw new Error(`Point of length ${H} was invalid. Expected ${s} compressed bytes or ${i} uncompressed bytes`)}}),h=B=>Mc(Rc(B,e.nByteLength));function p(B){const H=r>>Zr;return B>H}function m(B){return p(B)?a(-B):B}const g=(B,H,Q)=>Sl(B.slice(H,Q));class y{constructor(H,Q,te){this.r=H,this.s=Q,this.recovery=te,this.assertValidity()}static fromCompact(H){const Q=e.nByteLength;return H=Cs("compactSignature",H,Q*2),new y(g(H,0,Q),g(H,Q,2*Q))}static fromDER(H){const{r:Q,s:te}=Dl.toSig(Cs("DER",H));return new y(Q,te)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(H){return new y(this.r,this.s,H)}recoverPublicKey(H){const{r:Q,s:te,recovery:Z}=this,pe=C(Cs("msgHash",H));if(Z==null||![0,1,2,3].includes(Z))throw new Error("recovery id invalid");const Ee=Z===2||Z===3?Q+e.n:Q;if(Ee>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const Re=Z&1?"03":"02",Ce=u.fromHex(Re+h(Ee)),ke=l(Ee),He=a(-pe*ke),Ue=a(te*ke),ze=u.BASE.multiplyAndAddUnsafe(Ce,He,Ue);if(!ze)throw new Error("point at infinify");return ze.assertValidity(),ze}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Nc(this.toDERHex())}toDERHex(){return Dl.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Nc(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(B){try{return c(B),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const B=aR(e.n);return xre(e.randomBytes(B),e.n)},precompute(B=8,H=u.BASE){return H._setWindowSize(B),H.multiply(BigInt(3)),H}};function w(B,H=!0){return u.fromPrivateKey(B).toRawBytes(H)}function A(B){const H=B instanceof Uint8Array,Q=typeof B=="string",te=(H||Q)&&B.length;return H?te===s||te===i:Q?te===2*s||te===2*i:B instanceof u}function x(B,H,Q=!0){if(A(B))throw new Error("first arg must be private key");if(!A(H))throw new Error("second arg must be public key");return u.fromHex(H).multiply(c(B)).toRawBytes(Q)}const k=e.bits2int||function(B){const H=Sl(B),Q=B.length*8-e.nBitLength;return Q>0?H>>BigInt(Q):H},C=e.bits2int_modN||function(B){return a(k(B))},O=Fx(e.nBitLength);function _(B){if(typeof B!="bigint")throw new Error("bigint expected");if(!(zi<=B&&B<O))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Rc(B,e.nByteLength)}function D(B,H,Q=R){if(["recovered","canonical"].some(tt=>tt in Q))throw new Error("sign() legacy options not supported");const{hash:te,randomBytes:Z}=e;let{lowS:pe,prehash:Ee,extraEntropy:Re}=Q;pe==null&&(pe=!0),B=Cs("msgHash",B),Ee&&(B=Cs("prehashed msgHash",te(B)));const Ce=C(B),ke=c(H),He=[_(ke),_(Ce)];if(Re!=null){const tt=Re===!0?Z(n.BYTES):Re;He.push(Cs("extraEntropy",tt))}const Ue=Nh(...He),ze=Ce;function Le(tt){const le=k(tt);if(!d(le))return;const $e=l(le),ae=u.BASE.multiply(le).toAffine(),be=a(ae.x);if(be===zi)return;const Be=a($e*a(ze+be*ke));if(Be===zi)return;let z=(ae.x===be?0:2)|Number(ae.y&Zr),q=Be;return pe&&p(Be)&&(q=m(Be),z^=1),new y(be,q,z)}return{seed:Ue,k2sig:Le}}const R={lowS:e.lowS,prehash:!1},L={lowS:e.lowS,prehash:!1};function F(B,H,Q=R){const{seed:te,k2sig:Z}=D(B,H,Q),pe=e;return nR(pe.hash.outputLen,pe.nByteLength,pe.hmac)(te,Z)}u.BASE._setWindowSize(8);function G(B,H,Q,te=L){var ae;const Z=B;if(H=Cs("msgHash",H),Q=Cs("publicKey",Q),"strict"in te)throw new Error("options.strict was renamed to lowS");const{lowS:pe,prehash:Ee}=te;let Re,Ce;try{if(typeof Z=="string"||Z instanceof Uint8Array)try{Re=y.fromDER(Z)}catch(be){if(!(be instanceof Dl.Err))throw be;Re=y.fromCompact(Z)}else if(typeof Z=="object"&&typeof Z.r=="bigint"&&typeof Z.s=="bigint"){const{r:be,s:Be}=Z;Re=new y(be,Be)}else throw new Error("PARSE");Ce=u.fromHex(Q)}catch(be){if(be.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(pe&&Re.hasHighS())return!1;Ee&&(H=e.hash(H));const{r:ke,s:He}=Re,Ue=C(H),ze=l(He),Le=a(Ue*ze),tt=a(ke*ze),le=(ae=u.BASE.multiplyAndAddUnsafe(Ce,Le,tt))==null?void 0:ae.toAffine();return le?a(le.x)===ke:!1}return{CURVE:e,getPublicKey:w,getSharedSecret:x,sign:F,verify:G,ProjectivePoint:u,Signature:y,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Mre(t){return{hash:t,hmac:(e,...n)=>N4(t,e,Cne(...n)),randomBytes:Sne}}function Nre(t,e){const n=r=>_re({...t,...Mre(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const cR=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),fR=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Rre=BigInt(1),zx=BigInt(2),dR=(t,e)=>(t+e/zx)/e;function Pre(t){const e=cR,n=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),l=BigInt(88),u=t*t*t%e,c=u*u*t%e,f=Xr(c,n,e)*c%e,d=Xr(f,n,e)*c%e,h=Xr(d,zx,e)*u%e,p=Xr(h,s,e)*h%e,m=Xr(p,i,e)*p%e,g=Xr(m,a,e)*m%e,y=Xr(g,l,e)*g%e,v=Xr(y,a,e)*m%e,w=Xr(v,n,e)*c%e,A=Xr(w,o,e)*p%e,x=Xr(A,r,e)*u%e,k=Xr(x,zx,e);if(!$x.eql($x.sqr(k),t))throw new Error("Cannot find square root");return k}const $x=vre(cR,void 0,void 0,{sqrt:Pre}),sa=Nre({a:BigInt(0),b:BigInt(7),Fp:$x,n:fR,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=fR,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Rre*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,o=BigInt("0x100000000000000000000000000000000"),a=dR(i*t,e),l=dR(-r*t,e);let u=fr(t-a*n-l*s,e),c=fr(-a*r-l*i,e);const f=u>o,d=c>o;if(f&&(u=e-u),d&&(c=e-c),u>o||c>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:u,k2neg:d,k2:c}}}},P4);BigInt(0),sa.ProjectivePoint;const Ph="0x0000000000000000000000000000000000000000",hR="0x0000000000000000000000000000000000000000000000000000000000000000",pR=BigInt(0),mR=BigInt(1),gR=BigInt(2),yR=BigInt(27),bR=BigInt(28),ny=BigInt(35),Pc={};function wR(t){return xl(Wn(t),32)}const Ms=class Ms{constructor(e,n,r,s){J(this,cf);J(this,ff);J(this,df);J(this,eu);$g(e,Pc,"Signature"),I(this,cf,n),I(this,ff,r),I(this,df,s),I(this,eu,null)}get r(){return T(this,cf)}set r(e){$(Cc(e)===32,"invalid r","value",e),I(this,cf,we(e))}get s(){return T(this,ff)}set s(e){$(Cc(e)===32,"invalid s","value",e);const n=we(e);$(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),I(this,ff,n)}get v(){return T(this,df)}set v(e){const n=Qe(e,"value");$(n===27||n===28,"invalid v","v",e),I(this,df,n)}get networkV(){return T(this,eu)}get legacyChainId(){const e=this.networkV;return e==null?null:Ms.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=ct(this.s);return this.yParity&&(e[0]|=128),we(e)}get compactSerialized(){return $t([this.r,this.yParityAndS])}get serialized(){return $t([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new Ms(Pc,this.r,this.s,this.v);return this.networkV&&I(e,eu,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const n=xe(e,"v");return n==yR||n==bR?pR:($(n>=ny,"invalid EIP-155 v","v",e),(n-ny)/gR)}static getChainIdV(e,n){return xe(e)*gR+BigInt(35+n-27)}static getNormalizedV(e){const n=xe(e);return n===pR||n===yR?27:n===mR||n===bR?28:($(n>=ny,"invalid v","v",e),n&mR?27:28)}static from(e){function n(u,c){$(u,c,"signature",e)}if(e==null)return new Ms(Pc,hR,hR,27);if(typeof e=="string"){const u=ct(e,"signature");if(u.length===64){const c=we(u.slice(0,32)),f=u.slice(32,64),d=f[0]&128?28:27;return f[0]&=127,new Ms(Pc,c,we(f),d)}if(u.length===65){const c=we(u.slice(0,32)),f=u.slice(32,64);n((f[0]&128)===0,"non-canonical s");const d=Ms.getNormalizedV(u[64]);return new Ms(Pc,c,we(f),d)}n(!1,"invalid raw signature length")}if(e instanceof Ms)return e.clone();const r=e.r;n(r!=null,"missing r");const s=wR(r),i=function(u,c){if(u!=null)return wR(u);if(c!=null){n(St(c,32),"invalid yParityAndS");const f=ct(c);return f[0]&=127,we(f)}n(!1,"missing s")}(e.s,e.yParityAndS);n((ct(i)[0]&128)==0,"non-canonical s");const{networkV:o,v:a}=function(u,c,f){if(u!=null){const d=xe(u);return{networkV:d>=ny?d:void 0,v:Ms.getNormalizedV(d)}}if(c!=null)return n(St(c,32),"invalid yParityAndS"),{v:ct(c)[0]&128?28:27};if(f!=null){switch(Qe(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new Ms(Pc,s,i,a);return o&&I(l,eu,o),n(e.yParity==null||Qe(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}};cf=new WeakMap,ff=new WeakMap,df=new WeakMap,eu=new WeakMap;let Ss=Ms;const tu=class tu{constructor(e){J(this,oo);$(Cc(e)===32,"invalid private key","privateKey","[REDACTED]"),I(this,oo,we(e))}get privateKey(){return T(this,oo)}get publicKey(){return tu.computePublicKey(T(this,oo))}get compressedPublicKey(){return tu.computePublicKey(T(this,oo),!0)}sign(e){$(Cc(e)===32,"invalid digest length","digest",e);const n=sa.sign(Gn(e),Gn(T(this,oo)),{lowS:!0});return Ss.from({r:Xo(n.r,32),s:Xo(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=tu.computePublicKey(e);return we(sa.getSharedSecret(Gn(T(this,oo)),ct(n),!1))}static computePublicKey(e,n){let r=ct(e,"key");if(r.length===32){const i=sa.getPublicKey(r,!!n);return we(i)}if(r.length===64){const i=new Uint8Array(65);i[0]=4,i.set(r,1),r=i}const s=sa.ProjectivePoint.fromHex(r);return we(s.toRawBytes(n))}static recoverPublicKey(e,n){$(Cc(e)===32,"invalid digest length","digest",e);const r=Ss.from(n);let s=sa.Signature.fromCompact(Gn($t([r.r,r.s])));s=s.addRecoveryBit(r.yParity);const i=s.recoverPublicKey(Gn(e));return $(i!=null,"invalid signautre for digest","signature",n),"0x"+i.toHex(!1)}static addPoints(e,n,r){const s=sa.ProjectivePoint.fromHex(tu.computePublicKey(e).substring(2)),i=sa.ProjectivePoint.fromHex(tu.computePublicKey(n).substring(2));return"0x"+s.add(i).toHex(!!r)}};oo=new WeakMap;let Ih=tu;const Ire=BigInt(0),Lre=BigInt(36);function AR(t){t=t.toLowerCase();const e=t.substring(2).split(""),n=new Uint8Array(40);for(let s=0;s<40;s++)n[s]=e[s].charCodeAt(0);const r=ct(en(n));for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(r[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}const Gx={};for(let t=0;t<10;t++)Gx[String(t)]=String(t);for(let t=0;t<26;t++)Gx[String.fromCharCode(65+t)]=String(10+t);const vR=15;function Bre(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>Gx[r]).join("");for(;e.length>=vR;){let r=e.substring(0,vR);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const Fre=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function jre(t){t=t.toLowerCase();let e=Ire;for(let n=0;n<t.length;n++)e=e*Lre+Fre[t[n]];return e}function gt(t){if($(typeof t=="string","invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=AR(t);return $(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){$(t.substring(2,4)===Bre(t),"bad icap checksum","address",t);let e=jre(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return AR("0x"+e)}$(!1,"invalid address","address",t)}function Ure(t){const e=gt(t.from);let r=xe(t.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,gt(Ht(en(El([e,r])),12))}function xR(t){return t&&typeof t.getAddress=="function"}function Vre(t){try{return gt(t),!0}catch{}return!1}async function Wx(t,e){const n=await e;return(n==null||n==="0x0000000000000000000000000000000000000000")&&(ee(typeof t!="string","unconfigured name","UNCONFIGURED_NAME",{value:t}),$(!1,"invalid AddressLike value; did not resolve to a value address","target",t)),gt(n)}function Qn(t,e){if(typeof t=="string")return t.match(/^0x[0-9a-f]{40}$/i)?gt(t):(ee(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),Wx(t,e.resolveName(t)));if(xR(t))return Wx(t,t.getAddress());if(t&&typeof t.then=="function")return Wx(t,t);$(!1,"unsupported addressable value","target",t)}const $i={};function Ae(t,e){let n=!1;return e<0&&(n=!0,e*=-1),new Rn($i,`${n?"":"u"}int${e}`,t,{signed:n,width:e})}function dt(t,e){return new Rn($i,`bytes${e||""}`,t,{size:e})}const kR=Symbol.for("_ethers_typed"),ao=class ao{constructor(e,n,r,s){W(this,"type");W(this,"value");J(this,nu);W(this,"_typedSymbol");s==null&&(s=null),$g($i,e,"Typed"),Oe(this,{_typedSymbol:kR,type:n,value:r}),I(this,nu,s),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return T(this,nu)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return T(this,nu)===!0?-1:T(this,nu)===!1?this.value.length:null}static from(e,n){return new ao($i,e,n)}static uint8(e){return Ae(e,8)}static uint16(e){return Ae(e,16)}static uint24(e){return Ae(e,24)}static uint32(e){return Ae(e,32)}static uint40(e){return Ae(e,40)}static uint48(e){return Ae(e,48)}static uint56(e){return Ae(e,56)}static uint64(e){return Ae(e,64)}static uint72(e){return Ae(e,72)}static uint80(e){return Ae(e,80)}static uint88(e){return Ae(e,88)}static uint96(e){return Ae(e,96)}static uint104(e){return Ae(e,104)}static uint112(e){return Ae(e,112)}static uint120(e){return Ae(e,120)}static uint128(e){return Ae(e,128)}static uint136(e){return Ae(e,136)}static uint144(e){return Ae(e,144)}static uint152(e){return Ae(e,152)}static uint160(e){return Ae(e,160)}static uint168(e){return Ae(e,168)}static uint176(e){return Ae(e,176)}static uint184(e){return Ae(e,184)}static uint192(e){return Ae(e,192)}static uint200(e){return Ae(e,200)}static uint208(e){return Ae(e,208)}static uint216(e){return Ae(e,216)}static uint224(e){return Ae(e,224)}static uint232(e){return Ae(e,232)}static uint240(e){return Ae(e,240)}static uint248(e){return Ae(e,248)}static uint256(e){return Ae(e,256)}static uint(e){return Ae(e,256)}static int8(e){return Ae(e,-8)}static int16(e){return Ae(e,-16)}static int24(e){return Ae(e,-24)}static int32(e){return Ae(e,-32)}static int40(e){return Ae(e,-40)}static int48(e){return Ae(e,-48)}static int56(e){return Ae(e,-56)}static int64(e){return Ae(e,-64)}static int72(e){return Ae(e,-72)}static int80(e){return Ae(e,-80)}static int88(e){return Ae(e,-88)}static int96(e){return Ae(e,-96)}static int104(e){return Ae(e,-104)}static int112(e){return Ae(e,-112)}static int120(e){return Ae(e,-120)}static int128(e){return Ae(e,-128)}static int136(e){return Ae(e,-136)}static int144(e){return Ae(e,-144)}static int152(e){return Ae(e,-152)}static int160(e){return Ae(e,-160)}static int168(e){return Ae(e,-168)}static int176(e){return Ae(e,-176)}static int184(e){return Ae(e,-184)}static int192(e){return Ae(e,-192)}static int200(e){return Ae(e,-200)}static int208(e){return Ae(e,-208)}static int216(e){return Ae(e,-216)}static int224(e){return Ae(e,-224)}static int232(e){return Ae(e,-232)}static int240(e){return Ae(e,-240)}static int248(e){return Ae(e,-248)}static int256(e){return Ae(e,-256)}static int(e){return Ae(e,-256)}static bytes1(e){return dt(e,1)}static bytes2(e){return dt(e,2)}static bytes3(e){return dt(e,3)}static bytes4(e){return dt(e,4)}static bytes5(e){return dt(e,5)}static bytes6(e){return dt(e,6)}static bytes7(e){return dt(e,7)}static bytes8(e){return dt(e,8)}static bytes9(e){return dt(e,9)}static bytes10(e){return dt(e,10)}static bytes11(e){return dt(e,11)}static bytes12(e){return dt(e,12)}static bytes13(e){return dt(e,13)}static bytes14(e){return dt(e,14)}static bytes15(e){return dt(e,15)}static bytes16(e){return dt(e,16)}static bytes17(e){return dt(e,17)}static bytes18(e){return dt(e,18)}static bytes19(e){return dt(e,19)}static bytes20(e){return dt(e,20)}static bytes21(e){return dt(e,21)}static bytes22(e){return dt(e,22)}static bytes23(e){return dt(e,23)}static bytes24(e){return dt(e,24)}static bytes25(e){return dt(e,25)}static bytes26(e){return dt(e,26)}static bytes27(e){return dt(e,27)}static bytes28(e){return dt(e,28)}static bytes29(e){return dt(e,29)}static bytes30(e){return dt(e,30)}static bytes31(e){return dt(e,31)}static bytes32(e){return dt(e,32)}static address(e){return new ao($i,"address",e)}static bool(e){return new ao($i,"bool",!!e)}static bytes(e){return new ao($i,"bytes",e)}static string(e){return new ao($i,"string",e)}static array(e,n){throw new Error("not implemented yet")}static tuple(e,n){throw new Error("not implemented yet")}static overrides(e){return new ao($i,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===kR}static dereference(e,n){if(ao.isTyped(e)){if(e.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${e.type}`);return e.value}return e}};nu=new WeakMap;let Rn=ao;class Hre extends Hi{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){let r=Rn.dereference(n,"string");try{r=gt(r)}catch(s){return this._throwError(s.message,n)}return e.writeValue(r)}decode(e){return gt(Xo(e.readValue(),20))}}class zre extends Hi{constructor(n){super(n.name,n.type,"_",n.dynamic);W(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}}function ER(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let l={};r=e.map(u=>{const c=u.localName;return ee(c,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:n}),ee(!l[c],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:n}),l[c]=!0,n[c]})}else $(!1,"invalid tuple value","tuple",n);$(e.length===r.length,"types/value length mismatch","tuple",n);let s=new Sx,i=new Sx,o=[];e.forEach((l,u)=>{let c=r[u];if(l.dynamic){let f=i.length;l.encode(i,c);let d=s.writeUpdatableValue();o.push(h=>{d(h+f)})}else l.encode(s,c)}),o.forEach(l=>{l(s.length)});let a=t.appendWriter(s);return a+=t.appendWriter(i),a}function CR(t,e){let n=[],r=[],s=t.subReader(0);return e.forEach(i=>{let o=null;if(i.dynamic){let a=t.readIndex(),l=s.subReader(a);try{o=i.decode(l)}catch(u){if(gn(u,"BUFFER_OVERRUN"))throw u;o=u,o.baseType=i.name,o.name=i.localName,o.type=i.type}}else try{o=i.decode(t)}catch(a){if(gn(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=i.name,o.name=i.localName,o.type=i.type}if(o==null)throw new Error("investigate");n.push(o),r.push(i.localName||null)}),Dc.fromItems(n,r)}class $re extends Hi{constructor(n,r,s){const i=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",i,s,o);W(this,"coder");W(this,"length");Oe(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let s=0;s<this.length;s++)r.push(n);return r}encode(n,r){const s=Rn.dereference(r,"array");Array.isArray(s)||this._throwError("expected array value",s);let i=this.length;i===-1&&(i=s.length,n.writeValue(s.length)),s4(s.length,i,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let a=0;a<s.length;a++)o.push(this.coder);return ER(n,o,s)}decode(n){let r=this.length;r===-1&&(r=n.readIndex(),ee(r*qn<=n.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:n.bytes,offset:r*qn,length:n.dataLength}));let s=[];for(let i=0;i<r;i++)s.push(new zre(this.coder));return CR(n,s)}}class Gre extends Hi{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,n){const r=Rn.dereference(n,"bool");return e.writeValue(r?1:0)}decode(e){return!!e.readValue()}}class SR extends Hi{constructor(e,n){super(e,e,n,!0)}defaultValue(){return"0x"}encode(e,n){n=Gn(n);let r=e.writeValue(n.length);return r+=e.writeBytes(n),r}decode(e){return e.readBytes(e.readIndex(),!0)}}class Wre extends SR{constructor(e){super("bytes",e)}decode(e){return we(super.decode(e))}}class Kre extends Hi{constructor(n,r){let s="bytes"+String(n);super(s,s,r,!1);W(this,"size");Oe(this,{size:n},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(n,r){let s=Gn(Rn.dereference(r,this.type));return s.length!==this.size&&this._throwError("incorrect data length",r),n.writeBytes(s)}decode(n){return we(n.readBytes(this.size))}}const qre=new Uint8Array([]);class Qre extends Hi{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,n){return n!=null&&this._throwError("not null",n),e.writeBytes(qre)}decode(e){return e.readBytes(0),null}}const Jre=BigInt(0),Yre=BigInt(1),Xre=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class Zre extends Hi{constructor(n,r,s){const i=(r?"int":"uint")+n*8;super(i,i,s,!1);W(this,"size");W(this,"signed");Oe(this,{size:n,signed:r},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(n,r){let s=xe(Rn.dereference(r,this.type)),i=Oh(Xre,qn*8);if(this.signed){let o=Oh(i,this.size*8-1);(s>o||s<-(o+Yre))&&this._throwError("value out-of-bounds",r),s=l4(s,8*qn)}else(s<Jre||s>Oh(i,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(s)}decode(n){let r=Oh(n.readValue(),this.size*8);return this.signed&&(r=rne(r,this.size*8)),r}}class ese extends SR{constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,Vi(Rn.dereference(n,"string")))}decode(e){return Tc(super.decode(e))}}class ry extends Hi{constructor(n,r){let s=!1;const i=[];n.forEach(a=>{a.dynamic&&(s=!0),i.push(a.type)});const o="tuple("+i.join(",")+")";super("tuple",o,r,s);W(this,"coders");Oe(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(s=>{n.push(s.defaultValue())});const r=this.coders.reduce((s,i)=>{const o=i.localName;return o&&(s[o]||(s[o]=0),s[o]++),s},{});return this.coders.forEach((s,i)=>{let o=s.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[i]))}),Object.freeze(n)}encode(n,r){const s=Rn.dereference(r,"tuple");return ER(n,this.coders,s)}decode(n){return CR(n,this.coders)}}function Ol(t){return en(Vi(t))}var tse="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";const TR=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),DR=4;function nse(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),s=1,i=[0,1];for(let x=1;x<r;x++)i.push(s+=n());let o=n(),a=e;e+=o;let l=0,u=0;function c(){return l==0&&(u=u<<8|t[e++],l=8),u>>--l&1}const f=31,d=2**f,h=d>>>1,p=h>>1,m=d-1;let g=0;for(let x=0;x<f;x++)g=g<<1|c();let y=[],v=0,w=d;for(;;){let x=Math.floor(((g-v+1)*s-1)/w),k=0,C=r;for(;C-k>1;){let D=k+C>>>1;x<i[D]?C=D:k=D}if(k==0)break;y.push(k);let O=v+Math.floor(w*i[k]/s),_=v+Math.floor(w*i[k+1]/s)-1;for(;!((O^_)&h);)g=g<<1&m|c(),O=O<<1&m,_=_<<1&m|1;for(;O&~_&p;)g=g&h|g<<1&m>>>1|c(),O=O<<1^h,_=(_^h)<<1|h|1;v=O,w=1+_-O}let A=r-4;return y.map(x=>{switch(x-A){case 3:return A+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return A+256+(t[a++]<<8|t[a++]);case 1:return A+t[a++];default:return x-1}})}function rse(t){let e=0;return()=>t[e++]}function OR(t){return rse(nse(sse(t)))}function sse(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,i)=>e[s.charCodeAt(0)]=i);let n=t.length,r=new Uint8Array(6*n>>3);for(let s=0,i=0,o=0,a=0;s<n;s++)a=a<<6|e[t.charCodeAt(s)],o+=6,o>=8&&(r[i++]=a>>(o-=8));return r}function ise(t){return t&1?~t>>1:t>>1}function ose(t,e){let n=Array(t);for(let r=0,s=0;r<t;r++)n[r]=s+=ise(e());return n}function Lh(t,e=0){let n=[];for(;;){let r=t(),s=t();if(!s)break;e+=r;for(let i=0;i<s;i++)n.push(e+i);e+=s+1}return n}function _R(t){return Bh(()=>{let e=Lh(t);if(e.length)return e})}function MR(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(ase(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(lse(n,t))}return e.flat()}function Bh(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function NR(t,e,n){let r=Array(t).fill().map(()=>[]);for(let s=0;s<e;s++)ose(t,n).forEach((i,o)=>r[o].push(i));return r}function ase(t,e){let n=1+e(),r=e(),s=Bh(e);return NR(s.length,1+t,e).flatMap((o,a)=>{let[l,...u]=o;return Array(s[a]).fill().map((c,f)=>{let d=f*r;return[l+f*n,u.map(h=>h+d)]})})}function lse(t,e){let n=1+e();return NR(n,1+t,e).map(s=>[s[0],s.slice(1)])}function use(t){let e=[],n=Lh(t);return s(r([]),[]),e;function r(i){let o=t(),a=Bh(()=>{let l=Lh(t).map(u=>n[u]);if(l.length)return r(l)});return{S:o,B:a,Q:i}}function s({S:i,B:o},a,l){if(!(i&4&&l===a[a.length-1])){i&2&&(l=a[a.length-1]),i&1&&e.push(a);for(let u of o)for(let c of u.Q)s(u,[...a,c],l)}}}function cse(t){return t.toString(16).toUpperCase().padStart(2,"0")}function RR(t){return`{${cse(t)}}`}function fse(t){let e=[];for(let n=0,r=t.length;n<r;){let s=t.codePointAt(n);n+=s<65536?1:2,e.push(s)}return e}function Ic(t){let n=t.length;if(n<4096)return String.fromCodePoint(...t);let r=[];for(let s=0;s<n;)r.push(String.fromCodePoint(...t.slice(s,s+=4096)));return r.join("")}function dse(t,e){let n=t.length,r=n-e.length;for(let s=0;r==0&&s<n;s++)r=t[s]-e[s];return r}var hse="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";const Fh=44032,sy=4352,iy=4449,oy=4519,PR=19,IR=21,Lc=28,ay=IR*Lc,pse=PR*ay,mse=Fh+pse,gse=sy+PR,yse=iy+IR,bse=oy+Lc;function jh(t){return t>>24&255}function LR(t){return t&16777215}let Kx,BR,qx,ly;function wse(){let t=OR(hse);Kx=new Map(_R(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),BR=new Set(Lh(t)),qx=new Map,ly=new Map;for(let[e,n]of MR(t)){if(!BR.has(e)&&n.length==2){let[r,s]=n,i=ly.get(r);i||(i=new Map,ly.set(r,i)),i.set(s,e)}qx.set(e,n.reverse())}}function FR(t){return t>=Fh&&t<mse}function Ase(t,e){if(t>=sy&&t<gse&&e>=iy&&e<yse)return Fh+(t-sy)*ay+(e-iy)*Lc;if(FR(t)&&e>oy&&e<bse&&(t-Fh)%Lc==0)return t+(e-oy);{let n=ly.get(t);return n&&(n=n.get(e),n)?n:-1}}function jR(t){Kx||wse();let e=[],n=[],r=!1;function s(i){let o=Kx.get(i);o&&(r=!0,i|=o),e.push(i)}for(let i of t)for(;;){if(i<128)e.push(i);else if(FR(i)){let o=i-Fh,a=o/ay|0,l=o%ay/Lc|0,u=o%Lc;s(sy+a),s(iy+l),u>0&&s(oy+u)}else{let o=qx.get(i);o?n.push(...o):s(i)}if(!n.length)break;i=n.pop()}if(r&&e.length>1){let i=jh(e[0]);for(let o=1;o<e.length;o++){let a=jh(e[o]);if(a==0||i<=a){i=a;continue}let l=o-1;for(;;){let u=e[l+1];if(e[l+1]=e[l],e[l]=u,!l||(i=jh(e[--l]),i<=a))break}i=jh(e[o])}}return e}function vse(t){let e=[],n=[],r=-1,s=0;for(let i of t){let o=jh(i),a=LR(i);if(r==-1)o==0?r=a:e.push(a);else if(s>0&&s>=o)o==0?(e.push(r,...n),n.length=0,r=a):n.push(a),s=o;else{let l=Ase(r,a);l>=0?r=l:s==0&&o==0?(e.push(r),r=a):(n.push(a),s=o)}}return r>=0&&e.push(r,...n),e}function UR(t){return jR(t).map(LR)}function xse(t){return vse(jR(t))}const VR=45,HR=".",zR=65039,$R=1,uy=t=>Array.from(t);function Uh(t,e){return t.P.has(e)||t.Q.has(e)}class kse extends Array{get is_emoji(){return!0}}let Qx,GR,_l,Jx,WR,Bc,Yx,Fc,Ml,KR,Xx;function Zx(){if(Qx)return;let t=OR(tse);const e=()=>Lh(t),n=()=>new Set(e()),r=(c,f)=>f.forEach(d=>c.add(d));Qx=new Map(MR(t)),GR=n(),_l=e(),Jx=new Set(e().map(c=>_l[c])),_l=new Set(_l),WR=n(),n();let s=_R(t),i=t();const o=()=>{let c=new Set;return e().forEach(f=>r(c,s[f])),r(c,e()),c};Bc=Bh(c=>{let f=Bh(t).map(d=>d+96);if(f.length){let d=c>=i;f[0]-=32,f=Ic(f),d&&(f=`Restricted[${f}]`);let h=o(),p=o(),m=!t();return{N:f,P:h,Q:p,M:m,R:d}}}),Yx=n(),Fc=new Map;let a=e().concat(uy(Yx)).sort((c,f)=>c-f);a.forEach((c,f)=>{let d=t(),h=a[f]=d?a[f-d]:{V:[],M:new Map};h.V.push(c),Yx.has(c)||Fc.set(c,h)});for(let{V:c,M:f}of new Set(Fc.values())){let d=[];for(let p of c){let m=Bc.filter(y=>Uh(y,p)),g=d.find(({G:y})=>m.some(v=>y.has(v)));g||(g={G:new Set,V:[]},d.push(g)),g.V.push(p),r(g.G,m)}let h=d.flatMap(p=>uy(p.G));for(let{G:p,V:m}of d){let g=new Set(h.filter(y=>!p.has(y)));for(let y of m)f.set(y,g)}}Ml=new Set;let l=new Set;const u=c=>Ml.has(c)?l.add(c):Ml.add(c);for(let c of Bc){for(let f of c.P)u(f);for(let f of c.Q)u(f)}for(let c of Ml)!Fc.has(c)&&!l.has(c)&&Fc.set(c,$R);r(Ml,UR(Ml)),KR=use(t).map(c=>kse.from(c)).sort(dse),Xx=new Map;for(let c of KR){let f=[Xx];for(let d of c){let h=f.map(p=>{let m=p.get(d);return m||(m=new Map,p.set(d,m)),m});d===zR?f.push(...h):f=h}for(let d of f)d.V=c}}function e2(t){return(qR(t)?"":`${t2(cy([t]))} `)+RR(t)}function t2(t){return`"${t}"`}function Ese(t){if(t.length>=4&&t[2]==VR&&t[3]==VR)throw new Error(`invalid label extension: "${Ic(t.slice(0,4))}"`)}function Cse(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function Sse(t){let e=t[0],n=TR.get(e);if(n)throw Vh(`leading ${n}`);let r=t.length,s=-1;for(let i=1;i<r;i++){e=t[i];let o=TR.get(e);if(o){if(s==i)throw Vh(`${n} + ${o}`);s=i+1,n=o}}if(s==r)throw Vh(`trailing ${n}`)}function cy(t,e=1/0,n=RR){let r=[];Tse(t[0])&&r.push("◌"),t.length>e&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let s=0,i=t.length;for(let o=0;o<i;o++){let a=t[o];qR(a)&&(r.push(Ic(t.slice(s,o))),r.push(n(a)),s=o+1)}return r.push(Ic(t.slice(s,i))),r.join("")}function Tse(t){return Zx(),_l.has(t)}function qR(t){return Zx(),WR.has(t)}function Dse(t){return Nse(Ose(t,xse,Ise))}function Ose(t,e,n){if(!t)return[];Zx();let r=0;return t.split(HR).map(s=>{let i=fse(s),o={input:i,offset:r};r+=i.length+1;try{let a=o.tokens=Pse(i,e,n),l=a.length,u;if(!l)throw new Error("empty label");let c=o.output=a.flat();if(Cse(c),!(o.emoji=l>1||a[0].is_emoji)&&c.every(d=>d<128))Ese(c),u="ASCII";else{let d=a.flatMap(h=>h.is_emoji?[]:h);if(!d.length)u="Emoji";else{if(_l.has(c[0]))throw Vh("leading combining mark");for(let m=1;m<l;m++){let g=a[m];if(!g.is_emoji&&_l.has(g[0]))throw Vh(`emoji + combining mark: "${Ic(a[m-1])} + ${cy([g[0]])}"`)}Sse(c);let h=uy(new Set(d)),[p]=Mse(h);Rse(p,d),_se(p,h),u=p.N}}o.type=u}catch(a){o.error=a}return o})}function _se(t,e){let n,r=[];for(let s of e){let i=Fc.get(s);if(i===$R)return;if(i){let o=i.M.get(s);if(n=n?n.filter(a=>o.has(a)):uy(o),!n.length)return}else r.push(s)}if(n){for(let s of n)if(r.every(i=>Uh(s,i)))throw new Error(`whole-script confusable: ${t.N}/${s.N}`)}}function Mse(t){let e=Bc;for(let n of t){let r=e.filter(s=>Uh(s,n));if(!r.length)throw Bc.some(s=>Uh(s,n))?JR(e[0],n):QR(n);if(e=r,r.length==1)break}return e}function Nse(t){return t.map(({input:e,error:n,output:r})=>{if(n){let s=n.message;throw new Error(t.length==1?s:`Invalid label ${t2(cy(e,63))}: ${s}`)}return Ic(r)}).join(HR)}function QR(t){return new Error(`disallowed character: ${e2(t)}`)}function JR(t,e){let n=e2(e),r=Bc.find(s=>s.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function Vh(t){return new Error(`illegal placement: ${t}`)}function Rse(t,e){for(let n of e)if(!Uh(t,n))throw JR(t,n);if(t.M){let n=UR(e);for(let r=1,s=n.length;r<s;r++)if(Jx.has(n[r])){let i=r+1;for(let o;i<s&&Jx.has(o=n[i]);i++)for(let a=r;a<i;a++)if(n[a]==o)throw new Error(`duplicate non-spacing marks: ${e2(o)}`);if(i-r>DR)throw new Error(`excessive non-spacing marks: ${t2(cy(n.slice(r-1,i)))} (${i-r}/${DR})`);r=i}}}function Pse(t,e,n){let r=[],s=[];for(t=t.slice().reverse();t.length;){let i=Lse(t);if(i)s.length&&(r.push(e(s)),s=[]),r.push(n(i));else{let o=t.pop();if(Ml.has(o))s.push(o);else{let a=Qx.get(o);if(a)s.push(...a);else if(!GR.has(o))throw QR(o)}}}return s.length&&r.push(e(s)),r}function Ise(t){return t.filter(e=>e!=zR)}function Lse(t,e){let n=Xx,r,s=t.length;for(;s&&(n=n.get(t[--s]),!!n);){let{V:i}=n;i&&(r=i,t.length=s)}return r}const YR=new Uint8Array(32);YR.fill(0);function XR(t){return $(t.length!==0,"invalid ENS name; empty component","comp",t),t}function ZR(t){const e=Vi(Bse(t)),n=[];if(t.length===0)return n;let r=0;for(let s=0;s<e.length;s++)e[s]===46&&(n.push(XR(e.slice(r,s))),r=s+1);return $(r<e.length,"invalid ENS name; empty component","name",t),n.push(XR(e.slice(r))),n}function Bse(t){try{if(t.length===0)throw new Error("empty label");return Dse(t)}catch(e){$(!1,`invalid ENS name (${e.message})`,"name",t)}}function n2(t){$(typeof t=="string","invalid ENS name; not a string","name",t),$(t.length,"invalid ENS name (empty label)","name",t);let e=YR;const n=ZR(t);for(;n.length;)e=en($t([e,en(n.pop())]));return we(e)}function Fse(t,e){const n=e;return $(n<=255,"DNS encoded label cannot exceed 255","length",n),we($t(ZR(t).map(r=>{$(r.length<=n,`label ${JSON.stringify(t)} exceeds ${n} bytes`,"name",t);const s=new Uint8Array(r.length+1);return s.set(r,1),s[0]=s.length-1,s})))+"00"}function r2(t,e){return{address:gt(t),storageKeys:e.map((n,r)=>($(St(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function ia(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?($(n.length===2,"invalid slot set",`value[${r}]`,n),r2(n[0],n[1])):($(n!=null&&typeof n=="object","invalid address-slot set","value",t),r2(n.address,n.storageKeys)));$(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(n=>{const r=t[n].reduce((s,i)=>(s[i]=!0,s),{});return r2(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function jse(t){let e;return typeof t=="string"?e=Ih.computePublicKey(t,!1):e=t.publicKey,gt(en("0x"+e.substring(4)).substring(26))}function Use(t,e){return jse(Ih.recoverPublicKey(t,e))}const bn=BigInt(0),Vse=BigInt(2),Hse=BigInt(27),zse=BigInt(28),$se=BigInt(35),Gse=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),s2=4096*32;function eP(t,e){let n=t.toString(16);for(;n.length<2;)n="0"+n;return n+=_c(e).substring(4),"0x"+n}function fy(t){return t==="0x"?null:gt(t)}function i2(t,e){try{return ia(t)}catch(n){$(!1,n.message,e,t)}}function Hh(t,e){return t==="0x"?0:Qe(t,e)}function Wt(t,e){if(t==="0x")return bn;const n=xe(t,e);return $(n<=Gse,"value exceeds uint size",e,n),n}function Ot(t,e){const n=xe(t,"value"),r=Wn(n);return $(r.length<=32,"value too large",`tx.${e}`,n),r}function o2(t){return ia(t).map(e=>[e.address,e.storageKeys])}function Wse(t,e){$(Array.isArray(t),`invalid ${e}`,"value",t);for(let n=0;n<t.length;n++)$(St(t[n],32),"invalid ${ param } hash",`value[${n}]`,t[n]);return t}function Kse(t){const e=Qg(t);$(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const n={type:0,nonce:Hh(e[0],"nonce"),gasPrice:Wt(e[1],"gasPrice"),gasLimit:Wt(e[2],"gasLimit"),to:fy(e[3]),value:Wt(e[4],"value"),data:we(e[5]),chainId:bn};if(e.length===6)return n;const r=Wt(e[6],"v"),s=Wt(e[7],"r"),i=Wt(e[8],"s");if(s===bn&&i===bn)n.chainId=r;else{let o=(r-$se)/Vse;o<bn&&(o=bn),n.chainId=o,$(o!==bn||r===Hse||r===zse,"non-canonical legacy v","v",e[6]),n.signature=Ss.from({r:xl(e[7],32),s:xl(e[8],32),v:r})}return n}function qse(t,e){const n=[Ot(t.nonce,"nonce"),Ot(t.gasPrice||0,"gasPrice"),Ot(t.gasLimit,"gasLimit"),t.to||"0x",Ot(t.value,"value"),t.data];let r=bn;if(t.chainId!=bn)r=xe(t.chainId,"tx.chainId"),$(!e||e.networkV==null||e.legacyChainId===r,"tx.chainId/sig.v mismatch","sig",e);else if(t.signature){const i=t.signature.legacyChainId;i!=null&&(r=i)}if(!e)return r!==bn&&(n.push(Wn(r)),n.push("0x"),n.push("0x")),El(n);let s=BigInt(27+e.yParity);return r!==bn?s=Ss.getChainIdV(r,e.v):BigInt(e.v)!==s&&$(!1,"tx.chainId/sig.v mismatch","sig",e),n.push(Wn(s)),n.push(Wn(e.r)),n.push(Wn(e.s)),El(n)}function a2(t,e){let n;try{if(n=Hh(e[0],"yParity"),n!==0&&n!==1)throw new Error("bad yParity")}catch{$(!1,"invalid yParity","yParity",e[0])}const r=xl(e[1],32),s=xl(e[2],32),i=Ss.from({r,s,yParity:n});t.signature=i}function Qse(t){const e=Qg(ct(t).slice(1));$(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",we(t));const n={type:2,chainId:Wt(e[0],"chainId"),nonce:Hh(e[1],"nonce"),maxPriorityFeePerGas:Wt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Wt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Wt(e[4],"gasLimit"),to:fy(e[5]),value:Wt(e[6],"value"),data:we(e[7]),accessList:i2(e[8],"accessList")};return e.length===9||a2(n,e.slice(9)),n}function Jse(t,e){const n=[Ot(t.chainId,"chainId"),Ot(t.nonce,"nonce"),Ot(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Ot(t.maxFeePerGas||0,"maxFeePerGas"),Ot(t.gasLimit,"gasLimit"),t.to||"0x",Ot(t.value,"value"),t.data,o2(t.accessList||[])];return e&&(n.push(Ot(e.yParity,"yParity")),n.push(Wn(e.r)),n.push(Wn(e.s))),$t(["0x02",El(n)])}function Yse(t){const e=Qg(ct(t).slice(1));$(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",we(t));const n={type:1,chainId:Wt(e[0],"chainId"),nonce:Hh(e[1],"nonce"),gasPrice:Wt(e[2],"gasPrice"),gasLimit:Wt(e[3],"gasLimit"),to:fy(e[4]),value:Wt(e[5],"value"),data:we(e[6]),accessList:i2(e[7],"accessList")};return e.length===8||a2(n,e.slice(8)),n}function Xse(t,e){const n=[Ot(t.chainId,"chainId"),Ot(t.nonce,"nonce"),Ot(t.gasPrice||0,"gasPrice"),Ot(t.gasLimit,"gasLimit"),t.to||"0x",Ot(t.value,"value"),t.data,o2(t.accessList||[])];return e&&(n.push(Ot(e.yParity,"recoveryParam")),n.push(Wn(e.r)),n.push(Wn(e.s))),$t(["0x01",El(n)])}function Zse(t){let e=Qg(ct(t).slice(1)),n="3",r=null;if(e.length===4&&Array.isArray(e[0])){n="3 (network format)";const i=e[1],o=e[2],a=e[3];$(Array.isArray(i),"invalid network format: blobs not an array","fields[1]",i),$(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),$(Array.isArray(a),"invalid network format: proofs not an array","fields[3]",a),$(i.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),$(i.length===a.length,"invalid network format: blobs/proofs length mismatch","fields",e),r=[];for(let l=0;l<e[1].length;l++)r.push({data:i[l],commitment:o[l],proof:a[l]});e=e[0]}$(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${n}`,"data",we(t));const s={type:3,chainId:Wt(e[0],"chainId"),nonce:Hh(e[1],"nonce"),maxPriorityFeePerGas:Wt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Wt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Wt(e[4],"gasLimit"),to:fy(e[5]),value:Wt(e[6],"value"),data:we(e[7]),accessList:i2(e[8],"accessList"),maxFeePerBlobGas:Wt(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};r&&(s.blobs=r),$(s.to!=null,`invalid address for transaction type: ${n}`,"data",t),$(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",t);for(let i=0;i<s.blobVersionedHashes.length;i++)$(St(s.blobVersionedHashes[i],32),`invalid blobVersionedHash at index ${i}: must be length 32`,"data",t);return e.length===11||a2(s,e.slice(11)),s}function eie(t,e,n){const r=[Ot(t.chainId,"chainId"),Ot(t.nonce,"nonce"),Ot(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Ot(t.maxFeePerGas||0,"maxFeePerGas"),Ot(t.gasLimit,"gasLimit"),t.to||Ph,Ot(t.value,"value"),t.data,o2(t.accessList||[]),Ot(t.maxFeePerBlobGas||0,"maxFeePerBlobGas"),Wse(t.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(r.push(Ot(e.yParity,"yParity")),r.push(Wn(e.r)),r.push(Wn(e.s)),n)?$t(["0x03",El([r,n.map(s=>s.data),n.map(s=>s.commitment),n.map(s=>s.proof)])]):$t(["0x03",El(r)])}const uo=class uo{constructor(){J(this,Ef);J(this,pi);J(this,hf);J(this,pf);J(this,mf);J(this,gf);J(this,yf);J(this,bf);J(this,wf);J(this,Af);J(this,vf);J(this,xf);J(this,kf);J(this,ru);J(this,ga);J(this,lo);J(this,ya);I(this,pi,null),I(this,hf,null),I(this,mf,0),I(this,gf,bn),I(this,yf,null),I(this,bf,null),I(this,wf,null),I(this,pf,"0x"),I(this,Af,bn),I(this,vf,bn),I(this,xf,null),I(this,kf,null),I(this,ru,null),I(this,ga,null),I(this,ya,null),I(this,lo,null)}get type(){return T(this,pi)}set type(e){switch(e){case null:I(this,pi,null);break;case 0:case"legacy":I(this,pi,0);break;case 1:case"berlin":case"eip-2930":I(this,pi,1);break;case 2:case"london":case"eip-1559":I(this,pi,2);break;case 3:case"cancun":case"eip-4844":I(this,pi,3);break;default:$(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844"}return null}get to(){const e=T(this,hf);return e==null&&this.type===3?Ph:e}set to(e){I(this,hf,e==null?null:gt(e))}get nonce(){return T(this,mf)}set nonce(e){I(this,mf,Qe(e,"value"))}get gasLimit(){return T(this,gf)}set gasLimit(e){I(this,gf,xe(e))}get gasPrice(){const e=T(this,yf);return e==null&&(this.type===0||this.type===1)?bn:e}set gasPrice(e){I(this,yf,e==null?null:xe(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=T(this,bf);return e??(this.type===2||this.type===3?bn:null)}set maxPriorityFeePerGas(e){I(this,bf,e==null?null:xe(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=T(this,wf);return e??(this.type===2||this.type===3?bn:null)}set maxFeePerGas(e){I(this,wf,e==null?null:xe(e,"maxFeePerGas"))}get data(){return T(this,pf)}set data(e){I(this,pf,we(e))}get value(){return T(this,Af)}set value(e){I(this,Af,xe(e,"value"))}get chainId(){return T(this,vf)}set chainId(e){I(this,vf,xe(e))}get signature(){return T(this,xf)||null}set signature(e){I(this,xf,e==null?null:Ss.from(e))}get accessList(){const e=T(this,kf)||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){I(this,kf,e==null?null:ia(e))}get maxFeePerBlobGas(){const e=T(this,ru);return e==null&&this.type===3?bn:e}set maxFeePerBlobGas(e){I(this,ru,e==null?null:xe(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=T(this,ga);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){$(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let n=0;n<e.length;n++)$(St(e[n],32),"invalid blobVersionedHash",`value[${n}]`,e[n])}I(this,ga,e)}get blobs(){return T(this,ya)==null?null:T(this,ya).map(e=>Object.assign({},e))}set blobs(e){if(e==null){I(this,ya,null);return}const n=[],r=[];for(let s=0;s<e.length;s++){const i=e[s];if(vx(i)){ee(T(this,lo),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=ct(i);if($(o.length<=s2,"blob is too large",`blobs[${s}]`,i),o.length!==s2){const u=new Uint8Array(s2);u.set(o),o=u}const a=T(this,lo).blobToKzgCommitment(o),l=we(T(this,lo).computeBlobKzgProof(o,a));n.push({data:we(o),commitment:we(a),proof:l}),r.push(eP(1,a))}else{const o=we(i.commitment);n.push({data:we(i.data),commitment:o,proof:we(i.proof)}),r.push(eP(1,o))}}I(this,ya,n),I(this,ga,r)}get kzg(){return T(this,lo)}set kzg(e){I(this,lo,e)}get hash(){return this.signature==null?null:en(fe(this,Ef,db).call(this,!0,!1))}get unsignedHash(){return en(this.unsignedSerialized)}get from(){return this.signature==null?null:Use(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:Ih.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){return fe(this,Ef,db).call(this,!0,!0)}get unsignedSerialized(){return fe(this,Ef,db).call(this,!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,r=this.accessList!=null,s=T(this,ru)!=null||T(this,ga);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&ee(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),ee(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),ee(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return this.type!=null?i.push(this.type):n?i.push(2):e?(i.push(1),r||i.push(0)):r?(i.push(1),i.push(2)):(s&&this.to||(i.push(0),i.push(1),i.push(2)),i.push(3)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return uo.from(this)}toJSON(){const e=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new uo;if(typeof e=="string"){const r=ct(e);if(r[0]>=127)return uo.from(Kse(r));switch(r[0]){case 1:return uo.from(Yse(r));case 2:return uo.from(Qse(r));case 3:return uo.from(Zse(r))}ee(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new uo;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=Ss.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.blobVersionedHashes!=null&&(n.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(n.kzg=e.kzg),e.blobs!=null&&(n.blobs=e.blobs),e.hash!=null&&($(n.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),$(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&($(n.isSigned(),"unsigned transaction cannot define '.from'","tx",e),$(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}};pi=new WeakMap,hf=new WeakMap,pf=new WeakMap,mf=new WeakMap,gf=new WeakMap,yf=new WeakMap,bf=new WeakMap,wf=new WeakMap,Af=new WeakMap,vf=new WeakMap,xf=new WeakMap,kf=new WeakMap,ru=new WeakMap,ga=new WeakMap,lo=new WeakMap,ya=new WeakMap,Ef=new WeakSet,db=function(e,n){ee(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const r=e?this.signature:null;switch(this.inferType()){case 0:return qse(this,r);case 1:return Xse(this,r);case 2:return Jse(this,r);case 3:return eie(this,r,n?this.blobs:null)}ee(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};let zh=uo;const tP=new Uint8Array(32);tP.fill(0);const tie=BigInt(-1),nP=BigInt(0),rP=BigInt(1),nie=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function rie(t){const e=ct(t),n=e.length%32;return n?$t([e,tP.slice(n)]):we(e)}const sie=Xo(rP,32),iie=Xo(nP,32),sP={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},l2=["name","version","chainId","verifyingContract","salt"];function iP(t){return function(e){return $(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const oie={name:iP("name"),version:iP("version"),chainId:function(t){const e=xe(t,"domain.chainId");return $(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):kl(e)},verifyingContract:function(t){try{return gt(t).toLowerCase()}catch{}$(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=ct(t,"domain.salt");return $(e.length===32,'invalid domain value "salt"',"domain.salt",t),we(e)}};function u2(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const n=e[1]==="",r=parseInt(e[2]);$(r%8===0&&r!==0&&r<=256&&e[2]===String(r),"invalid numeric width","type",t);const s=Oh(nie,n?r-1:r),i=n?(s+rP)*tie:nP;return function(o){const a=xe(o,"value");return $(a>=i&&a<=s,`value out-of-bounds for ${t}`,"value",a),Xo(n?l4(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return $(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const s=ct(r);return $(s.length===n,`invalid length for ${t}`,"value",r),rie(r)}}}switch(t){case"address":return function(e){return xl(gt(e),32)};case"bool":return function(e){return e?sie:iie};case"bytes":return function(e){return en(e)};case"string":return function(e){return Ol(e)}}return null}function oP(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}function dy(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}const ns=class ns{constructor(e){J(this,ib);W(this,"primaryType");J(this,gp);J(this,co);J(this,Cf);I(this,co,new Map),I(this,Cf,new Map);const n=new Map,r=new Map,s=new Map,i={};Object.keys(e).forEach(l=>{i[l]=e[l].map(({name:u,type:c})=>{let{base:f,index:d}=dy(c);return f==="int"&&!e.int&&(f="int256"),f==="uint"&&!e.uint&&(f="uint256"),{name:u,type:f+(d||"")}}),n.set(l,new Set),r.set(l,[]),s.set(l,new Set)}),I(this,gp,JSON.stringify(i));for(const l in i){const u=new Set;for(const c of i[l]){$(!u.has(c.name),`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(l)}`,"types",e),u.add(c.name);const f=dy(c.type).base;$(f!==l,`circular type reference to ${JSON.stringify(f)}`,"types",e),!u2(f)&&($(r.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),r.get(f).push(l),n.get(l).add(f))}}const o=Array.from(r.keys()).filter(l=>r.get(l).length===0);$(o.length!==0,"missing primary type","types",e),$(o.length===1,`ambiguous primary types or unused types: ${o.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),Oe(this,{primaryType:o[0]});function a(l,u){$(!u.has(l),`circular type reference to ${JSON.stringify(l)}`,"types",e),u.add(l);for(const c of n.get(l))if(r.has(c)){a(c,u);for(const f of u)s.get(f).add(c)}u.delete(l)}a(this.primaryType,new Set);for(const[l,u]of s){const c=Array.from(u);c.sort(),T(this,co).set(l,oP(l,i[l])+c.map(f=>oP(f,i[f])).join(""))}}get types(){return JSON.parse(T(this,gp))}getEncoder(e){let n=T(this,Cf).get(e);return n||(n=fe(this,ib,QL).call(this,e),T(this,Cf).set(e,n)),n}encodeType(e){const n=T(this,co).get(e);return $(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return en(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,r){if(u2(e))return r(e,n);const s=dy(e).array;if(s)return $(s.count===-1||s.count===n.length,`array length mismatch; expected length ${s.count}`,"value",n),n.map(o=>this._visit(s.prefix,o,r));const i=this.types[e];if(i)return i.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,n[a],r),o),{});$(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new ns(e)}static getPrimaryType(e){return ns.from(e).primaryType}static hashStruct(e,n,r){return ns.from(n).hashStruct(e,r)}static hashDomain(e){const n=[];for(const r in e){if(e[r]==null)continue;const s=sP[r];$(s,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:s})}return n.sort((r,s)=>l2.indexOf(r.name)-l2.indexOf(s.name)),ns.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,r){return $t(["0x1901",ns.hashDomain(e),ns.from(n).hash(r)])}static hash(e,n,r){return en(ns.encode(e,n,r))}static async resolveNames(e,n,r,s){e=Object.assign({},e);for(const a in e)e[a]==null&&delete e[a];const i={};e.verifyingContract&&!St(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=ns.from(n);o.visit(r,(a,l)=>(a==="address"&&!St(l,20)&&(i[l]="0x"),l));for(const a in i)i[a]=await s(a);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=o.visit(r,(a,l)=>a==="address"&&i[l]?i[l]:l),{domain:e,value:r}}static getPayload(e,n,r){ns.hashDomain(e);const s={},i=[];l2.forEach(l=>{const u=e[l];u!=null&&(s[l]=oie[l](u),i.push({name:l,type:sP[l]}))});const o=ns.from(n);n=o.types;const a=Object.assign({},n);return $(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),a.EIP712Domain=i,o.encode(r),{types:a,domain:s,primaryType:o.primaryType,message:o.visit(r,(l,u)=>{if(l.match(/^bytes(\d*)/))return we(ct(u));if(l.match(/^u?int/))return xe(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return $(typeof u=="string","invalid string","value",u),u}$(!1,"unsupported type","type",l)})}}};gp=new WeakMap,co=new WeakMap,Cf=new WeakMap,ib=new WeakSet,QL=function(e){{const s=u2(e);if(s)return s}const n=dy(e).array;if(n){const s=n.prefix,i=this.getEncoder(s);return o=>{$(n.count===-1||n.count===o.length,`array length mismatch; expected length ${n.count}`,"value",o);let a=o.map(i);return T(this,co).has(s)&&(a=a.map(en)),en($t(a))}}const r=this.types[e];if(r){const s=Ol(T(this,co).get(e));return i=>{const o=r.map(({name:a,type:l})=>{const u=this.getEncoder(l)(i[a]);return T(this,co).has(l)?en(u):u});return o.unshift(s),$t(o)}}$(!1,`unknown type: ${e}`,"type",e)};let hy=ns;function Jn(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const aie=Jn("external public payable override".split(" ")),aP="constant external internal payable private public pure view override",lie=Jn(aP.split(" ")),lP="constructor error event fallback function receive struct",uP=Jn(lP.split(" ")),cP="calldata memory storage payable indexed",uie=Jn(cP.split(" ")),cie=[lP,cP,"tuple returns",aP].join(" "),fie=Jn(cie.split(" ")),die={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},hie=new RegExp("^(\\s*)"),pie=new RegExp("^([0-9]+)"),mie=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),fP=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),dP=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),ob=class ob{constructor(e){J(this,yp);J(this,Dn);J(this,Ns);I(this,Dn,0),I(this,Ns,e.slice())}get offset(){return T(this,Dn)}get length(){return T(this,Ns).length-T(this,Dn)}clone(){return new ob(T(this,Ns))}reset(){I(this,Dn,0)}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const n=this.peek();throw new Error(`expected ${e}; got ${n.type} ${JSON.stringify(n.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=fe(this,yp,Zk).call(this,T(this,Dn)+1,e.match+1);return I(this,Dn,e.match+1),n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;T(this,Dn)<e.match-1;){const r=this.peek().linkNext;n.push(fe(this,yp,Zk).call(this,T(this,Dn)+1,r)),I(this,Dn,r)}return I(this,Dn,e.match+1),n}peek(){if(T(this,Dn)>=T(this,Ns).length)throw new Error("out-of-bounds");return T(this,Ns)[T(this,Dn)]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return Dp(this,Dn)._++,e}toString(){const e=[];for(let n=T(this,Dn);n<T(this,Ns).length;n++){const r=T(this,Ns)[n];e.push(`${r.type}:${r.text}`)}return`<TokenString ${e.join(" ")}>`}};Dn=new WeakMap,Ns=new WeakMap,yp=new WeakSet,Zk=function(e=0,n=0){return new ob(T(this,Ns).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))};let Ts=ob;function oa(t){const e=[],n=o=>{const a=i<t.length?JSON.stringify(t[i]):"$EOI";throw new Error(`invalid token ${a} at ${i}: ${o}`)};let r=[],s=[],i=0;for(;i<t.length;){let o=t.substring(i),a=o.match(hie);a&&(i+=a[1].length,o=t.substring(i));const l={depth:r.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:i,value:-1};e.push(l);let u=die[o[0]]||"";if(u){if(l.type=u,l.text=o[0],i++,u==="OPEN_PAREN")r.push(e.length-1),s.push(e.length-1);else if(u=="CLOSE_PAREN")r.length===0&&n("no matching open bracket"),l.match=r.pop(),e[l.match].match=e.length-1,l.depth--,l.linkBack=s.pop(),e[l.linkBack].linkNext=e.length-1;else if(u==="COMMA")l.linkBack=s.pop(),e[l.linkBack].linkNext=e.length-1,s.push(e.length-1);else if(u==="OPEN_BRACKET")l.type="BRACKET";else if(u==="CLOSE_BRACKET"){let c=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const f=e.pop().text;c=f+c,e[e.length-1].value=Qe(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=c}continue}if(a=o.match(mie),a){if(l.text=a[1],i+=l.text.length,fie.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(dP)){l.type="TYPE";continue}l.type="ID";continue}if(a=o.match(pie),a){l.text=a[1],l.type="NUMBER",i+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${i}`)}return new Ts(e.map(o=>Object.freeze(o)))}function hP(t,e){let n=[];for(const r in e.keys())t.has(r)&&n.push(r);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function py(t,e){if(e.peekKeyword(uP)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function Gi(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(r==null||e&&!e.has(r))break;if(t.pop(),n.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);n.add(r)}return Object.freeze(n)}function pP(t){let e=Gi(t,lie);return hP(e,Jn("constant payable nonpayable".split(" "))),hP(e,Jn("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function Wi(t,e){return t.popParams().map(n=>En.from(n,e))}function mP(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return xe(t.pop().text);throw new Error("invalid gas")}return null}function Nl(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const gie=new RegExp(/^(.*)\[([0-9]*)\]$/);function gP(t){const e=t.match(dP);if($(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);$(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);$(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const Lt={},dr=Symbol.for("_ethers_internal"),yP="_ParamTypeInternal",bP="_ErrorInternal",wP="_EventInternal",AP="_ConstructorInternal",vP="_FallbackInternal",xP="_FunctionInternal",kP="_StructInternal",rs=class rs{constructor(e,n,r,s,i,o,a,l){J(this,Sf);W(this,"name");W(this,"type");W(this,"baseType");W(this,"indexed");W(this,"components");W(this,"arrayLength");W(this,"arrayChildren");if($g(e,Lt,"ParamType"),Object.defineProperty(this,dr,{value:yP}),o&&(o=Object.freeze(o.slice())),s==="array"){if(a==null||l==null)throw new Error("")}else if(a!=null||l!=null)throw new Error("");if(s==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Oe(this,{name:n,type:r,baseType:s,indexed:i,components:o,arrayLength:a,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const i=JSON.parse(this.arrayChildren.format("json"));return i.name=r,i.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(i)}const s={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(s)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")":n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map(s=>r.arrayChildren.walk(s,n))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((s,i)=>r.components[i].walk(s,n))}return n(this.type,e)}async walkAsync(e,n){const r=[],s=[e];return fe(this,Sf,hb).call(this,r,e,n,i=>{s[0]=i}),r.length&&await Promise.all(r),s[0]}static from(e,n){if(rs.isParamType(e))return e;if(typeof e=="string")try{return rs.from(oa(e),n)}catch{$(!1,"invalid param type","obj",e)}else if(e instanceof Ts){let a="",l="",u=null;Gi(e,Jn(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",u=e.popParams().map(m=>rs.from(m)),a=`tuple(${u.map(m=>m.format()).join(",")})`):(a=gP(e.popType("TYPE")),l=a);let c=null,f=null;for(;e.length&&e.peekType("BRACKET");){const m=e.pop();c=new rs(Lt,"",a,l,null,u,f,c),f=m.value,a+=m.text,l="array",u=null}let d=null;if(Gi(e,uie).has("indexed")){if(!n)throw new Error("");d=!0}const p=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new rs(Lt,p,a,l,d,u,f,c)}const r=e.name;$(!r||typeof r=="string"&&r.match(fP),"invalid name","obj.name",r);let s=e.indexed;s!=null&&($(n,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let i=e.type,o=i.match(gie);if(o){const a=parseInt(o[2]||"-1"),l=rs.from({type:o[1],components:e.components});return new rs(Lt,r||"",i,"array",s,null,a,l)}if(i==="tuple"||i.startsWith("tuple(")||i.startsWith("(")){const a=e.components!=null?e.components.map(u=>rs.from(u)):null;return new rs(Lt,r||"",i,"tuple",s,a,null,null)}return i=gP(e.type),new rs(Lt,r||"",i,i,s,null,null,null)}static isParamType(e){return e&&e[dr]===yP}};Sf=new WeakSet,hb=function(e,n,r,s){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,a=n.slice();a.forEach((l,u)=>{var c;fe(c=o,Sf,hb).call(c,e,l,r,f=>{a[u]=f})}),s(a);return}if(this.isTuple()){const o=this.components;let a;if(Array.isArray(n))a=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");a=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((l,u)=>{var c;fe(c=o[u],Sf,hb).call(c,e,l,r,f=>{a[u]=f})}),s(a);return}const i=r(this.type,n);i.then?e.push(async function(){s(await i)}()):s(i)};let En=rs;class Rl{constructor(e,n,r){W(this,"type");W(this,"inputs");$g(e,Lt,"Fragment"),r=Object.freeze(r.slice()),Oe(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{Rl.from(JSON.parse(e))}catch{}return Rl.from(oa(e))}if(e instanceof Ts)switch(e.peekKeyword(uP)){case"constructor":return Ki.from(e);case"error":return hr.from(e);case"event":return ci.from(e);case"fallback":case"receive":return qi.from(e);case"function":return fi.from(e);case"struct":return Pl.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Ki.from(e);case"error":return hr.from(e);case"event":return ci.from(e);case"fallback":case"receive":return qi.from(e);case"function":return fi.from(e);case"struct":return Pl.from(e)}ee(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}$(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Ki.isFragment(e)}static isError(e){return hr.isFragment(e)}static isEvent(e){return ci.isFragment(e)}static isFunction(e){return fi.isFragment(e)}static isStruct(e){return Pl.isFragment(e)}}class my extends Rl{constructor(n,r,s,i){super(n,r,i);W(this,"name");$(typeof s=="string"&&s.match(fP),"invalid identifier","name",s),i=Object.freeze(i.slice()),Oe(this,{name:s})}}function $h(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}class hr extends my{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,dr,{value:bP})}get selector(){return Ol(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+$h(e,this.inputs)),n.join(" ")}static from(e){if(hr.isFragment(e))return e;if(typeof e=="string")return hr.from(oa(e));if(e instanceof Ts){const n=py("error",e),r=Wi(e);return Nl(e),new hr(Lt,n,r)}return new hr(Lt,e.name,e.inputs?e.inputs.map(En.from):[])}static isFragment(e){return e&&e[dr]===bP}}class ci extends my{constructor(n,r,s,i){super(n,"event",r,s);W(this,"anonymous");Object.defineProperty(this,dr,{value:wP}),Oe(this,{anonymous:i})}get topicHash(){return Ol(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(s=>JSON.parse(s.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+$h(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(i=>En.from(i)),new ci(Lt,n,r,!1).topicHash}static from(n){if(ci.isFragment(n))return n;if(typeof n=="string")try{return ci.from(oa(n))}catch{$(!1,"invalid event fragment","obj",n)}else if(n instanceof Ts){const r=py("event",n),s=Wi(n,!0),i=!!Gi(n,Jn(["anonymous"])).has("anonymous");return Nl(n),new ci(Lt,r,s,i)}return new ci(Lt,n.name,n.inputs?n.inputs.map(r=>En.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[dr]===wP}}class Ki extends Rl{constructor(n,r,s,i,o){super(n,r,s);W(this,"payable");W(this,"gas");Object.defineProperty(this,dr,{value:AP}),Oe(this,{payable:i,gas:o})}format(n){if(ee(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(s=>JSON.parse(s.format(n)))});const r=[`constructor${$h(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(Ki.isFragment(n))return n;if(typeof n=="string")try{return Ki.from(oa(n))}catch{$(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Ts){Gi(n,Jn(["constructor"]));const r=Wi(n),s=!!Gi(n,aie).has("payable"),i=mP(n);return Nl(n),new Ki(Lt,"constructor",r,s,i)}return new Ki(Lt,"constructor",n.inputs?n.inputs.map(En.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[dr]===AP}}class qi extends Rl{constructor(n,r,s){super(n,"fallback",r);W(this,"payable");Object.defineProperty(this,dr,{value:vP}),Oe(this,{payable:s})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const s=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:s})}return`${r}()${this.payable?" payable":""}`}static from(n){if(qi.isFragment(n))return n;if(typeof n=="string")try{return qi.from(oa(n))}catch{$(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Ts){const r=n.toString(),s=n.peekKeyword(Jn(["fallback","receive"]));if($(s,"type must be fallback or receive","obj",r),n.popKeyword(Jn(["fallback","receive"]))==="receive"){const l=Wi(n);return $(l.length===0,"receive cannot have arguments","obj.inputs",l),Gi(n,Jn(["payable"])),Nl(n),new qi(Lt,[],!0)}let o=Wi(n);o.length?$(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[En.from("bytes")];const a=pP(n);if($(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),Gi(n,Jn(["returns"])).has("returns")){const l=Wi(n);$(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(u=>u.format("minimal")).join(", "))}return Nl(n),new qi(Lt,o,a==="payable")}if(n.type==="receive")return new qi(Lt,[],!0);if(n.type==="fallback"){const r=[En.from("bytes")],s=n.stateMutability==="payable";return new qi(Lt,r,s)}$(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[dr]===vP}}class fi extends my{constructor(n,r,s,i,o,a){super(n,"function",r,i);W(this,"constant");W(this,"outputs");W(this,"stateMutability");W(this,"payable");W(this,"gas");Object.defineProperty(this,dr,{value:xP}),o=Object.freeze(o.slice()),Oe(this,{constant:s==="view"||s==="pure",gas:a,outputs:o,payable:s==="payable",stateMutability:s})}get selector(){return Ol(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="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!=null?this.gas:void 0,inputs:this.inputs.map(s=>JSON.parse(s.format(n))),outputs:this.outputs.map(s=>JSON.parse(s.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+$h(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push($h(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(i=>En.from(i)),new fi(Lt,n,"view",r,[],null).selector}static from(n){if(fi.isFragment(n))return n;if(typeof n=="string")try{return fi.from(oa(n))}catch{$(!1,"invalid function fragment","obj",n)}else if(n instanceof Ts){const s=py("function",n),i=Wi(n),o=pP(n);let a=[];Gi(n,Jn(["returns"])).has("returns")&&(a=Wi(n));const l=mP(n);return Nl(n),new fi(Lt,s,o,i,a,l)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new fi(Lt,n.name,r,n.inputs?n.inputs.map(En.from):[],n.outputs?n.outputs.map(En.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[dr]===xP}}class Pl extends my{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,dr,{value:kP})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Pl.from(oa(e))}catch{$(!1,"invalid struct fragment","obj",e)}else if(e instanceof Ts){const n=py("struct",e),r=Wi(e);return Nl(e),new Pl(Lt,n,r)}return new Pl(Lt,e.name,e.inputs?e.inputs.map(En.from):[])}static isFragment(e){return e&&e[dr]===kP}}const Ds=new Map;Ds.set(0,"GENERIC_PANIC"),Ds.set(1,"ASSERT_FALSE"),Ds.set(17,"OVERFLOW"),Ds.set(18,"DIVIDE_BY_ZERO"),Ds.set(33,"ENUM_RANGE_ERROR"),Ds.set(34,"BAD_STORAGE_DATA"),Ds.set(49,"STACK_UNDERFLOW"),Ds.set(50,"ARRAY_RANGE_ERROR"),Ds.set(65,"OUT_OF_MEMORY"),Ds.set(81,"UNINITIALIZED_FUNCTION_CALL");const yie=new RegExp(/^bytes([0-9]*)$/),bie=new RegExp(/^(u?int)([0-9]*)$/);let c2=null,EP=1024;function wie(t,e,n,r){let s="missing revert data",i=null;const o=null;let a=null;if(n){s="execution reverted";const u=ct(n);if(n=we(n),u.length===0)s+=" (no data present; likely require(false) occurred",i="require(false)";else if(u.length%32!==4)s+=" (could not decode reason; invalid data length)";else if(we(u.slice(0,4))==="0x08c379a0")try{i=r.decode(["string"],u.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[i]},s+=`: ${JSON.stringify(i)}`}catch{s+=" (could not decode reason; invalid string data)"}else if(we(u.slice(0,4))==="0x4e487b71")try{const c=Number(r.decode(["uint256"],u.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[c]},i=`Panic due to ${Ds.get(c)||"UNKNOWN"}(${c})`,s+=`: ${i}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}const l={to:e.to?gt(e.to):null,data:e.data||"0x"};return e.from&&(l.from=gt(e.from)),Nt(s,"CALL_EXCEPTION",{action:t,data:n,reason:i,transaction:l,invocation:o,revert:a})}const ab=class ab{constructor(){J(this,ba)}getDefaultValue(e){const n=e.map(s=>fe(this,ba,Qf).call(this,En.from(s)));return new ry(n,"_").defaultValue()}encode(e,n){s4(n.length,e.length,"types/values length mismatch");const r=e.map(o=>fe(this,ba,Qf).call(this,En.from(o))),s=new ry(r,"_"),i=new Sx;return s.encode(i,n),i.data}decode(e,n,r){const s=e.map(o=>fe(this,ba,Qf).call(this,En.from(o)));return new ry(s,"_").decode(new Tx(n,r,EP))}static _setDefaultMaxInflation(e){$(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),EP=e}static defaultAbiCoder(){return c2==null&&(c2=new ab),c2}static getBuiltinCallException(e,n,r){return wie(e,n,r,ab.defaultAbiCoder())}};ba=new WeakSet,Qf=function(e){if(e.isArray())return new $re(fe(this,ba,Qf).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new ry(e.components.map(r=>fe(this,ba,Qf).call(this,r)),e.name);switch(e.baseType){case"address":return new Hre(e.name);case"bool":return new Gre(e.name);case"string":return new ese(e.name);case"bytes":return new Wre(e.name);case"":return new Qre(e.name)}let n=e.type.match(bie);if(n){let r=parseInt(n[2]||"256");return $(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new Zre(r/8,n[1]==="int",e.name)}if(n=e.type.match(yie),n){let r=parseInt(n[1]);return $(r!==0&&r<=32,"invalid bytes length","param",e),new Kre(r,e.name)}$(!1,"invalid type","type",e.type)};let jc=ab;class Aie{constructor(e,n,r){W(this,"fragment");W(this,"name");W(this,"signature");W(this,"topic");W(this,"args");const s=e.name,i=e.format();Oe(this,{fragment:e,name:s,signature:i,topic:n,args:r})}}class vie{constructor(e,n,r,s){W(this,"fragment");W(this,"name");W(this,"args");W(this,"signature");W(this,"selector");W(this,"value");const i=e.name,o=e.format();Oe(this,{fragment:e,name:i,args:r,signature:o,selector:n,value:s})}}class xie{constructor(e,n,r){W(this,"fragment");W(this,"name");W(this,"args");W(this,"signature");W(this,"selector");const s=e.name,i=e.format();Oe(this,{fragment:e,name:s,args:r,signature:i,selector:n})}}class CP{constructor(e){W(this,"hash");W(this,"_isIndexed");Oe(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const SP={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},TP={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&SP[t.toString()]&&(e=SP[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}},su=class su{constructor(e){J(this,bi);W(this,"fragments");W(this,"deploy");W(this,"fallback");W(this,"receive");J(this,mi);J(this,gi);J(this,yi);J(this,Ln);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,I(this,yi,new Map),I(this,mi,new Map),I(this,gi,new Map);const r=[];for(const o of n)try{r.push(Rl.from(o))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,a.message)}Oe(this,{fragments:Object.freeze(r)});let s=null,i=!1;I(this,Ln,this.getAbiCoder()),this.fragments.forEach((o,a)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Oe(this,{deploy:o});return;case"fallback":o.inputs.length===0?i=!0:($(!s||o.payable!==s.payable,"conflicting fallback fragments",`fragments[${a}]`,o),s=o,i=s.payable);return;case"function":l=T(this,yi);break;case"event":l=T(this,gi);break;case"error":l=T(this,mi);break;default:return}const u=o.format();l.has(u)||l.set(u,o)}),this.deploy||Oe(this,{deploy:Ki.from("constructor()")}),Oe(this,{fallback:s,receive:i})}format(e){const n=e?"minimal":"full";return this.fragments.map(s=>s.format(n))}formatJson(){const e=this.fragments.map(n=>n.format("json"));return JSON.stringify(e.map(n=>JSON.parse(n)))}getAbiCoder(){return jc.defaultAbiCoder()}getFunctionName(e){const n=fe(this,bi,pb).call(this,e,null,!1);return $(n,"no matching function","key",e),n.name}hasFunction(e){return!!fe(this,bi,pb).call(this,e,null,!1)}getFunction(e,n){return fe(this,bi,pb).call(this,e,n||null,!0)}forEachFunction(e){const n=Array.from(T(this,yi).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];e(T(this,yi).get(s),r)}}getEventName(e){const n=fe(this,bi,mb).call(this,e,null,!1);return $(n,"no matching event","key",e),n.name}hasEvent(e){return!!fe(this,bi,mb).call(this,e,null,!1)}getEvent(e,n){return fe(this,bi,mb).call(this,e,n||null,!0)}forEachEvent(e){const n=Array.from(T(this,gi).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];e(T(this,gi).get(s),r)}}getError(e,n){if(St(e)){const s=e.toLowerCase();if(TP[s])return hr.from(TP[s].signature);for(const i of T(this,mi).values())if(s===i.selector)return i;return null}if(e.indexOf("(")===-1){const s=[];for(const[i,o]of T(this,mi))i.split("(")[0]===e&&s.push(o);if(s.length===0)return e==="Error"?hr.from("error Error(string)"):e==="Panic"?hr.from("error Panic(uint256)"):null;if(s.length>1){const i=s.map(o=>JSON.stringify(o.format())).join(", ");$(!1,`ambiguous error description (i.e. ${i})`,"name",e)}return s[0]}if(e=hr.from(e).format(),e==="Error(string)")return hr.from("error Error(string)");if(e==="Panic(uint256)")return hr.from("error Panic(uint256)");const r=T(this,mi).get(e);return r||null}forEachError(e){const n=Array.from(T(this,mi).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];e(T(this,mi).get(s),r)}}_decodeParams(e,n){return T(this,Ln).decode(e,n)}_encodeParams(e,n){return T(this,Ln).encode(e,n)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,n){if(typeof e=="string"){const r=this.getError(e);$(r,"unknown error","fragment",e),e=r}return $(Ht(n,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",n),this._decodeParams(e.inputs,Ht(n,4))}encodeErrorResult(e,n){if(typeof e=="string"){const r=this.getError(e);$(r,"unknown error","fragment",e),e=r}return $t([e.selector,this._encodeParams(e.inputs,n||[])])}decodeFunctionData(e,n){if(typeof e=="string"){const r=this.getFunction(e);$(r,"unknown function","fragment",e),e=r}return $(Ht(n,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",n),this._decodeParams(e.inputs,Ht(n,4))}encodeFunctionData(e,n){if(typeof e=="string"){const r=this.getFunction(e);$(r,"unknown function","fragment",e),e=r}return $t([e.selector,this._encodeParams(e.inputs,n||[])])}decodeFunctionResult(e,n){if(typeof e=="string"){const i=this.getFunction(e);$(i,"unknown function","fragment",e),e=i}let r="invalid length for result data";const s=Gn(n);if(s.length%32===0)try{return T(this,Ln).decode(e.outputs,s)}catch{r="could not decode result data"}ee(!1,r,"BAD_DATA",{value:we(s),info:{method:e.name,signature:e.format()}})}makeError(e,n){const r=ct(e,"data"),s=jc.getBuiltinCallException("call",n,r);if(s.message.startsWith("execution reverted (unknown custom error)")){const a=we(r.slice(0,4)),l=this.getError(a);if(l)try{const u=T(this,Ln).decode(l.inputs,r.slice(4));s.revert={name:l.name,signature:l.format(),args:u},s.reason=s.revert.signature,s.message=`execution reverted: ${s.reason}`}catch{s.message="execution reverted (coult not decode custom error)"}}const o=this.parseTransaction(n);return o&&(s.invocation={method:o.name,signature:o.signature,args:o.args}),s}encodeFunctionResult(e,n){if(typeof e=="string"){const r=this.getFunction(e);$(r,"unknown function","fragment",e),e=r}return we(T(this,Ln).encode(e.outputs,n||[]))}encodeFilterTopics(e,n){if(typeof e=="string"){const i=this.getEvent(e);$(i,"unknown event","eventFragment",e),e=i}ee(n.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:n.length,expectedCount:e.inputs.length});const r=[];e.anonymous||r.push(e.topicHash);const s=(i,o)=>i.type==="string"?Ol(o):i.type==="bytes"?en(we(o)):(i.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":i.type.match(/^u?int/)?o=Xo(o):i.type.match(/^bytes/)?o=nne(o,32):i.type==="address"&&T(this,Ln).encode(["address"],[o]),xl(we(o),32));for(n.forEach((i,o)=>{const a=e.inputs[o];if(!a.indexed){$(i==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,i);return}i==null?r.push(null):a.baseType==="array"||a.baseType==="tuple"?$(!1,"filtering with tuples or arrays not supported","contract."+a.name,i):Array.isArray(i)?r.push(i.map(l=>s(a,l))):r.push(s(a,i))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,n){if(typeof e=="string"){const o=this.getEvent(e);$(o,"unknown event","eventFragment",e),e=o}const r=[],s=[],i=[];return e.anonymous||r.push(e.topicHash),$(n.length===e.inputs.length,"event arguments/values mismatch","values",n),e.inputs.forEach((o,a)=>{const l=n[a];if(o.indexed)if(o.type==="string")r.push(Ol(l));else if(o.type==="bytes")r.push(en(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(T(this,Ln).encode([o.type],[l]))}else s.push(o),i.push(l)}),{data:T(this,Ln).encode(s,i),topics:r}}decodeEventLog(e,n,r){if(typeof e=="string"){const h=this.getEvent(e);$(h,"unknown event","eventFragment",e),e=h}if(r!=null&&!e.anonymous){const h=e.topicHash;$(St(r[0],32)&&r[0].toLowerCase()===h,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const s=[],i=[],o=[];e.inputs.forEach((h,p)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(s.push(En.from({type:"bytes32",name:h.name})),o.push(!0)):(s.push(h),o.push(!1)):(i.push(h),o.push(!1))});const a=r!=null?T(this,Ln).decode(s,$t(r)):null,l=T(this,Ln).decode(i,n,!0),u=[],c=[];let f=0,d=0;return e.inputs.forEach((h,p)=>{let m=null;if(h.indexed)if(a==null)m=new CP(null);else if(o[p])m=new CP(a[d++]);else try{m=a[d++]}catch(g){m=g}else try{m=l[f++]}catch(g){m=g}u.push(m),c.push(h.name||null)}),Dc.fromItems(u,c)}parseTransaction(e){const n=ct(e.data,"tx.data"),r=xe(e.value!=null?e.value:0,"tx.value"),s=this.getFunction(we(n.slice(0,4)));if(!s)return null;const i=T(this,Ln).decode(s.inputs,n.slice(4));return new vie(s,s.selector,i,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new Aie(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=we(e),r=this.getError(Ht(n,0,4));if(!r)return null;const s=T(this,Ln).decode(r.inputs,Ht(n,4));return new xie(r,r.selector,s)}static from(e){return e instanceof su?e:typeof e=="string"?new su(JSON.parse(e)):typeof e.formatJson=="function"?new su(e.formatJson()):typeof e.format=="function"?new su(e.format("json")):new su(e)}};mi=new WeakMap,gi=new WeakMap,yi=new WeakMap,Ln=new WeakMap,bi=new WeakSet,pb=function(e,n,r){if(St(e)){const i=e.toLowerCase();for(const o of T(this,yi).values())if(i===o.selector)return o;return null}if(e.indexOf("(")===-1){const i=[];for(const[o,a]of T(this,yi))o.split("(")[0]===e&&i.push(a);if(n){const o=n.length>0?n[n.length-1]:null;let a=n.length,l=!0;Rn.isTyped(o)&&o.type==="overrides"&&(l=!1,a--);for(let u=i.length-1;u>=0;u--){const c=i[u].inputs.length;c!==a&&(!l||c!==a-1)&&i.splice(u,1)}for(let u=i.length-1;u>=0;u--){const c=i[u].inputs;for(let f=0;f<n.length;f++)if(Rn.isTyped(n[f])){if(f>=c.length){if(n[f].type==="overrides")continue;i.splice(u,1);break}if(n[f].type!==c[f].baseType){i.splice(u,1);break}}}}if(i.length===1&&n&&n.length!==i[0].inputs.length){const o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&r){const o=i.map(a=>JSON.stringify(a.format())).join(", ");$(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return i[0]}const s=T(this,yi).get(fi.from(e).format());return s||null},mb=function(e,n,r){if(St(e)){const i=e.toLowerCase();for(const o of T(this,gi).values())if(i===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const i=[];for(const[o,a]of T(this,gi))o.split("(")[0]===e&&i.push(a);if(n){for(let o=i.length-1;o>=0;o--)i[o].inputs.length<n.length&&i.splice(o,1);for(let o=i.length-1;o>=0;o--){const a=i[o].inputs;for(let l=0;l<n.length;l++)if(Rn.isTyped(n[l])&&n[l].type!==a[l].baseType){i.splice(o,1);break}}}if(i.length===0)return null;if(i.length>1&&r){const o=i.map(a=>JSON.stringify(a.format())).join(", ");$(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return i[0]}const s=T(this,gi).get(ci.from(e).format());return s||null};let f2=su;const DP=BigInt(0);function Uc(t){return t??null}function Kt(t){return t==null?null:t.toString()}class OP{constructor(e,n,r){W(this,"gasPrice");W(this,"maxFeePerGas");W(this,"maxPriorityFeePerGas");Oe(this,{gasPrice:Uc(e),maxFeePerGas:Uc(n),maxPriorityFeePerGas:Uc(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Kt(e),maxFeePerGas:Kt(n),maxPriorityFeePerGas:Kt(r)}}}function gy(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=we(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const s of n)!(s in t)||t[s]==null||(e[s]=xe(t[s],`request.${s}`));const r="type,nonce".split(/,/);for(const s of r)!(s in t)||t[s]==null||(e[s]=Qe(t[s],`request.${s}`));return t.accessList&&(e.accessList=ia(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),"blobVersionedHashes"in t&&t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes.slice()),"kzg"in t&&(e.kzg=t.kzg),"blobs"in t&&t.blobs&&(e.blobs=t.blobs.map(s=>vx(s)?we(s):Object.assign({},s))),e}class kie{constructor(e,n){W(this,"provider");W(this,"number");W(this,"hash");W(this,"timestamp");W(this,"parentHash");W(this,"parentBeaconBlockRoot");W(this,"nonce");W(this,"difficulty");W(this,"gasLimit");W(this,"gasUsed");W(this,"stateRoot");W(this,"receiptsRoot");W(this,"blobGasUsed");W(this,"excessBlobGas");W(this,"miner");W(this,"prevRandao");W(this,"extraData");W(this,"baseFeePerGas");J(this,fo);I(this,fo,e.transactions.map(r=>typeof r!="string"?new Wh(r,n):r)),Oe(this,{provider:n,hash:Uc(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:Uc(e.prevRandao),extraData:e.extraData,baseFeePerGas:Uc(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return T(this,fo).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=T(this,fo).slice();return e.length===0?[]:(ee(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:n,extraData:r,gasLimit:s,gasUsed:i,hash:o,miner:a,prevRandao:l,nonce:u,number:c,parentHash:f,parentBeaconBlockRoot:d,stateRoot:h,receiptsRoot:p,timestamp:m,transactions:g}=this;return{_type:"Block",baseFeePerGas:Kt(e),difficulty:Kt(n),extraData:r,gasLimit:Kt(s),gasUsed:Kt(i),blobGasUsed:Kt(this.blobGasUsed),excessBlobGas:Kt(this.excessBlobGas),hash:o,miner:a,prevRandao:l,nonce:u,number:c,parentHash:f,timestamp:m,parentBeaconBlockRoot:d,stateRoot:h,receiptsRoot:p,transactions:g}}[Symbol.iterator](){let e=0;const n=this.transactions;return{next:()=>e<this.length?{value:n[e++],done:!1}:{value:void 0,done:!0}}}get length(){return T(this,fo).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let n;if(typeof e=="number")n=T(this,fo)[e];else{const r=e.toLowerCase();for(const s of T(this,fo))if(typeof s=="string"){if(s!==r)continue;n=s;break}else{if(s.hash===r)continue;n=s;break}}if(n==null)throw new Error("no such tx");return typeof n=="string"?await this.provider.getTransaction(n):n}getPrefetchedTransaction(e){const n=this.prefetchedTransactions;if(typeof e=="number")return n[e];e=e.toLowerCase();for(const r of n)if(r.hash===e)return r;$(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return Eie(this)}}fo=new WeakMap;class Gh{constructor(e,n){W(this,"provider");W(this,"transactionHash");W(this,"blockHash");W(this,"blockNumber");W(this,"removed");W(this,"address");W(this,"data");W(this,"topics");W(this,"index");W(this,"transactionIndex");this.provider=n;const r=Object.freeze(e.topics.slice());Oe(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:r,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:n,blockNumber:r,data:s,index:i,removed:o,topics:a,transactionHash:l,transactionIndex:u}=this;return{_type:"log",address:e,blockHash:n,blockNumber:r,data:s,index:i,removed:o,topics:a,transactionHash:l,transactionIndex:u}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return ee(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return ee(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return ee(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return Cie(this)}}class _P{constructor(e,n){W(this,"provider");W(this,"to");W(this,"from");W(this,"contractAddress");W(this,"hash");W(this,"index");W(this,"blockHash");W(this,"blockNumber");W(this,"logsBloom");W(this,"gasUsed");W(this,"blobGasUsed");W(this,"cumulativeGasUsed");W(this,"gasPrice");W(this,"blobGasPrice");W(this,"type");W(this,"status");W(this,"root");J(this,bp);I(this,bp,Object.freeze(e.logs.map(s=>new Gh(s,n))));let r=DP;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),Oe(this,{provider:n,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:r,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return T(this,bp)}toJSON(){const{to:e,from:n,contractAddress:r,hash:s,index:i,blockHash:o,blockNumber:a,logsBloom:l,logs:u,status:c,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:r,cumulativeGasUsed:Kt(this.cumulativeGasUsed),from:n,gasPrice:Kt(this.gasPrice),blobGasUsed:Kt(this.blobGasUsed),blobGasPrice:Kt(this.blobGasPrice),gasUsed:Kt(this.gasUsed),hash:s,index:i,logs:u,logsBloom:l,root:f,status:c,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return NP(this)}reorderedEvent(e){return ee(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),MP(this,e)}}bp=new WeakMap;const $k=class $k{constructor(e,n){W(this,"provider");W(this,"blockNumber");W(this,"blockHash");W(this,"index");W(this,"hash");W(this,"type");W(this,"to");W(this,"from");W(this,"nonce");W(this,"gasLimit");W(this,"gasPrice");W(this,"maxPriorityFeePerGas");W(this,"maxFeePerGas");W(this,"maxFeePerBlobGas");W(this,"data");W(this,"value");W(this,"chainId");W(this,"signature");W(this,"accessList");W(this,"blobVersionedHashes");J(this,wa);this.provider=n,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,I(this,wa,-1)}toJSON(){const{blockNumber:e,blockHash:n,index:r,hash:s,type:i,to:o,from:a,nonce:l,data:u,signature:c,accessList:f,blobVersionedHashes:d}=this;return{_type:"TransactionResponse",accessList:f,blockNumber:e,blockHash:n,blobVersionedHashes:d,chainId:Kt(this.chainId),data:u,from:a,gasLimit:Kt(this.gasLimit),gasPrice:Kt(this.gasPrice),hash:s,maxFeePerGas:Kt(this.maxFeePerGas),maxPriorityFeePerGas:Kt(this.maxPriorityFeePerGas),maxFeePerBlobGas:Kt(this.maxFeePerBlobGas),nonce:l,signature:c,to:o,index:r,type:i,value:Kt(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){const r=await this.getTransaction();r&&(e=r.blockNumber)}if(e==null)return null;const n=this.provider.getBlock(e);if(n==null)throw new Error("TODO");return n}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:n,blockNumber:r}=await Nn({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return n==null||n.blockNumber==null?0:r-n.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,n){const r=e??1,s=n??0;let i=T(this,wa),o=-1,a=i===-1;const l=async()=>{if(a)return null;const{blockNumber:d,nonce:h}=await Nn({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(h<this.nonce){i=d;return}if(a)return null;const p=await this.getTransaction();if(!(p&&p.blockNumber!=null))for(o===-1&&(o=i-3,o<T(this,wa)&&(o=T(this,wa)));o<=d;){if(a)return null;const m=await this.provider.getBlock(o,!0);if(m==null)return;for(const g of m)if(g===this.hash)return;for(let g=0;g<m.length;g++){const y=await m.getTransaction(g);if(y.from===this.from&&y.nonce===this.nonce){if(a)return null;const v=await this.provider.getTransactionReceipt(y.hash);if(v==null||d-v.blockNumber+1<r)return;let w="replaced";y.data===this.data&&y.to===this.to&&y.value===this.value?w="repriced":y.data==="0x"&&y.from===y.to&&y.value===DP&&(w="cancelled"),ee(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:w==="replaced"||w==="cancelled",reason:w,replacement:y.replaceableTransaction(i),hash:y.hash,receipt:v})}}o++}},u=d=>{if(d==null||d.status!==0)return d;ee(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:d.to,from:d.from,data:""},receipt:d})},c=await this.provider.getTransactionReceipt(this.hash);if(r===0)return u(c);if(c){if(await c.confirmations()>=r)return u(c)}else if(await l(),r===0)return null;return await new Promise((d,h)=>{const p=[],m=()=>{p.forEach(y=>y())};if(p.push(()=>{a=!0}),s>0){const y=setTimeout(()=>{m(),h(Nt("wait for transaction timeout","TIMEOUT"))},s);p.push(()=>{clearTimeout(y)})}const g=async y=>{if(await y.confirmations()>=r){m();try{d(u(y))}catch(v){h(v)}}};if(p.push(()=>{this.provider.off(this.hash,g)}),this.provider.on(this.hash,g),i>=0){const y=async()=>{try{await l()}catch(v){if(gn(v,"TRANSACTION_REPLACED")){m(),h(v);return}}a||this.provider.once("block",y)};p.push(()=>{this.provider.off("block",y)}),this.provider.once("block",y)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return ee(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),NP(this)}reorderedEvent(e){return ee(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ee(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),MP(this,e)}replaceableTransaction(e){$(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new $k(this,this.provider);return I(n,wa,e),n}};wa=new WeakMap;let Wh=$k;function Eie(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function MP(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function NP(t){return{orphan:"drop-transaction",tx:t}}function Cie(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class d2 extends Gh{constructor(n,r,s){super(n,n.provider);W(this,"interface");W(this,"fragment");W(this,"args");const i=r.decodeEventLog(s,n.data,n.topics);Oe(this,{args:i,fragment:s,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class RP extends Gh{constructor(n,r){super(n,n.provider);W(this,"error");Oe(this,{error:r})}}class Sie extends _P{constructor(n,r,s){super(s,r);J(this,Tf);I(this,Tf,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?T(this,Tf).getEvent(n.topics[0]):null;if(r)try{return new d2(n,T(this,Tf),r)}catch(s){return new RP(n,s)}return n})}}Tf=new WeakMap;class h2 extends Wh{constructor(n,r,s){super(s,r);J(this,wp);I(this,wp,n)}async wait(n,r){const s=await super.wait(n,r);return s==null?null:new Sie(T(this,wp),this.provider,s)}}wp=new WeakMap;class PP extends d4{constructor(n,r,s,i){super(n,r,s);W(this,"log");Oe(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class Tie extends PP{constructor(e,n,r,s,i){super(e,n,r,new d2(i,e.interface,s));const o=e.interface.decodeEventLog(s,this.log.data,this.log.topics);Oe(this,{args:o,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const IP=BigInt(0);function LP(t){return t&&typeof t.call=="function"}function BP(t){return t&&typeof t.estimateGas=="function"}function yy(t){return t&&typeof t.resolveName=="function"}function FP(t){return t&&typeof t.sendTransaction=="function"}function jP(t){if(t!=null){if(yy(t))return t;if(t.provider)return t.provider}}class Die{constructor(e,n,r){J(this,Ap);W(this,"fragment");if(Oe(this,{fragment:n}),n.inputs.length<r.length)throw new Error("too many arguments");const s=Il(e.runner,"resolveName"),i=yy(s)?s:null;I(this,Ap,async function(){const o=await Promise.all(n.inputs.map((a,l)=>r[l]==null?null:a.walkAsync(r[l],(c,f)=>c==="address"?Array.isArray(f)?Promise.all(f.map(d=>Qn(d,i))):Qn(f,i):f)));return e.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return T(this,Ap)}}Ap=new WeakMap;function Il(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function Ll(t){return t==null?null:t.provider||null}async function UP(t,e){const n=Rn.dereference(t,"overrides");$(typeof n=="object","invalid overrides parameter","overrides",t);const r=gy(n);return $(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),$(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function Oie(t,e,n){const r=Il(t,"resolveName"),s=yy(r)?r:null;return await Promise.all(e.map((i,o)=>i.walkAsync(n[o],(a,l)=>(l=Rn.dereference(l,a),a==="address"?Qn(l,s):l))))}function _ie(t){const e=async function(o){const a=await UP(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await Qn(a.from,jP(t.runner)));const l=t.interface,u=xe(a.value||IP,"overrides.value")===IP,c=(a.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!c&&!u&&$(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),$(l.fallback||c,"cannot send data to receive-only contract","overrides.data",a.data);const f=l.receive||l.fallback&&l.fallback.payable;return $(f||u,"cannot send value to non-payable fallback","overrides.value",a.value),$(l.fallback||c,"cannot send data to receive-only contract","overrides.data",a.data),a},n=async function(o){const a=Il(t.runner,"call");ee(LP(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await a.call(l)}catch(u){throw Ax(u)&&u.data?t.interface.makeError(u.data,l):u}},r=async function(o){const a=t.runner;ee(FP(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await a.sendTransaction(await e(o)),u=Ll(t.runner);return new h2(t.interface,u,l)},s=async function(o){const a=Il(t.runner,"estimateGas");return ee(BP(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},i=async o=>await r(o);return Oe(i,{_contract:t,estimateGas:s,populateTransaction:e,send:r,staticCall:n}),i}function Mie(t,e){const n=function(...u){const c=t.interface.getFunction(e,u);return ee(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),c},r=async function(...u){const c=n(...u);let f={};if(c.inputs.length+1===u.length&&(f=await UP(u.pop()),f.from&&(f.from=await Qn(f.from,jP(t.runner)))),c.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const d=await Oie(t.runner,c.inputs,u);return Object.assign({},f,await Nn({to:t.getAddress(),data:t.interface.encodeFunctionData(c,d)}))},s=async function(...u){const c=await a(...u);return c.length===1?c[0]:c},i=async function(...u){const c=t.runner;ee(FP(c),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await c.sendTransaction(await r(...u)),d=Ll(t.runner);return new h2(t.interface,d,f)},o=async function(...u){const c=Il(t.runner,"estimateGas");return ee(BP(c),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await c.estimateGas(await r(...u))},a=async function(...u){const c=Il(t.runner,"call");ee(LP(c),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...u);let d="0x";try{d=await c.call(f)}catch(p){throw Ax(p)&&p.data?t.interface.makeError(p.data,f):p}const h=n(...u);return t.interface.decodeFunctionResult(h,d)},l=async(...u)=>n(...u).constant?await s(...u):await i(...u);return Oe(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:n,estimateGas:o,populateTransaction:r,send:i,staticCall:s,staticCallResult:a}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const u=t.interface.getFunction(e);return ee(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),l}function Nie(t,e){const n=function(...s){const i=t.interface.getEvent(e,s);return ee(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:s}}),i},r=function(...s){return new Die(t,n(...s),s)};return Oe(r,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const s=t.interface.getEvent(e);return ee(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),s}}),r}const by=Symbol.for("_ethersInternal_contract"),VP=new WeakMap;function Rie(t,e){VP.set(t[by],e)}function Rr(t){return VP.get(t[by])}function Pie(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function p2(t,e){let n,r=null;if(Array.isArray(e)){const i=function(o){if(St(o,32))return o;const a=t.interface.getEvent(o);return $(a,"unknown fragment","name",o),a.topicHash};n=e.map(o=>o==null?null:Array.isArray(o)?o.map(i):i(o))}else e==="*"?n=[null]:typeof e=="string"?St(e,32)?n=[e]:(r=t.interface.getEvent(e),$(r,"unknown fragment","event",e),n=[r.topicHash]):Pie(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):$(!1,"unknown event name","event",e);n=n.map(i=>{if(i==null)return null;if(Array.isArray(i)){const o=Array.from(new Set(i.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return i.toLowerCase()});const s=n.map(i=>i==null?"null":Array.isArray(i)?i.join("|"):i).join("&");return{fragment:r,tag:s,topics:n}}async function Kh(t,e){const{subs:n}=Rr(t);return n.get((await p2(t,e)).tag)||null}async function HP(t,e,n){const r=Ll(t.runner);ee(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:s,tag:i,topics:o}=await p2(t,n),{addr:a,subs:l}=Rr(t);let u=l.get(i);if(!u){const f={address:a||t,topics:o},d=g=>{let y=s;if(y==null)try{y=t.interface.getEvent(g.topics[0])}catch{}if(y){const v=y,w=s?t.interface.decodeEventLog(s,g.data,g.topics):[];g2(t,n,w,A=>new Tie(t,A,n,v,g))}else g2(t,n,[],v=>new PP(t,v,n,g))};let h=[];u={tag:i,listeners:[],start:()=>{h.length||h.push(r.on(f,d))},stop:async()=>{if(h.length==0)return;let g=h;h=[],await Promise.all(g),r.off(f,d)}},l.set(i,u)}return u}let m2=Promise.resolve();async function Iie(t,e,n,r){await m2;const s=await Kh(t,e);if(!s)return!1;const i=s.listeners.length;return s.listeners=s.listeners.filter(({listener:o,once:a})=>{const l=Array.from(n);r&&l.push(r(a?null:o));try{o.call(t,...l)}catch{}return!a}),s.listeners.length===0&&(s.stop(),Rr(t).subs.delete(s.tag)),i>0}async function g2(t,e,n,r){try{await m2}catch{}const s=Iie(t,e,n,r);return m2=s,await s}const wy=["then"];zL=by;const vp=class vp{constructor(e,n,r,s){W(this,"target");W(this,"interface");W(this,"runner");W(this,"filters");W(this,zL);W(this,"fallback");$(typeof e=="string"||xR(e),"invalid value for Contract target","target",e),r==null&&(r=null);const i=f2.from(n);Oe(this,{target:e,runner:r,interface:i}),Object.defineProperty(this,by,{value:{}});let o,a=null,l=null;if(s){const f=Ll(r);l=new h2(this.interface,f,s)}let u=new Map;if(typeof e=="string")if(St(e))a=e,o=Promise.resolve(e);else{const f=Il(r,"resolveName");if(!yy(f))throw Nt("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(d=>{if(d==null)throw Nt("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Rr(this).addr=d,d})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Rr(this).addr=f,f});Rie(this,{addrPromise:o,addr:a,deployTx:l,subs:u});const c=new Proxy({},{get:(f,d,h)=>{if(typeof d=="symbol"||wy.indexOf(d)>=0)return Reflect.get(f,d,h);try{return this.getEvent(d)}catch(p){if(!gn(p,"INVALID_ARGUMENT")||p.argument!=="key")throw p}},has:(f,d)=>wy.indexOf(d)>=0?Reflect.has(f,d):Reflect.has(f,d)||this.interface.hasEvent(String(d))});return Oe(this,{filters:c}),Oe(this,{fallback:i.receive||i.fallback?_ie(this):null}),new Proxy(this,{get:(f,d,h)=>{if(typeof d=="symbol"||d in f||wy.indexOf(d)>=0)return Reflect.get(f,d,h);try{return f.getFunction(d)}catch(p){if(!gn(p,"INVALID_ARGUMENT")||p.argument!=="key")throw p}},has:(f,d)=>typeof d=="symbol"||d in f||wy.indexOf(d)>=0?Reflect.has(f,d):f.interface.hasFunction(d)})}connect(e){return new vp(this.target,this.interface,e)}attach(e){return new vp(e,this.interface,this.runner)}async getAddress(){return await Rr(this).addrPromise}async getDeployedCode(){const e=Ll(this.runner);ee(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await e.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=Ll(this.runner);return ee(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,i)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);r.once("block",o)}catch(a){i(a)}};o()})}deploymentTransaction(){return Rr(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),Mie(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),Nie(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:s,addrPromise:i}=Rr(this),o=s||await i,{fragment:a,topics:l}=await p2(this,e),u={address:o,topics:l,fromBlock:n,toBlock:r},c=Ll(this.runner);return ee(c,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await c.getLogs(u)).map(f=>{let d=a;if(d==null)try{d=this.interface.getEvent(f.topics[0])}catch{}if(d)try{return new d2(f,this.interface,d)}catch(h){return new RP(f,h)}return new Gh(f,c)})}async on(e,n){const r=await HP(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await HP(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await g2(this,e,n,null)}async listenerCount(e){if(e){const s=await Kh(this,e);return s?s.listeners.length:0}const{subs:n}=Rr(this);let r=0;for(const{listeners:s}of n.values())r+=s.length;return r}async listeners(e){if(e){const s=await Kh(this,e);return s?s.listeners.map(({listener:i})=>i):[]}const{subs:n}=Rr(this);let r=[];for(const{listeners:s}of n.values())r=r.concat(s.map(({listener:i})=>i));return r}async off(e,n){const r=await Kh(this,e);if(!r)return this;if(n){const s=r.listeners.map(({listener:i})=>i).indexOf(n);s>=0&&r.listeners.splice(s,1)}return(n==null||r.listeners.length===0)&&(r.stop(),Rr(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const n=await Kh(this,e);if(!n)return this;n.stop(),Rr(this).subs.delete(n.tag)}else{const{subs:n}=Rr(this);for(const{tag:r,stop:s}of n.values())s(),n.delete(r)}return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return await this.off(e,n)}static buildClass(e){class n extends vp{constructor(s,i=null){super(s,e,i)}}return n}static from(e,n,r){return r==null&&(r=null),new this(e,n,r)}};let y2=vp;function Lie(){return y2}class Vc extends Lie(){}function b2(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):$(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class Bie{constructor(e){W(this,"name");Oe(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,n){throw new Error("unsupported coin")}async decodeAddress(e,n){throw new Error("unsupported coin")}}const zP=new RegExp("^(ipfs)://(.*)$","i"),$P=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),zP,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")],Df=class Df{constructor(e,n,r){J(this,va);W(this,"provider");W(this,"address");W(this,"name");J(this,Aa);J(this,iu);Oe(this,{provider:e,address:n,name:r}),I(this,Aa,null),I(this,iu,new Vc(n,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return T(this,Aa)==null&&I(this,Aa,(async()=>{try{return await T(this,iu).supportsInterface("0x9061b923")}catch(e){if(gn(e,"CALL_EXCEPTION"))return!1;throw I(this,Aa,null),e}})()),await T(this,Aa)}async getAddress(e){if(e==null&&(e=60),e===60)try{const i=await fe(this,va,Jf).call(this,"addr(bytes32)");return i==null||i===Ph?null:i}catch(i){if(gn(i,"CALL_EXCEPTION"))return null;throw i}if(e>=0&&e<2147483648){let i=e+2147483648;const o=await fe(this,va,Jf).call(this,"addr(bytes32,uint)",[i]);if(St(o,20))return gt(o)}let n=null;for(const i of this.provider.plugins)if(i instanceof Bie&&i.supportsCoinType(e)){n=i;break}if(n==null)return null;const r=await fe(this,va,Jf).call(this,"addr(bytes32,uint)",[e]);if(r==null||r==="0x")return null;const s=await n.decodeAddress(e,r);if(s!=null)return s;ee(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const n=await fe(this,va,Jf).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await fe(this,va,Jf).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const n=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const s=n[1]==="e3010170"?"ipfs":"ipns",i=parseInt(n[4],16);if(n[5].length===i*2)return`${s}://${ine("0x"+n[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;ee(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(n==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let r=0;r<$P.length;r++){const s=n.match($P[r]);if(s==null)continue;const i=s[1].toLowerCase();switch(i){case"https":case"data":return e.push({type:"url",value:n}),{linkage:e,url:n};case"ipfs":{const o=b2(n);return e.push({type:"ipfs",value:n}),e.push({type:"url",value:o}),{linkage:e,url:o}}case"erc721":case"erc1155":{const o=i==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:i,value:n});const a=await this.getAddress();if(a==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const l=(s[2]||"").split("/");if(l.length!==2)return e.push({type:`!${i}caip`,value:s[2]||""}),{url:null,linkage:e};const u=l[1],c=new Vc(l[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(i==="erc721"){const m=await c.ownerOf(u);if(a!==m)return e.push({type:"!owner",value:m}),{url:null,linkage:e};e.push({type:"owner",value:m})}else if(i==="erc1155"){const m=await c.balanceOf(a,u);if(!m)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:m.toString()})}let f=await c[o](u);if(f==null||f==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:f}),i==="erc1155"&&(f=f.replace("{id}",Xo(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:f})),f.match(/^ipfs:/i)&&(f=b2(f)),e.push({type:"metadata-url",value:f});let d={};const h=await new Kn(f).send();h.assertOk();try{d=h.bodyJson}catch{try{e.push({type:"!metadata",value:h.bodyText})}catch{const y=h.body;return y&&e.push({type:"!metadata",value:we(y)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!d)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(d)});let p=d.image;if(typeof p!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!p.match(/^(https:\/\/|data:)/i)){if(p.match(zP)==null)return e.push({type:"!imageUrl-ipfs",value:p}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:p}),p=b2(p)}return e.push({type:"url",value:p}),{linkage:e,url:p}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){const n=await e.getNetwork(),r=n.getPlugin("org.ethers.plugins.network.Ens");return ee(r,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:n}}),r.address}static async fromName(e,n){var s;let r=n;for(;;){if(r===""||r==="."||n!=="eth"&&r==="eth")return null;const i=await fe(s=Df,lb,JL).call(s,e,r);if(i!=null){const o=new Df(e,i,n);return r!==n&&!await o.supportsWildcard()?null:o}r=r.split(".").slice(1).join(".")}}};Aa=new WeakMap,iu=new WeakMap,va=new WeakSet,Jf=async function(e,n){n=(n||[]).slice();const r=T(this,iu).interface;n.unshift(n2(this.name));let s=null;await this.supportsWildcard()&&(s=r.getFunction(e),ee(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),n=[Fse(this.name,255),r.encodeFunctionData(s,n)],e="resolve(bytes,bytes)"),n.push({enableCcipRead:!0});try{const i=await T(this,iu)[e](...n);return s?r.decodeFunctionResult(s,i)[0]:i}catch(i){if(!gn(i,"CALL_EXCEPTION"))throw i}return null},lb=new WeakSet,JL=async function(e,n){const r=await Df.getEnsAddress(e);try{const i=await new Vc(r,["function resolver(bytes32) view returns (address)"],e).resolver(n2(n),{enableCcipRead:!0});return i===Ph?null:i}catch(s){throw s}return null},J(Df,lb);let Ay=Df;const GP=BigInt(0);function lt(t,e){return function(n){return n==null?e:t(n)}}function vy(t,e){return n=>{if(e&&n==null)return null;if(!Array.isArray(n))throw new Error("not an array");return n.map(r=>t(r))}}function qh(t,e){return n=>{const r={};for(const s in t){let i=s;if(e&&s in e&&!(i in n)){for(const o of e[s])if(o in n){i=o;break}}try{const o=t[s](n[i]);o!==void 0&&(r[s]=o)}catch(o){const a=o instanceof Error?o.message:"not-an-error";ee(!1,`invalid value for value.${s} (${a})`,"BAD_DATA",{value:n})}}return r}}function Fie(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}$(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Hc(t){return $(St(t,!0),"invalid data","value",t),t}function Cn(t){return $(St(t,32),"invalid hash","value",t),t}const jie=qh({address:gt,blockHash:Cn,blockNumber:Qe,data:Hc,index:Qe,removed:lt(Fie,!1),topics:vy(Cn),transactionHash:Cn,transactionIndex:Qe},{index:["logIndex"]});function Uie(t){return jie(t)}const Vie=qh({hash:lt(Cn),parentHash:Cn,parentBeaconBlockRoot:lt(Cn,null),number:Qe,timestamp:Qe,nonce:lt(Hc),difficulty:xe,gasLimit:xe,gasUsed:xe,stateRoot:lt(Cn,null),receiptsRoot:lt(Cn,null),blobGasUsed:lt(xe,null),excessBlobGas:lt(xe,null),miner:lt(gt),prevRandao:lt(Cn,null),extraData:Hc,baseFeePerGas:lt(xe)},{prevRandao:["mixHash"]});function Hie(t){const e=Vie(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:WP(n)),e}const zie=qh({transactionIndex:Qe,blockNumber:Qe,transactionHash:Cn,address:gt,topics:vy(Cn),data:Hc,index:Qe,blockHash:Cn},{index:["logIndex"]});function $ie(t){return zie(t)}const Gie=qh({to:lt(gt,null),from:lt(gt,null),contractAddress:lt(gt,null),index:Qe,root:lt(we),gasUsed:xe,blobGasUsed:lt(xe,null),logsBloom:lt(Hc),blockHash:Cn,hash:Cn,logs:vy($ie),blockNumber:Qe,cumulativeGasUsed:xe,effectiveGasPrice:lt(xe),blobGasPrice:lt(xe,null),status:lt(Qe),type:lt(Qe,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function Wie(t){return Gie(t)}function WP(t){t.to&&xe(t.to)===GP&&(t.to="0x0000000000000000000000000000000000000000");const e=qh({hash:Cn,index:lt(Qe,void 0),type:n=>n==="0x"||n==null?0:Qe(n),accessList:lt(ia,null),blobVersionedHashes:lt(vy(Cn,!0),null),blockHash:lt(Cn,null),blockNumber:lt(Qe,null),transactionIndex:lt(Qe,null),from:gt,gasPrice:lt(xe),maxPriorityFeePerGas:lt(xe),maxFeePerGas:lt(xe),maxFeePerBlobGas:lt(xe,null),gasLimit:xe,to:lt(gt,null),value:xe,nonce:Qe,data:Hc,creates:lt(gt,null),chainId:lt(xe,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=Ure(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=Ss.from(t.signature):e.signature=Ss.from(t),e.chainId==null){const n=e.signature.legacyChainId;n!=null&&(e.chainId=n)}return e.blockHash&&xe(e.blockHash)===GP&&(e.blockHash=null),e}const Kie="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class Qh{constructor(e){W(this,"name");Oe(this,{name:e})}clone(){return new Qh(this.name)}}class xy extends Qh{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);W(this,"effectiveBlock");W(this,"txBase");W(this,"txCreate");W(this,"txDataZero");W(this,"txDataNonzero");W(this,"txAccessListStorageKey");W(this,"txAccessListAddress");const s={effectiveBlock:n};function i(o,a){let l=(r||{})[o];l==null&&(l=a),$(typeof l=="number",`invalud value for ${o}`,"costs",r),s[o]=l}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),Oe(this,s)}clone(){return new xy(this.effectiveBlock,this)}}class ky extends Qh{constructor(n,r){super("org.ethers.plugins.network.Ens");W(this,"address");W(this,"targetNetwork");Oe(this,{address:n||Kie,targetNetwork:r??1})}clone(){return new ky(this.address,this.targetNetwork)}}class qie extends Qh{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");J(this,xp);J(this,kp);I(this,xp,n),I(this,kp,r)}get url(){return T(this,xp)}get processFunc(){return T(this,kp)}clone(){return this}}xp=new WeakMap,kp=new WeakMap;const w2=new Map,Mf=class Mf{constructor(e,n){J(this,Of);J(this,_f);J(this,xa);I(this,Of,e),I(this,_f,xe(n)),I(this,xa,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return T(this,Of)}set name(e){I(this,Of,e)}get chainId(){return T(this,_f)}set chainId(e){I(this,_f,xe(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===xe(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===xe(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===xe(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(T(this,xa).values())}attachPlugin(e){if(T(this,xa).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return T(this,xa).set(e.name,e.clone()),this}getPlugin(e){return T(this,xa).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new Mf(this.name,this.chainId);return this.plugins.forEach(n=>{e.attachPlugin(n.clone())}),e}computeIntrinsicGas(e){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new xy;let r=n.txBase;if(e.to==null&&(r+=n.txCreate),e.data)for(let s=2;s<e.data.length;s+=2)e.data.substring(s,s+2)==="00"?r+=n.txDataZero:r+=n.txDataNonzero;if(e.accessList){const s=ia(e.accessList);for(const i in s)r+=n.txAccessListAddress+n.txAccessListStorageKey*s[i].storageKeys.length}return r}static from(e){if(Qie(),e==null)return Mf.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const n=w2.get(e);if(n)return n();if(typeof e=="bigint")return new Mf("unknown",e);$(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){$(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const n=new Mf(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&n.attachPlugin(new ky(e.ensAddress,e.ensNetwork)),n}$(!1,"invalid network","network",e)}static register(e,n){typeof e=="number"&&(e=BigInt(e));const r=w2.get(e);r&&$(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",e),w2.set(e,n)}};Of=new WeakMap,_f=new WeakMap,xa=new WeakMap;let rn=Mf;function KP(t,e){const n=String(t);if(!n.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${t}`);const r=n.split(".");if(r.length===1&&r.push(""),r.length!==2)throw new Error(`invalid gwei value: ${t}`);for(;r[1].length<e;)r[1]+="0";if(r[1].length>9){let s=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||s++,r[1]=s.toString()}return BigInt(r[0]+r[1])}function qP(t){return new qie(t,async(e,n,r)=>{r.setHeader("User-Agent","ethers");let s;try{const[i,o]=await Promise.all([r.send(),e()]);s=i;const a=s.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:KP(a.maxFee,9),maxPriorityFeePerGas:KP(a.maxPriorityFee,9)}}catch(i){ee(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:s,error:i})}})}let QP=!1;function Qie(){if(QP)return;QP=!0;function t(e,n,r){const s=function(){const i=new rn(e,n);return r.ensNetwork!=null&&i.attachPlugin(new ky(null,r.ensNetwork)),i.attachPlugin(new xy),(r.plugins||[]).forEach(o=>{i.attachPlugin(o)}),i};rn.register(e,s),rn.register(n,s),r.altNames&&r.altNames.forEach(i=>{rn.register(i,s)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("linea-sepolia",59141,{}),t("matic",137,{ensNetwork:1,plugins:[qP("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[qP("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function A2(t){return JSON.parse(JSON.stringify(t))}class Jie{constructor(e){J(this,Nf);J(this,ho);J(this,ss);J(this,ka);J(this,wi);I(this,ho,e),I(this,ss,null),I(this,ka,4e3),I(this,wi,-2)}get pollingInterval(){return T(this,ka)}set pollingInterval(e){I(this,ka,e)}start(){T(this,ss)||(I(this,ss,T(this,ho)._setTimeout(fe(this,Nf,gb).bind(this),T(this,ka))),fe(this,Nf,gb).call(this))}stop(){T(this,ss)&&(T(this,ho)._clearTimeout(T(this,ss)),I(this,ss,null))}pause(e){this.stop(),e&&I(this,wi,-2)}resume(){this.start()}}ho=new WeakMap,ss=new WeakMap,ka=new WeakMap,wi=new WeakMap,Nf=new WeakSet,gb=async function(){try{const e=await T(this,ho).getBlockNumber();if(T(this,wi)===-2){I(this,wi,e);return}if(e!==T(this,wi)){for(let n=T(this,wi)+1;n<=e;n++){if(T(this,ss)==null)return;await T(this,ho).emit("block",n)}I(this,wi,e)}}catch{}T(this,ss)!=null&&I(this,ss,T(this,ho)._setTimeout(fe(this,Nf,gb).bind(this),T(this,ka)))};class v2{constructor(e){J(this,ou);J(this,au);J(this,Ea);I(this,ou,e),I(this,Ea,!1),I(this,au,n=>{this._poll(n,T(this,ou))})}async _poll(e,n){throw new Error("sub-classes must override this")}start(){T(this,Ea)||(I(this,Ea,!0),T(this,au).call(this,-2),T(this,ou).on("block",T(this,au)))}stop(){T(this,Ea)&&(I(this,Ea,!1),T(this,ou).off("block",T(this,au)))}pause(e){this.stop()}resume(){this.start()}}ou=new WeakMap,au=new WeakMap,Ea=new WeakMap;class Yie extends v2{constructor(n,r){super(n);J(this,Rf);J(this,po);I(this,Rf,r),I(this,po,-2)}pause(n){n&&I(this,po,-2),super.pause(n)}async _poll(n,r){const s=await r.getBlock(T(this,Rf));s!=null&&(T(this,po)===-2?I(this,po,s.number):s.number>T(this,po)&&(r.emit(T(this,Rf),s.number),I(this,po,s.number)))}}Rf=new WeakMap,po=new WeakMap;class Xie extends v2{constructor(n,r){super(n);J(this,ub);I(this,ub,A2(r))}async _poll(n,r){throw new Error("@TODO")}}ub=new WeakMap;class Zie extends v2{constructor(n,r){super(n);J(this,Pf);I(this,Pf,r)}async _poll(n,r){const s=await r.getTransactionReceipt(T(this,Pf));s&&r.emit(T(this,Pf),s)}}Pf=new WeakMap;class x2{constructor(e,n){J(this,cb);J(this,mo);J(this,If);J(this,Lf);J(this,Ca);J(this,is);I(this,mo,e),I(this,If,A2(n)),I(this,Lf,fe(this,cb,YL).bind(this)),I(this,Ca,!1),I(this,is,-2)}start(){T(this,Ca)||(I(this,Ca,!0),T(this,is)===-2&&T(this,mo).getBlockNumber().then(e=>{I(this,is,e)}),T(this,mo).on("block",T(this,Lf)))}stop(){T(this,Ca)&&(I(this,Ca,!1),T(this,mo).off("block",T(this,Lf)))}pause(e){this.stop(),e&&I(this,is,-2)}resume(){this.start()}}mo=new WeakMap,If=new WeakMap,Lf=new WeakMap,Ca=new WeakMap,is=new WeakMap,cb=new WeakSet,YL=async function(e){if(T(this,is)===-2)return;const n=A2(T(this,If));n.fromBlock=T(this,is)+1,n.toBlock=e;const r=await T(this,mo).getLogs(n);if(r.length===0){T(this,is)<e-60&&I(this,is,e-60);return}for(const s of r)T(this,mo).emit(T(this,If),s),I(this,is,s.blockNumber)};const eoe=BigInt(2),toe=10;function Ey(t){return t&&typeof t.then=="function"}function Cy(t,e){return t+":"+JSON.stringify(e,(n,r)=>{if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const s=Object.keys(r);return s.sort(),s.reduce((i,o)=>(i[o]=r[o],i),{})}return r})}class Sy{constructor(e){W(this,"name");Oe(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function noe(t){return JSON.parse(JSON.stringify(t))}function k2(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function E2(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(St(t,32)){const n=t.toLowerCase();return{type:"transaction",tag:Cy("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:Cy("orphan",n),filter:noe(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(s=>s==null?null:Array.isArray(s)?k2(s.map(i=>i.toLowerCase())):s.toLowerCase())};if(n.address){const s=[],i=[],o=a=>{St(a)?s.push(a):i.push((async()=>{s.push(await Qn(a,e))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),i.length&&await Promise.all(i),r.address=k2(s.map(a=>a.toLowerCase()))}return{filter:r,tag:Cy("event",r),type:"event"}}$(!1,"unknown ProviderEvent","event",t)}function C2(){return new Date().getTime()}const roe={cacheTimeout:250,pollingInterval:4e3};class Ty{constructor(e,n){J(this,st);J(this,Bn);J(this,Sa);J(this,Fn);J(this,Bf);J(this,Fr);J(this,lu);J(this,Ta);J(this,go);J(this,Ep);J(this,as);J(this,Ff);J(this,jf);if(I(this,jf,Object.assign({},roe,n||{})),e==="any")I(this,lu,!0),I(this,Fr,null);else if(e){const r=rn.from(e);I(this,lu,!1),I(this,Fr,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else I(this,lu,!1),I(this,Fr,null);I(this,go,-1),I(this,Ta,new Map),I(this,Bn,new Map),I(this,Sa,new Map),I(this,Fn,null),I(this,Bf,!1),I(this,Ep,1),I(this,as,new Map),I(this,Ff,!1)}get pollingInterval(){return T(this,jf).pollingInterval}get provider(){return this}get plugins(){return Array.from(T(this,Sa).values())}attachPlugin(e){if(T(this,Sa).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return T(this,Sa).set(e.name,e.connect(this)),this}getPlugin(e){return T(this,Sa).get(e)||null}get disableCcipRead(){return T(this,Ff)}set disableCcipRead(e){I(this,Ff,!!e)}async ccipReadFetch(e,n,r){if(this.disableCcipRead||r.length===0||e.to==null)return null;const s=e.to.toLowerCase(),i=n.toLowerCase(),o=[];for(let a=0;a<r.length;a++){const l=r[a],u=l.replace("{sender}",s).replace("{data}",i),c=new Kn(u);l.indexOf("{data}")===-1&&(c.body={data:i,sender:s}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:c,index:a,urls:r});let f="unknown error";const d=await c.send();try{const h=d.bodyJson;if(h.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:c,result:h}),h.data;h.message&&(f=h.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:c,result:h})}catch{}ee(d.statusCode<400||d.statusCode>=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:f}}),o.push(f)}ee(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:o}})}_wrapBlock(e,n){return new kie(Hie(e),this)}_wrapLog(e,n){return new Gh(Uie(e),this)}_wrapTransactionReceipt(e,n){return new _P(Wie(e),this)}_wrapTransactionResponse(e,n){return new Wh(WP(e),this)}_detectNetwork(){ee(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){ee(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Qe(await fe(this,st,jr).call(this,{method:"getBlockNumber"}),"%response");return T(this,go)>=0&&I(this,go,e),e}_getAddress(e){return Qn(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(St(e))return St(e,32)?e:kl(e);if(typeof e=="bigint"&&(e=Qe(e,"blockTag")),typeof e=="number")return e>=0?kl(e):T(this,go)>=0?kl(T(this,go)+e):this.getBlockNumber().then(n=>kl(n+e));$(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?k2(l.map(u=>u.toLowerCase())):l.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,s=(l,u,c)=>{let f;switch(l.length){case 0:break;case 1:f=l[0];break;default:l.sort(),f=l}if(r&&(u!=null||c!=null))throw new Error("invalid filter");const d={};return f&&(d.address=f),n.length&&(d.topics=n),u&&(d.fromBlock=u),c&&(d.toBlock=c),r&&(d.blockHash=r),d};let i=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)i.push(this._getAddress(l));else i.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),i.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(i),o,a]).then(l=>s(l[0],l[1],l[2])):s(i,o,a)}_getTransactionRequest(e){const n=gy(e),r=[];if(["to","from"].forEach(s=>{if(n[s]==null)return;const i=Qn(n[s],this);Ey(i)?r.push(async function(){n[s]=await i}()):n[s]=i}),n.blockTag!=null){const s=this._getBlockTag(n.blockTag);Ey(s)?r.push(async function(){n.blockTag=await s}()):n.blockTag=s}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(T(this,Fr)==null){const s=(async()=>{try{const i=await this._detectNetwork();return this.emit("network",i,null),i}catch(i){throw T(this,Fr)===s&&I(this,Fr,null),i}})();return I(this,Fr,s),(await s).clone()}const e=T(this,Fr),[n,r]=await Promise.all([e,this._detectNetwork()]);return n.chainId!==r.chainId&&(T(this,lu)?(this.emit("network",r,n),T(this,Fr)===e&&I(this,Fr,Promise.resolve(r))):ee(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const e=await this.getNetwork(),n=async()=>{const{_block:s,gasPrice:i,priorityFee:o}=await Nn({_block:fe(this,st,nE).call(this,"latest",!1),gasPrice:(async()=>{try{const c=await fe(this,st,jr).call(this,{method:"getGasPrice"});return xe(c,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const c=await fe(this,st,jr).call(this,{method:"getPriorityFee"});return xe(c,"%response")}catch{}return null})()});let a=null,l=null;const u=this._wrapBlock(s,e);return u&&u.baseFeePerGas&&(l=o??BigInt("1000000000"),a=u.baseFeePerGas*eoe+l),new OP(i,a,l)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const s=new Kn(r.url),i=await r.processFunc(n,this,s);return new OP(i.gasPrice,i.maxFeePerGas,i.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return Ey(n)&&(n=await n),xe(await fe(this,st,jr).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await Nn({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await fe(this,st,tE).call(this,fe(this,st,eE).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return xe(await fe(this,st,_p).call(this,{method:"getBalance"},e,n),"%response")}async getTransactionCount(e,n){return Qe(await fe(this,st,_p).call(this,{method:"getTransactionCount"},e,n),"%response")}async getCode(e,n){return we(await fe(this,st,_p).call(this,{method:"getCode"},e,n))}async getStorage(e,n,r){const s=xe(n,"position");return we(await fe(this,st,_p).call(this,{method:"getStorage",position:s},e,r))}async broadcastTransaction(e){const{blockNumber:n,hash:r,network:s}=await Nn({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=zh.from(e);if(i.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,s).replaceableTransaction(n)}async getBlock(e,n){const{network:r,params:s}=await Nn({network:this.getNetwork(),params:fe(this,st,nE).call(this,e,!!n)});return s==null?null:this._wrapBlock(s,r)}async getTransaction(e){const{network:n,params:r}=await Nn({network:this.getNetwork(),params:fe(this,st,jr).call(this,{method:"getTransaction",hash:e})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(e){const{network:n,params:r}=await Nn({network:this.getNetwork(),params:fe(this,st,jr).call(this,{method:"getTransactionReceipt",hash:e})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const s=await fe(this,st,jr).call(this,{method:"getTransaction",hash:e});if(s==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=s.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(e){const{result:n}=await Nn({network:this.getNetwork(),result:fe(this,st,jr).call(this,{method:"getTransactionResult",hash:e})});return n==null?null:we(n)}async getLogs(e){let n=this._getFilter(e);Ey(n)&&(n=await n);const{network:r,params:s}=await Nn({network:this.getNetwork(),params:fe(this,st,jr).call(this,{method:"getLogs",filter:n})});return s.map(i=>this._wrapLog(i,r))}_getProvider(e){ee(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Ay.fromName(this,e)}async getAvatar(e){const n=await this.getResolver(e);return n?await n.getAvatar():null}async resolveName(e){const n=await this.getResolver(e);return n?await n.getAddress():null}async lookupAddress(e){e=gt(e);const n=n2(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await Ay.getEnsAddress(this),i=await new Vc(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(i==null||i===Ph)return null;const a=await new Vc(i,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(a)!==e?null:a}catch(r){if(gn(r,"BAD_DATA")&&r.value==="0x"||gn(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(e,n,r){const s=n??1;return s===0?this.getTransactionReceipt(e):new Promise(async(i,o)=>{let a=null;const l=async u=>{try{const c=await this.getTransactionReceipt(e);if(c!=null&&u-c.blockNumber+1>=s){i(c),a&&(clearTimeout(a),a=null);return}}catch(c){console.log("EEE",c)}this.once("block",l)};r!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",l),o(Nt("timeout","TIMEOUT",{reason:"timeout"})))},r)),l(await this.getBlockNumber())})}async waitForBlock(e){ee(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const n=T(this,as).get(e);n&&(n.timer&&clearTimeout(n.timer),T(this,as).delete(e))}_setTimeout(e,n){n==null&&(n=0);const r=Dp(this,Ep)._++,s=()=>{T(this,as).delete(r),e()};if(this.paused)T(this,as).set(r,{timer:null,func:s,time:n});else{const i=setTimeout(s,n);T(this,as).set(r,{timer:i,func:s,time:C2()})}return r}_forEachSubscriber(e){for(const n of T(this,Bn).values())e(n.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new Sy(e.type);case"block":{const n=new Jie(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new Yie(this,e.type);case"event":return new x2(this,e.filter);case"transaction":return new Zie(this,e.hash);case"orphan":return new Xie(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,n){for(const r of T(this,Bn).values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),T(this,Fn)!=null&&n.pause(T(this,Fn));break}}async on(e,n){const r=await fe(this,st,yb).call(this,e);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,T(this,Fn)!=null&&r.subscriber.pause(T(this,Fn))),this}async once(e,n){const r=await fe(this,st,yb).call(this,e);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,T(this,Fn)!=null&&r.subscriber.pause(T(this,Fn))),this}async emit(e,...n){const r=await fe(this,st,Mp).call(this,e,n);if(!r||r.listeners.length===0)return!1;const s=r.listeners.length;return r.listeners=r.listeners.filter(({listener:i,once:o})=>{const a=new d4(this,o?null:i,e);try{i.call(this,...n,a)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),T(this,Bn).delete(r.tag)),s>0}async listenerCount(e){if(e){const r=await fe(this,st,Mp).call(this,e);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of T(this,Bn).values())n+=r.length;return n}async listeners(e){if(e){const r=await fe(this,st,Mp).call(this,e);return r?r.listeners.map(({listener:s})=>s):[]}let n=[];for(const{listeners:r}of T(this,Bn).values())n=n.concat(r.map(({listener:s})=>s));return n}async off(e,n){const r=await fe(this,st,Mp).call(this,e);if(!r)return this;if(n){const s=r.listeners.map(({listener:i})=>i).indexOf(n);s>=0&&r.listeners.splice(s,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),T(this,Bn).delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:n,started:r,subscriber:s}=await fe(this,st,yb).call(this,e);r&&s.stop(),T(this,Bn).delete(n)}else for(const[n,{started:r,subscriber:s}]of T(this,Bn))r&&s.stop(),T(this,Bn).delete(n);return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return this.off(e,n)}get destroyed(){return T(this,Bf)}destroy(){this.removeAllListeners();for(const e of T(this,as).keys())this._clearTimeout(e);I(this,Bf,!0)}get paused(){return T(this,Fn)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(I(this,go,-1),T(this,Fn)!=null){if(T(this,Fn)==!!e)return;ee(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(e)),I(this,Fn,!!e);for(const n of T(this,as).values())n.timer&&clearTimeout(n.timer),n.time=C2()-n.time}resume(){if(T(this,Fn)!=null){this._forEachSubscriber(e=>e.resume()),I(this,Fn,null);for(const e of T(this,as).values()){let n=e.time;n<0&&(n=0),e.time=C2(),setTimeout(e.func,n)}}}}Bn=new WeakMap,Sa=new WeakMap,Fn=new WeakMap,Bf=new WeakMap,Fr=new WeakMap,lu=new WeakMap,Ta=new WeakMap,go=new WeakMap,Ep=new WeakMap,as=new WeakMap,Ff=new WeakMap,jf=new WeakMap,st=new WeakSet,jr=async function(e){const n=T(this,jf).cacheTimeout;if(n<0)return await this._perform(e);const r=Cy(e.method,e);let s=T(this,Ta).get(r);return s||(s=this._perform(e),T(this,Ta).set(r,s),setTimeout(()=>{T(this,Ta).get(r)===s&&T(this,Ta).delete(r)},n)),await s},eE=async function(e,n,r){ee(r<toe,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:n,enableCcipRead:!0})});const s=gy(e);try{return we(await this._perform({method:"call",transaction:s,blockTag:n}))}catch(i){if(!this.disableCcipRead&&Ax(i)&&i.data&&r>=0&&n==="latest"&&s.to!=null&&Ht(i.data,0,4)==="0x556f1830"){const o=i.data,a=await Qn(s.to,this);let l;try{l=loe(Ht(i.data,4))}catch(f){ee(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:o}})}ee(l.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const u=await this.ccipReadFetch(s,l.calldata,l.urls);ee(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:i.data,errorArgs:l.errorArgs}});const c={to:a,data:$t([l.selector,aoe([u,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:c});try{const f=await fe(this,st,eE).call(this,c,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},c),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},c),error:f}),f}}throw i}},tE=async function(e){const{value:n}=await Nn({network:this.getNetwork(),value:e});return n},_p=async function(e,n,r){let s=this._getAddress(n),i=this._getBlockTag(r);return(typeof s!="string"||typeof i!="string")&&([s,i]=await Promise.all([s,i])),await fe(this,st,tE).call(this,fe(this,st,jr).call(this,Object.assign(e,{address:s,blockTag:i})))},nE=async function(e,n){if(St(e,32))return await fe(this,st,jr).call(this,{method:"getBlock",blockHash:e,includeTransactions:n});let r=this._getBlockTag(e);return typeof r!="string"&&(r=await r),await fe(this,st,jr).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},Mp=async function(e,n){let r=await E2(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await E2({orphan:"drop-log",log:n[0]},this)),T(this,Bn).get(r.tag)||null},yb=async function(e){const n=await E2(e,this),r=n.tag;let s=T(this,Bn).get(r);return s||(s={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},T(this,Bn).set(r,s)),s};function soe(t,e){try{const n=S2(t,e);if(n)return Tc(n)}catch{}return null}function S2(t,e){if(t==="0x")return null;try{const n=Qe(Ht(t,e,e+32)),r=Qe(Ht(t,n,n+32));return Ht(t,n+32,n+32+r)}catch{}return null}function JP(t){const e=Wn(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function ioe(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const ooe=new Uint8Array([]);function aoe(t){const e=[];let n=0;for(let r=0;r<t.length;r++)e.push(ooe),n+=32;for(let r=0;r<t.length;r++){const s=ct(t[r]);e[r]=JP(n),e.push(JP(s.length)),e.push(ioe(s)),n+=32+Math.ceil(s.length/32)*32}return $t(e)}const YP="0x0000000000000000000000000000000000000000000000000000000000000000";function loe(t){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};ee(Cc(t)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Ht(t,0,32);ee(Ht(n,0,12)===Ht(YP,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Ht(n,12);try{const r=[],s=Qe(Ht(t,32,64)),i=Qe(Ht(t,s,s+32)),o=Ht(t,s+32);for(let a=0;a<i;a++){const l=soe(o,a*32);if(l==null)throw new Error("abort");r.push(l)}e.urls=r}catch{ee(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const r=S2(t,64);if(r==null)throw new Error("abort");e.calldata=r}catch{ee(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}ee(Ht(t,100,128)===Ht(YP,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=Ht(t,96,100);try{const r=S2(t,128);if(r==null)throw new Error("abort");e.extraData=r}catch{ee(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(r=>e[r]),e}function zc(t,e){if(t.provider)return t.provider;ee(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function XP(t,e){let n=gy(e);if(n.to!=null&&(n.to=Qn(n.to,t)),n.from!=null){const r=n.from;n.from=Promise.all([t.getAddress(),Qn(r,t)]).then(([s,i])=>($(s.toLowerCase()===i.toLowerCase(),"transaction from mismatch","tx.from",i),s))}else n.from=t.getAddress();return await Nn(n)}class uoe{constructor(e){W(this,"provider");Oe(this,{provider:e||null})}async getNonce(e){return zc(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await XP(this,e)}async populateTransaction(e){const n=zc(this,"populateTransaction"),r=await XP(this,e);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const s=await this.provider.getNetwork();if(r.chainId!=null){const o=xe(r.chainId);$(o===s.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=s.chainId;const i=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||i)?$(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&i&&$(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const o=await n.getFeeData();ee(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{const o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const a=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=a,r.maxPriorityFeePerGas=a}else r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(ee(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):ee(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(r.type===2||r.type===3)&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await Nn(r)}async estimateGas(e){return zc(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return zc(this,"call").call(await this.populateCall(e))}async resolveName(e){return await zc(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=zc(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const s=zh.from(r);return await n.broadcastTransaction(await this.signTransaction(s))}}const ZP=new Set;function $c(t){ZP.has(t)||(ZP.add(t),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${t} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))}function coe(t){return JSON.parse(JSON.stringify(t))}class eI{constructor(e){J(this,Oa);J(this,Yn);J(this,Ai);J(this,uu);J(this,Da);J(this,cu);J(this,Uf);I(this,Yn,e),I(this,Ai,null),I(this,uu,fe(this,Oa,rE).bind(this)),I(this,Da,!1),I(this,cu,null),I(this,Uf,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,n){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){T(this,Da)||(I(this,Da,!0),fe(this,Oa,rE).call(this,-2))}stop(){T(this,Da)&&(I(this,Da,!1),I(this,Uf,!0),fe(this,Oa,sE).call(this),T(this,Yn).off("block",T(this,uu)))}pause(e){e&&fe(this,Oa,sE).call(this),T(this,Yn).off("block",T(this,uu))}resume(){this.start()}}Yn=new WeakMap,Ai=new WeakMap,uu=new WeakMap,Da=new WeakMap,cu=new WeakMap,Uf=new WeakMap,Oa=new WeakSet,rE=async function(e){try{T(this,Ai)==null&&I(this,Ai,this._subscribe(T(this,Yn)));let n=null;try{n=await T(this,Ai)}catch(i){if(!gn(i,"UNSUPPORTED_OPERATION")||i.operation!=="eth_newFilter")throw i}if(n==null){I(this,Ai,null),T(this,Yn)._recoverSubscriber(this,this._recover(T(this,Yn)));return}const r=await T(this,Yn).getNetwork();if(T(this,cu)||I(this,cu,r),T(this,cu).chainId!==r.chainId)throw new Error("chaid changed");if(T(this,Uf))return;const s=await T(this,Yn).send("eth_getFilterChanges",[n]);await this._emitResults(T(this,Yn),s)}catch(n){console.log("@TODO",n)}T(this,Yn).once("block",T(this,uu))},sE=function(){const e=T(this,Ai);e&&(I(this,Ai,null),e.then(n=>{T(this,Yn).destroyed||T(this,Yn).send("eth_uninstallFilter",[n])}))};class foe extends eI{constructor(n,r){super(n);J(this,fu);I(this,fu,coe(r))}_recover(n){return new x2(n,T(this,fu))}async _subscribe(n){return await n.send("eth_newFilter",[T(this,fu)])}async _emitResults(n,r){for(const s of r)n.emit(T(this,fu),n._wrapLog(s,n._network))}}fu=new WeakMap;class doe extends eI{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}}const hoe="bigint,boolean,function,number,string,symbol".split(/,/g);function Dy(t){if(t==null||hoe.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(Dy);if(typeof t=="object")return Object.keys(t).reduce((e,n)=>(e[n]=t[n],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function poe(t){return new Promise(e=>{setTimeout(e,t)})}function Gc(t){return t&&t.toLowerCase()}function tI(t){return t&&typeof t.pollingInterval=="number"}const nI={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class T2 extends uoe{constructor(n,r){super(n);W(this,"address");r=gt(r),Oe(this,{address:r})}connect(n){ee(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=Dy(n),s=[];if(r.from){const o=r.from;s.push((async()=>{const a=await Qn(o,this.provider);$(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a})())}else r.from=this.address;if(r.gasLimit==null&&s.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;s.push((async()=>{r.to=await Qn(o,this.provider)})())}s.length&&await Promise.all(s);const i=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[i])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),s=await this.sendUncheckedTransaction(n);return await new Promise((i,o)=>{const a=[1e3,100];let l=0;const u=async()=>{try{const c=await this.provider.getTransaction(s);if(c!=null){i(c.replaceableTransaction(r));return}}catch(c){if(gn(c,"CANCELLED")||gn(c,"BAD_DATA")||gn(c,"NETWORK_ERROR")){c.info==null&&(c.info={}),c.info.sendTransactionHash=s,o(c);return}if(gn(c,"INVALID_ARGUMENT")&&(l++,c.info==null&&(c.info={}),c.info.sendTransactionHash=s,l>10)){o(c);return}this.provider.emit("error",Nt("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:c}))}this.provider._setTimeout(()=>{u()},a.pop()||4e3)};u()})}async signTransaction(n){const r=Dy(n);if(r.from){const i=await Qn(r.from,this.provider);$(i!=null&&i.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=i}else r.from=this.address;const s=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[s])}async signMessage(n){const r=typeof n=="string"?Vi(n):n;return await this.provider.send("personal_sign",[we(r),this.address.toLowerCase()])}async signTypedData(n,r,s){const i=Dy(s),o=await hy.resolveNames(n,r,i,async a=>{const l=await Qn(a);return $(l!=null,"TypedData does not support null address","value",a),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(hy.getPayload(o.domain,r,o.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?Vi(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),we(r)])}}class rI extends Ty{constructor(n,r){super(n,r);J(this,Cp);J(this,du);J(this,Vf);J(this,yo);J(this,vi);J(this,Rs);J(this,ls);J(this,mr);I(this,Vf,1),I(this,du,Object.assign({},nI,r||{})),I(this,yo,[]),I(this,vi,null),I(this,ls,null),I(this,mr,null);{let i=null;const o=new Promise(a=>{i=a});I(this,Rs,{promise:o,resolve:i})}const s=this._getOption("staticNetwork");typeof s=="boolean"?($(!s||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),s&&n!=null&&I(this,ls,rn.from(n))):s&&($(n==null||s.matches(n),"staticNetwork MUST match network object","options",r),I(this,ls,s))}_getOption(n){return T(this,du)[n]}get _network(){return ee(T(this,ls),"network is not available yet","NETWORK_ERROR"),T(this,ls)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let s=n.transaction;if(s&&s.type!=null&&xe(s.type)&&s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null){const i=await this.getFeeData();i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},s,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if(T(this,ls))return T(this,ls)}else return n;return T(this,mr)?await T(this,mr):this.ready?(I(this,mr,(async()=>{try{const r=rn.from(xe(await this.send("eth_chainId",[])));return I(this,mr,null),r}catch(r){throw I(this,mr,null),r}})()),await T(this,mr)):(I(this,mr,(async()=>{const r={id:Dp(this,Vf)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let s;try{s=(await this._send(r))[0],I(this,mr,null)}catch(i){throw I(this,mr,null),this.emit("debug",{action:"receiveRpcError",error:i}),i}if(this.emit("debug",{action:"receiveRpcResult",result:s}),"result"in s)return rn.from(xe(s.result));throw this.getRpcError(r,s)})()),await T(this,mr))}_start(){T(this,Rs)==null||T(this,Rs).resolve==null||(T(this,Rs).resolve(),I(this,Rs,null),(async()=>{for(;T(this,ls)==null&&!this.destroyed;)try{I(this,ls,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Nt("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await poe(1e3)}fe(this,Cp,iE).call(this)})())}async _waitUntilReady(){if(T(this,Rs)!=null)return await T(this,Rs).promise}_getSubscriber(n){return n.type==="pending"?new doe(this):n.type==="event"?this._getOption("polling")?new x2(this,n.filter):new foe(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new Sy("orphan"):super._getSubscriber(n)}get ready(){return T(this,Rs)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(s=>{if(n[s]==null)return;let i=s;s==="gasLimit"&&(i="gas"),r[i]=kl(xe(n[s],`tx.${s}`))}),["from","to","data"].forEach(s=>{n[s]!=null&&(r[s]=we(n[s]))}),n.accessList&&(r.accessList=ia(n.accessList)),n.blobVersionedHashes&&(r.blobVersionedHashes=n.blobVersionedHashes.map(s=>s.toLowerCase())),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Gc(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Gc(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[Gc(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Gc(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map(Gc):n.filter.address=Gc(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:s}=n,{error:i}=r;if(s==="eth_estimateGas"&&i.message){const l=i.message;if(!l.match(/revert/i)&&l.match(/insufficient funds/i))return Nt("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:i}})}if(s==="eth_call"||s==="eth_estimateGas"){const l=D2(i),u=jc.getBuiltinCallException(s==="eth_call"?"call":"estimateGas",n.params[0],l?l.data:null);return u.info={error:i,payload:n},u}const o=JSON.stringify(goe(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i))return Nt("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[s]||"unknown",reason:"rejected",info:{payload:n,error:i}});if(s==="eth_sendRawTransaction"||s==="eth_sendTransaction"){const l=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return Nt("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:i}});if(o.match(/nonce/i)&&o.match(/too low/i))return Nt("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:i}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return Nt("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:i}});if(o.match(/only replay-protected/i))return Nt("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:s,info:{transaction:l,info:{error:i}}})}let a=!!o.match(/the method .* does not exist/i);return a||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(a=!0),a?Nt("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:i,payload:n}}):Nt("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(Nt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const s=Dp(this,Vf)._++,i=new Promise((o,a)=>{T(this,yo).push({resolve:o,reject:a,payload:{method:n,params:r,id:s,jsonrpc:"2.0"}})});return fe(this,Cp,iE).call(this),i}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const i=await r;if(n>=i.length)throw new Error("no such account");return new T2(this,i[n])}const{accounts:s}=await Nn({network:this.getNetwork(),accounts:r});n=gt(n);for(const i of s)if(gt(i)===n)return new T2(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new T2(this,r))}destroy(){T(this,vi)&&(clearTimeout(T(this,vi)),I(this,vi,null));for(const{payload:n,reject:r}of T(this,yo))r(Nt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));I(this,yo,[]),super.destroy()}}du=new WeakMap,Vf=new WeakMap,yo=new WeakMap,vi=new WeakMap,Rs=new WeakMap,ls=new WeakMap,mr=new WeakMap,Cp=new WeakSet,iE=function(){if(T(this,vi))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");I(this,vi,setTimeout(()=>{I(this,vi,null);const r=T(this,yo);for(I(this,yo,[]);r.length;){const s=[r.shift()];for(;r.length&&s.length!==T(this,du).batchMaxCount;)if(s.push(r.shift()),JSON.stringify(s.map(o=>o.payload)).length>T(this,du).batchMaxSize){r.unshift(s.pop());break}(async()=>{const i=s.length===1?s[0].payload:s.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:i});try{const o=await this._send(i);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:a,reject:l,payload:u}of s){if(this.destroyed){l(Nt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:u.method}));continue}const c=o.filter(f=>f.id===u.id)[0];if(c==null){const f=Nt("missing response for request","BAD_DATA",{value:o,info:{payload:u}});this.emit("error",f),l(f);continue}if("error"in c){l(this.getRpcError(u,c));continue}a(c.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:a}of s)a(o)}})()}},n))};class moe extends rI{constructor(n,r){super(n,r);J(this,_a);let s=this._getOption("pollingInterval");s==null&&(s=nI.pollingInterval),I(this,_a,s)}_getSubscriber(n){const r=super._getSubscriber(n);return tI(r)&&(r.pollingInterval=T(this,_a)),r}get pollingInterval(){return T(this,_a)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");I(this,_a,n),this._forEachSubscriber(r=>{tI(r)&&(r.pollingInterval=T(this,_a))})}}_a=new WeakMap;class Qi extends moe{constructor(n,r,s){n==null&&(n="http://localhost:8545");super(r,s);J(this,Hf);typeof n=="string"?I(this,Hf,new Kn(n)):I(this,Hf,n.clone())}_getConnection(){return T(this,Hf).clone()}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){const r=this._getConnection();r.body=JSON.stringify(n),r.setHeader("content-type","application/json");const s=await r.send();s.assertOk();let i=s.bodyJson;return Array.isArray(i)||(i=[i]),i}}Hf=new WeakMap;function D2(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&St(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const n=D2(t[e]);if(n)return n}return null}if(typeof t=="string")try{return D2(JSON.parse(t))}catch{}return null}function O2(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)O2(t[n],e);if(typeof t=="string")try{return O2(JSON.parse(t),e)}catch{}}}function goe(t){const e=[];return O2(t,e),e}const Oy="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function yoe(t){switch(t){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}$(!1,"unsupported network","network",t)}class _y extends Qi{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Oy);const i={polling:!0,staticNetwork:s},o=_y.getRequest(s,r);super(o,s,i);W(this,"apiKey");Oe(this,{apiKey:r})}_getProvider(n){try{return new _y(n,this.apiKey)}catch{}return super._getProvider(n)}static getRequest(n,r){r==null&&(r=Oy);const s=new Kn(`https://${yoe(n.name)}/${r}`);return s.allowGzip=!0,r===Oy&&(s.retryFunc=async(i,o,a)=>($c("AnkrProvider"),!0)),s}getRpcError(n,r){return n.method==="eth_sendRawTransaction"&&r&&r.error&&r.error.message==="INTERNAL_ERROR: could not replace existing tx"&&(r.error.message="replacement transaction underpriced"),super.getRpcError(n,r)}isCommunityResource(){return this.apiKey===Oy}}const My="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function boe(t){switch(t){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-amoy":return"polygon-amoy.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}$(!1,"unsupported network","network",t)}class Ny extends Qi{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=My);const i=Ny.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"apiKey");Oe(this,{apiKey:r})}_getProvider(n){try{return new Ny(n,this.apiKey)}catch{}return super._getProvider(n)}async _perform(n){if(n.method==="getTransactionResult"){const{trace:r,tx:s}=await Nn({trace:this.send("trace_transaction",[n.hash]),tx:this.getTransaction(n.hash)});if(r==null||s==null)return null;let i,o=!1;try{i=r[0].result.output,o=r[0].error==="Reverted"}catch{}if(i)return ee(!o,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:i,reason:null,transaction:s,invocation:null,revert:null}),i;ee(!1,"could not parse trace result","BAD_DATA",{value:r})}return await super._perform(n)}isCommunityResource(){return this.apiKey===My}static getRequest(n,r){r==null&&(r=My);const s=new Kn(`https://${boe(n.name)}/v2/${r}`);return s.allowGzip=!0,r===My&&(s.retryFunc=async(i,o,a)=>($c("alchemy"),!0)),s}}function Ry(t){switch(t){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}$(!1,"unsupported network","network",t)}function woe(t){switch(t){case"mainnet":return"ethereum-mainnet.core.chainstack.com";case"arbitrum":return"arbitrum-mainnet.core.chainstack.com";case"bnb":return"bsc-mainnet.core.chainstack.com";case"matic":return"polygon-mainnet.core.chainstack.com"}$(!1,"unsupported network","network",t)}class Py extends Qi{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Ry(s.name));const i=Py.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"apiKey");Oe(this,{apiKey:r})}_getProvider(n){try{return new Py(n,this.apiKey)}catch{}return super._getProvider(n)}isCommunityResource(){return this.apiKey===Ry(this._network.name)}static getRequest(n,r){r==null&&(r=Ry(n.name));const s=new Kn(`https://${woe(n.name)}/${r}`);return s.allowGzip=!0,r===Ry(n.name)&&(s.retryFunc=async(i,o,a)=>($c("ChainstackProvider"),!0)),s}}class Aoe extends Qi{constructor(e){e==null&&(e="mainnet");const n=rn.from(e);$(n.name==="mainnet","unsupported network","network",e),super("https://cloudflare-eth.com/",n,{staticNetwork:n})}}const sI=2e3;function voe(t){return t&&typeof t.then=="function"}const xoe="org.ethers.plugins.provider.Etherscan",koe=["enableCcipRead"];let Eoe=1;class Coe extends Ty{constructor(n,r){const s=r??null;super();W(this,"network");W(this,"apiKey");J(this,zf);const i=rn.from(n);I(this,zf,i.getPlugin(xoe)),Oe(this,{apiKey:s,network:i}),this.getBaseUrl()}getBaseUrl(){if(T(this,zf))return T(this,zf).baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"base":return"https://api.basescan.org";case"base-sepolia":return"https://api-sepolia.basescan.org";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-amoy":return"https://api-amoy.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}$(!1,"unsupported network","network",this.network)}getUrl(n,r){const s=Object.keys(r).reduce((o,a)=>{const l=r[a];return l!=null&&(o+=`&${a}=${l}`),o},""),i=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.getBaseUrl()}/api?module=${n}${s}${i}`}getPostUrl(){return`${this.getBaseUrl()}/api`}getPostData(n,r){return r.module=n,r.apikey=this.apiKey,r}async detectNetwork(){return this.network}async fetch(n,r,s){const i=Eoe++,o=s?this.getPostUrl():this.getUrl(n,r),a=s?this.getPostData(n,r):null;this.emit("debug",{action:"sendRequest",id:i,url:o,payload:a});const l=new Kn(o);l.setThrottleParams({slotInterval:1e3}),l.retryFunc=(f,d,h)=>(this.isCommunityResource()&&$c("Etherscan"),Promise.resolve(!0)),l.processFunc=async(f,d)=>{const h=d.hasBody()?JSON.parse(Tc(d.body)):{},p=(typeof h.result=="string"?h.result:"").toLowerCase().indexOf("rate limit")>=0;return n==="proxy"?h&&h.status==0&&h.message=="NOTOK"&&p&&(this.emit("debug",{action:"receiveError",id:i,reason:"proxy-NOTOK",error:h}),d.throwThrottleError(h.result,sI)):p&&(this.emit("debug",{action:"receiveError",id:i,reason:"null result",error:h.result}),d.throwThrottleError(h.result,sI)),d},a&&(l.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),l.body=Object.keys(a).map(f=>`${f}=${a[f]}`).join("&"));const u=await l.send();try{u.assertOk()}catch(f){this.emit("debug",{action:"receiveError",id:i,error:f,reason:"assertOk"}),ee(!1,"response error","SERVER_ERROR",{request:l,response:u})}u.hasBody()||(this.emit("debug",{action:"receiveError",id:i,error:"missing body",reason:"null body"}),ee(!1,"missing response","SERVER_ERROR",{request:l,response:u}));const c=JSON.parse(Tc(u.body));return n==="proxy"?(c.jsonrpc!="2.0"&&(this.emit("debug",{action:"receiveError",id:i,result:c,reason:"invalid JSON-RPC"}),ee(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:l,response:u,info:{result:c}})),c.error&&(this.emit("debug",{action:"receiveError",id:i,result:c,reason:"JSON-RPC error"}),ee(!1,"error response","SERVER_ERROR",{request:l,response:u,info:{result:c}})),this.emit("debug",{action:"receiveRequest",id:i,result:c}),c.result):c.status==0&&(c.message==="No records found"||c.message==="No transactions found")?(this.emit("debug",{action:"receiveRequest",id:i,result:c}),c.result):((c.status!=1||typeof c.message=="string"&&!c.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:i,result:c}),ee(!1,"error response","SERVER_ERROR",{request:l,response:u,info:{result:c}})),this.emit("debug",{action:"receiveRequest",id:i,result:c}),c.result)}_getTransactionPostData(n){const r={};for(let s in n){if(koe.indexOf(s)>=0||n[s]==null)continue;let i=n[s];if(!(s==="type"&&i===0)&&!(s==="blockTag"&&i==="latest")){if({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[s])i=kl(i);else if(s==="accessList")i="["+ia(i).map(o=>`{address:"${o.address}",storageKeys:["${o.storageKeys.join('","')}"]}`).join(",")+"]";else if(s==="blobVersionedHashes"){if(i.length===0)continue;ee(!1,"Etherscan API does not support blobVersionedHashes","UNSUPPORTED_OPERATION",{operation:"_getTransactionPostData",info:{transaction:n}})}else i=we(i);r[s]=i}}return r}_checkError(n,r,s){let i="";if(gn(r,"SERVER_ERROR")){try{i=r.info.result.error.message}catch{}if(!i)try{i=r.info.message}catch{}}if(n.method==="estimateGas"&&!i.match(/revert/i)&&i.match(/insufficient funds/i)&&ee(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.transaction}),(n.method==="call"||n.method==="estimateGas")&&i.match(/execution reverted/i)){let o="";try{o=r.info.result.error.data}catch{}const a=jc.getBuiltinCallException(n.method,n.transaction,o);throw a.info={request:n,error:r},a}if(i&&n.method==="broadcastTransaction"){const o=zh.from(n.signedTransaction);i.match(/replacement/i)&&i.match(/underpriced/i)&&ee(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:o}),i.match(/insufficient funds/)&&ee(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:o}),i.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&ee(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:o})}throw r}async _detectNetwork(){return this.network}async _perform(n){switch(n.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if(this.network.name==="mainnet")return"1000000000";if(this.network.name==="optimism")return"1000000";throw new Error("fallback onto the AbstractProvider default");case"getBalance":return this.fetch("account",{action:"balance",address:n.address,tag:n.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:n.address,tag:n.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:n.address,tag:n.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:n.address,position:n.position,tag:n.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:n.signedTransaction},!0).catch(r=>this._checkError(n,r,n.signedTransaction));case"getBlock":if("blockTag"in n)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:n.blockTag,boolean:n.includeTransactions?"true":"false"});ee(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:n.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:n.hash});case"call":{if(n.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");const r=this._getTransactionPostData(n.transaction);r.module="proxy",r.action="eth_call";try{return await this.fetch("proxy",r,!0)}catch(s){return this._checkError(n,s,n.transaction)}}case"estimateGas":{const r=this._getTransactionPostData(n.transaction);r.module="proxy",r.action="eth_estimateGas";try{return await this.fetch("proxy",r,!0)}catch(s){return this._checkError(n,s,n.transaction)}}}return super._perform(n)}async getNetwork(){return this.network}async getEtherPrice(){return this.network.name!=="mainnet"?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(n){let r=this._getAddress(n);voe(r)&&(r=await r);try{const s=await this.fetch("contract",{action:"getabi",address:r}),i=JSON.parse(s);return new Vc(r,i,this)}catch{return null}}isCommunityResource(){return this.apiKey==null}}zf=new WeakMap;function Soe(){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 Toe=Soe().WebSocket;class _2{constructor(e,n){J(this,xi);J(this,Sp);J(this,Ma);J(this,hu);J(this,Na);I(this,xi,e),I(this,Sp,JSON.stringify(n)),I(this,Ma,null),I(this,hu,null),I(this,Na,null)}get filter(){return JSON.parse(T(this,Sp))}start(){I(this,Ma,T(this,xi).send("eth_subscribe",this.filter).then(e=>(T(this,xi)._register(e,this),e)))}stop(){T(this,Ma).then(e=>{T(this,xi).destroyed||T(this,xi).send("eth_unsubscribe",[e])}),I(this,Ma,null)}pause(e){ee(e,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),I(this,hu,!!e)}resume(){I(this,hu,null)}_handleMessage(e){if(T(this,Ma)!=null&&T(this,hu)===null){let n=T(this,Na);n==null?n=this._emit(T(this,xi),e):n=n.then(async()=>{await this._emit(T(this,xi),e)}),I(this,Na,n.then(()=>{T(this,Na)===n&&I(this,Na,null)}))}}async _emit(e,n){throw new Error("sub-classes must implemente this; _emit")}}xi=new WeakMap,Sp=new WeakMap,Ma=new WeakMap,hu=new WeakMap,Na=new WeakMap;class Doe extends _2{constructor(e){super(e,["newHeads"])}async _emit(e,n){e.emit("block",parseInt(n.number))}}class Ooe extends _2{constructor(e){super(e,["newPendingTransactions"])}async _emit(e,n){e.emit("pending",n)}}class _oe extends _2{constructor(n,r){super(n,["logs",r]);J(this,Tp);I(this,Tp,JSON.stringify(r))}get logFilter(){return JSON.parse(T(this,Tp))}async _emit(n,r){n.emit(this.logFilter,n._wrapLog(r,n._network))}}Tp=new WeakMap;class Moe extends rI{constructor(n,r){const s=Object.assign({},r??{});$(s.batchMaxCount==null||s.batchMaxCount===1,"sockets-based providers do not support batches","options.batchMaxCount",r),s.batchMaxCount=1,s.staticNetwork==null&&(s.staticNetwork=!0);super(n,s);J(this,pu);J(this,$f);J(this,Ra);I(this,pu,new Map),I(this,$f,new Map),I(this,Ra,new Map)}_getSubscriber(n){switch(n.type){case"close":return new Sy("close");case"block":return new Doe(this);case"pending":return new Ooe(this);case"event":return new _oe(this,n.filter);case"orphan":if(n.filter.orphan==="drop-log")return new Sy("drop-log")}return super._getSubscriber(n)}_register(n,r){T(this,$f).set(n,r);const s=T(this,Ra).get(n);if(s){for(const i of s)r._handleMessage(i);T(this,Ra).delete(n)}}async _send(n){$(!Array.isArray(n),"WebSocket does not support batch send","payload",n);const r=new Promise((s,i)=>{T(this,pu).set(n.id,{payload:n,resolve:s,reject:i})});return await this._waitUntilReady(),await this._write(JSON.stringify(n)),[await r]}async _processMessage(n){const r=JSON.parse(n);if(r&&typeof r=="object"&&"id"in r){const s=T(this,pu).get(r.id);if(s==null){this.emit("error",Nt("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:r}));return}T(this,pu).delete(r.id),s.resolve(r)}else if(r&&r.method==="eth_subscription"){const s=r.params.subscription,i=T(this,$f).get(s);if(i)i._handleMessage(r.params.result);else{let o=T(this,Ra).get(s);o==null&&(o=[],T(this,Ra).set(s,o)),o.push(r.params.result)}}else{this.emit("error",Nt("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:r}));return}}async _write(n){throw new Error("sub-classes must override this")}}pu=new WeakMap,$f=new WeakMap,Ra=new WeakMap;class iI extends Moe{constructor(n,r,s){super(r,s);J(this,mu);J(this,Ps);typeof n=="string"?(I(this,mu,()=>new Toe(n)),I(this,Ps,T(this,mu).call(this))):typeof n=="function"?(I(this,mu,n),I(this,Ps,n())):(I(this,mu,null),I(this,Ps,n)),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(i){console.log("failed to start WebsocketProvider",i)}},this.websocket.onmessage=i=>{this._processMessage(i.data)}}get websocket(){if(T(this,Ps)==null)throw new Error("websocket closed");return T(this,Ps)}async _write(n){this.websocket.send(n)}async destroy(){T(this,Ps)!=null&&(T(this,Ps).close(),I(this,Ps,null)),super.destroy()}}mu=new WeakMap,Ps=new WeakMap;const Jh="84842078b09946638c03157f83405213";function Noe(t){switch(t){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bnbsmartchain-mainnet.infura.io";case"bnbt":return"bnbsmartchain-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"linea-sepolia":return"linea-sepolia.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-amoy":return"polygon-amoy.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}$(!1,"unsupported network","network",t)}class Roe extends iI{constructor(n,r){const s=new Yh(n,r),i=s._getConnection();ee(!i.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});const o=i.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(o,s._network);W(this,"projectId");W(this,"projectSecret");Oe(this,{projectId:s.projectId,projectSecret:s.projectSecret})}isCommunityResource(){return this.projectId===Jh}}class Yh extends Qi{constructor(n,r,s){n==null&&(n="mainnet");const i=rn.from(n);r==null&&(r=Jh),s==null&&(s=null);const o=Yh.getRequest(i,r,s);super(o,i,{staticNetwork:i});W(this,"projectId");W(this,"projectSecret");Oe(this,{projectId:r,projectSecret:s})}_getProvider(n){try{return new Yh(n,this.projectId,this.projectSecret)}catch{}return super._getProvider(n)}isCommunityResource(){return this.projectId===Jh}static getWebSocketProvider(n,r){return new Roe(n,r)}static getRequest(n,r,s){r==null&&(r=Jh),s==null&&(s=null);const i=new Kn(`https://${Noe(n.name)}/v3/${r}`);return i.allowGzip=!0,s&&i.setCredentials("",s),r===Jh&&(i.retryFunc=async(o,a,l)=>($c("InfuraProvider"),!0)),i}}const Iy="919b412a057b5e9c9b6dce193c5a60242d6efadb";function Poe(t){switch(t){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}$(!1,"unsupported network","network",t)}class Ly extends Qi{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Iy);const i=Ly.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"token");Oe(this,{token:r})}_getProvider(n){try{return new Ly(n,this.token)}catch{}return super._getProvider(n)}isCommunityResource(){return this.token===Iy}static getRequest(n,r){r==null&&(r=Iy);const s=new Kn(`https://${Poe(n.name)}/${r}`);return s.allowGzip=!0,r===Iy&&(s.retryFunc=async(i,o,a)=>($c("QuickNodeProvider"),!0)),s}}const Ioe=BigInt("1"),Loe=BigInt("2");function Boe(t){for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1)),r=t[e];t[e]=t[n],t[n]=r}}function Foe(t){return new Promise(e=>{setTimeout(e,t)})}function M2(){return new Date().getTime()}function N2(t){return JSON.stringify(t,(e,n)=>typeof n=="bigint"?{type:"bigint",value:n.toString()}:n)}const oI={stallTimeout:400,priority:1,weight:1},aI={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};async function joe(t,e){for(;(t.blockNumber<0||t.blockNumber<e)&&(t._updateNumber||(t._updateNumber=(async()=>{try{const n=await t.provider.getBlockNumber();n>t.blockNumber&&(t.blockNumber=n)}catch(n){t.blockNumber=-2,t._lastFatalError=n,t._lastFatalErrorTimestamp=M2()}t._updateNumber=null})()),await t._updateNumber,t.outOfSync++,!t._lastFatalError););}function Xh(t){if(t==null)return"null";if(Array.isArray(t))return"["+t.map(Xh).join(",")+"]";if(typeof t=="object"&&typeof t.toJSON=="function")return Xh(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":case"number":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{"+e.map(n=>`${JSON.stringify(n)}:${Xh(t[n])}`).join(",")+"}"}}throw console.log("Could not serialize",t),new Error("Hmm...")}function R2(t){if("error"in t){const n=t.error;return{tag:Xh(n),value:n}}const e=t.result;return{tag:Xh(e),value:e}}function By(t,e){const n=new Map;for(const{value:s,tag:i,weight:o}of e){const a=n.get(i)||{value:s,weight:0};a.weight+=o,n.set(i,a)}let r=null;for(const s of n.values())s.weight>=t&&(!r||s.weight>r.weight)&&(r=s);if(r)return r.value}function P2(t,e){let n=0;const r=new Map;let s=null;const i=[];for(const{value:a,tag:l,weight:u}of e)if(a instanceof Error){const c=r.get(l)||{value:a,weight:0};c.weight+=u,r.set(l,c),(s==null||c.weight>s.weight)&&(s=c)}else i.push(BigInt(a)),n+=u;if(n<t)return s&&s.weight>=t?s.value:void 0;i.sort((a,l)=>a<l?-1:l>a?1:0);const o=Math.floor(i.length/2);return i.length%2?i[o]:(i[o-1]+i[o]+Ioe)/Loe}function I2(t,e){const n=By(t,e);if(n!==void 0)return n;for(const r of e)if(r.value)return r.value}function Uoe(t,e){if(t===1)return Qe(P2(t,e),"%internal");const n=new Map,r=(o,a)=>{const l=n.get(o)||{result:o,weight:0};l.weight+=a,n.set(o,l)};for(const{weight:o,value:a}of e){const l=Qe(a);r(l-1,o),r(l,o),r(l+1,o)}let s=0,i;for(const{weight:o,result:a}of n.values())o>=t&&(o>s||i!=null&&o===s&&a>i)&&(s=o,i=a);return i}class Voe extends Ty{constructor(n,r,s){super(r,s);J(this,yr);W(this,"quorum");W(this,"eventQuorum");W(this,"eventWorkers");J(this,gr);J(this,bo);J(this,Gf);I(this,gr,n.map(i=>i instanceof Ty?Object.assign({provider:i},oI,aI):Object.assign({},oI,i,aI))),I(this,bo,-2),I(this,Gf,null),s&&s.quorum!=null?this.quorum=s.quorum:this.quorum=Math.ceil(T(this,gr).reduce((i,o)=>(i+=o.weight,i),0)/2),this.eventQuorum=1,this.eventWorkers=1,$(this.quorum<=T(this,gr).reduce((i,o)=>i+o.weight,0),"quorum exceed provider weight","quorum",this.quorum)}get providerConfigs(){return T(this,gr).map(n=>{const r=Object.assign({},n);for(const s in r)s[0]==="_"&&delete r[s];return r})}async _detectNetwork(){return rn.from(xe(await this._perform({method:"chainId"})))}async _translatePerform(n,r){switch(r.method){case"broadcastTransaction":return await n.broadcastTransaction(r.signedTransaction);case"call":return await n.call(Object.assign({},r.transaction,{blockTag:r.blockTag}));case"chainId":return(await n.getNetwork()).chainId;case"estimateGas":return await n.estimateGas(r.transaction);case"getBalance":return await n.getBalance(r.address,r.blockTag);case"getBlock":{const s="blockHash"in r?r.blockHash:r.blockTag;return await n.getBlock(s,r.includeTransactions)}case"getBlockNumber":return await n.getBlockNumber();case"getCode":return await n.getCode(r.address,r.blockTag);case"getGasPrice":return(await n.getFeeData()).gasPrice;case"getPriorityFee":return(await n.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await n.getLogs(r.filter);case"getStorage":return await n.getStorage(r.address,r.position,r.blockTag);case"getTransaction":return await n.getTransaction(r.hash);case"getTransactionCount":return await n.getTransactionCount(r.address,r.blockTag);case"getTransactionReceipt":return await n.getTransactionReceipt(r.hash);case"getTransactionResult":return await n.getTransactionResult(r.hash)}}async _perform(n){if(n.method==="broadcastTransaction"){const o=T(this,gr).map(u=>null),a=T(this,gr).map(async({provider:u,weight:c},f)=>{try{const d=await u._perform(n);o[f]=Object.assign(R2({result:d}),{weight:c})}catch(d){o[f]=Object.assign(R2({error:d}),{weight:c})}});for(;;){const u=o.filter(d=>d!=null);for(const{value:d}of u)if(!(d instanceof Error))return d;const c=By(this.quorum,o.filter(d=>d!=null));if(gn(c,"INSUFFICIENT_FUNDS"))throw c;const f=a.filter((d,h)=>o[h]==null);if(f.length===0)break;await Promise.race(f)}const l=I2(this.quorum,o);if(ee(l!==void 0,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:n,results:o.map(N2)}}),l instanceof Error)throw l;return l}await fe(this,yr,ZL).call(this);const r=new Set;let s=0;for(;;){const o=fe(this,yr,oE).call(this,r,n);if(o==null||(s+=o.config.weight,s>=this.quorum))break}const i=await fe(this,yr,aE).call(this,r,n);for(const o of r)o.perform&&o.result==null&&o.config.lateResponses++;return i}async destroy(){for(const{provider:n}of T(this,gr))n.destroy();super.destroy()}}gr=new WeakMap,bo=new WeakMap,Gf=new WeakMap,yr=new WeakSet,XL=function(n){const r=Array.from(n).map(i=>i.config),s=T(this,gr).slice();Boe(s),s.sort((i,o)=>i.priority-o.priority);for(const i of s)if(!i._lastFatalError&&r.indexOf(i)===-1)return i;return null},oE=function(n,r){const s=fe(this,yr,XL).call(this,n);if(s==null)return null;const i={config:s,result:null,didBump:!1,perform:null,staller:null},o=M2();return i.perform=(async()=>{try{s.requests++;const l=await this._translatePerform(s.provider,r);i.result={result:l}}catch(l){s.errorResponses++,i.result={error:l}}const a=M2()-o;s._totalTime+=a,s.rollingDuration=.95*s.rollingDuration+.05*a,i.perform=null})(),i.staller=(async()=>{await Foe(s.stallTimeout),i.staller=null})(),n.add(i),i},ZL=async function(){let n=T(this,Gf);if(!n){const r=[];T(this,gr).forEach(s=>{r.push((async()=>{await joe(s,0),s._lastFatalError||(s._network=await s.provider.getNetwork())})())}),I(this,Gf,n=(async()=>{await Promise.all(r);let s=null;for(const i of T(this,gr)){if(i._lastFatalError)continue;const o=i._network;s==null?s=o.chainId:o.chainId!==s&&ee(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})())}await n},e5=async function(n,r){const s=[];for(const i of n)if(i.result!=null){const{tag:o,value:a}=R2(i.result);s.push({tag:o,value:a,weight:i.config.weight})}if(!(s.reduce((i,o)=>i+o.weight,0)<this.quorum)){switch(r.method){case"getBlockNumber":{T(this,bo)===-2&&I(this,bo,Math.ceil(Qe(P2(this.quorum,T(this,gr).filter(o=>!o._lastFatalError).map(o=>({value:o.blockNumber,tag:Qe(o.blockNumber).toString(),weight:o.weight}))))));const i=Uoe(this.quorum,s);return i===void 0?void 0:(i>T(this,bo)&&I(this,bo,i),T(this,bo))}case"getGasPrice":case"getPriorityFee":case"estimateGas":return P2(this.quorum,s);case"getBlock":return"blockTag"in r&&r.blockTag==="pending"?I2(this.quorum,s):By(this.quorum,s);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return By(this.quorum,s);case"broadcastTransaction":return I2(this.quorum,s)}ee(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${N2(r.method)})`})}},aE=async function(n,r){if(n.size===0)throw new Error("no runners?!");const s=[];let i=0;for(const a of n){if(a.perform&&s.push(a.perform),a.staller){s.push(a.staller);continue}a.didBump||(a.didBump=!0,i++)}const o=await fe(this,yr,e5).call(this,n,r);if(o!==void 0){if(o instanceof Error)throw o;return o}for(let a=0;a<i;a++)fe(this,yr,oE).call(this,n,r);return ee(s.length>0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:r,results:Array.from(n).map(a=>N2(a.result))}}),await Promise.race(s),await fe(this,yr,aE).call(this,n,r)};function Hoe(t){return t&&typeof t.send=="function"&&typeof t.close=="function"}const zoe="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function $oe(t,e){e==null&&(e={});const n=o=>e[o]==="-"?!1:typeof e.exclusive=="string"?o===e.exclusive:Array.isArray(e.exclusive)?e.exclusive.indexOf(o)!==-1:!0;if(typeof t=="string"&&t.match(/^https?:/))return new Qi(t);if(typeof t=="string"&&t.match(/^wss?:/)||Hoe(t))return new iI(t);let r=null;try{r=rn.from(t)}catch{}const s=[];if(n("publicPolygon")&&r&&(r.name==="matic"?s.push(new Qi("https://polygon-rpc.com/",r,{staticNetwork:r})):r.name==="matic-amoy"&&s.push(new Qi("https://rpc-amoy.polygon.technology/",r,{staticNetwork:r}))),n("alchemy"))try{s.push(new Ny(t,e.alchemy))}catch{}if(n("ankr")&&e.ankr!=null)try{s.push(new _y(t,e.ankr))}catch{}if(n("chainstack"))try{s.push(new Py(t,e.chainstack))}catch{}if(n("cloudflare"))try{s.push(new Aoe(t))}catch{}if(n("etherscan"))try{s.push(new Coe(t,e.etherscan))}catch{}if(n("infura"))try{let o=e.infura,a;typeof o=="object"&&(a=o.projectSecret,o=o.projectId),s.push(new Yh(t,o,a))}catch{}if(n("quicknode"))try{let o=e.quicknode;s.push(new Ly(t,o))}catch{}if(ee(s.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),s.length===1)return s[0];let i=Math.floor(s.length/2);return i>2&&(i=2),r&&zoe.indexOf(r.name)!==-1&&(i=1),e&&e.quorum&&(i=e.quorum),new Voe(s,void 0,{quorum:i})}const Goe=async(t,e)=>{const n={name:t,isEns:!1};if(!e)throw new Error("cannot fetch ens name without a provider url");if(!Vre(t))return n;try{const r=await Woe(t,e);r&&(n.name=r,n.isEns=!0)}catch(r){console.log(r)}return n},Woe=async(t,e)=>await Koe(e).lookupAddress(t),Koe=t=>$oe(t),qoe=(t,e,n)=>{if((t==null?void 0:t.length)>n){const r=t.substring(0,e),s=t.substring((t==null?void 0:t.length)-e);return`${r}...${s}`}return t};function Qoe(t){var e;const{char:n,allowSpaces:r,allowedPrefixes:s,startOfLine:i,$position:o}=t,a=z7(n),l=new RegExp(`\\s${a}$`),u=i?"^":"",c=r?new RegExp(`${u}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${u}(?:^)?${a}[^\\s${a}]*`,"gm"),f=((e=o.nodeBefore)===null||e===void 0?void 0:e.isText)&&o.nodeBefore.text;if(!f)return null;const d=o.pos-f.length,h=Array.from(f.matchAll(c)).pop();if(!h||h.input===void 0||h.index===void 0)return null;const p=h.input.slice(Math.max(0,h.index-1),h.index),m=new RegExp(`^[${s==null?void 0:s.join("")}\0]?$`).test(p);if(s!==null&&!m)return null;const g=d+h.index;let y=g+h[0].length;return r&&l.test(f.slice(y-1,y+1))&&(h[0]+=" ",y+=1),g<o.pos&&y>=o.pos?{range:{from:g,to:y},query:h[0].slice(n.length),text:h[0]}:null}const Joe=new _t("suggestion");function Yoe({pluginKey:t=Joe,editor:e,char:n="@",allowSpaces:r=!1,allowedPrefixes:s=[" "],startOfLine:i=!1,decorationTag:o="span",decorationClass:a="suggestion",command:l=()=>null,items:u=()=>[],render:c=()=>({}),allow:f=()=>!0,findSuggestionMatch:d=Qoe}){let h;const p=c==null?void 0:c(),m=new bt({key:t,view(){return{update:async(g,y)=>{var v,w,A,x,k,C,O;const _=(v=this.key)===null||v===void 0?void 0:v.getState(y),D=(w=this.key)===null||w===void 0?void 0:w.getState(g.state),R=_.active&&D.active&&_.range.from!==D.range.from,L=!_.active&&D.active,F=_.active&&!D.active,G=!L&&!F&&_.query!==D.query,B=L,H=G||R,Q=F;if(!B&&!H&&!Q)return;const te=Q&&!B?_:D,Z=g.dom.querySelector(`[data-decoration-id="${te.decorationId}"]`);h={editor:e,range:te.range,query:te.query,text:te.text,items:[],command:pe=>l({editor:e,range:te.range,props:pe}),decorationNode:Z,clientRect:Z?()=>{var pe;const{decorationId:Ee}=(pe=this.key)===null||pe===void 0?void 0:pe.getState(e.state),Re=g.dom.querySelector(`[data-decoration-id="${Ee}"]`);return(Re==null?void 0:Re.getBoundingClientRect())||null}:null},B&&((A=p==null?void 0:p.onBeforeStart)===null||A===void 0||A.call(p,h)),H&&((x=p==null?void 0:p.onBeforeUpdate)===null||x===void 0||x.call(p,h)),(H||B)&&(h.items=await u({editor:e,query:te.query})),Q&&((k=p==null?void 0:p.onExit)===null||k===void 0||k.call(p,h)),H&&((C=p==null?void 0:p.onUpdate)===null||C===void 0||C.call(p,h)),B&&((O=p==null?void 0:p.onStart)===null||O===void 0||O.call(p,h))},destroy:()=>{var g;h&&((g=p==null?void 0:p.onExit)===null||g===void 0||g.call(p,h))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(g,y,v,w){const{isEditable:A}=e,{composing:x}=e.view,{selection:k}=g,{empty:C,from:O}=k,_={...y};if(_.composing=x,A&&(C||e.view.composing)){(O<y.range.from||O>y.range.to)&&!x&&!y.composing&&(_.active=!1);const D=d({char:n,allowSpaces:r,allowedPrefixes:s,startOfLine:i,$position:k.$from}),R=`id_${Math.floor(Math.random()*4294967295)}`;D&&f({editor:e,state:w,range:D.range,isActive:y.active})?(_.active=!0,_.decorationId=y.decorationId?y.decorationId:R,_.range=D.range,_.query=D.query,_.text=D.text):_.active=!1}else _.active=!1;return _.active||(_.decorationId=null,_.range={from:0,to:0},_.query=null,_.text=null),_}},props:{handleKeyDown(g,y){var v;const{active:w,range:A}=m.getState(g.state);return w&&((v=p==null?void 0:p.onKeyDown)===null||v===void 0?void 0:v.call(p,{view:g,event:y,range:A}))||!1},decorations(g){const{active:y,range:v,decorationId:w}=m.getState(g);return y?kt.create(g.doc,[nn.inline(v.from,v.to,{nodeName:o,class:a,"data-decoration-id":w})]):null}}});return m}var Xoe=typeof tr=="object"&&tr&&tr.Object===Object&&tr,Zoe=typeof self=="object"&&self&&self.Object===Object&&self;Xoe||Zoe||Function("return this")();var eae=typeof window<"u"?N.useLayoutEffect:N.useEffect,tae=typeof window>"u";function L2(t,{defaultValue:e=!1,initializeWithValue:n=!0}={}){const r=a=>tae?e:window.matchMedia(a).matches,[s,i]=N.useState(()=>n?r(t):e);function o(){i(r(t))}return eae(()=>{const a=window.matchMedia(t);return o(),a.addListener?a.addListener(o):a.addEventListener("change",o),()=>{a.removeListener?a.removeListener(o):a.removeEventListener("change",o)}},[t]),s}const nae=wt.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:n})=>{n.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[Yoe({editor:this.editor,...this.options.suggestion})]}}),rae=({query:t,onError:e})=>[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:S.jsx(XT,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).toggleNode("paragraph","paragraph").run()}},{title:"To-do List",description:"Track tasks with a to-do list.",searchTerms:["todo","task","list","check","checkbox"],icon:S.jsx(YT,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).toggleTaskList().run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["title","big","large"],icon:S.jsx(C0,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["subtitle","medium"],icon:S.jsx(S0,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["subtitle","small"],icon:S.jsx(T0,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:S.jsx(D0,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:S.jsx(Uu,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).toggleOrderedList().run()}},{title:"Divider",description:"Visually divide content.",searchTerms:["hr","divider","break","line","delimiter"],icon:S.jsx(nV,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setHorizontalRule().run()}},{title:"Quote",description:"Capture a quote.",searchTerms:["blockquote"],icon:S.jsx(O0,{size:18}),image:"",command:({editor:n,range:r})=>n.chain().focus().deleteRange(r).toggleNode("paragraph","paragraph").toggleBlockquote().run()},{title:"Code",description:"Capture a code snippet.",searchTerms:["codeblock"],icon:S.jsx(Md,{size:18}),image:"",command:({editor:n,range:r})=>n.chain().focus().deleteRange(r).toggleCodeBlock().run()},{title:"Table",description:"Create a table.",searchTerms:["table"],icon:S.jsx(iw,{size:18}),image:"",command:({editor:n,range:r})=>n.chain().focus().deleteRange(r).insertTable({rows:3,cols:2,withHeaderRow:!0}).run()},{title:"Image",description:"Upload an image from your computer.",searchTerms:["photo","picture","media"],icon:S.jsx(ZU,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).run();const s=document.createElement("input");s.type="file",s.accept="image/*",s.onchange=async()=>{var i;if((i=s.files)!=null&&i.length){const o=s.files[0];if(o.size>Vd){e&&typeof e=="function"&&e(Kw.IMAGE_SIZE);return}const l=n.view.state.selection.from;uw(o,n.view,l)}},s.click()}},{title:"Video Embed",description:"Embed a video from YouTube, Vimeo, etc.",searchTerms:["iframe","embed","video","youtube"],icon:S.jsx(e3,{}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setActionButton("iframe").run()}},{title:"Twitter",description:"Embed a Twitter tweet.",searchTerms:["embed","twitter","tweet"],icon:S.jsx(ZT,{}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setActionButton("twitter").run()}},{title:"2 Columns",description:"Create 2 columns of block",searchTerms:["col","column","2","layout"],icon:S.jsx(qT,{}),image:"",command:({editor:n})=>{n.chain().focus().setColumns(2).focus(n.state.selection.head-1).run()}},{title:"3 Columns",description:"Create 3 columns of block",searchTerms:["col","column","3","layout"],icon:S.jsx(QU,{}),image:"",command:({editor:n})=>{n.chain().focus().setColumns(3).focus(n.state.selection.head-1).run()}}].filter(n=>{if(typeof t=="string"&&t.length>0){const r=t.toLowerCase();return n.title.toLowerCase().includes(r)||n.description.toLowerCase().includes(r)||n.searchTerms&&n.searchTerms.some(s=>s.includes(r))}return!0}),sae=(t,e)=>{const n=t.offsetHeight,r=e?e.offsetHeight:0,s=e.offsetTop,i=s+r;s<t.scrollTop?t.scrollTop-=t.scrollTop-s+5:i>n+t.scrollTop&&(t.scrollTop+=i-n-t.scrollTop+5)},iae=({items:t,command:e,editor:n})=>{const[r,s]=N.useState(0),[i,o]=N.useState(t),a=L2("(max-width: 640px)"),l=N.useCallback(c=>{const f=i[c];f&&(f.title==="Continue writing"||e(f))},[e,n,i]);N.useEffect(()=>{if(a){const c=t.filter(f=>!["2 Columns","3 Columns","Twitter","Video Embed"].includes(f.title));o(c)}else o(t)},[t,a]),N.useEffect(()=>{const c=["ArrowUp","ArrowDown","Enter"],f=d=>{if(c.includes(d.key))return d.preventDefault(),d.key==="ArrowUp"?(s((r+i.length-1)%i.length),!0):d.key==="ArrowDown"?(s((r+1)%i.length),!0):d.key==="Enter"?(l(r),!0):!1};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}},[i,r,s,l]),N.useEffect(()=>{s(0)},[i]);const u=N.useRef(null);return N.useLayoutEffect(()=>{const c=u==null?void 0:u.current,f=c==null?void 0:c.children[r];f&&c&&sae(c,f)},[r]),i.length>0?S.jsx("div",{id:"slash-command",ref:u,className:"z-50 h-auto max-h-[330px] w-72 overflow-y-auto scroll-smooth rounded-md border border-[#DDD] bg-white px-1 py-2 shadow-md transition-all",children:i.map((c,f)=>S.jsxs("button",{className:`flex w-full items-center space-x-2 rounded-md px-2 py-1 text-left text-sm text-neutral-500 hover:bg-neutral-100 hover:border-neutral-200 border border-transparent transition-all ${f===r?"bg-neutral-200 text-neutral-800":""}`,onClick:()=>l(f),children:[S.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-md border border-neutral-200 bg-white",children:c.icon}),S.jsxs("div",{children:[S.jsx("p",{className:"font-medium",children:c.title}),S.jsx("p",{className:"text-xs text-neutral-500",children:c.description})]})]},f))}):null},oae=()=>{let t=null,e=null;return{onStart:n=>{t=new GT(iae,{props:n,editor:n.editor}),e=Xa("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:n=>{t==null||t.updateProps(n),e&&e[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown:n=>{var r;return n.event.key==="Escape"?(e==null||e[0].hide(),!0):(r=t==null?void 0:t.ref)==null?void 0:r.onKeyDown(n)},onExit:()=>{e==null||e[0].destroy(),t==null||t.destroy()}}},aae=t=>{const e=({query:n})=>rae({query:n,onError:t});return nae.configure({suggestion:{items:e,render:oae}})},lI=["#30bced","#6eeb83","#fa69d1","#ecd444","#ee6352","#db3041","#0ad7f2","#1bff39"],lae=({isPreviewMode:t,initialContent:e,enableCollaboration:n,collaborationId:r,walletAddress:s,username:i,onChange:o,onCollaboratorChange:a,onCommentInteraction:l,onTextSelection:u,ensResolutionUrl:c,onError:f})=>{var O,_;const[d]=N.useState(new ul),[h,p]=N.useState([...qte,aae(f)]),m=N.useRef(!1),g=(D,R,L)=>{let F=!1;return D.doc.nodesBetween(R,L,G=>{G.marks&&G.marks.some(B=>B.type.name==="highlight"&&B.attrs.color==="yellow")&&(F=!0)}),F},y=(D,R)=>{var F;const L=R.target;if(L&&L.nodeName==="MARK"&&L.dataset.color&&((F=L==null?void 0:L.dataset)==null?void 0:F.color)==="yellow"){const G=L.textContent,B=D.posAtCoords({left:R.clientX,top:R.clientY});if(B){const{state:H}=D;let Q=B.pos,te=B.pos;if(H.doc.nodesBetween(Q,te,(Z,pe)=>{Z.marks&&Z.marks.length&&Z.marks.forEach(Ee=>{Ee.type.name==="highlight"&&(Q=pe,te=pe+Z.nodeSize)})}),Q!==te){const Z={text:G,from:Q,to:te,isHighlightedYellow:g(H,Q,te)};l==null||l(Z)}}}},w=FU({extensions:h,editorProps:{...cK,handleDOMEvents:{mouseover:y,keydown:(D,R)=>{if(["ArrowUp","ArrowDown","Enter"].includes(R.key)&&document.querySelector("#slash-command"))return!0}},handleClick:(D,R,L)=>{y(D,L)}},autofocus:"start",onTransaction:D=>{w!=null&&w.isEmpty||o==null||o(D.editor.getJSON())},shouldRerenderOnTransaction:!0,immediatelyRender:!1},[h]),A=N.useRef(()=>{}),x=(D,R=!1)=>{if(!n||!r)throw new Error("docId or username is not provided");const L=new uK(r,d,{signaling:["wss://fileverse-signaling-server-0529292ff51c.herokuapp.com/"]});return p([...h,LK.configure({document:d}),BK.configure({provider:L,user:{name:D&&D.length>20?qoe(D,7,15):D,color:lI[Math.floor(Math.random()*lI.length)],isEns:R},render:Zte})]),A.current=()=>{L.destroy(),d.destroy()},A.current},k=N.useRef(null);N.useEffect(()=>{w==null||w.setEditable(!t)},[t,w]),N.useEffect(()=>{e&&w&&!m.current&&(queueMicrotask(()=>{w.commands.setContent(e)}),m.current=!0),setTimeout(()=>{m.current=!1})},[e,w]),N.useEffect(()=>{if(!w)return;const D=()=>{const{state:R}=w,{from:L,to:F}=R.selection,G=R.doc.textBetween(L,F," ");u==null||u({text:G,from:L,to:F,isHighlightedYellow:g(R,L,F)})};return w.on("selectionUpdate",D),()=>{w.off("selectionUpdate",D)}},[w]);const C=async()=>{let D=i,R=!1;if(s&&c){const{name:L,isEns:F}=await Goe(s,c);D=L,R=F}if(!D)throw new Error("Cannot start collaboration without a username");x(D,R)};return N.useEffect(()=>{n?C():A.current()},[n]),N.useEffect(()=>{var D,R;a==null||a((R=(D=w==null?void 0:w.storage)==null?void 0:D.collaborationCursor)==null?void 0:R.users)},[(_=(O=w==null?void 0:w.storage)==null?void 0:O.collaborationCursor)==null?void 0:_.users]),{editor:w,ref:k,connect:x,ydoc:d}},uae=({title:t,content:e,contentClassName:n,open:r,onOpenChange:s,primaryAction:i,secondaryAction:o})=>S.jsx(dz,{open:r,onOpenChange:s,children:S.jsxs(bD,{className:"max-w-md sm:w-full w-[90%] z-20",children:[S.jsx(wD,{className:"px-4 pt-0 border-b-[1px]",children:S.jsx(vD,{className:"text-left text-base",children:t})}),S.jsx("div",{className:he("flex flex-col gap-4 w-full h-full pb-4 text-base text-black",n),children:e&&e}),S.jsxs(AD,{className:"px-5 pb-5 justify-end sm:",children:[o&&S.jsx(mz,{asChild:!0,children:S.jsx(sl,{disabled:o==null?void 0:o.isLoading,isLoading:o==null?void 0:o.isLoading,className:o==null?void 0:o.className,variant:(o==null?void 0:o.variant)||"ghost",onClick:o==null?void 0:o.onClick,children:o==null?void 0:o.label})}),i&&S.jsx(sl,{disabled:i==null?void 0:i.isLoading,isLoading:i==null?void 0:i.isLoading,className:i==null?void 0:i.className,variant:(i==null?void 0:i.variant)||"primary",onClick:i==null?void 0:i.onClick,children:i==null?void 0:i.label})]})]})}),cae=({editor:t,onError:e})=>{const{toolVisibilty:n,setToolVisibility:r,bottomToolbar:s}=qw({editor:t,onError:e}),i=L2("(max-width: 1023px)"),[o,a]=N.useState(""),[l,u]=N.useState(""),[c,f]=N.useState(!0),d=()=>{if(o===null){f(!1);return}if(o===""){t.chain().focus().extendMarkRange("link").unsetLink().run(),f(!1);return}let m=o;!o.startsWith("http://")&&!o.startsWith("https://")&&(m="https://"+o);try{m.match(/^((http|https):\/\/)?([w|W]{3}\.)+[a-zA-Z0-9\-\.]{3,}\.[a-zA-Z]{2,}(\.[a-zA-Z]{2,})?$/)&&t.chain().focus().extendMarkRange("link").setLink({href:m}).command(({tr:g})=>(g.insertText(l),!0)).run(),f(!0)}catch{console.error("Invalid URL"),f(!1);return}t.chain().focus().extendMarkRange("link").setLink({href:m}).command(({tr:g})=>(g.insertText(l),!0)).run(),f(!0),r(Me.NONE)},h=m=>{const{from:g,to:y}=m.state.selection,v=m.state.doc.textBetween(g,y);return u(v),v},p=N.useRef(null);return N.useEffect(()=>{let m=0;const g=()=>{m=Date.now()},y=()=>{var A;if(Date.now()-m>500){const{selection:x}=t.state;x.from!==x.to&&((A=p.current)==null||A.click())}},v=()=>{var x;if(!i)return;const{selection:w}=t.state;w.from!==w.to&&((x=p.current)==null||x.click())};return i?(document.addEventListener("touchstart",g),document.addEventListener("touchend",y)):document.addEventListener("mouseup",v),()=>{i?(document.removeEventListener("touchstart",g),document.removeEventListener("touchend",y)):document.removeEventListener("mouseup",v)}},[t,i]),N.useEffect(()=>{h(t)},[t]),N.useEffect(()=>{const m=g=>{g.key==="k"&&(g.metaKey||g.ctrlKey)&&(g.preventDefault(),n!==Me.LINK_POPUP?r(Me.LINK_POPUP):r(Me.NONE))};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[t,n]),S.jsxs(fD,{children:[S.jsx("div",{className:"flex w-full justify-between sm:justify-evenly select-none",children:s.map(m=>{if(m)return S.jsx("div",{className:"flex items-center",children:m.title==="Text formating"?S.jsx(dD,{asChild:!0,children:S.jsx("button",{ref:p,onClick:()=>m.onClick(),children:m.icon})}):m.title==="Text color"?S.jsx(dD,{asChild:!0,children:S.jsx("button",{onClick:()=>m.onClick(),children:m.icon})}):S.jsx("button",{className:he("flex items-center rounded px-2 py-1 transition",{"text-black":m.isActive,"text-[#A1AAB1]":!m.isActive}),onClick:()=>m.onClick(),disabled:!m.isActive,children:m.icon})},m.title)})}),n===Me.TEXT_FORMATING&&S.jsx(n$,{editor:t,setToolVisibility:r}),n===Me.LINK_POPUP&&S.jsx(uae,{open:n===Me.LINK_POPUP,onOpenChange:()=>r(Me.NONE),title:"Link",content:S.jsxs("div",{className:"flex flex-col gap-4 w-full h-full px-4",children:[S.jsx(q0,{label:"Text",placeholder:"Link text",className:"w-full",defaultValue:l,onChange:m=>{m.preventDefault(),u(m.target.value)}}),S.jsx(q0,{label:"Link",placeholder:"Paste URL",className:"w-full",defaultValue:t.getAttributes("link").href,onChange:m=>{m.preventDefault(),a(m.target.value)},isValid:c,message:c?"":"Invalid URL"})]}),primaryAction:{label:"Save",onClick:()=>d(),isLoading:!1,className:"w-auto min-w-[80px]"},secondaryAction:{label:"Cancel",variant:"secondary",onClick:()=>r(Me.NONE),className:"w-auto min-w-[80px]"}})]})},B2=N.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Fy=N.createContext({}),jy=N.createContext(null),F2=typeof document<"u",j2=F2?N.useLayoutEffect:N.useEffect,uI=N.createContext({strict:!1}),U2=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),cI="data-"+U2("framerAppearId"),fae={skipAnimations:!1,useManualTiming:!1};class fI{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const n=this.order.indexOf(e);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}function dae(t){let e=new fI,n=new fI,r=0,s=!1,i=!1;const o=new WeakSet,a={schedule:(l,u=!1,c=!1)=>{const f=c&&s,d=f?e:n;return u&&o.add(l),d.add(l)&&f&&s&&(r=e.order.length),l},cancel:l=>{n.remove(l),o.delete(l)},process:l=>{if(s){i=!0;return}if(s=!0,[e,n]=[n,e],n.clear(),r=e.order.length,r)for(let u=0;u<r;u++){const c=e.order[u];o.has(c)&&(a.schedule(c),t()),c(l)}s=!1,i&&(i=!1,a.process(l))}};return a}const Uy=["read","resolveKeyframes","update","preRender","render","postRender"],hae=40;function dI(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=Uy.reduce((f,d)=>(f[d]=dae(()=>n=!0),f),{}),o=f=>{i[f].process(s)},a=()=>{const f=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(f-s.timestamp,hae),1),s.timestamp=f,s.isProcessing=!0,Uy.forEach(o),s.isProcessing=!1,n&&e&&(r=!1,t(a))},l=()=>{n=!0,r=!0,s.isProcessing||t(a)};return{schedule:Uy.reduce((f,d)=>{const h=i[d];return f[d]=(p,m=!1,g=!1)=>(n||l(),h.schedule(p,m,g)),f},{}),cancel:f=>Uy.forEach(d=>i[d].cancel(f)),state:s,steps:i}}const{schedule:V2,cancel:Yde}=dI(queueMicrotask,!1);function Wc(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}const hI=N.createContext({});let pI=!1;function pae(t,e,n,r,s){const{visualElement:i}=N.useContext(Fy),o=N.useContext(uI),a=N.useContext(jy),l=N.useContext(B2).reducedMotion,u=N.useRef();r=r||o.renderer,!u.current&&r&&(u.current=r(t,{visualState:e,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const c=u.current,f=N.useContext(hI);c&&!c.projection&&s&&(c.type==="html"||c.type==="svg")&&gae(u.current,n,s,f),N.useInsertionEffect(()=>{c&&c.update(n,a)});const d=N.useRef(!!(n[cI]&&!window.HandoffComplete));return j2(()=>{c&&(c.updateFeatures(),V2.render(c.render),d.current&&c.animationState&&c.animationState.animateChanges())}),N.useEffect(()=>{c&&(!d.current&&c.animationState&&c.animationState.animateChanges(),d.current&&(d.current=!1,pI||(pI=!0,queueMicrotask(mae))))}),c}function mae(){window.HandoffComplete=!0}function gae(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:mI(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&Wc(a),visualElement:t,scheduleRender:()=>t.scheduleRender(),animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function mI(t){if(t)return t.options.allowProjection!==!1?t.projection:mI(t.parent)}function yae(t,e,n){return N.useCallback(r=>{r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):Wc(n)&&(n.current=r))},[e])}function Zh(t){return typeof t=="string"||Array.isArray(t)}function Vy(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const H2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],z2=["initial",...H2];function Hy(t){return Vy(t.animate)||z2.some(e=>Zh(t[e]))}function gI(t){return!!(Hy(t)||t.variants)}function bae(t,e){if(Hy(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Zh(n)?n:void 0,animate:Zh(r)?r:void 0}}return t.inherit!==!1?e:{}}function wae(t){const{initial:e,animate:n}=bae(t,N.useContext(Fy));return N.useMemo(()=>({initial:e,animate:n}),[yI(e),yI(n)])}function yI(t){return Array.isArray(t)?t.join(" "):t}const bI={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Kc={};for(const t in bI)Kc[t]={isEnabled:e=>bI[t].some(n=>!!e[n])};function Aae(t){for(const e in t)Kc[e]={...Kc[e],...t[e]}}const $2=N.createContext({}),vae=Symbol.for("motionComponentSymbol"),Sn=t=>t;let qc=Sn,Ji=Sn;process.env.NODE_ENV!=="production"&&(qc=(t,e)=>{!t&&typeof console<"u"&&console.warn(e)},Ji=(t,e)=>{if(!t)throw new Error(e)});function xae({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:s}){t&&Aae(t);function i(a,l){let u;const c={...N.useContext(B2),...a,layoutId:kae(a)},{isStatic:f}=c,d=wae(a),h=r(a,f);if(!f&&F2){Eae(c,t);const p=Cae(c);u=p.MeasureLayout,d.visualElement=pae(s,h,c,e,p.ProjectionNode)}return S.jsxs(Fy.Provider,{value:d,children:[u&&d.visualElement?S.jsx(u,{visualElement:d.visualElement,...c}):null,n(s,a,yae(h,d.visualElement,l),h,f,d.visualElement)]})}const o=N.forwardRef(i);return o[vae]=s,o}function kae({layoutId:t}){const e=N.useContext($2).id;return e&&t!==void 0?e+"-"+t:t}function Eae(t,e){const n=N.useContext(uI).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?qc(!1,r):Ji(!1,r)}}function Cae(t){const{drag:e,layout:n}=Kc;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Sae(t){function e(r,s={}){return xae(t(r,s))}if(typeof Proxy>"u")return e;const n=new Map;return new Proxy(e,{get:(r,s)=>(n.has(s)||n.set(s,e(s)),n.get(s))})}const Tae=["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 G2(t){return typeof t!="string"||t.includes("-")?!1:!!(Tae.indexOf(t)>-1||/[A-Z]/u.test(t))}const zy={};function Dae(t){Object.assign(zy,t)}const ep=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Bl=new Set(ep);function wI(t,{layout:e,layoutId:n}){return Bl.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!zy[t]||t==="opacity")}const Pn=t=>!!(t&&t.getVelocity),Oae={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_ae=ep.length;function Mae(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},r,s){let i="";for(let o=0;o<_ae;o++){const a=ep[o];if(t[a]!==void 0){const l=Oae[a]||a;i+=`${l}(${t[a]}) `}}return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),s?i=s(t,r?"":i):n&&r&&(i="none"),i}const AI=t=>e=>typeof e=="string"&&e.startsWith(t),vI=AI("--"),Nae=AI("var(--"),W2=t=>Nae(t)?Rae.test(t.split("/*")[0].trim()):!1,Rae=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Pae=(t,e)=>e&&typeof t=="number"?e.transform(t):t,aa=(t,e,n)=>n>e?e:n<t?t:n,Qc={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},tp={...Qc,transform:t=>aa(0,1,t)},$y={...Qc,default:1},np=t=>Math.round(t*1e5)/1e5,K2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Iae=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Lae=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function rp(t){return typeof t=="string"}const sp=t=>({test:e=>rp(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),la=sp("deg"),di=sp("%"),Ie=sp("px"),Bae=sp("vh"),Fae=sp("vw"),xI={...di,parse:t=>di.parse(t)/100,transform:t=>di.transform(t*100)},kI={...Qc,transform:Math.round},EI={borderWidth:Ie,borderTopWidth:Ie,borderRightWidth:Ie,borderBottomWidth:Ie,borderLeftWidth:Ie,borderRadius:Ie,radius:Ie,borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomRightRadius:Ie,borderBottomLeftRadius:Ie,width:Ie,maxWidth:Ie,height:Ie,maxHeight:Ie,size:Ie,top:Ie,right:Ie,bottom:Ie,left:Ie,padding:Ie,paddingTop:Ie,paddingRight:Ie,paddingBottom:Ie,paddingLeft:Ie,margin:Ie,marginTop:Ie,marginRight:Ie,marginBottom:Ie,marginLeft:Ie,rotate:la,rotateX:la,rotateY:la,rotateZ:la,scale:$y,scaleX:$y,scaleY:$y,scaleZ:$y,skew:la,skewX:la,skewY:la,distance:Ie,translateX:Ie,translateY:Ie,translateZ:Ie,x:Ie,y:Ie,z:Ie,perspective:Ie,transformPerspective:Ie,opacity:tp,originX:xI,originY:xI,originZ:Ie,zIndex:kI,backgroundPositionX:Ie,backgroundPositionY:Ie,fillOpacity:tp,strokeOpacity:tp,numOctaves:kI};function q2(t,e,n,r){const{style:s,vars:i,transform:o,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const f in e){const d=e[f];if(vI(f)){i[f]=d;continue}const h=EI[f],p=Pae(d,h);if(Bl.has(f)){if(l=!0,o[f]=p,!c)continue;d!==(h.default||0)&&(c=!1)}else f.startsWith("origin")?(u=!0,a[f]=p):s[f]=p}if(e.transform||(l||r?s.transform=Mae(t.transform,n,c,r):s.transform&&(s.transform="none")),u){const{originX:f="50%",originY:d="50%",originZ:h=0}=a;s.transformOrigin=`${f} ${d} ${h}`}}const Q2=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function CI(t,e,n){for(const r in e)!Pn(e[r])&&!wI(r,n)&&(t[r]=e[r])}function jae({transformTemplate:t},e,n){return N.useMemo(()=>{const r=Q2();return q2(r,e,{enableHardwareAcceleration:!n},t),Object.assign({},r.vars,r.style)},[e])}function Uae(t,e,n){const r=t.style||{},s={};return CI(s,r,t),Object.assign(s,jae(t,e,n)),s}function Vae(t,e,n){const r={},s=Uae(t,e,n);return t.drag&&t.dragListener!==!1&&(r.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=s,r}const Hae=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Gy(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Hae.has(t)}let SI=t=>!Gy(t);function zae(t){t&&(SI=e=>e.startsWith("on")?!Gy(e):t(e))}try{zae(require("@emotion/is-prop-valid").default)}catch{}function $ae(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||(SI(s)||n===!0&&Gy(s)||!e&&!Gy(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}function TI(t,e,n){return typeof t=="string"?t:Ie.transform(e+n*t)}function Gae(t,e,n){const r=TI(e,t.x,t.width),s=TI(n,t.y,t.height);return`${r} ${s}`}const Wae={offset:"stroke-dashoffset",array:"stroke-dasharray"},Kae={offset:"strokeDashoffset",array:"strokeDasharray"};function qae(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?Wae:Kae;t[i.offset]=Ie.transform(-r);const o=Ie.transform(e),a=Ie.transform(n);t[i.array]=`${o} ${a}`}function J2(t,{attrX:e,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,f,d){if(q2(t,u,c,d),f){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:p,dimensions:m}=t;h.transform&&(m&&(p.transform=h.transform),delete h.transform),m&&(s!==void 0||i!==void 0||p.transform)&&(p.transformOrigin=Gae(m,s!==void 0?s:.5,i!==void 0?i:.5)),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&qae(h,o,a,l,!1)}const DI=()=>({...Q2(),attrs:{}}),Y2=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Qae(t,e,n,r){const s=N.useMemo(()=>{const i=DI();return J2(i,e,{enableHardwareAcceleration:!1},Y2(r),t.transformTemplate),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};CI(i,t.style,t),s.style={...i,...s.style}}return s}function Jae(t=!1){return(n,r,s,{latestValues:i},o)=>{const l=(G2(n)?Qae:Vae)(r,i,o,n),u=$ae(r,typeof n=="string",t),c=n!==N.Fragment?{...u,...l,ref:s}:{},{children:f}=r,d=N.useMemo(()=>Pn(f)?f.get():f,[f]);return N.createElement(n,{...c,children:d})}}function OI(t,{style:e,vars:n},r,s){Object.assign(t.style,e,s&&s.getProjectionStyles(r));for(const i in n)t.style.setProperty(i,n[i])}const _I=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 MI(t,e,n,r){OI(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(_I.has(s)?s:U2(s),e.attrs[s])}function X2(t,e,n){var r;const{style:s}=t,i={};for(const o in s)(Pn(s[o])||e.style&&Pn(e.style[o])||wI(o,t)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}function NI(t,e,n){const r=X2(t,e,n);for(const s in t)if(Pn(t[s])||Pn(e[s])){const i=ep.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}function RI(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Z2(t,e,n,r){if(typeof e=="function"){const[s,i]=RI(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=RI(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function PI(t){const e=N.useRef(null);return e.current===null&&(e.current=t()),e.current}const ek=t=>Array.isArray(t),Yae=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Xae=t=>ek(t)?t[t.length-1]||0:t;function Wy(t){const e=Pn(t)?t.get():t;return Yae(e)?e.toValue():e}function Zae({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,s,i){const o={latestValues:ele(r,s,i,t),renderState:e()};return n&&(o.mount=a=>n(r,a,o)),o}const II=t=>(e,n)=>{const r=N.useContext(Fy),s=N.useContext(jy),i=()=>Zae(t,e,r,s);return n?i():PI(i)};function ele(t,e,n,r){const s={},i=r(t,{});for(const d in i)s[d]=Wy(i[d]);let{initial:o,animate:a}=t;const l=Hy(t),u=gI(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const f=c?a:o;return f&&typeof f!="boolean"&&!Vy(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=Z2(t,h);if(!p)return;const{transitionEnd:m,transition:g,...y}=p;for(const v in y){let w=y[v];if(Array.isArray(w)){const A=c?w.length-1:0;w=w[A]}w!==null&&(s[v]=w)}for(const v in m)s[v]=m[v]}),s}const{schedule:pt,cancel:Yi,state:Tn,steps:tk}=dI(typeof requestAnimationFrame<"u"?requestAnimationFrame:Sn,!0),tle={useVisualState:II({scrapeMotionValuesFromProps:NI,createRenderState:DI,onMount:(t,e,{renderState:n,latestValues:r})=>{pt.read(()=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),pt.render(()=>{J2(n,r,{enableHardwareAcceleration:!1},Y2(e.tagName),t.transformTemplate),MI(e,n)})}})},nle={useVisualState:II({scrapeMotionValuesFromProps:X2,createRenderState:Q2})};function rle(t,{forwardMotionProps:e=!1},n,r){return{...G2(t)?tle:nle,preloadedFeatures:n,useRender:Jae(e),createVisualElement:r,Component:t}}function Xi(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const LI=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function Ky(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}const sle=t=>e=>LI(e)&&t(e,Ky(e));function Zi(t,e,n,r){return Xi(t,e,sle(n),r)}const ile=(t,e)=>n=>e(t(n)),eo=(...t)=>t.reduce(ile);function BI(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const FI=BI("dragHorizontal"),jI=BI("dragVertical");function UI(t){let e=!1;if(t==="y")e=jI();else if(t==="x")e=FI();else{const n=FI(),r=jI();n&&r?e=()=>{n(),r()}:(n&&n(),r&&r())}return e}function VI(){const t=UI(!0);return t?(t(),!1):!0}class ua{constructor(e){this.isMounted=!1,this.node=e}update(){}}function HI(t,e){const n=e?"pointerenter":"pointerleave",r=e?"onHoverStart":"onHoverEnd",s=(i,o)=>{if(i.pointerType==="touch"||VI())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e);const l=a[r];l&&pt.postRender(()=>l(i,o))};return Zi(t.current,n,s,{passive:!t.getProps()[r]})}class ole extends ua{mount(){this.unmount=eo(HI(this.node,!0),HI(this.node,!1))}unmount(){}}class ale extends ua{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=eo(Xi(this.node.current,"focus",()=>this.onFocus()),Xi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const zI=(t,e)=>e?t===e?!0:zI(t,e.parentElement):!1;function nk(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,Ky(n))}class lle extends ua{constructor(){super(...arguments),this.removeStartListeners=Sn,this.removeEndListeners=Sn,this.removeAccessibleListeners=Sn,this.startPointerPress=(e,n)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),i=Zi(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:f}=this.node.getProps(),d=!f&&!zI(this.node.current,a.target)?c:u;d&&pt.update(()=>d(a,l))},{passive:!(r.onTap||r.onPointerUp)}),o=Zi(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=eo(i,o),this.startPress(e,n)},this.startAccessiblePress=()=>{const e=i=>{if(i.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||nk("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&pt.postRender(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Xi(this.node.current,"keyup",o),nk("down",(a,l)=>{this.startPress(a,l)})},n=Xi(this.node.current,"keydown",e),r=()=>{this.isPressing&&nk("cancel",(i,o)=>this.cancelPress(i,o))},s=Xi(this.node.current,"blur",r);this.removeAccessibleListeners=eo(n,s)}}startPress(e,n){this.isPressing=!0;const{onTapStart:r,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&pt.postRender(()=>r(e,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!VI()}cancelPress(e,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&pt.postRender(()=>r(e,n))}mount(){const e=this.node.getProps(),n=Zi(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),r=Xi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=eo(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const rk=new WeakMap,sk=new WeakMap,ule=t=>{const e=rk.get(t.target);e&&e(t)},cle=t=>{t.forEach(ule)};function fle({root:t,...e}){const n=t||document;sk.has(n)||sk.set(n,{});const r=sk.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(cle,{root:t,...e})),r[s]}function dle(t,e,n){const r=fle(e);return rk.set(t,n),r.observe(t),()=>{rk.delete(t),r.unobserve(t)}}const hle={some:0,all:1};class ple extends ua{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:hle[s]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),d=u?c:f;d&&d(l)};return dle(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(mle(e,n))&&this.startObserver()}unmount(){}}function mle({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const gle={inView:{Feature:ple},tap:{Feature:lle},focus:{Feature:ale},hover:{Feature:ole}};function $I(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function qy(t,e,n){const r=t.getProps();return Z2(r,e,n!==void 0?n:r.custom,t)}const to=t=>t*1e3,no=t=>t/1e3,yle={type:"spring",stiffness:500,damping:25,restSpeed:10},ble=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),wle={type:"keyframes",duration:.8},Ale={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},vle=(t,{keyframes:e})=>e.length>2?wle:Bl.has(t)?t.startsWith("scale")?ble(e[1]):yle:Ale;function xle({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}function ik(t,e){return t[e]||t.default||t}const kle=t=>t!==null;function Qy(t,{repeat:e,repeatType:n="loop"},r){const s=t.filter(kle),i=e&&n!=="loop"&&e%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}let Jy;function Ele(){Jy=void 0}const ca={now:()=>(Jy===void 0&&ca.set(Tn.isProcessing||fae.useManualTiming?Tn.timestamp:performance.now()),Jy),set:t=>{Jy=t,queueMicrotask(Ele)}},GI=t=>/^0[^.\s]+$/u.test(t);function Cle(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||GI(t):!0}const WI=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Sle=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Tle(t){const e=Sle.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}const Dle=4;function KI(t,e,n=1){Ji(n<=Dle,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,s]=Tle(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return WI(o)?parseFloat(o):o}return W2(s)?KI(s,e,n+1):s}const Ole=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),qI=t=>t===Qc||t===Ie,QI=(t,e)=>parseFloat(t.split(", ")[e]),JI=(t,e)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return QI(s[1],e);{const i=r.match(/^matrix\((.+)\)$/u);return i?QI(i[1],t):0}},_le=new Set(["x","y","z"]),Mle=ep.filter(t=>!_le.has(t));function Nle(t){const e=[];return Mle.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Jc={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),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:JI(4,13),y:JI(5,14)};Jc.translateX=Jc.x,Jc.translateY=Jc.y;const YI=t=>e=>e.test(t),XI=[Qc,Ie,di,la,Fae,Bae,{test:t=>t==="auto",parse:t=>t}],ZI=t=>XI.find(YI(t)),Fl=new Set;let ok=!1,ak=!1;function e8(){if(ak){const t=Array.from(Fl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=Nle(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))===null||a===void 0||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ak=!1,ok=!1,Fl.forEach(t=>t.complete()),Fl.clear()}function t8(){Fl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ak=!0)})}function Rle(){t8(),e8()}class lk{constructor(e,n,r,s,i,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Fl.add(this),ok||(ok=!0,pt.read(t8),pt.resolveKeyframes(e8))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;for(let i=0;i<e.length;i++)if(e[i]===null)if(i===0){const o=s==null?void 0:s.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),s&&o===void 0&&s.set(e[0])}else e[i]=e[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Fl.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Fl.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const uk=(t,e)=>n=>!!(rp(n)&&Lae.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),n8=(t,e,n)=>r=>{if(!rp(r))return r;const[s,i,o,a]=r.match(K2);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Ple=t=>aa(0,255,t),ck={...Qc,transform:t=>Math.round(Ple(t))},jl={test:uk("rgb","red"),parse:n8("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+ck.transform(t)+", "+ck.transform(e)+", "+ck.transform(n)+", "+np(tp.transform(r))+")"};function Ile(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const fk={test:uk("#"),parse:Ile,transform:jl.transform},Yc={test:uk("hsl","hue"),parse:n8("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+di.transform(np(e))+", "+di.transform(np(n))+", "+np(tp.transform(r))+")"},In={test:t=>jl.test(t)||fk.test(t)||Yc.test(t),parse:t=>jl.test(t)?jl.parse(t):Yc.test(t)?Yc.parse(t):fk.parse(t),transform:t=>rp(t)?t:t.hasOwnProperty("red")?jl.transform(t):Yc.transform(t)};function Lle(t){var e,n;return isNaN(t)&&rp(t)&&(((e=t.match(K2))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(Iae))===null||n===void 0?void 0:n.length)||0)>0}const r8="number",s8="color",Ble="var",Fle="var(",i8="${}",jle=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ip(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=e.replace(jle,l=>(In.test(l)?(r.color.push(i),s.push(s8),n.push(In.parse(l))):l.startsWith(Fle)?(r.var.push(i),s.push(Ble),n.push(l)):(r.number.push(i),s.push(r8),n.push(parseFloat(l))),++i,i8)).split(i8);return{values:n,split:a,indexes:r,types:s}}function o8(t){return ip(t).values}function a8(t){const{split:e,types:n}=ip(t),r=e.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=e[o],s[o]!==void 0){const a=n[o];a===r8?i+=np(s[o]):a===s8?i+=In.transform(s[o]):i+=s[o]}return i}}const Ule=t=>typeof t=="number"?0:t;function Vle(t){const e=o8(t);return a8(t)(e.map(Ule))}const fa={test:Lle,parse:o8,createTransformer:a8,getAnimatableNone:Vle},Hle=new Set(["brightness","contrast","saturate","opacity"]);function zle(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(K2)||[];if(!r)return t;const s=n.replace(r,"");let i=Hle.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const $le=/\b([a-z-]*)\(.*?\)/gu,dk={...fa,getAnimatableNone:t=>{const e=t.match($le);return e?e.map(zle).join(" "):t}},Gle={...EI,color:In,backgroundColor:In,outlineColor:In,fill:In,stroke:In,borderColor:In,borderTopColor:In,borderRightColor:In,borderBottomColor:In,borderLeftColor:In,filter:dk,WebkitFilter:dk},hk=t=>Gle[t];function l8(t,e){let n=hk(t);return n!==dk&&(n=fa),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Wle=new Set(["auto","none","0"]);function Kle(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!Wle.has(i)&&ip(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=l8(n,s)}class u8 extends lk{constructor(e,n,r,s){super(e,n,r,s,s==null?void 0:s.owner,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),W2(u))){const c=KI(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Ole.has(r)||e.length!==2)return;const[s,i]=e,o=ZI(s),a=ZI(i);if(o!==a)if(qI(o)&&qI(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)Cle(e[s])&&r.push(s);r.length&&Kle(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Jc[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var e;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n.current)return;const i=n.getValue(r);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,a=s[o];s[o]=Jc[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function c8(t){let e;return()=>(e===void 0&&(e=t()),e)}const f8=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(fa.test(t)||t==="0")&&!t.startsWith("url("));function qle(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Qle(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=f8(s,e),a=f8(i,e);return qc(o===a,`You are trying to animate ${e} from "${s}" to "${i}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${i} via the \`style\` property.`),!o||!a?!1:qle(t)||n==="spring"&&r}class d8{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...a},this.updateFinishedPromise()}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Rle(),this._resolved}onKeyframesResolved(e,n){this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Qle(e,r,s,i))if(o)this.options.duration=0;else{l==null||l(Qy(e,this.options,n)),a==null||a(),this.resolveFinishedPromise();return}const c=this.initPlayback(e,n);c!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function h8(t,e){return e?t*(1e3/e):0}const Jle=5;function p8(t,e,n){const r=Math.max(e-Jle,0);return h8(n-t(r),e-r)}const pk=.001,Yle=.01,m8=10,Xle=.05,Zle=1;function eue({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let s,i;qc(t<=to(m8),"Spring duration must be 10 seconds or less");let o=1-e;o=aa(Xle,Zle,o),t=aa(Yle,m8,no(t)),o<1?(s=u=>{const c=u*o,f=c*t,d=c-n,h=mk(u,o),p=Math.exp(-f);return pk-d/h*p},i=u=>{const f=u*o*t,d=f*n+n,h=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-f),m=mk(Math.pow(u,2),o);return(-s(u)+pk>0?-1:1)*((d-h)*p)/m}):(s=u=>{const c=Math.exp(-u*t),f=(u-n)*t+1;return-pk+c*f},i=u=>{const c=Math.exp(-u*t),f=(n-u)*(t*t);return c*f});const a=5/t,l=nue(s,i,a);if(t=to(t),isNaN(l))return{stiffness:100,damping:10,duration:t};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:t}}}const tue=12;function nue(t,e,n){let r=n;for(let s=1;s<tue;s++)r=r-t(r)/e(r);return r}function mk(t,e){return t*Math.sqrt(1-e*e)}const rue=["duration","bounce"],sue=["stiffness","damping","mass"];function g8(t,e){return e.some(n=>t[n]!==void 0)}function iue(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!g8(t,sue)&&g8(t,rue)){const n=eue(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}function y8({keyframes:t,restDelta:e,restSpeed:n,...r}){const s=t[0],i=t[t.length-1],o={done:!1,value:s},{stiffness:a,damping:l,mass:u,duration:c,velocity:f,isResolvedFromDuration:d}=iue({...r,velocity:-no(r.velocity||0)}),h=f||0,p=l/(2*Math.sqrt(a*u)),m=i-s,g=no(Math.sqrt(a/u)),y=Math.abs(m)<5;n||(n=y?.01:2),e||(e=y?.005:.5);let v;if(p<1){const w=mk(g,p);v=A=>{const x=Math.exp(-p*g*A);return i-x*((h+p*g*m)/w*Math.sin(w*A)+m*Math.cos(w*A))}}else if(p===1)v=w=>i-Math.exp(-g*w)*(m+(h+g*m)*w);else{const w=g*Math.sqrt(p*p-1);v=A=>{const x=Math.exp(-p*g*A),k=Math.min(w*A,300);return i-x*((h+p*g*m)*Math.sinh(k)+w*m*Math.cosh(k))/w}}return{calculatedDuration:d&&c||null,next:w=>{const A=v(w);if(d)o.done=w>=c;else{let x=h;w!==0&&(p<1?x=p8(v,w,A):x=0);const k=Math.abs(x)<=n,C=Math.abs(i-A)<=e;o.done=k&&C}return o.value=o.done?i:A,o}}}function b8({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const f=t[0],d={done:!1,value:f},h=O=>a!==void 0&&O<a||l!==void 0&&O>l,p=O=>a===void 0?l:l===void 0||Math.abs(a-O)<Math.abs(l-O)?a:l;let m=n*e;const g=f+m,y=o===void 0?g:o(g);y!==g&&(m=y-f);const v=O=>-m*Math.exp(-O/r),w=O=>y+v(O),A=O=>{const _=v(O),D=w(O);d.done=Math.abs(_)<=u,d.value=d.done?y:D};let x,k;const C=O=>{h(d.value)&&(x=O,k=y8({keyframes:[d.value,p(d.value)],velocity:p8(w,O,d.value),damping:s,stiffness:i,restDelta:u,restSpeed:c}))};return C(0),{calculatedDuration:null,next:O=>{let _=!1;return!k&&x===void 0&&(_=!0,A(O),C(O)),x!==void 0&&O>=x?k.next(O-x):(!_&&A(O),d)}}}const w8=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,oue=1e-7,aue=12;function lue(t,e,n,r,s){let i,o,a=0;do o=e+(n-e)/2,i=w8(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>oue&&++a<aue);return o}function op(t,e,n,r){if(t===e&&n===r)return Sn;const s=i=>lue(i,0,1,t,n);return i=>i===0||i===1?i:w8(s(i),e,r)}const uue=op(.42,0,1,1),cue=op(0,0,.58,1),A8=op(.42,0,.58,1),fue=t=>Array.isArray(t)&&typeof t[0]!="number",v8=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,x8=t=>e=>1-t(1-e),gk=t=>1-Math.sin(Math.acos(t)),k8=x8(gk),due=v8(gk),E8=op(.33,1.53,.69,.99),yk=x8(E8),hue=v8(yk),C8={linear:Sn,easeIn:uue,easeInOut:A8,easeOut:cue,circIn:gk,circInOut:due,circOut:k8,backIn:yk,backInOut:hue,backOut:E8,anticipate:t=>(t*=2)<1?.5*yk(t):.5*(2-Math.pow(2,-10*(t-1)))},S8=t=>{if(Array.isArray(t)){Ji(t.length===4,"Cubic bezier arrays must contain four numerical values.");const[e,n,r,s]=t;return op(e,n,r,s)}else if(typeof t=="string")return Ji(C8[t]!==void 0,`Invalid easing type '${t}'`),C8[t];return t},ap=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r},Bt=(t,e,n)=>t+(e-t)*n;function bk(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function pue({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;s=bk(l,a,t+1/3),i=bk(l,a,t),o=bk(l,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Yy(t,e){return n=>n>0?e:t}const wk=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},mue=[fk,jl,Yc],gue=t=>mue.find(e=>e.test(t));function T8(t){const e=gue(t);if(qc(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let n=e.parse(t);return e===Yc&&(n=pue(n)),n}const D8=(t,e)=>{const n=T8(t),r=T8(e);if(!n||!r)return Yy(t,e);const s={...n};return i=>(s.red=wk(n.red,r.red,i),s.green=wk(n.green,r.green,i),s.blue=wk(n.blue,r.blue,i),s.alpha=Bt(n.alpha,r.alpha,i),jl.transform(s))},Ak=new Set(["none","hidden"]);function yue(t,e){return Ak.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function bue(t,e){return n=>Bt(t,e,n)}function vk(t){return typeof t=="number"?bue:typeof t=="string"?W2(t)?Yy:In.test(t)?D8:vue:Array.isArray(t)?O8:typeof t=="object"?In.test(t)?D8:wue:Yy}function O8(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>vk(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function wue(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=vk(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function Aue(t,e){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],a=t.indexes[o][s[o]],l=(n=t.values[a])!==null&&n!==void 0?n:0;r[i]=l,s[o]++}return r}const vue=(t,e)=>{const n=fa.createTransformer(e),r=ip(t),s=ip(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Ak.has(t)&&!s.values.length||Ak.has(e)&&!r.values.length?yue(t,e):eo(O8(Aue(r,s),s.values),n):(qc(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Yy(t,e))};function _8(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Bt(t,e,n):vk(t)(t,e)}function xue(t,e,n){const r=[],s=n||_8,i=t.length-1;for(let o=0;o<i;o++){let a=s(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||Sn:e;a=eo(l,a)}r.push(a)}return r}function kue(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(Ji(i===e.length,"Both input and output ranges must be the same length"),i===1)return()=>e[0];if(i===2&&t[0]===t[1])return()=>e[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=xue(e,r,s),a=o.length,l=u=>{let c=0;if(a>1)for(;c<t.length-2&&!(u<t[c+1]);c++);const f=ap(t[c],t[c+1],u);return o[c](f)};return n?u=>l(aa(t[0],t[i-1],u)):l}function Eue(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=ap(0,e,r);t.push(Bt(n,1,s))}}function Cue(t){const e=[0];return Eue(e,t.length-1),e}function Sue(t,e){return t.map(n=>n*e)}function Tue(t,e){return t.map(()=>e||A8).splice(0,t.length-1)}function Xy({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=fue(r)?r.map(S8):S8(r),i={done:!1,value:e[0]},o=Sue(n&&n.length===e.length?n:Cue(e),t),a=kue(o,e,{ease:Array.isArray(s)?s:Tue(e,s)});return{calculatedDuration:t,next:l=>(i.value=a(l),i.done=l>=t,i)}}const M8=2e4;function Due(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<M8;)e+=n,r=t.next(e);return e>=M8?1/0:e}const Oue=t=>{const e=({timestamp:n})=>t(n);return{start:()=>pt.update(e,!0),stop:()=>Yi(e),now:()=>Tn.isProcessing?Tn.timestamp:ca.now()}},_ue={decay:b8,inertia:b8,tween:Xy,keyframes:Xy,spring:y8},Mue=t=>t/100;class xk extends d8{constructor({KeyframeResolver:e=lk,...n}){super(n),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:a}=this.options;a&&a()};const{name:r,motionValue:s,keyframes:i}=this.options,o=(a,l)=>this.onKeyframesResolved(a,l);r&&s&&s.owner?this.resolver=s.owner.resolveKeyframes(i,o,r,s):this.resolver=new e(i,o,r,s),this.resolver.scheduleResolve()}initPlayback(e){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=this.options,a=_ue[n]||Xy;let l,u;a!==Xy&&typeof e[0]!="number"&&(process.env.NODE_ENV!=="production"&&Ji(e.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),l=eo(Mue,_8(e[0],e[1])),e=[0,100]);const c=a({...this.options,keyframes:e});i==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Due(c));const{calculatedDuration:f}=c,d=f+s,h=d*(r+1)-s;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:d,totalDuration:h}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:r}=this;if(!r){const{keyframes:O}=this.options;return{done:!0,value:O[O.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:d,repeat:h,repeatType:p,repeatDelay:m,onUpdate:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const y=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?y<0:y>c;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let w=this.currentTime,A=i;if(h){const O=Math.min(this.currentTime,c)/f;let _=Math.floor(O),D=O%1;!D&&O>=1&&(D=1),D===1&&_--,_=Math.min(_,h+1),!!(_%2)&&(p==="reverse"?(D=1-D,m&&(D-=m/f)):p==="mirror"&&(A=o)),w=aa(0,1,D)*f}const x=v?{done:!1,value:l[0]}:A.next(w);a&&(x.value=a(x.value));let{done:k}=x;!v&&u!==null&&(k=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return C&&s!==void 0&&(x.value=Qy(l,this.options,s)),g&&g(x.value),C&&this.finish(),x}get duration(){const{resolved:e}=this;return e?no(e.calculatedDuration):0}get time(){return no(this.currentTime)}set time(e){e=to(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=no(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Oue,onPlay:n}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:(!this.startTime||this.state==="finished")&&(this.startTime=r),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const N8=t=>Array.isArray(t)&&typeof t[0]=="number";function R8(t){return!!(!t||typeof t=="string"&&t in kk||N8(t)||Array.isArray(t)&&t.every(R8))}const lp=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,kk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:lp([0,.65,.55,1]),circOut:lp([.55,0,1,.45]),backIn:lp([.31,.01,.66,-.59]),backOut:lp([.33,1.53,.69,.99])};function Nue(t){return P8(t)||kk.easeOut}function P8(t){if(t)return N8(t)?lp(t):Array.isArray(t)?t.map(Nue):kk[t]}function Rue(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=P8(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:r,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const Pue=c8(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Iue=new Set(["opacity","clipPath","filter","transform"]),Zy=10,Lue=2e4;function Bue(t){return t.type==="spring"||t.name==="backgroundColor"||!R8(t.ease)}function Fue(t,e){const n=new xk({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const s=[];let i=0;for(;!r.done&&i<Lue;)r=n.sample(i),s.push(r.value),i+=Zy;return{times:void 0,keyframes:s,duration:i-Zy,ease:"linear"}}class I8 extends d8{constructor(e){super(e);const{name:n,motionValue:r,keyframes:s}=this.options;this.resolver=new u8(s,(i,o)=>this.onKeyframesResolved(i,o),n,r),this.resolver.scheduleResolve()}initPlayback(e,n){var r;let{duration:s=300,times:i,ease:o,type:a,motionValue:l,name:u}=this.options;if(!(!((r=l.owner)===null||r===void 0)&&r.current))return!1;if(Bue(this.options)){const{onComplete:f,onUpdate:d,motionValue:h,...p}=this.options,m=Fue(e,p);e=m.keyframes,e.length===1&&(e[1]=e[0]),s=m.duration,i=m.times,o=m.ease,a="keyframes"}const c=Rue(l.owner.current,u,e,{...this.options,duration:s,times:i,ease:o});return c.startTime=ca.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:f}=this.options;l.set(Qy(e,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:s,times:i,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return no(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return no(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=to(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return Sn;const{animation:r}=n;r.timeline=e,r.onfinish=null}return Sn}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:r,duration:s,type:i,ease:o,times:a}=e;if(!(n.playState==="idle"||n.playState==="finished")){if(this.time){const{motionValue:l,onUpdate:u,onComplete:c,...f}=this.options,d=new xk({...f,keyframes:r,duration:s,type:i,ease:o,times:a,isGenerator:!0}),h=to(this.time);l.setWithVelocity(d.sample(h-Zy).value,d.sample(h).value,Zy)}this.cancel()}}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:r,repeatDelay:s,repeatType:i,damping:o,type:a}=e;return Pue()&&r&&Iue.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!s&&i!=="mirror"&&o!==0&&a!=="inertia"}}function jue(t,e){let n;const r=()=>{const{currentTime:s}=e,o=(s===null?0:s.value)/100;n!==o&&t(o),n=o};return pt.update(r,!0),()=>Yi(r)}const Uue=c8(()=>window.ScrollTimeline!==void 0);class Vue{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,n){return Promise.all(this.animations).then(e).catch(n)}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=n}attachTimeline(e){const n=this.animations.map(r=>{if(Uue()&&r.attachTimeline)r.attachTimeline(e);else return r.pause(),jue(s=>{r.time=r.duration*s},e)});return()=>{n.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const Ek=(t,e,n,r={},s,i)=>o=>{const a=ik(r,t)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-to(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:i?void 0:s};xle(a)||(c={...c,...vle(t,c)}),c.duration&&(c.duration=to(c.duration)),c.repeatDelay&&(c.repeatDelay=to(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(f=!0)),f&&!i&&e.get()!==void 0){const d=Qy(c.keyframes,a);if(d!==void 0)return pt.update(()=>{c.onUpdate(d),c.onComplete()}),new Vue([])}return!i&&I8.supports(c)?new I8(c):new xk(c)};function eb(t){return!!(Pn(t)&&t.add)}function Ck(t,e){t.indexOf(e)===-1&&t.push(e)}function Sk(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Tk{constructor(){this.subscriptions=[]}add(e){return Ck(this.subscriptions,e),()=>Sk(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const L8=new Set;function Dk(t,e,n){t||L8.has(e)||(console.warn(e),L8.add(e))}const B8=30,Hue=t=>!isNaN(parseFloat(t));class zue{constructor(e,n={}){this.version="11.2.12",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=ca.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=ca.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Hue(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&Dk(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Tk);const r=this.events[e].add(n);return e==="change"?()=>{r(),pt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ca.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>B8)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,B8);return h8(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),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(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function up(t,e){return new zue(t,e)}function $ue(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,up(n))}function Gue(t,e){const n=qy(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=Xae(i[o]);$ue(t,o,a)}}function F8(t){return t.getProps()[cI]}function Wue({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function j8(t,e,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;const u=t.getValue("willChange");r&&(o=r);const c=[],f=s&&t.animationState&&t.animationState.getState()[s];for(const d in l){const h=t.getValue(d,(i=t.latestValues[d])!==null&&i!==void 0?i:null),p=l[d];if(p===void 0||f&&Wue(f,d))continue;const m={delay:n,elapsed:0,...ik(o||{},d)};let g=!1;if(window.HandoffAppearAnimations){const v=F8(t);if(v){const w=window.HandoffAppearAnimations(v,d,h,pt);w!==null&&(m.elapsed=w,g=!0)}}h.start(Ek(d,h,p,t.shouldReduceMotion&&Bl.has(d)?{type:!1}:m,t,g));const y=h.animation;y&&(eb(u)&&(u.add(d),y.then(()=>u.remove(d))),c.push(y))}return a&&Promise.all(c).then(()=>{pt.update(()=>{a&&Gue(t,a)})}),c}function Ok(t,e,n={}){var r;const s=qy(t,e,n.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(j8(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:d}=i;return Kue(t,e,c+u,f,d,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[u,c]=l==="beforeChildren"?[o,a]:[a,o];return u().then(()=>c())}else return Promise.all([o(),a(n.delay)])}function Kue(t,e,n=0,r=0,s=1,i){const o=[],a=(t.variantChildren.size-1)*r,l=s===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(t.variantChildren).sort(que).forEach((u,c)=>{u.notify("AnimationStart",e),o.push(Ok(u,e,{...i,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function que(t,e){return t.sortNodePosition(e)}function Que(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>Ok(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=Ok(t,e,n);else{const s=typeof e=="function"?qy(t,e,n.custom):e;r=Promise.all(j8(t,s,n))}return r.then(()=>{pt.postRender(()=>{t.notify("AnimationComplete",e)})})}const Jue=[...H2].reverse(),Yue=H2.length;function Xue(t){return e=>Promise.all(e.map(({animation:n,options:r})=>Que(t,n,r)))}function Zue(t){let e=Xue(t),n=U8(),r=!0;const s=l=>(u,c)=>{var f;const d=qy(t,c,l==="exit"?(f=t.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:p,...m}=d;u={...u,...m,...p}}return u};function i(l){e=l(t)}function o(l){const u=t.getProps(),c=t.getVariantContext(!0)||{},f=[],d=new Set;let h={},p=1/0;for(let g=0;g<Yue;g++){const y=Jue[g],v=n[y],w=u[y]!==void 0?u[y]:c[y],A=Zh(w),x=y===l?v.isActive:null;x===!1&&(p=g);let k=w===c[y]&&w!==u[y]&&A;if(k&&r&&t.manuallyAnimateOnMount&&(k=!1),v.protectedKeys={...h},!v.isActive&&x===null||!w&&!v.prevProp||Vy(w)||typeof w=="boolean")continue;let O=ece(v.prevProp,w)||y===l&&v.isActive&&!k&&A||g>p&&A,_=!1;const D=Array.isArray(w)?w:[w];let R=D.reduce(s(y),{});x===!1&&(R={});const{prevResolvedValues:L={}}=v,F={...L,...R},G=B=>{O=!0,d.has(B)&&(_=!0,d.delete(B)),v.needsAnimating[B]=!0;const H=t.getValue(B);H&&(H.liveStyle=!1)};for(const B in F){const H=R[B],Q=L[B];if(h.hasOwnProperty(B))continue;let te=!1;ek(H)&&ek(Q)?te=!$I(H,Q):te=H!==Q,te?H!=null?G(B):d.add(B):H!==void 0&&d.has(B)?G(B):v.protectedKeys[B]=!0}v.prevProp=w,v.prevResolvedValues=R,v.isActive&&(h={...h,...R}),r&&t.blockInitialAnimation&&(O=!1),O&&(!k||_)&&f.push(...D.map(B=>({animation:B,options:{type:y}})))}if(d.size){const g={};d.forEach(y=>{const v=t.getBaseTarget(y),w=t.getValue(y);w&&(w.liveStyle=!0),g[y]=v??null}),f.push({animation:g})}let m=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(m=!1),r=!1,m?e(f):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=t.variantChildren)===null||c===void 0||c.forEach(d=>{var h;return(h=d.animationState)===null||h===void 0?void 0:h.setActive(l,u)}),n[l].isActive=u;const f=o(l);for(const d in n)n[d].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=U8(),r=!0}}}function ece(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!$I(e,t):!1}function Ul(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function U8(){return{animate:Ul(!0),whileInView:Ul(),whileHover:Ul(),whileTap:Ul(),whileDrag:Ul(),whileFocus:Ul(),exit:Ul()}}class tce extends ua{constructor(e){super(e),e.animationState||(e.animationState=Zue(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Vy(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let nce=0;class rce extends ua{constructor(){super(...arguments),this.id=nce++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const sce={animation:{Feature:tce},exit:{Feature:rce}},V8=(t,e)=>Math.abs(t-e);function ice(t,e){const n=V8(t.x,e.x),r=V8(t.y,e.y);return Math.sqrt(n**2+r**2)}class H8{constructor(e,n,{transformPagePoint:r,contextWindow:s,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Mk(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,h=ice(f.offset,{x:0,y:0})>=3;if(!d&&!h)return;const{point:p}=f,{timestamp:m}=Tn;this.history.push({...p,timestamp:m});const{onStart:g,onMove:y}=this.handlers;d||(g&&g(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,d)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=_k(d,this.transformPagePoint),pt.update(this.updatePoint,!0)},this.handlePointerUp=(f,d)=>{this.end();const{onEnd:h,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=Mk(f.type==="pointercancel"?this.lastMoveEventInfo:_k(d,this.transformPagePoint),this.history);this.startEvent&&h&&h(f,g),p&&p(f,g)},!LI(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const o=Ky(e),a=_k(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=Tn;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,Mk(a,this.history)),this.removeListeners=eo(Zi(this.contextWindow,"pointermove",this.handlePointerMove),Zi(this.contextWindow,"pointerup",this.handlePointerUp),Zi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Yi(this.updatePoint)}}function _k(t,e){return e?{point:e(t.point)}:t}function z8(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Mk({point:t},e){return{point:t,delta:z8(t,$8(e)),offset:z8(t,oce(e)),velocity:ace(e,.1)}}function oce(t){return t[0]}function $8(t){return t[t.length-1]}function ace(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=$8(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>to(e)));)n--;if(!r)return{x:0,y:0};const i=no(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Pr(t){return t.max-t.min}function Nk(t,e=0,n=.01){return Math.abs(t-e)<=n}function G8(t,e,n,r=.5){t.origin=r,t.originPoint=Bt(e.min,e.max,t.origin),t.scale=Pr(n)/Pr(e),(Nk(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Bt(n.min,n.max,t.origin)-t.originPoint,(Nk(t.translate)||isNaN(t.translate))&&(t.translate=0)}function cp(t,e,n,r){G8(t.x,e.x,n.x,r?r.originX:void 0),G8(t.y,e.y,n.y,r?r.originY:void 0)}function W8(t,e,n){t.min=n.min+e.min,t.max=t.min+Pr(e)}function lce(t,e,n){W8(t.x,e.x,n.x),W8(t.y,e.y,n.y)}function K8(t,e,n){t.min=e.min-n.min,t.max=t.min+Pr(e)}function fp(t,e,n){K8(t.x,e.x,n.x),K8(t.y,e.y,n.y)}function uce(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Bt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Bt(n,t,r.max):Math.min(t,n)),t}function q8(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function cce(t,{top:e,left:n,bottom:r,right:s}){return{x:q8(t.x,n,s),y:q8(t.y,e,r)}}function Q8(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function fce(t,e){return{x:Q8(t.x,e.x),y:Q8(t.y,e.y)}}function dce(t,e){let n=.5;const r=Pr(t),s=Pr(e);return s>r?n=ap(e.min,e.max-r,t.min):r>s&&(n=ap(t.min,t.max-s,e.min)),aa(0,1,n)}function hce(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Rk=.35;function pce(t=Rk){return t===!1?t=0:t===!0&&(t=Rk),{x:J8(t,"left","right"),y:J8(t,"top","bottom")}}function J8(t,e,n){return{min:Y8(t,e),max:Y8(t,n)}}function Y8(t,e){return typeof t=="number"?t:t[e]||0}const X8=()=>({translate:0,scale:1,origin:0,originPoint:0}),Xc=()=>({x:X8(),y:X8()}),Z8=()=>({min:0,max:0}),qt=()=>({x:Z8(),y:Z8()});function es(t){return[t("x"),t("y")]}function eL({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function mce({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function gce(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Pk(t){return t===void 0||t===1}function Ik({scale:t,scaleX:e,scaleY:n}){return!Pk(t)||!Pk(e)||!Pk(n)}function Vl(t){return Ik(t)||tL(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function tL(t){return nL(t.x)||nL(t.y)}function nL(t){return t&&t!=="0%"}function tb(t,e,n){const r=t-n,s=e*r;return n+s}function rL(t,e,n,r,s){return s!==void 0&&(t=tb(t,s,r)),tb(t,n,r)+e}function Lk(t,e=0,n=1,r,s){t.min=rL(t.min,e,n,r,s),t.max=rL(t.max,e,n,r,s)}function sL(t,{x:e,y:n}){Lk(t.x,e.translate,e.scale,e.originPoint),Lk(t.y,n.translate,n.scale,n.originPoint)}function yce(t,e,n,r=!1){const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const l=i.instance;l&&l.style&&l.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Zc(t,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,sL(t,o)),r&&Vl(i.latestValues)&&Zc(t,i.latestValues))}e.x=iL(e.x),e.y=iL(e.y)}function iL(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function da(t,e){t.min=t.min+e,t.max=t.max+e}function oL(t,e,[n,r,s]){const i=e[s]!==void 0?e[s]:.5,o=Bt(t.min,t.max,i);Lk(t,e[n],e[r],o,e.scale)}const bce=["x","scaleX","originX"],wce=["y","scaleY","originY"];function Zc(t,e){oL(t.x,e,bce),oL(t.y,e,wce)}function aL(t,e){return eL(gce(t.getBoundingClientRect(),e))}function Ace(t,e,n){const r=aL(t,n),{scroll:s}=e;return s&&(da(r.x,s.offset.x),da(r.y,s.offset.y)),r}const lL=({current:t})=>t?t.ownerDocument.defaultView:null,vce=new WeakMap;class xce{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=qt(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=c=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ky(c,"page").point)},i=(c,f)=>{const{drag:d,dragPropagation:h,onDragStart:p}=this.getProps();if(d&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=UI(d),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),es(g=>{let y=this.getAxisMotionValue(g).get()||0;if(di.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[g];w&&(y=Pr(w)*(parseFloat(y)/100))}}this.originPoint[g]=y}),p&&pt.postRender(()=>p(c,f));const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(c,f)=>{const{dragPropagation:d,dragDirectionLock:h,onDirectionLock:p,onDrag:m}=this.getProps();if(!d&&!this.openGlobalLock)return;const{offset:g}=f;if(h&&this.currentDirection===null){this.currentDirection=kce(g),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",f.point,g),this.updateAxis("y",f.point,g),this.visualElement.render(),m&&m(c,f)},a=(c,f)=>this.stop(c,f),l=()=>es(c=>{var f;return this.getAnimationState(c)==="paused"&&((f=this.getAxisMotionValue(c).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new H8(e,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:lL(this.visualElement)})}stop(e,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&pt.postRender(()=>i(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!nb(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=uce(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,i=this.constraints;n&&Wc(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=cce(s.layoutBox,n):this.constraints=!1,this.elastic=pce(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&es(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=hce(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Wc(e))return!1;const r=e.current;Ji(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=Ace(r,s.root,this.visualElement.getTransformPagePoint());let o=fce(s.layout.layoutBox,i);if(n){const a=n(mce(o));this.hasMutatedConstraints=!!a,a&&(o=eL(a))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=es(c=>{if(!nb(c,n,this.currentDirection))return;let f=l&&l[c]||{};o&&(f={min:0,max:0});const d=s?200:1e6,h=s?40:1e7,p={type:"inertia",velocity:r?e[c]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return r.start(Ek(e,r,0,n,this.visualElement))}stopAnimation(){es(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){es(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){es(n=>{const{drag:r}=this.getProps();if(!nb(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];i.set(e[n]-Bt(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Wc(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};es(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=dce({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),es(o=>{if(!nb(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(Bt(l,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;vce.set(this.visualElement,this);const e=this.visualElement.current,n=Zi(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Wc(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),pt.read(r);const o=Xi(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(es(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Rk,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function nb(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function kce(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Ece extends ua{constructor(e){super(e),this.removeGroupControls=Sn,this.removeListeners=Sn,this.controls=new xce(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Sn}unmount(){this.removeGroupControls(),this.removeListeners()}}const uL=t=>(e,n)=>{t&&pt.postRender(()=>t(e,n))};class Cce extends ua{constructor(){super(...arguments),this.removePointerDownListener=Sn}onPointerDown(e){this.session=new H8(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:lL(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:uL(e),onStart:uL(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&pt.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=Zi(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function Sce(){const t=N.useContext(jy);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:r}=t,s=N.useId();return N.useEffect(()=>r(s),[]),!e&&n?[!1,()=>n&&n(s)]:[!0]}const rb={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function cL(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const dp={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Ie.test(t))t=parseFloat(t);else return t;const n=cL(t,e.target.x),r=cL(t,e.target.y);return`${n}% ${r}%`}},Tce={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=fa.parse(t);if(s.length>5)return r;const i=fa.createTransformer(t),o=typeof s[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const u=Bt(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),i(s)}};class Dce extends N.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;Dae(Oce),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),rb.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||e.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||pt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),V2.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function fL(t){const[e,n]=Sce(),r=N.useContext($2);return S.jsx(Dce,{...t,layoutGroup:r,switchLayoutGroup:N.useContext(hI),isPresent:e,safeToRemove:n})}const Oce={borderRadius:{...dp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:dp,borderTopRightRadius:dp,borderBottomLeftRadius:dp,borderBottomRightRadius:dp,boxShadow:Tce},dL=["TopLeft","TopRight","BottomLeft","BottomRight"],_ce=dL.length,hL=t=>typeof t=="string"?parseFloat(t):t,pL=t=>typeof t=="number"||Ie.test(t);function Mce(t,e,n,r,s,i){s?(t.opacity=Bt(0,n.opacity!==void 0?n.opacity:1,Nce(r)),t.opacityExit=Bt(e.opacity!==void 0?e.opacity:1,0,Rce(r))):i&&(t.opacity=Bt(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<_ce;o++){const a=`border${dL[o]}Radius`;let l=mL(e,a),u=mL(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||pL(l)===pL(u)?(t[a]=Math.max(Bt(hL(l),hL(u),r),0),(di.test(u)||di.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=Bt(e.rotate||0,n.rotate||0,r))}function mL(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Nce=gL(0,.5,k8),Rce=gL(.5,.95,Sn);function gL(t,e,n){return r=>r<t?0:r>e?1:n(ap(t,e,r))}function yL(t,e){t.min=e.min,t.max=e.max}function ts(t,e){yL(t.x,e.x),yL(t.y,e.y)}function bL(t,e,n,r,s){return t-=e,t=tb(t,1/n,r),s!==void 0&&(t=tb(t,1/s,r)),t}function Pce(t,e=0,n=1,r=.5,s,i=t,o=t){if(di.test(e)&&(e=parseFloat(e),e=Bt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Bt(i.min,i.max,r);t===i&&(a-=e),t.min=bL(t.min,e,n,a,s),t.max=bL(t.max,e,n,a,s)}function wL(t,e,[n,r,s],i,o){Pce(t,e[n],e[r],e[s],e.scale,i,o)}const Ice=["x","scaleX","originX"],Lce=["y","scaleY","originY"];function AL(t,e,n,r){wL(t.x,e,Ice,n?n.x:void 0,r?r.x:void 0),wL(t.y,e,Lce,n?n.y:void 0,r?r.y:void 0)}function vL(t){return t.translate===0&&t.scale===1}function xL(t){return vL(t.x)&&vL(t.y)}function Bce(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 kL(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function EL(t){return Pr(t.x)/Pr(t.y)}class Fce{constructor(){this.members=[]}add(e){Ck(this.members,e),e.scheduleRender()}remove(e){if(Sk(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(s=>e===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:s}=e.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function CL(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:f,rotateY:d,skewX:h,skewY:p}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),f&&(r+=`rotateX(${f}deg) `),d&&(r+=`rotateY(${d}deg) `),h&&(r+=`skewX(${h}deg) `),p&&(r+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const jce=(t,e)=>t.depth-e.depth;class Uce{constructor(){this.children=[],this.isDirty=!1}add(e){Ck(this.children,e),this.isDirty=!0}remove(e){Sk(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(jce),this.isDirty=!1,this.children.forEach(e)}}function Vce(t,e){const n=ca.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Yi(r),t(i-e))};return pt.read(r,!0),()=>Yi(r)}function Hce(t){window.MotionDebug&&window.MotionDebug.record(t)}function zce(t){return t instanceof SVGElement&&t.tagName!=="svg"}function $ce(t,e,n){const r=Pn(t)?t:up(t);return r.start(Ek("",r,e,n)),r.animation}const Bk=["","X","Y","Z"],Gce={visibility:"hidden"},SL=1e3;let Wce=0;const Hl={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Fk(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function TL(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return!1;const{visualElement:e}=t.options;return e?F8(e)?!0:t.parent&&!t.parent.hasCheckedOptimisedAppear?TL(t.parent):!1:!1}function DL({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=e==null?void 0:e()){this.id=Wce++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Hl.totalNodes=Hl.resolvedTargetDeltas=Hl.recalculatedProjection=0,this.nodes.forEach(Qce),this.nodes.forEach(efe),this.nodes.forEach(tfe),this.nodes.forEach(Jce),Hce(Hl)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Uce)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Tk),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=zce(o),this.instance=o;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),t){let f;const d=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Vce(d,250),rb.hasAnimatedSinceResize&&(rb.hasAnimatedSinceResize=!1,this.nodes.forEach(_L))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:d,hasRelativeTargetChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||ofe,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=c.getProps(),v=!this.targetLayout||!kL(this.targetLayout,p)||h,w=!d&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,w);const A={...ik(m,"layout"),onPlay:g,onComplete:y};(c.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A)}else d||_L(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Yi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(nfe),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.HandoffCancelAllAnimations&&TL(this)&&window.HandoffCancelAllAnimations(),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const f=this.path[c];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(OL);return}this.isUpdating||this.nodes.forEach(Xce),this.isUpdating=!1,this.nodes.forEach(Zce),this.nodes.forEach(Kce),this.nodes.forEach(qce),this.clearAllSnapshots();const a=ca.now();Tn.delta=aa(0,1e3/60,a-Tn.timestamp),Tn.timestamp=a,Tn.isProcessing=!0,tk.update.process(Tn),tk.preRender.process(Tn),tk.render.process(Tn),Tn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,V2.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Yce),this.sharedNodes.forEach(rfe)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,pt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){pt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=qt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&(this.scroll={animationId:this.root.animationId,phase:o,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!xL(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(a||Vl(this.latestValues)||c)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),afe(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return qt();const a=o.measureViewportBox(),{scroll:l}=this.root;return l&&(da(a.x,l.offset.x),da(a.y,l.offset.y)),a}removeElementScroll(o){const a=qt();ts(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:f}=u;if(u!==this.root&&c&&f.layoutScroll){if(c.isRoot){ts(a,o);const{scroll:d}=this.root;d&&(da(a.x,-d.offset.x),da(a.y,-d.offset.y))}da(a.x,c.offset.x),da(a.y,c.offset.y)}}return a}applyTransform(o,a=!1){const l=qt();ts(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Zc(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Vl(c.latestValues)&&Zc(l,c.latestValues)}return Vl(this.latestValues)&&Zc(l,this.latestValues),l}removeTransform(o){const a=qt();ts(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Vl(u.latestValues))continue;Ik(u.latestValues)&&u.updateSnapshot();const c=qt(),f=u.measurePageBox();ts(c,f),AL(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Vl(this.latestValues)&&AL(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Tn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:f,layoutId:d}=this.options;if(!(!this.layout||!(f||d))){if(this.resolvedRelativeTargetAt=Tn.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=qt(),this.relativeTargetOrigin=qt(),fp(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),ts(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=qt(),this.targetWithTransforms=qt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),lce(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ts(this.target,this.layout.layoutBox),sL(this.target,this.targetDelta)):ts(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=qt(),this.relativeTargetOrigin=qt(),fp(this.relativeTargetOrigin,this.target,h.target),ts(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Hl.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Ik(this.parent.latestValues)||tL(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Tn.timestamp&&(u=!1),u)return;const{layout:c,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||f))return;ts(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;yce(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=qt());const{target:p}=a;if(!p){this.projectionTransform&&(this.projectionDelta=Xc(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=Xc(),this.projectionDeltaWithTransform=Xc());const m=this.projectionTransform;cp(this.projectionDelta,this.layoutCorrected,p,this.latestValues),this.projectionTransform=CL(this.projectionDelta,this.treeScale),(this.projectionTransform!==m||this.treeScale.x!==d||this.treeScale.y!==h)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Hl.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},f=Xc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=qt(),h=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=h!==p,g=this.getStack(),y=!g||g.members.length<=1,v=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(ife));this.animationProgress=0;let w;this.mixTargetDelta=A=>{const x=A/1e3;ML(f.x,o.x,x),ML(f.y,o.y,x),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(fp(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),sfe(this.relativeTarget,this.relativeTargetOrigin,d,x),w&&Bce(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=qt()),ts(w,this.relativeTarget)),m&&(this.animationValues=c,Mce(c,u,this.latestValues,x,v,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=x},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Yi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pt.update(()=>{rb.hasAnimatedSinceResize=!0,this.currentAnimation=$ce(0,SL,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(SL),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&LL(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||qt();const f=Pr(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const d=Pr(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}ts(a,l),Zc(a,c),cp(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Fce),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}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:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&Fk("z",o,u,this.animationValues);for(let c=0;c<Bk.length;c++)Fk(`rotate${Bk[c]}`,o,u,this.animationValues),Fk(`skew${Bk[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Gce;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Wy(o==null?void 0:o.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=Wy(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Vl(this.latestValues)&&(m.transform=c?c({},""):"none",this.hasProjected=!1),m}const d=f.animationValues||f.latestValues;this.applyTransformsToTarget(),u.transform=CL(this.projectionDeltaWithTransform,this.treeScale,d),c&&(u.transform=c(d,u.transform));const{x:h,y:p}=this.projectionDelta;u.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,f.animationValues?u.opacity=f===this?(l=(a=d.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:u.opacity=f===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in zy){if(d[m]===void 0)continue;const{correct:g,applyTo:y}=zy[m],v=u.transform==="none"?d[m]:g(d[m],f);if(y){const w=y.length;for(let A=0;A<w;A++)u[y[A]]=v}else u[m]=v}return this.options.layoutId&&(u.pointerEvents=f===this?Wy(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(OL),this.root.sharedNodes.clear()}}}function Kce(t){t.updateLayout()}function qce(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,o=n.source!==t.layout.source;i==="size"?es(f=>{const d=o?n.measuredBox[f]:n.layoutBox[f],h=Pr(d);d.min=r[f].min,d.max=d.min+h}):LL(i,n.layoutBox,r)&&es(f=>{const d=o?n.measuredBox[f]:n.layoutBox[f],h=Pr(r[f]);d.max=d.min+h,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[f].max=t.relativeTarget[f].min+h)});const a=Xc();cp(a,r,n.layoutBox);const l=Xc();o?cp(l,t.applyTransform(s,!0),n.measuredBox):cp(l,r,n.layoutBox);const u=!xL(a);let c=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:d,layout:h}=f;if(d&&h){const p=qt();fp(p,n.layoutBox,d.layoutBox);const m=qt();fp(m,r,h.layoutBox),kL(p,m)||(c=!0),f.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=p,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function Qce(t){Hl.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Jce(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Yce(t){t.clearSnapshot()}function OL(t){t.clearMeasurements()}function Xce(t){t.isLayoutDirty=!1}function Zce(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function _L(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function efe(t){t.resolveTargetDelta()}function tfe(t){t.calcProjection()}function nfe(t){t.resetSkewAndRotation()}function rfe(t){t.removeLeadSnapshot()}function ML(t,e,n){t.translate=Bt(e.translate,0,n),t.scale=Bt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function NL(t,e,n,r){t.min=Bt(e.min,n.min,r),t.max=Bt(e.max,n.max,r)}function sfe(t,e,n,r){NL(t.x,e.x,n.x,r),NL(t.y,e.y,n.y,r)}function ife(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const ofe={duration:.45,ease:[.4,0,.1,1]},RL=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),PL=RL("applewebkit/")&&!RL("chrome/")?Math.round:Sn;function IL(t){t.min=PL(t.min),t.max=PL(t.max)}function afe(t){IL(t.x),IL(t.y)}function LL(t,e,n){return t==="position"||t==="preserve-aspect"&&!Nk(EL(e),EL(n),.2)}const lfe=DL({attachResizeListener:(t,e)=>Xi(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),jk={current:void 0},BL=DL({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!jk.current){const t=new lfe({});t.mount(window),t.setOptions({layoutScroll:!0}),jk.current=t}return jk.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),ufe={pan:{Feature:Cce},drag:{Feature:Ece,ProjectionNode:BL,MeasureLayout:fL}},Uk={current:null},FL={current:!1};function cfe(){if(FL.current=!0,!!F2)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Uk.current=t.matches;t.addListener(e),e()}else Uk.current=!1}function ffe(t,e,n){const{willChange:r}=e;for(const s in e){const i=e[s],o=n[s];if(Pn(i))t.addValue(s,i),eb(r)&&r.add(s),process.env.NODE_ENV==="development"&&Dk(i.version==="11.2.12",`Attempting to mix Framer Motion versions ${i.version} with 11.2.12 may not work as expected.`);else if(Pn(o))t.addValue(s,up(i,{owner:t})),eb(r)&&r.remove(s);else if(o!==i)if(t.hasValue(s)){const a=t.getValue(s);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=t.getStaticValue(s);t.addValue(s,up(a!==void 0?a:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const jL=new WeakMap,dfe=[...XI,In,fa],hfe=t=>dfe.find(YI(t)),UL=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],pfe=z2.length;class mfe{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},a={}){this.resolveKeyframes=(d,h,p,m)=>new this.KeyframeResolver(d,h,p,m,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=lk,this.features={},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=()=>pt.render(this.render,!1,!0);const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=Hy(n),this.isVariantNode=gI(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const h=f[d];l[d]!==void 0&&Pn(h)&&(h.set(l[d],!1),eb(c)&&c.add(d))}}mount(e){this.current=e,jL.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),FL.current||cfe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Uk.current,process.env.NODE_ENV!=="production"&&Dk(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){jL.delete(this.current),this.projection&&this.projection.unmount(),Yi(this.notifyUpdate),Yi(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){const r=Bl.has(e),s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&pt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{s(),i(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Kc){const n=Kc[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):qt()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<UL.length;r++){const s=UL[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=e[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=ffe(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const r=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(r.initial=this.props.initial),r}const n={};for(let r=0;r<pfe;r++){const s=z2[r],i=this.props[s];(Zh(i)||i===!1)&&(n[s]=i)}return n}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=up(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){var r;let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(r=this.getBaseTargetFromProps(this.props,e))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(WI(s)||GI(s))?s=parseFloat(s):!hfe(s)&&fa.test(n)&&(s=l8(e,n)),this.setBaseTarget(e,Pn(s)?s.get():s)),Pn(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=Z2(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[e])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!Pn(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Tk),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class VL extends mfe{constructor(){super(...arguments),this.KeyframeResolver=u8}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}}function gfe(t){return window.getComputedStyle(t)}class yfe extends VL{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,n){if(Bl.has(n)){const r=hk(n);return r&&r.default||0}else{const r=gfe(e),s=(vI(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return aL(e,n)}build(e,n,r,s){q2(e,n,r,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return X2(e,n,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Pn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(e,n,r,s){OI(e,n,r,s)}}class bfe extends VL{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Bl.has(n)){const r=hk(n);return r&&r.default||0}return n=_I.has(n)?n:U2(n),e.getAttribute(n)}measureInstanceViewportBox(){return qt()}scrapeMotionValuesFromProps(e,n,r){return NI(e,n,r)}build(e,n,r,s){J2(e,n,r,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,r,s){MI(e,n,r,s)}mount(e){this.isSVGTag=Y2(e.tagName),super.mount(e)}}const wfe=(t,e)=>G2(t)?new bfe(e,{enableHardwareAcceleration:!1}):new yfe(e,{allowProjection:t!==N.Fragment,enableHardwareAcceleration:!0}),Afe={...sce,...gle,...ufe,...{layout:{ProjectionNode:BL,MeasureLayout:fL}}},vfe=Sae((t,e)=>rle(t,e,Afe,wfe));function HL(){const t=N.useRef(!1);return j2(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function xfe(){const t=HL(),[e,n]=N.useState(0),r=N.useCallback(()=>{t.current&&n(e+1)},[e]);return[N.useCallback(()=>pt.postRender(r),[r]),e]}class kfe extends V.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Efe({children:t,isPresent:e}){const n=N.useId(),r=N.useRef(null),s=N.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=N.useContext(B2);return N.useInsertionEffect(()=>{const{width:o,height:a,top:l,left:u}=s.current;if(e||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return i&&(c.nonce=i),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
|
|
515
|
+
`?s.slice(0,-1):s};return e.renderer.rules.hardbreak=n(e.renderer.rules.hardbreak),e.renderer.rules.softbreak=n(e.renderer.rules.softbreak),e.renderer.rules.fence=n(e.renderer.rules.fence),e.renderer.rules.code_block=n(e.renderer.rules.code_block),e.renderer.renderToken=n(e.renderer.renderToken.bind(e.renderer)),e}}const Wte=wt.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new bt({key:new _t("markdownClipboard"),props:{clipboardTextParser:(t,e,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(t,{inline:!0});return Up.fromSchema(this.editor.schema).parseSlice(bx(r),{preserveWhitespace:!0,context:e})},clipboardTextSerializer:t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null}})]}}),Kte=wt.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const t=B7.Commands.config.addCommands();return{setContent:(e,n,r)=>s=>t.setContent(s.editor.storage.markdown.parser.parse(e),n,r)(s),insertContentAt:(e,n,r)=>s=>t.insertContentAt(e,s.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(s)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new Gte(this.editor,this.options),serializer:new $te(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[hte.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),Wte.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),qte=[Nq,_q.configure({strike:{HTMLAttributes:{class:"select-text pointer-events-auto"}},bold:{HTMLAttributes:{class:"select-text pointer-events-auto"}},italic:{HTMLAttributes:{class:"select-text pointer-events-auto"}},heading:{HTMLAttributes:{class:"select-text pointer-events-auto"}},paragraph:{HTMLAttributes:{class:"select-text pointer-events-auto"}},orderedList:{HTMLAttributes:{class:"flex flex-col items-start list-decimal list-outside space-y-4 ml-6"}},blockquote:{HTMLAttributes:{class:"rounded-lg bg-[#E8EBEC] p-5 font-serif italic text-black"}},codeBlock:{HTMLAttributes:{class:"rounded-lg bg-transparent border border-[#DDE2E4] p-5 font-mono font-medium text-black"},exitOnArrowDown:!0},code:{HTMLAttributes:{class:"rounded bg-transparent p-1.5 font-mono font-medium text-black text-sm",spellcheck:"false"}},history:!1,gapcursor:!1,dropcursor:!1,document:!1,horizontalRule:!1,bulletList:!1,listItem:!1}),hM.configure({depth:10,newGroupDelay:100}),Rq.configure({types:["heading","paragraph"]}),hQ,sQ.extend({exitable:!0}).configure({HTMLAttributes:{class:"text-blue-500 font-bold transition-colors cursor-pointer select-text pointer-events-auto"},openOnClick:!0,autolink:!1}),iQ.configure({placeholder:()=>"",includeChildren:!0,showOnlyCurrent:!0}),lQ.configure({multicolor:!0}),dQ.configure({HTMLAttributes:{class:"select-text pointer-events-auto"}}),Mq,gQ,uQ.configure({HTMLAttributes:{class:"not-prose space-y-4 !ml-0"}}),fQ.configure({HTMLAttributes:{class:"flex items-start"},nested:!0}),rM.configure({HTMLAttributes:{class:"space-y-4 !ml-6"}}),mM.configure({HTMLAttributes:{class:"leading-normal"}}),iM.configure({width:3,color:"#d1d5db"}),oM,QJ,dX,fX,...cX,CQ.configure({uploadFn:yV}),mQ,yQ,vQ,pX,pQ,Kte.configure({html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!0,breaks:!0,transformPastedText:!0,transformCopiedText:!1})],Qte="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAOCAYAAAD0f5bSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAE/SURBVHgBhVJBTsJQEH3zMcElR+gRuIF6gwYPAOwkLoQTUE6ArEA3xbWJ4gnQE8gNwBuwhMR2fPNLk9o0ZZImM/P/e39e3wgqojPXXiPFJnFovw1kWT53xSKca3C70LXlr/eySYFdZ6Fb61eCePnBCb6VF3P21UA+WX+wv+086fgfyMbh4aPlqWJSZH2/k6EINlBEJI6tdxHG2tIDrsUqxYzsO5Qi+UXfNfwUPT7w49wRU1EyZWNFqIgV9REw84Wga+P1Uj7PsW5QE9pEZMT8Aq+JQmNcYl8HwgEtEvf9fc3RR4zrMCRe84WA6dJRz8upPwyftV0FOP3ugHqu0iZGzsSbF3bYUMRlgDdWMcyE4WvVl73XRC9CNiaqaHMDpkUQrYh8kmKUmy5lVpvdBNs2mOk0tptk9a5AVKHhzML+AZaSjR/r++n9AAAAAElFTkSuQmCC",Jte="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEjSURBVHgBjZJBToNQEIb/NzTeoMbGjTeoN5Au1S7wBrqwyk5OoD1B46pRF9UbsEBc9nmEHsI08QhGZnxMpaGUEv4EwoP/mxnyj0GNTp++AoPORA+Gx+mo91r1mOJh+LL0WYwDqC8i/obJGCuSfRJ1bHLdtWtQIaY5WoiYBknYtZQfmOGjpTIvC7TAahTvpMksmUQCvK0A6itzNl1egmi2k2K+2gPsD+mvHGkh4MIVoPuSLYbIYxOk3YAJVRuktwd3DhjvggqRB0Slc3D+/D1Lw95DE5Rnq3E487ySXeyu4zooz/R9tD/QUYV5Ufke1HbKvW4RdFS9icRoKeKO1c7Fi+HUbQ/BzzPdXjmxDCy8TOIk7G2CZf1nqzEJfqOPm8Otif4AFnp3K1F5HHAAAAAASUVORK5CYII=",Yte=t=>{const e=document.createElement("span");e.classList.add("collaboration-cursor__caret"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");return n.classList.add("collaboration-cursor__label"),n.setAttribute("style",`background-color: ${t.color}`),n.insertBefore(document.createTextNode(t.name),null),e.insertBefore(n,null),e},Xte=t=>{const e=document.createElement("span");e.classList.add("custom-cursor__caret"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");n.classList.add("custom-cursor__label-container"),n.setAttribute("style",`border: 1px solid ${t.color}`);const r=document.createElement("img");r.src=Qte,r.classList.add("custom-cursor__icon");const s=document.createElement("div");s.classList.add("custom-cursor__label");const i=document.createElement("span");i.classList.add("custom-cursor__text"),i.textContent=t.name;const o=document.createElement("img");return o.src=Jte,o.classList.add("custom-cursor__badge"),s.appendChild(i),n.appendChild(r),n.appendChild(s),n.appendChild(o),e.appendChild(n),e},Zte=t=>t.isEns?Xte(t):Yte(t),ene="6.13.1";function tne(t,e,n){const r=e.split("|").map(i=>i.trim());for(let i=0;i<r.length;i++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const s=new Error(`invalid value for type ${e}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${n}`,s.value=t,s}async function Nn(t){const e=Object.keys(t);return(await Promise.all(e.map(r=>Promise.resolve(t[r])))).reduce((r,s,i)=>(r[e[i]]=s,r),{})}function Oe(t,e,n){for(let r in e){let s=e[r];const i=n?n[r]:null;i&&tne(s,i,r),Object.defineProperty(t,r,{enumerable:!0,value:s,writable:!1})}}function Ec(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(Ec).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r<t.length;r++)n+=e[t[r]>>4],n+=e[t[r]&15];return n}if(typeof t=="object"&&typeof t.toJSON=="function")return Ec(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(n=>`${Ec(n)}: ${Ec(t[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function gn(t,e){return t&&t.code===e}function Ax(t){return gn(t,"CALL_EXCEPTION")}function Nt(t,e,n){let r=t;{const i=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${Ec(n)}`);for(const o in n){if(o==="shortMessage")continue;const a=n[o];i.push(o+"="+Ec(a))}}i.push(`code=${e}`),i.push(`version=${ene}`),i.length&&(t+=" ("+i.join(", ")+")")}let s;switch(e){case"INVALID_ARGUMENT":s=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(t);break;default:s=new Error(t)}return Oe(s,{code:e}),n&&Object.assign(s,n),s.shortMessage==null&&Oe(s,{shortMessage:r}),s}function ee(t,e,n,r){if(!t)throw Nt(e,n,r)}function $(t,e,n,r){ee(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function s4(t,e,n){n==null&&(n=""),n&&(n=": "+n),ee(t>=e,"missing arguemnt"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),ee(t<=e,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function $g(t,e,n){if(n==null&&(n=""),t!==e){let r=n,s="new";n&&(r+=".",s+=" "+n),ee(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}function i4(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((t.length-2)/2);let s=2;for(let i=0;i<r.length;i++)r[i]=parseInt(t.substring(s,s+2),16),s+=2;return r}$(!1,"invalid BytesLike value",e||"value",t)}function ct(t,e){return i4(t,e,!1)}function Gn(t,e){return i4(t,e,!0)}function St(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&t.length!==2+2*e||e===!0&&t.length%2!==0)}function vx(t){return St(t,!0)||t instanceof Uint8Array}const o4="0123456789abcdef";function we(t){const e=ct(t);let n="0x";for(let r=0;r<e.length;r++){const s=e[r];n+=o4[(s&240)>>4]+o4[s&15]}return n}function $t(t){return"0x"+t.map(e=>we(e).substring(2)).join("")}function Cc(t){return St(t,!0)?(t.length-2)/2:ct(t).length}function Ht(t,e,n){const r=ct(t);return n!=null&&n>r.length&&ee(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),we(r.slice(e??0,n??r.length))}function a4(t,e,n){const r=ct(t);ee(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const s=new Uint8Array(e);return s.fill(0),n?s.set(r,e-r.length):s.set(r,0),we(s)}function xl(t,e){return a4(t,e,!0)}function nne(t,e){return a4(t,e,!1)}const Gg=BigInt(0),Es=BigInt(1),Sc=9007199254740991;function rne(t,e){const n=Wg(t,"value"),r=BigInt(Qe(e,"width"));if(ee(n>>r===Gg,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-Es){const s=(Es<<r)-Es;return-((~n&s)+Es)}return n}function l4(t,e){let n=xe(t,"value");const r=BigInt(Qe(e,"width")),s=Es<<r-Es;if(n<Gg){n=-n,ee(n<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});const i=(Es<<r)-Es;return(~n&i)+Es}else ee(n<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});return n}function Oh(t,e){const n=Wg(t,"value"),r=BigInt(Qe(e,"bits"));return n&(Es<<r)-Es}function xe(t,e){switch(typeof t){case"bigint":return t;case"number":return $(Number.isInteger(t),"underflow",e||"value",t),$(t>=-Sc&&t<=Sc,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(n){$(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}$(!1,"invalid BigNumberish value",e||"value",t)}function Wg(t,e){const n=xe(t,e);return ee(n>=Gg,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const u4="0123456789abcdef";function xx(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=u4[n>>4],e+=u4[n&15];return BigInt(e)}return xe(t)}function Qe(t,e){switch(typeof t){case"bigint":return $(t>=-Sc&&t<=Sc,"overflow",e||"value",t),Number(t);case"number":return $(Number.isInteger(t),"underflow",e||"value",t),$(t>=-Sc&&t<=Sc,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Qe(BigInt(t),e)}catch(n){$(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}$(!1,"invalid numeric value",e||"value",t)}function sne(t){return Qe(xx(t))}function Xo(t,e){let r=Wg(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const s=Qe(e,"width");for(ee(s*2>=r.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length<s*2;)r="0"+r}return"0x"+r}function Wn(t){const e=Wg(t,"value");if(e===Gg)return new Uint8Array([]);let n=e.toString(16);n.length%2&&(n="0"+n);const r=new Uint8Array(n.length/2);for(let s=0;s<r.length;s++){const i=s*2;r[s]=parseInt(n.substring(i,i+2),16)}return r}function kl(t){let e=we(vx(t)?t:Wn(t)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const c4="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";BigInt(0);const f4=BigInt(58);function ine(t){const e=ct(t);let n=xx(e),r="";for(;n;)r=c4[Number(n%f4)]+r,n/=f4;for(let s=0;s<e.length&&!e[s];s++)r=c4[0]+r;return r}function one(t){t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return ct(e)}function ane(t){const e=ct(t);let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}class d4{constructor(e,n,r){W(this,"filter");W(this,"emitter");J(this,ef);I(this,ef,n),Oe(this,{emitter:e,filter:r})}async removeListener(){T(this,ef)!=null&&await this.emitter.off(this.filter,T(this,ef))}}ef=new WeakMap;function lne(t,e,n,r,s){$(!1,`invalid codepoint at offset ${e}; ${t}`,"bytes",n)}function h4(t,e,n,r,s){if(t==="BAD_PREFIX"||t==="UNEXPECTED_CONTINUE"){let i=0;for(let o=e+1;o<n.length&&n[o]>>6===2;o++)i++;return i}return t==="OVERRUN"?n.length-e-1:0}function une(t,e,n,r,s){return t==="OVERLONG"?($(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),r.push(s),0):(r.push(65533),h4(t,e,n))}const cne=Object.freeze({error:lne,ignore:h4,replace:une});function fne(t,e){e==null&&(e=cne.error);const n=ct(t,"bytes"),r=[];let s=0;for(;s<n.length;){const i=n[s++];if(!(i>>7)){r.push(i);continue}let o=null,a=null;if((i&224)===192)o=1,a=127;else if((i&240)===224)o=2,a=2047;else if((i&248)===240)o=3,a=65535;else{(i&192)===128?s+=e("UNEXPECTED_CONTINUE",s-1,n,r):s+=e("BAD_PREFIX",s-1,n,r);continue}if(s-1+o>=n.length){s+=e("OVERRUN",s-1,n,r);continue}let l=i&(1<<8-o-1)-1;for(let u=0;u<o;u++){let c=n[s];if((c&192)!=128){s+=e("MISSING_CONTINUE",s,n,r),l=null;break}l=l<<6|c&63,s++}if(l!==null){if(l>1114111){s+=e("OUT_OF_RANGE",s-1-o,n,r,l);continue}if(l>=55296&&l<=57343){s+=e("UTF16_SURROGATE",s-1-o,n,r,l);continue}if(l<=a){s+=e("OVERLONG",s-1-o,n,r,l);continue}r.push(l)}}return r}function Vi(t,e){$(typeof t=="string","invalid string value","str",t);let n=[];for(let r=0;r<t.length;r++){const s=t.charCodeAt(r);if(s<128)n.push(s);else if(s<2048)n.push(s>>6|192),n.push(s&63|128);else if((s&64512)==55296){r++;const i=t.charCodeAt(r);$(r<t.length&&(i&64512)===56320,"invalid surrogate pair","str",t);const o=65536+((s&1023)<<10)+(i&1023);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(s>>12|224),n.push(s>>6&63|128),n.push(s&63|128)}return new Uint8Array(n)}function dne(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Tc(t,e){return dne(fne(t,e))}function p4(t){async function e(n,r){ee(r==null||!r.cancelled,"request cancelled before sending","CANCELLED");const s=n.url.split(":")[0].toLowerCase();ee(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),ee(s==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let i=null;const o=new AbortController,a=setTimeout(()=>{i=Nt("request timeout","TIMEOUT"),o.abort()},n.timeout);r&&r.addListener(()=>{i=Nt("request cancelled","CANCELLED"),o.abort()});const l={method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:o.signal};let u;try{u=await fetch(n.url,l)}catch(h){throw clearTimeout(a),i||h}clearTimeout(a);const c={};u.headers.forEach((h,p)=>{c[p.toLowerCase()]=h});const f=await u.arrayBuffer(),d=f==null?null:new Uint8Array(f);return{statusCode:u.status,statusMessage:u.statusText,headers:c,body:d}}return e}const hne=12,pne=250;let m4=p4();const mne=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),gne=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let kx=!1;async function g4(t,e){try{const n=t.match(mne);if(!n)throw new Error("invalid data");return new Zo(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?one(n[3]):bne(n[3]))}catch{return new Zo(599,"BAD REQUEST (invalid data: URI)",{},null,new Kn(t))}}function y4(t){async function e(n,r){try{const s=n.match(gne);if(!s)throw new Error("invalid link");return new Kn(`${t}${s[2]}`)}catch{return new Zo(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Kn(n))}}return e}const Kg={data:g4,ipfs:y4("https://gateway.ipfs.io/ipfs/")},b4=new WeakMap;class yne{constructor(e){J(this,$l);J(this,ha);I(this,$l,[]),I(this,ha,!1),b4.set(e,()=>{if(!T(this,ha)){I(this,ha,!0);for(const n of T(this,$l))setTimeout(()=>{n()},0);I(this,$l,[])}})}addListener(e){ee(!T(this,ha),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),T(this,$l).push(e)}get cancelled(){return T(this,ha)}checkSignal(){ee(!this.cancelled,"cancelled","CANCELLED",{})}}$l=new WeakMap,ha=new WeakMap;function qg(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}const sb=class sb{constructor(e){J(this,ql);J(this,tf);J(this,nf);J(this,Os);J(this,ro);J(this,rf);J(this,sf);J(this,wn);J(this,Ir);J(this,so);J(this,Gl);J(this,Wl);J(this,Kl);J(this,hi);J(this,_s);J(this,pa);I(this,sf,String(e)),I(this,tf,!1),I(this,nf,!0),I(this,Os,{}),I(this,ro,""),I(this,rf,3e5),I(this,_s,{slotInterval:pne,maxAttempts:hne}),I(this,pa,null)}get url(){return T(this,sf)}set url(e){I(this,sf,String(e))}get body(){return T(this,wn)==null?null:new Uint8Array(T(this,wn))}set body(e){if(e==null)I(this,wn,void 0),I(this,Ir,void 0);else if(typeof e=="string")I(this,wn,Vi(e)),I(this,Ir,"text/plain");else if(e instanceof Uint8Array)I(this,wn,e),I(this,Ir,"application/octet-stream");else if(typeof e=="object")I(this,wn,Vi(JSON.stringify(e))),I(this,Ir,"application/json");else throw new Error("invalid body")}hasBody(){return T(this,wn)!=null}get method(){return T(this,ro)?T(this,ro):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),I(this,ro,String(e).toUpperCase())}get headers(){const e=Object.assign({},T(this,Os));return T(this,so)&&(e.authorization=`Basic ${ane(Vi(T(this,so)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&T(this,Ir)&&(e["content-type"]=T(this,Ir)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,n){T(this,Os)[String(e).toLowerCase()]=String(n)}clearHeaders(){I(this,Os,{})}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r<n.length){const s=n[r++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return T(this,so)||null}setCredentials(e,n){$(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),I(this,so,`${e}:${n}`)}get allowGzip(){return T(this,nf)}set allowGzip(e){I(this,nf,!!e)}get allowInsecureAuthentication(){return!!T(this,tf)}set allowInsecureAuthentication(e){I(this,tf,!!e)}get timeout(){return T(this,rf)}set timeout(e){$(e>=0,"timeout must be non-zero","timeout",e),I(this,rf,e)}get preflightFunc(){return T(this,Gl)||null}set preflightFunc(e){I(this,Gl,e)}get processFunc(){return T(this,Wl)||null}set processFunc(e){I(this,Wl,e)}get retryFunc(){return T(this,Kl)||null}set retryFunc(e){I(this,Kl,e)}get getUrlFunc(){return T(this,pa)||m4}set getUrlFunc(e){I(this,pa,e)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${T(this,wn)?we(T(this,wn)):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(T(this,_s).slotInterval=e.slotInterval),e.maxAttempts!=null&&(T(this,_s).maxAttempts=e.maxAttempts)}send(){return ee(T(this,hi)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),I(this,hi,new yne(this)),fe(this,ql,Op).call(this,0,w4()+this.timeout,0,this,new Zo(0,"",{},null,this))}cancel(){ee(T(this,hi)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=b4.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const n=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();ee(this.method==="GET"&&(n!=="https"||r!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const s=new sb(e);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,I(s,Os,Object.assign({},T(this,Os))),T(this,wn)&&I(s,wn,new Uint8Array(T(this,wn))),I(s,Ir,T(this,Ir)),s}clone(){const e=new sb(this.url);return I(e,ro,T(this,ro)),T(this,wn)&&I(e,wn,T(this,wn)),I(e,Ir,T(this,Ir)),I(e,Os,Object.assign({},T(this,Os))),I(e,so,T(this,so)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),I(e,Gl,T(this,Gl)),I(e,Wl,T(this,Wl)),I(e,Kl,T(this,Kl)),I(e,_s,Object.assign({},T(this,_s))),I(e,pa,T(this,pa)),e}static lockConfig(){kx=!0}static getGateway(e){return Kg[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(kx)throw new Error("gateways locked");Kg[e]=n}static registerGetUrl(e){if(kx)throw new Error("gateways locked");m4=e}static createGetUrlFunc(e){return p4()}static createDataGateway(){return g4}static createIpfsGatewayFunc(e){return y4(e)}};tf=new WeakMap,nf=new WeakMap,Os=new WeakMap,ro=new WeakMap,rf=new WeakMap,sf=new WeakMap,wn=new WeakMap,Ir=new WeakMap,so=new WeakMap,Gl=new WeakMap,Wl=new WeakMap,Kl=new WeakMap,hi=new WeakMap,_s=new WeakMap,pa=new WeakMap,ql=new WeakSet,Op=async function(e,n,r,s,i){var c,f,d;if(e>=T(this,_s).maxAttempts)return i.makeServerError("exceeded maximum retry limit");ee(w4()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),r>0&&await wne(r);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in Kg){const h=await Kg[a](o.url,qg(T(s,hi)));if(h instanceof Zo){let p=h;if(this.processFunc){qg(T(s,hi));try{p=await this.processFunc(o,p)}catch(m){(m.throttle==null||typeof m.stall!="number")&&p.makeServerError("error in post-processing function",m).assertOk()}}return p}o=h}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,qg(T(s,hi)));let u=new Zo(l.statusCode,l.statusMessage,l.headers,l.body,s);if(u.statusCode===301||u.statusCode===302){try{const h=u.headers.location||"";return fe(c=o.redirect(h),ql,Op).call(c,e+1,n,0,s,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,u,e))){const h=u.headers["retry-after"];let p=T(this,_s).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof h=="string"&&h.match(/^[1-9][0-9]*$/)&&(p=parseInt(h)),fe(f=o.clone(),ql,Op).call(f,e+1,n,p,s,u)}if(this.processFunc){qg(T(s,hi));try{u=await this.processFunc(o,u)}catch(h){(h.throttle==null||typeof h.stall!="number")&&u.makeServerError("error in post-processing function",h).assertOk();let p=T(this,_s).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return h.stall>=0&&(p=h.stall),fe(d=o.clone(),ql,Op).call(d,e+1,n,p,s,u)}}return u};let Kn=sb;const Hk=class Hk{constructor(e,n,r,s,i){J(this,hp);J(this,pp);J(this,mp);J(this,Lr);J(this,of);J(this,Ql);I(this,hp,e),I(this,pp,n),I(this,mp,Object.keys(r).reduce((o,a)=>(o[a.toLowerCase()]=String(r[a]),o),{})),I(this,Lr,s==null?null:new Uint8Array(s)),I(this,of,i||null),I(this,Ql,{message:""})}toString(){return`<FetchResponse status=${this.statusCode} body=${T(this,Lr)?we(T(this,Lr)):"null"}>`}get statusCode(){return T(this,hp)}get statusMessage(){return T(this,pp)}get headers(){return Object.assign({},T(this,mp))}get body(){return T(this,Lr)==null?null:new Uint8Array(T(this,Lr))}get bodyText(){try{return T(this,Lr)==null?"":Tc(T(this,Lr))}catch{ee(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{ee(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r<n.length){const s=n[r++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}makeServerError(e,n){let r;e?r=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,r=`CLIENT ESCALATED SERVER ERROR (${e})`);const s=new Hk(599,r,this.headers,this.body,T(this,of)||void 0);return I(s,Ql,{message:e,error:n}),s}throwThrottleError(e,n){n==null?n=-1:$(Number.isInteger(n)&&n>=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw Oe(r,{stall:n,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return T(this,Lr)!=null}get request(){return T(this,of)}ok(){return T(this,Ql).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:n}=T(this,Ql);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let s=null;try{T(this,Lr)&&(s=Tc(T(this,Lr)))}catch{}ee(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n,info:{requestUrl:r,responseBody:s,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};hp=new WeakMap,pp=new WeakMap,mp=new WeakMap,Lr=new WeakMap,of=new WeakMap,Ql=new WeakMap;let Zo=Hk;function w4(){return new Date().getTime()}function bne(t){return Vi(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function wne(t){return new Promise(e=>setTimeout(e,t))}function Ane(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function A4(t,e,n){let r=0;for(let s=0;s<n;s++)r=r*256+t[e+s];return r}function v4(t,e,n,r){const s=[];for(;n<e+1+r;){const i=x4(t,n);s.push(i.result),n+=i.consumed,ee(n<=e+1+r,"child data too short","BUFFER_OVERRUN",{buffer:t,length:r,offset:e})}return{consumed:1+r,result:s}}function x4(t,e){ee(t.length!==0,"data too short","BUFFER_OVERRUN",{buffer:t,length:0,offset:1});const n=r=>{ee(r<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:r})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const s=A4(t,e+1,r);return n(e+1+r+s),v4(t,e,e+1+r,r+s)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),v4(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const s=A4(t,e+1,r);n(e+1+r+s);const i=we(t.slice(e+1+r,e+1+r+s));return{consumed:1+r+s,result:i}}else if(t[e]>=128){const r=t[e]-128;n(e+1+r);const s=we(t.slice(e+1,e+1+r));return{consumed:1+r,result:s}}return{consumed:1,result:Ane(t[e])}}function Qg(t){const e=ct(t,"data"),n=x4(e,0);return $(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function k4(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function E4(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(i){r=r.concat(E4(i))}),r.length<=55)return r.unshift(192+r.length),r;const s=k4(r.length);return s.unshift(247+s.length),s.concat(r)}const e=Array.prototype.slice.call(ct(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=k4(e.length);return n.unshift(183+n.length),n.concat(e)}const C4="0123456789abcdef";function El(t){let e="0x";for(const n of E4(t))e+=C4[n>>4],e+=C4[n&15];return e}const qn=32,Ex=new Uint8Array(qn),vne=["then"],Jg={},S4=new WeakMap;function Cl(t){return S4.get(t)}function T4(t,e){S4.set(t,e)}function _h(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw n.error=e,n}function Cx(t,e,n){return t.indexOf(null)>=0?e.map((r,s)=>r instanceof Dc?Cx(Cl(r),r,n):r):t.reduce((r,s,i)=>{let o=e.getValue(s);return s in r||(n&&o instanceof Dc&&(o=Cx(Cl(o),o,n)),r[s]=o),r},{})}const lf=class lf extends Array{constructor(...n){const r=n[0];let s=n[1],i=(n[2]||[]).slice(),o=!0;r!==Jg&&(s=n,i=[],o=!1);super(s.length);J(this,af);s.forEach((u,c)=>{this[c]=u});const a=i.reduce((u,c)=>(typeof c=="string"&&u.set(c,(u.get(c)||0)+1),u),new Map);if(T4(this,Object.freeze(s.map((u,c)=>{const f=i[c];return f!=null&&a.get(f)===1?f:null}))),I(this,af,[]),T(this,af)==null&&T(this,af),!o)return;Object.freeze(this);const l=new Proxy(this,{get:(u,c,f)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const h=Qe(c,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");const p=u[h];return p instanceof Error&&_h(`index ${h}`,p),p}if(vne.indexOf(c)>=0)return Reflect.get(u,c,f);const d=u[c];if(d instanceof Function)return function(...h){return d.apply(this===f?u:this,h)};if(!(c in u))return u.getValue.apply(this===f?u:this,[c])}return Reflect.get(u,c,f)}});return T4(l,Cl(this)),l}toArray(n){const r=[];return this.forEach((s,i)=>{s instanceof Error&&_h(`index ${i}`,s),n&&s instanceof lf&&(s=s.toArray(n)),r.push(s)}),r}toObject(n){const r=Cl(this);return r.reduce((s,i,o)=>(ee(i!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),Cx(r,this,n)),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const s=Cl(this),i=[],o=[];for(let a=n;a<r;a++)i.push(this[a]),o.push(s[a]);return new lf(Jg,i,o)}filter(n,r){const s=Cl(this),i=[],o=[];for(let a=0;a<this.length;a++){const l=this[a];l instanceof Error&&_h(`index ${a}`,l),n.call(r,l,a,this)&&(i.push(l),o.push(s[a]))}return new lf(Jg,i,o)}map(n,r){const s=[];for(let i=0;i<this.length;i++){const o=this[i];o instanceof Error&&_h(`index ${i}`,o),s.push(n.call(r,o,i,this))}return s}getValue(n){const r=Cl(this).indexOf(n);if(r===-1)return;const s=this[r];return s instanceof Error&&_h(`property ${JSON.stringify(n)}`,s.error),s}static fromItems(n,r){return new lf(Jg,n,r)}};af=new WeakMap;let Dc=lf;function D4(t){let e=Wn(t);return ee(e.length<=qn,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:qn,offset:e.length}),e.length!==qn&&(e=Gn($t([Ex.slice(e.length%qn),e]))),e}class Hi{constructor(e,n,r,s){W(this,"name");W(this,"type");W(this,"localName");W(this,"dynamic");Oe(this,{name:e,type:n,localName:r,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,n){$(!1,e,this.localName,n)}}class Sx{constructor(){J(this,uf);J(this,io);J(this,Jl);I(this,io,[]),I(this,Jl,0)}get data(){return $t(T(this,io))}get length(){return T(this,Jl)}appendWriter(e){return fe(this,uf,fb).call(this,Gn(e.data))}writeBytes(e){let n=Gn(e);const r=n.length%qn;return r&&(n=Gn($t([n,Ex.slice(r)]))),fe(this,uf,fb).call(this,n)}writeValue(e){return fe(this,uf,fb).call(this,D4(e))}writeUpdatableValue(){const e=T(this,io).length;return T(this,io).push(Ex),I(this,Jl,T(this,Jl)+qn),n=>{T(this,io)[e]=D4(n)}}}io=new WeakMap,Jl=new WeakMap,uf=new WeakSet,fb=function(e){return T(this,io).push(e),I(this,Jl,T(this,Jl)+e.length),e.length};const zk=class zk{constructor(e,n,r){J(this,Zl);W(this,"allowLoose");J(this,pr);J(this,Br);J(this,Yl);J(this,Xl);J(this,ma);Oe(this,{allowLoose:!!n}),I(this,pr,Gn(e)),I(this,Yl,0),I(this,Xl,null),I(this,ma,r??1024),I(this,Br,0)}get data(){return we(T(this,pr))}get dataLength(){return T(this,pr).length}get consumed(){return T(this,Br)}get bytes(){return new Uint8Array(T(this,pr))}subReader(e){const n=new zk(T(this,pr).slice(T(this,Br)+e),this.allowLoose,T(this,ma));return I(n,Xl,this),n}readBytes(e,n){let r=fe(this,Zl,qL).call(this,0,e,!!n);return fe(this,Zl,Xk).call(this,e),I(this,Br,T(this,Br)+r.length),r.slice(0,e)}readValue(){return xx(this.readBytes(qn))}readIndex(){return sne(this.readBytes(qn))}};pr=new WeakMap,Br=new WeakMap,Yl=new WeakMap,Xl=new WeakMap,ma=new WeakMap,Zl=new WeakSet,Xk=function(e){var n;if(T(this,Xl))return fe(n=T(this,Xl),Zl,Xk).call(n,e);I(this,Yl,T(this,Yl)+e),ee(T(this,ma)<1||T(this,Yl)<=T(this,ma)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${T(this,ma)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Gn(T(this,pr)),offset:T(this,Br),length:e,info:{bytesRead:T(this,Yl),dataLength:this.dataLength}})},qL=function(e,n,r){let s=Math.ceil(n/qn)*qn;return T(this,Br)+s>T(this,pr).length&&(this.allowLoose&&r&&T(this,Br)+n<=T(this,pr).length?s=n:ee(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Gn(T(this,pr)),length:T(this,pr).length,offset:T(this,Br)+s})),T(this,pr).slice(T(this,Br),T(this,Br)+s)};let Tx=zk;function Yg(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function Dx(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 xne(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Yg(t.outputLen),Yg(t.blockLen)}function Oc(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 O4(t,e){Dx(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const Ox=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _4=t=>t instanceof Uint8Array,kne=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),_x=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ui=(t,e)=>t<<32-e|t>>>e;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");function Ene(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Xg(t){if(typeof t=="string"&&(t=Ene(t)),!_4(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function Cne(...t){const e=new Uint8Array(t.reduce((r,s)=>r+s.length,0));let n=0;return t.forEach(r=>{if(!_4(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}class Mx{clone(){return this._cloneInto()}}function Nx(t){const e=r=>t().update(Xg(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function Sne(t=32){if(Ox&&typeof Ox.getRandomValues=="function")return Ox.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class M4 extends Mx{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,xne(e);const r=Xg(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(r.length>s?e.create().update(r).digest():r);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),i.fill(0)}update(e){return Oc(this),this.iHash.update(e),this}digestInto(e){Oc(this),Dx(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:i,blockLen:o,outputLen:a}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const N4=(t,e,n)=>new M4(t,e).update(n).digest();N4.create=(t,e)=>new M4(t,e);function Tne(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(n>>s&i),a=Number(n&i),l=r?4:0,u=r?0:4;t.setUint32(e+l,o,r),t.setUint32(e+u,a,r)}class R4 extends Mx{constructor(e,n,r,s){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=_x(this.buffer)}update(e){Oc(this);const{view:n,buffer:r,blockLen:s}=this;e=Xg(e);const i=e.length;for(let o=0;o<i;){const a=Math.min(s-this.pos,i-o);if(a===s){const l=_x(e);for(;s<=i-o;o+=s)this.process(l,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Oc(this),O4(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:i}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let f=o;f<s;f++)n[f]=0;Tne(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=_x(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,c=this.get();if(u>c.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)a.setUint32(4*f,c[f],i)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:i,destroyed:o,pos:a}=this;return e.length=s,e.pos=a,e.finished=i,e.destroyed=o,s%n&&e.buffer.set(r),e}}const Dne=(t,e,n)=>t&e^~t&n,One=(t,e,n)=>t&e^t&n^e&n,_ne=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ea=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ta=new Uint32Array(64);class Mne extends R4{constructor(){super(64,32,8,!1),this.A=ea[0]|0,this.B=ea[1]|0,this.C=ea[2]|0,this.D=ea[3]|0,this.E=ea[4]|0,this.F=ea[5]|0,this.G=ea[6]|0,this.H=ea[7]|0}get(){const{A:e,B:n,C:r,D:s,E:i,F:o,G:a,H:l}=this;return[e,n,r,s,i,o,a,l]}set(e,n,r,s,i,o,a,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)ta[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const d=ta[f-15],h=ta[f-2],p=ui(d,7)^ui(d,18)^d>>>3,m=ui(h,17)^ui(h,19)^h>>>10;ta[f]=m+ta[f-7]+p+ta[f-16]|0}let{A:r,B:s,C:i,D:o,E:a,F:l,G:u,H:c}=this;for(let f=0;f<64;f++){const d=ui(a,6)^ui(a,11)^ui(a,25),h=c+d+Dne(a,l,u)+_ne[f]+ta[f]|0,m=(ui(r,2)^ui(r,13)^ui(r,22))+One(r,s,i)|0;c=u,u=l,l=a,a=o+h|0,o=i,i=s,s=r,r=h+m|0}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,s,i,o,a,l,u,c)}roundClean(){ta.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const P4=Nx(()=>new Mne),Zg=BigInt(2**32-1),Rx=BigInt(32);function I4(t,e=!1){return e?{h:Number(t&Zg),l:Number(t>>Rx&Zg)}:{h:Number(t>>Rx&Zg)|0,l:Number(t&Zg)|0}}function L4(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let s=0;s<t.length;s++){const{h:i,l:o}=I4(t[s],e);[n[s],r[s]]=[i,o]}return[n,r]}const Nne=(t,e)=>BigInt(t>>>0)<<Rx|BigInt(e>>>0),Rne=(t,e,n)=>t>>>n,Pne=(t,e,n)=>t<<32-n|e>>>n,Ine=(t,e,n)=>t>>>n|e<<32-n,Lne=(t,e,n)=>t<<32-n|e>>>n,Bne=(t,e,n)=>t<<64-n|e>>>n-32,Fne=(t,e,n)=>t>>>n-32|e<<64-n,jne=(t,e)=>e,Une=(t,e)=>t,B4=(t,e,n)=>t<<n|e>>>32-n,F4=(t,e,n)=>e<<n|t>>>32-n,j4=(t,e,n)=>e<<n-32|t>>>64-n,U4=(t,e,n)=>t<<n-32|e>>>64-n;function Vne(t,e,n,r){const s=(e>>>0)+(r>>>0);return{h:t+n+(s/2**32|0)|0,l:s|0}}const Ze={fromBig:I4,split:L4,toBig:Nne,shrSH:Rne,shrSL:Pne,rotrSH:Ine,rotrSL:Lne,rotrBH:Bne,rotrBL:Fne,rotr32H:jne,rotr32L:Une,rotlSH:B4,rotlSL:F4,rotlBH:j4,rotlBL:U4,add:Vne,add3L:(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),add3H:(t,e,n,r)=>e+n+r+(t/2**32|0)|0,add4L:(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),add4H:(t,e,n,r,s)=>e+n+r+s+(t/2**32|0)|0,add5H:(t,e,n,r,s,i)=>e+n+r+s+i+(t/2**32|0)|0,add5L:(t,e,n,r,s)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(s>>>0)},[Hne,zne]=Ze.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),na=new Uint32Array(80),ra=new Uint32Array(80);class $ne extends R4{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:r,Bl:s,Ch:i,Cl:o,Dh:a,Dl:l,Eh:u,El:c,Fh:f,Fl:d,Gh:h,Gl:p,Hh:m,Hl:g}=this;return[e,n,r,s,i,o,a,l,u,c,f,d,h,p,m,g]}set(e,n,r,s,i,o,a,l,u,c,f,d,h,p,m,g){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=s|0,this.Ch=i|0,this.Cl=o|0,this.Dh=a|0,this.Dl=l|0,this.Eh=u|0,this.El=c|0,this.Fh=f|0,this.Fl=d|0,this.Gh=h|0,this.Gl=p|0,this.Hh=m|0,this.Hl=g|0}process(e,n){for(let w=0;w<16;w++,n+=4)na[w]=e.getUint32(n),ra[w]=e.getUint32(n+=4);for(let w=16;w<80;w++){const A=na[w-15]|0,x=ra[w-15]|0,k=Ze.rotrSH(A,x,1)^Ze.rotrSH(A,x,8)^Ze.shrSH(A,x,7),C=Ze.rotrSL(A,x,1)^Ze.rotrSL(A,x,8)^Ze.shrSL(A,x,7),O=na[w-2]|0,_=ra[w-2]|0,D=Ze.rotrSH(O,_,19)^Ze.rotrBH(O,_,61)^Ze.shrSH(O,_,6),R=Ze.rotrSL(O,_,19)^Ze.rotrBL(O,_,61)^Ze.shrSL(O,_,6),L=Ze.add4L(C,R,ra[w-7],ra[w-16]),F=Ze.add4H(L,k,D,na[w-7],na[w-16]);na[w]=F|0,ra[w]=L|0}let{Ah:r,Al:s,Bh:i,Bl:o,Ch:a,Cl:l,Dh:u,Dl:c,Eh:f,El:d,Fh:h,Fl:p,Gh:m,Gl:g,Hh:y,Hl:v}=this;for(let w=0;w<80;w++){const A=Ze.rotrSH(f,d,14)^Ze.rotrSH(f,d,18)^Ze.rotrBH(f,d,41),x=Ze.rotrSL(f,d,14)^Ze.rotrSL(f,d,18)^Ze.rotrBL(f,d,41),k=f&h^~f&m,C=d&p^~d&g,O=Ze.add5L(v,x,C,zne[w],ra[w]),_=Ze.add5H(O,y,A,k,Hne[w],na[w]),D=O|0,R=Ze.rotrSH(r,s,28)^Ze.rotrBH(r,s,34)^Ze.rotrBH(r,s,39),L=Ze.rotrSL(r,s,28)^Ze.rotrBL(r,s,34)^Ze.rotrBL(r,s,39),F=r&i^r&a^i&a,G=s&o^s&l^o&l;y=m|0,v=g|0,m=h|0,g=p|0,h=f|0,p=d|0,{h:f,l:d}=Ze.add(u|0,c|0,_|0,D|0),u=a|0,c=l|0,a=i|0,l=o|0,i=r|0,o=s|0;const B=Ze.add3L(D,L,G);r=Ze.add3H(B,_,R,F),s=B|0}({h:r,l:s}=Ze.add(this.Ah|0,this.Al|0,r|0,s|0)),{h:i,l:o}=Ze.add(this.Bh|0,this.Bl|0,i|0,o|0),{h:a,l}=Ze.add(this.Ch|0,this.Cl|0,a|0,l|0),{h:u,l:c}=Ze.add(this.Dh|0,this.Dl|0,u|0,c|0),{h:f,l:d}=Ze.add(this.Eh|0,this.El|0,f|0,d|0),{h,l:p}=Ze.add(this.Fh|0,this.Fl|0,h|0,p|0),{h:m,l:g}=Ze.add(this.Gh|0,this.Gl|0,m|0,g|0),{h:y,l:v}=Ze.add(this.Hh|0,this.Hl|0,y|0,v|0),this.set(r,s,i,o,a,l,u,c,f,d,h,p,m,g,y,v)}roundClean(){na.fill(0),ra.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Gne=Nx(()=>new $ne);function Wne(){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 V4=Wne();V4.crypto||V4.msCrypto;function Kne(t){switch(t){case"sha256":return P4.create();case"sha512":return Gne.create()}$(!1,"invalid hashing algorithm name","algorithm",t)}const[H4,z4,$4]=[[],[],[]],qne=BigInt(0),Mh=BigInt(1),Qne=BigInt(2),Jne=BigInt(7),Yne=BigInt(256),Xne=BigInt(113);for(let t=0,e=Mh,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],H4.push(2*(5*r+n)),z4.push((t+1)*(t+2)/2%64);let s=qne;for(let i=0;i<7;i++)e=(e<<Mh^(e>>Jne)*Xne)%Yne,e&Qne&&(s^=Mh<<(Mh<<BigInt(i))-Mh);$4.push(s)}const[Zne,ere]=L4($4,!0),G4=(t,e,n)=>n>32?j4(t,e,n):B4(t,e,n),W4=(t,e,n)=>n>32?U4(t,e,n):F4(t,e,n);function tre(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[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,l=(o+2)%10,u=n[l],c=n[l+1],f=G4(u,c,1)^n[a],d=W4(u,c,1)^n[a+1];for(let h=0;h<50;h+=10)t[o+h]^=f,t[o+h+1]^=d}let s=t[2],i=t[3];for(let o=0;o<24;o++){const a=z4[o],l=G4(s,i,a),u=W4(s,i,a),c=H4[o];s=t[c],i=t[c+1],t[c]=l,t[c+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=Zne[r],t[1]^=ere[r]}n.fill(0)}class Px extends Mx{constructor(e,n,r,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Yg(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=kne(this.state)}keccak(){tre(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Oc(this);const{blockLen:n,state:r}=this;e=Xg(e);const s=e.length;for(let i=0;i<s;){const o=Math.min(n-this.pos,s-i);for(let a=0;a<o;a++)r[this.pos++]^=e[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:s}=this;e[r]^=n,n&128&&r===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){Oc(this,!1),Dx(e),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,i=e.length;s<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-s);e.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=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 Yg(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(O4(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:n,suffix:r,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new Px(n,r,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}}const nre=((t,e,n)=>Nx(()=>new Px(e,t,n)))(1,136,256/8);let K4=!1;const q4=function(t){return nre(t)};let Q4=q4;function en(t){const e=ct(t,"data");return we(Q4(e))}en._=q4,en.lock=function(){K4=!0},en.register=function(t){if(K4)throw new TypeError("keccak256 is locked");Q4=t},Object.freeze(en);const J4=function(t){return Kne("sha256").update(t).digest()};let Y4=J4,X4=!1;function _c(t){const e=ct(t,"data");return we(Y4(e))}_c._=J4,_c.lock=function(){X4=!0},_c.register=function(t){if(X4)throw new Error("sha256 is locked");Y4=t},Object.freeze(_c),Object.freeze(_c);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Z4=BigInt(0),ey=BigInt(1),rre=BigInt(2),ty=t=>t instanceof Uint8Array,sre=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Mc(t){if(!ty(t))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=sre[t[n]];return e}function eR(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function Ix(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function Nc(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(e/2);for(let r=0;r<n.length;r++){const s=r*2,i=t.slice(s,s+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");n[r]=o}return n}function Sl(t){return Ix(Mc(t))}function Lx(t){if(!ty(t))throw new Error("Uint8Array expected");return Ix(Mc(Uint8Array.from(t).reverse()))}function Rc(t,e){return Nc(t.toString(16).padStart(e*2,"0"))}function Bx(t,e){return Rc(t,e).reverse()}function ire(t){return Nc(eR(t))}function Cs(t,e,n){let r;if(typeof e=="string")try{r=Nc(e)}catch(i){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${i}`)}else if(ty(e))r=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(`${t} expected ${n} bytes, got ${s}`);return r}function Nh(...t){const e=new Uint8Array(t.reduce((r,s)=>r+s.length,0));let n=0;return t.forEach(r=>{if(!ty(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function ore(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function are(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function lre(t){let e;for(e=0;t>Z4;t>>=ey,e+=1);return e}function ure(t,e){return t>>BigInt(e)&ey}const cre=(t,e,n)=>t|(n?ey:Z4)<<BigInt(e),Fx=t=>(rre<<BigInt(t-1))-ey,jx=t=>new Uint8Array(t),tR=t=>Uint8Array.from(t);function nR(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=jx(t),s=jx(t),i=0;const o=()=>{r.fill(1),s.fill(0),i=0},a=(...f)=>n(s,r,...f),l=(f=jx())=>{s=a(tR([0]),f),r=a(),f.length!==0&&(s=a(tR([1]),f),r=a())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f<e;){r=a();const h=r.slice();d.push(h),f+=r.length}return Nh(...d)};return(f,d)=>{o(),l(f);let h;for(;!(h=d(u()));)l();return o(),h}}const fre={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Rh(t,e,n={}){const r=(s,i,o)=>{const a=fre[i];if(typeof a!="function")throw new Error(`Invalid validator "${i}", expected function`);const l=t[s];if(!(o&&l===void 0)&&!a(l,t))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${i}`)};for(const[s,i]of Object.entries(e))r(s,i,!1);for(const[s,i]of Object.entries(n))r(s,i,!0);return t}const dre=Object.freeze(Object.defineProperty({__proto__:null,bitGet:ure,bitLen:lre,bitMask:Fx,bitSet:cre,bytesToHex:Mc,bytesToNumberBE:Sl,bytesToNumberLE:Lx,concatBytes:Nh,createHmacDrbg:nR,ensureBytes:Cs,equalBytes:ore,hexToBytes:Nc,hexToNumber:Ix,numberToBytesBE:Rc,numberToBytesLE:Bx,numberToHexUnpadded:eR,numberToVarBytesBE:ire,utf8ToBytes:are,validateObject:Rh},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const yn=BigInt(0),Gt=BigInt(1),Tl=BigInt(2),hre=BigInt(3),Ux=BigInt(4),rR=BigInt(5),sR=BigInt(8);BigInt(9),BigInt(16);function fr(t,e){const n=t%e;return n>=yn?n:e+n}function pre(t,e,n){if(n<=yn||e<yn)throw new Error("Expected power/modulo > 0");if(n===Gt)return yn;let r=Gt;for(;e>yn;)e&Gt&&(r=r*t%n),t=t*t%n,e>>=Gt;return r}function Xr(t,e,n){let r=t;for(;e-- >yn;)r*=r,r%=n;return r}function Vx(t,e){if(t===yn||e<=yn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=fr(t,e),r=e,s=yn,i=Gt;for(;n!==yn;){const a=r/n,l=r%n,u=s-i*a;r=n,n=l,s=i,i=u}if(r!==Gt)throw new Error("invert: does not exist");return fr(s,e)}function mre(t){const e=(t-Gt)/Tl;let n,r,s;for(n=t-Gt,r=0;n%Tl===yn;n/=Tl,r++);for(s=Tl;s<t&&pre(s,e,t)!==t-Gt;s++);if(r===1){const o=(t+Gt)/Ux;return function(l,u){const c=l.pow(u,o);if(!l.eql(l.sqr(c),u))throw new Error("Cannot find square root");return c}}const i=(n+Gt)/Tl;return function(a,l){if(a.pow(l,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=r,c=a.pow(a.mul(a.ONE,s),n),f=a.pow(l,i),d=a.pow(l,n);for(;!a.eql(d,a.ONE);){if(a.eql(d,a.ZERO))return a.ZERO;let h=1;for(let m=a.sqr(d);h<u&&!a.eql(m,a.ONE);h++)m=a.sqr(m);const p=a.pow(c,Gt<<BigInt(u-h-1));c=a.sqr(p),f=a.mul(f,p),d=a.mul(d,c),u=h}return f}}function gre(t){if(t%Ux===hre){const e=(t+Gt)/Ux;return function(r,s){const i=r.pow(s,e);if(!r.eql(r.sqr(i),s))throw new Error("Cannot find square root");return i}}if(t%sR===rR){const e=(t-rR)/sR;return function(r,s){const i=r.mul(s,Tl),o=r.pow(i,e),a=r.mul(s,o),l=r.mul(r.mul(a,Tl),o),u=r.mul(a,r.sub(l,r.ONE));if(!r.eql(r.sqr(u),s))throw new Error("Cannot find square root");return u}}return mre(t)}const yre=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function bre(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=yre.reduce((r,s)=>(r[s]="function",r),e);return Rh(t,n)}function wre(t,e,n){if(n<yn)throw new Error("Expected power > 0");if(n===yn)return t.ONE;if(n===Gt)return e;let r=t.ONE,s=e;for(;n>yn;)n&Gt&&(r=t.mul(r,s)),s=t.sqr(s),n>>=Gt;return r}function Are(t,e){const n=new Array(e.length),r=e.reduce((i,o,a)=>t.is0(o)?i:(n[a]=i,t.mul(i,o)),t.ONE),s=t.inv(r);return e.reduceRight((i,o,a)=>t.is0(o)?i:(n[a]=t.mul(i,n[a]),t.mul(i,o)),s),n}function iR(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function vre(t,e,n=!1,r={}){if(t<=yn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:s,nByteLength:i}=iR(t,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=gre(t),a=Object.freeze({ORDER:t,BITS:s,BYTES:i,MASK:Fx(s),ZERO:yn,ONE:Gt,create:l=>fr(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return yn<=l&&l<t},is0:l=>l===yn,isOdd:l=>(l&Gt)===Gt,neg:l=>fr(-l,t),eql:(l,u)=>l===u,sqr:l=>fr(l*l,t),add:(l,u)=>fr(l+u,t),sub:(l,u)=>fr(l-u,t),mul:(l,u)=>fr(l*u,t),pow:(l,u)=>wre(a,l,u),div:(l,u)=>fr(l*Vx(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Vx(l,t),sqrt:r.sqrt||(l=>o(a,l)),invertBatch:l=>Are(a,l),cmov:(l,u,c)=>c?u:l,toBytes:l=>n?Bx(l,i):Rc(l,i),fromBytes:l=>{if(l.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${l.length}`);return n?Lx(l):Sl(l)}});return Object.freeze(a)}function oR(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function aR(t){const e=oR(t);return e+Math.ceil(e/2)}function xre(t,e,n=!1){const r=t.length,s=oR(e),i=aR(e);if(r<16||r<i||r>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);const o=n?Sl(t):Lx(t),a=fr(o,e-Gt)+Gt;return n?Bx(a,s):Rc(a,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const kre=BigInt(0),Hx=BigInt(1);function Ere(t,e){const n=(s,i)=>{const o=i.negate();return s?o:i},r=s=>{const i=Math.ceil(e/s)+1,o=2**(s-1);return{windows:i,windowSize:o}};return{constTimeNegate:n,unsafeLadder(s,i){let o=t.ZERO,a=s;for(;i>kre;)i&Hx&&(o=o.add(a)),a=a.double(),i>>=Hx;return o},precomputeWindow(s,i){const{windows:o,windowSize:a}=r(i),l=[];let u=s,c=u;for(let f=0;f<o;f++){c=u,l.push(c);for(let d=1;d<a;d++)c=c.add(u),l.push(c);u=c.double()}return l},wNAF(s,i,o){const{windows:a,windowSize:l}=r(s);let u=t.ZERO,c=t.BASE;const f=BigInt(2**s-1),d=2**s,h=BigInt(s);for(let p=0;p<a;p++){const m=p*l;let g=Number(o&f);o>>=h,g>l&&(g-=d,o+=Hx);const y=m,v=m+Math.abs(g)-1,w=p%2!==0,A=g<0;g===0?c=c.add(n(w,i[y])):u=u.add(n(A,i[v]))}return{p:u,f:c}},wNAFCached(s,i,o,a){const l=s._WINDOW_SIZE||1;let u=i.get(s);return u||(u=this.precomputeWindow(s,l),l!==1&&i.set(s,a(u))),this.wNAF(l,u,o)}}}function lR(t){return bre(t.Fp),Rh(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...iR(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Cre(t){const e=lR(t);Rh(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=e;if(n){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:Sre,hexToBytes:Tre}=dre,Dl={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Dl;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:Sre(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=Dl,n=typeof t=="string"?Tre(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:s,l:i}=Dl._parseInt(n.subarray(2)),{d:o,l:a}=Dl._parseInt(i);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const c=u.toString(16);return c.length&1?`0${c}`:c},r=e(n(t.s)),s=e(n(t.r)),i=r.length/2,o=s.length/2,a=n(i),l=n(o);return`30${n(o+i+4)}02${l}${s}02${a}${r}`}},zi=BigInt(0),Zr=BigInt(1);BigInt(2);const uR=BigInt(3);BigInt(4);function Dre(t){const e=Cre(t),{Fp:n}=e,r=e.toBytes||((p,m,g)=>{const y=m.toAffine();return Nh(Uint8Array.from([4]),n.toBytes(y.x),n.toBytes(y.y))}),s=e.fromBytes||(p=>{const m=p.subarray(1),g=n.fromBytes(m.subarray(0,n.BYTES)),y=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x:g,y}});function i(p){const{a:m,b:g}=e,y=n.sqr(p),v=n.mul(y,p);return n.add(n.add(v,n.mul(p,m)),g)}if(!n.eql(n.sqr(e.Gy),i(e.Gx)))throw new Error("bad generator point: equation left != right");function o(p){return typeof p=="bigint"&&zi<p&&p<e.n}function a(p){if(!o(p))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function l(p){const{allowedPrivateKeyLengths:m,nByteLength:g,wrapPrivateKey:y,n:v}=e;if(m&&typeof p!="bigint"){if(p instanceof Uint8Array&&(p=Mc(p)),typeof p!="string"||!m.includes(p.length))throw new Error("Invalid key");p=p.padStart(g*2,"0")}let w;try{w=typeof p=="bigint"?p:Sl(Cs("private key",p,g))}catch{throw new Error(`private key must be ${g} bytes, hex or bigint, not ${typeof p}`)}return y&&(w=fr(w,v)),a(w),w}const u=new Map;function c(p){if(!(p instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(m,g,y){if(this.px=m,this.py=g,this.pz=y,m==null||!n.isValid(m))throw new Error("x required");if(g==null||!n.isValid(g))throw new Error("y required");if(y==null||!n.isValid(y))throw new Error("z required")}static fromAffine(m){const{x:g,y}=m||{};if(!m||!n.isValid(g)||!n.isValid(y))throw new Error("invalid affine point");if(m instanceof f)throw new Error("projective point not allowed");const v=w=>n.eql(w,n.ZERO);return v(g)&&v(y)?f.ZERO:new f(g,y,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const g=n.invertBatch(m.map(y=>y.pz));return m.map((y,v)=>y.toAffine(g[v])).map(f.fromAffine)}static fromHex(m){const g=f.fromAffine(s(Cs("pointHex",m)));return g.assertValidity(),g}static fromPrivateKey(m){return f.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:m,y:g}=this.toAffine();if(!n.isValid(m)||!n.isValid(g))throw new Error("bad point: x or y not FE");const y=n.sqr(g),v=i(m);if(!n.eql(y,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){c(m);const{px:g,py:y,pz:v}=this,{px:w,py:A,pz:x}=m,k=n.eql(n.mul(g,x),n.mul(w,v)),C=n.eql(n.mul(y,x),n.mul(A,v));return k&&C}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b:g}=e,y=n.mul(g,uR),{px:v,py:w,pz:A}=this;let x=n.ZERO,k=n.ZERO,C=n.ZERO,O=n.mul(v,v),_=n.mul(w,w),D=n.mul(A,A),R=n.mul(v,w);return R=n.add(R,R),C=n.mul(v,A),C=n.add(C,C),x=n.mul(m,C),k=n.mul(y,D),k=n.add(x,k),x=n.sub(_,k),k=n.add(_,k),k=n.mul(x,k),x=n.mul(R,x),C=n.mul(y,C),D=n.mul(m,D),R=n.sub(O,D),R=n.mul(m,R),R=n.add(R,C),C=n.add(O,O),O=n.add(C,O),O=n.add(O,D),O=n.mul(O,R),k=n.add(k,O),D=n.mul(w,A),D=n.add(D,D),O=n.mul(D,R),x=n.sub(x,O),C=n.mul(D,_),C=n.add(C,C),C=n.add(C,C),new f(x,k,C)}add(m){c(m);const{px:g,py:y,pz:v}=this,{px:w,py:A,pz:x}=m;let k=n.ZERO,C=n.ZERO,O=n.ZERO;const _=e.a,D=n.mul(e.b,uR);let R=n.mul(g,w),L=n.mul(y,A),F=n.mul(v,x),G=n.add(g,y),B=n.add(w,A);G=n.mul(G,B),B=n.add(R,L),G=n.sub(G,B),B=n.add(g,v);let H=n.add(w,x);return B=n.mul(B,H),H=n.add(R,F),B=n.sub(B,H),H=n.add(y,v),k=n.add(A,x),H=n.mul(H,k),k=n.add(L,F),H=n.sub(H,k),O=n.mul(_,B),k=n.mul(D,F),O=n.add(k,O),k=n.sub(L,O),O=n.add(L,O),C=n.mul(k,O),L=n.add(R,R),L=n.add(L,R),F=n.mul(_,F),B=n.mul(D,B),L=n.add(L,F),F=n.sub(R,F),F=n.mul(_,F),B=n.add(B,F),R=n.mul(L,B),C=n.add(C,R),R=n.mul(H,B),k=n.mul(G,k),k=n.sub(k,R),R=n.mul(G,L),O=n.mul(H,O),O=n.add(O,R),new f(k,C,O)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return h.wNAFCached(this,u,m,g=>{const y=n.invertBatch(g.map(v=>v.pz));return g.map((v,w)=>v.toAffine(y[w])).map(f.fromAffine)})}multiplyUnsafe(m){const g=f.ZERO;if(m===zi)return g;if(a(m),m===Zr)return this;const{endo:y}=e;if(!y)return h.unsafeLadder(this,m);let{k1neg:v,k1:w,k2neg:A,k2:x}=y.splitScalar(m),k=g,C=g,O=this;for(;w>zi||x>zi;)w&Zr&&(k=k.add(O)),x&Zr&&(C=C.add(O)),O=O.double(),w>>=Zr,x>>=Zr;return v&&(k=k.negate()),A&&(C=C.negate()),C=new f(n.mul(C.px,y.beta),C.py,C.pz),k.add(C)}multiply(m){a(m);let g=m,y,v;const{endo:w}=e;if(w){const{k1neg:A,k1:x,k2neg:k,k2:C}=w.splitScalar(g);let{p:O,f:_}=this.wNAF(x),{p:D,f:R}=this.wNAF(C);O=h.constTimeNegate(A,O),D=h.constTimeNegate(k,D),D=new f(n.mul(D.px,w.beta),D.py,D.pz),y=O.add(D),v=_.add(R)}else{const{p:A,f:x}=this.wNAF(g);y=A,v=x}return f.normalizeZ([y,v])[0]}multiplyAndAddUnsafe(m,g,y){const v=f.BASE,w=(x,k)=>k===zi||k===Zr||!x.equals(v)?x.multiplyUnsafe(k):x.multiply(k),A=w(this,g).add(w(m,y));return A.is0()?void 0:A}toAffine(m){const{px:g,py:y,pz:v}=this,w=this.is0();m==null&&(m=w?n.ONE:n.inv(v));const A=n.mul(g,m),x=n.mul(y,m),k=n.mul(v,m);if(w)return{x:n.ZERO,y:n.ZERO};if(!n.eql(k,n.ONE))throw new Error("invZ was invalid");return{x:A,y:x}}isTorsionFree(){const{h:m,isTorsionFree:g}=e;if(m===Zr)return!0;if(g)return g(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:g}=e;return m===Zr?this:g?g(f,this):this.multiplyUnsafe(e.h)}toRawBytes(m=!0){return this.assertValidity(),r(f,this,m)}toHex(m=!0){return Mc(this.toRawBytes(m))}}f.BASE=new f(e.Gx,e.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const d=e.nBitLength,h=Ere(f,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:i,isWithinCurveOrder:o}}function Ore(t){const e=lR(t);return Rh(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function _re(t){const e=Ore(t),{Fp:n,n:r}=e,s=n.BYTES+1,i=2*n.BYTES+1;function o(B){return zi<B&&B<n.ORDER}function a(B){return fr(B,r)}function l(B){return Vx(B,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:f,isWithinCurveOrder:d}=Dre({...e,toBytes(B,H,Q){const te=H.toAffine(),Z=n.toBytes(te.x),pe=Nh;return Q?pe(Uint8Array.from([H.hasEvenY()?2:3]),Z):pe(Uint8Array.from([4]),Z,n.toBytes(te.y))},fromBytes(B){const H=B.length,Q=B[0],te=B.subarray(1);if(H===s&&(Q===2||Q===3)){const Z=Sl(te);if(!o(Z))throw new Error("Point is not on curve");const pe=f(Z);let Ee=n.sqrt(pe);const Re=(Ee&Zr)===Zr;return(Q&1)===1!==Re&&(Ee=n.neg(Ee)),{x:Z,y:Ee}}else if(H===i&&Q===4){const Z=n.fromBytes(te.subarray(0,n.BYTES)),pe=n.fromBytes(te.subarray(n.BYTES,2*n.BYTES));return{x:Z,y:pe}}else throw new Error(`Point of length ${H} was invalid. Expected ${s} compressed bytes or ${i} uncompressed bytes`)}}),h=B=>Mc(Rc(B,e.nByteLength));function p(B){const H=r>>Zr;return B>H}function m(B){return p(B)?a(-B):B}const g=(B,H,Q)=>Sl(B.slice(H,Q));class y{constructor(H,Q,te){this.r=H,this.s=Q,this.recovery=te,this.assertValidity()}static fromCompact(H){const Q=e.nByteLength;return H=Cs("compactSignature",H,Q*2),new y(g(H,0,Q),g(H,Q,2*Q))}static fromDER(H){const{r:Q,s:te}=Dl.toSig(Cs("DER",H));return new y(Q,te)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(H){return new y(this.r,this.s,H)}recoverPublicKey(H){const{r:Q,s:te,recovery:Z}=this,pe=C(Cs("msgHash",H));if(Z==null||![0,1,2,3].includes(Z))throw new Error("recovery id invalid");const Ee=Z===2||Z===3?Q+e.n:Q;if(Ee>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const Re=Z&1?"03":"02",Ce=u.fromHex(Re+h(Ee)),ke=l(Ee),He=a(-pe*ke),Ue=a(te*ke),ze=u.BASE.multiplyAndAddUnsafe(Ce,He,Ue);if(!ze)throw new Error("point at infinify");return ze.assertValidity(),ze}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Nc(this.toDERHex())}toDERHex(){return Dl.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Nc(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(B){try{return c(B),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const B=aR(e.n);return xre(e.randomBytes(B),e.n)},precompute(B=8,H=u.BASE){return H._setWindowSize(B),H.multiply(BigInt(3)),H}};function w(B,H=!0){return u.fromPrivateKey(B).toRawBytes(H)}function A(B){const H=B instanceof Uint8Array,Q=typeof B=="string",te=(H||Q)&&B.length;return H?te===s||te===i:Q?te===2*s||te===2*i:B instanceof u}function x(B,H,Q=!0){if(A(B))throw new Error("first arg must be private key");if(!A(H))throw new Error("second arg must be public key");return u.fromHex(H).multiply(c(B)).toRawBytes(Q)}const k=e.bits2int||function(B){const H=Sl(B),Q=B.length*8-e.nBitLength;return Q>0?H>>BigInt(Q):H},C=e.bits2int_modN||function(B){return a(k(B))},O=Fx(e.nBitLength);function _(B){if(typeof B!="bigint")throw new Error("bigint expected");if(!(zi<=B&&B<O))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Rc(B,e.nByteLength)}function D(B,H,Q=R){if(["recovered","canonical"].some(tt=>tt in Q))throw new Error("sign() legacy options not supported");const{hash:te,randomBytes:Z}=e;let{lowS:pe,prehash:Ee,extraEntropy:Re}=Q;pe==null&&(pe=!0),B=Cs("msgHash",B),Ee&&(B=Cs("prehashed msgHash",te(B)));const Ce=C(B),ke=c(H),He=[_(ke),_(Ce)];if(Re!=null){const tt=Re===!0?Z(n.BYTES):Re;He.push(Cs("extraEntropy",tt))}const Ue=Nh(...He),ze=Ce;function Le(tt){const le=k(tt);if(!d(le))return;const $e=l(le),ae=u.BASE.multiply(le).toAffine(),be=a(ae.x);if(be===zi)return;const Be=a($e*a(ze+be*ke));if(Be===zi)return;let z=(ae.x===be?0:2)|Number(ae.y&Zr),q=Be;return pe&&p(Be)&&(q=m(Be),z^=1),new y(be,q,z)}return{seed:Ue,k2sig:Le}}const R={lowS:e.lowS,prehash:!1},L={lowS:e.lowS,prehash:!1};function F(B,H,Q=R){const{seed:te,k2sig:Z}=D(B,H,Q),pe=e;return nR(pe.hash.outputLen,pe.nByteLength,pe.hmac)(te,Z)}u.BASE._setWindowSize(8);function G(B,H,Q,te=L){var ae;const Z=B;if(H=Cs("msgHash",H),Q=Cs("publicKey",Q),"strict"in te)throw new Error("options.strict was renamed to lowS");const{lowS:pe,prehash:Ee}=te;let Re,Ce;try{if(typeof Z=="string"||Z instanceof Uint8Array)try{Re=y.fromDER(Z)}catch(be){if(!(be instanceof Dl.Err))throw be;Re=y.fromCompact(Z)}else if(typeof Z=="object"&&typeof Z.r=="bigint"&&typeof Z.s=="bigint"){const{r:be,s:Be}=Z;Re=new y(be,Be)}else throw new Error("PARSE");Ce=u.fromHex(Q)}catch(be){if(be.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(pe&&Re.hasHighS())return!1;Ee&&(H=e.hash(H));const{r:ke,s:He}=Re,Ue=C(H),ze=l(He),Le=a(Ue*ze),tt=a(ke*ze),le=(ae=u.BASE.multiplyAndAddUnsafe(Ce,Le,tt))==null?void 0:ae.toAffine();return le?a(le.x)===ke:!1}return{CURVE:e,getPublicKey:w,getSharedSecret:x,sign:F,verify:G,ProjectivePoint:u,Signature:y,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Mre(t){return{hash:t,hmac:(e,...n)=>N4(t,e,Cne(...n)),randomBytes:Sne}}function Nre(t,e){const n=r=>_re({...t,...Mre(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const cR=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),fR=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Rre=BigInt(1),zx=BigInt(2),dR=(t,e)=>(t+e/zx)/e;function Pre(t){const e=cR,n=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),l=BigInt(88),u=t*t*t%e,c=u*u*t%e,f=Xr(c,n,e)*c%e,d=Xr(f,n,e)*c%e,h=Xr(d,zx,e)*u%e,p=Xr(h,s,e)*h%e,m=Xr(p,i,e)*p%e,g=Xr(m,a,e)*m%e,y=Xr(g,l,e)*g%e,v=Xr(y,a,e)*m%e,w=Xr(v,n,e)*c%e,A=Xr(w,o,e)*p%e,x=Xr(A,r,e)*u%e,k=Xr(x,zx,e);if(!$x.eql($x.sqr(k),t))throw new Error("Cannot find square root");return k}const $x=vre(cR,void 0,void 0,{sqrt:Pre}),sa=Nre({a:BigInt(0),b:BigInt(7),Fp:$x,n:fR,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=fR,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Rre*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,o=BigInt("0x100000000000000000000000000000000"),a=dR(i*t,e),l=dR(-r*t,e);let u=fr(t-a*n-l*s,e),c=fr(-a*r-l*i,e);const f=u>o,d=c>o;if(f&&(u=e-u),d&&(c=e-c),u>o||c>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:u,k2neg:d,k2:c}}}},P4);BigInt(0),sa.ProjectivePoint;const Ph="0x0000000000000000000000000000000000000000",hR="0x0000000000000000000000000000000000000000000000000000000000000000",pR=BigInt(0),mR=BigInt(1),gR=BigInt(2),yR=BigInt(27),bR=BigInt(28),ny=BigInt(35),Pc={};function wR(t){return xl(Wn(t),32)}const Ms=class Ms{constructor(e,n,r,s){J(this,cf);J(this,ff);J(this,df);J(this,eu);$g(e,Pc,"Signature"),I(this,cf,n),I(this,ff,r),I(this,df,s),I(this,eu,null)}get r(){return T(this,cf)}set r(e){$(Cc(e)===32,"invalid r","value",e),I(this,cf,we(e))}get s(){return T(this,ff)}set s(e){$(Cc(e)===32,"invalid s","value",e);const n=we(e);$(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),I(this,ff,n)}get v(){return T(this,df)}set v(e){const n=Qe(e,"value");$(n===27||n===28,"invalid v","v",e),I(this,df,n)}get networkV(){return T(this,eu)}get legacyChainId(){const e=this.networkV;return e==null?null:Ms.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=ct(this.s);return this.yParity&&(e[0]|=128),we(e)}get compactSerialized(){return $t([this.r,this.yParityAndS])}get serialized(){return $t([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new Ms(Pc,this.r,this.s,this.v);return this.networkV&&I(e,eu,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const n=xe(e,"v");return n==yR||n==bR?pR:($(n>=ny,"invalid EIP-155 v","v",e),(n-ny)/gR)}static getChainIdV(e,n){return xe(e)*gR+BigInt(35+n-27)}static getNormalizedV(e){const n=xe(e);return n===pR||n===yR?27:n===mR||n===bR?28:($(n>=ny,"invalid v","v",e),n&mR?27:28)}static from(e){function n(u,c){$(u,c,"signature",e)}if(e==null)return new Ms(Pc,hR,hR,27);if(typeof e=="string"){const u=ct(e,"signature");if(u.length===64){const c=we(u.slice(0,32)),f=u.slice(32,64),d=f[0]&128?28:27;return f[0]&=127,new Ms(Pc,c,we(f),d)}if(u.length===65){const c=we(u.slice(0,32)),f=u.slice(32,64);n((f[0]&128)===0,"non-canonical s");const d=Ms.getNormalizedV(u[64]);return new Ms(Pc,c,we(f),d)}n(!1,"invalid raw signature length")}if(e instanceof Ms)return e.clone();const r=e.r;n(r!=null,"missing r");const s=wR(r),i=function(u,c){if(u!=null)return wR(u);if(c!=null){n(St(c,32),"invalid yParityAndS");const f=ct(c);return f[0]&=127,we(f)}n(!1,"missing s")}(e.s,e.yParityAndS);n((ct(i)[0]&128)==0,"non-canonical s");const{networkV:o,v:a}=function(u,c,f){if(u!=null){const d=xe(u);return{networkV:d>=ny?d:void 0,v:Ms.getNormalizedV(d)}}if(c!=null)return n(St(c,32),"invalid yParityAndS"),{v:ct(c)[0]&128?28:27};if(f!=null){switch(Qe(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new Ms(Pc,s,i,a);return o&&I(l,eu,o),n(e.yParity==null||Qe(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}};cf=new WeakMap,ff=new WeakMap,df=new WeakMap,eu=new WeakMap;let Ss=Ms;const tu=class tu{constructor(e){J(this,oo);$(Cc(e)===32,"invalid private key","privateKey","[REDACTED]"),I(this,oo,we(e))}get privateKey(){return T(this,oo)}get publicKey(){return tu.computePublicKey(T(this,oo))}get compressedPublicKey(){return tu.computePublicKey(T(this,oo),!0)}sign(e){$(Cc(e)===32,"invalid digest length","digest",e);const n=sa.sign(Gn(e),Gn(T(this,oo)),{lowS:!0});return Ss.from({r:Xo(n.r,32),s:Xo(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=tu.computePublicKey(e);return we(sa.getSharedSecret(Gn(T(this,oo)),ct(n),!1))}static computePublicKey(e,n){let r=ct(e,"key");if(r.length===32){const i=sa.getPublicKey(r,!!n);return we(i)}if(r.length===64){const i=new Uint8Array(65);i[0]=4,i.set(r,1),r=i}const s=sa.ProjectivePoint.fromHex(r);return we(s.toRawBytes(n))}static recoverPublicKey(e,n){$(Cc(e)===32,"invalid digest length","digest",e);const r=Ss.from(n);let s=sa.Signature.fromCompact(Gn($t([r.r,r.s])));s=s.addRecoveryBit(r.yParity);const i=s.recoverPublicKey(Gn(e));return $(i!=null,"invalid signautre for digest","signature",n),"0x"+i.toHex(!1)}static addPoints(e,n,r){const s=sa.ProjectivePoint.fromHex(tu.computePublicKey(e).substring(2)),i=sa.ProjectivePoint.fromHex(tu.computePublicKey(n).substring(2));return"0x"+s.add(i).toHex(!!r)}};oo=new WeakMap;let Ih=tu;const Ire=BigInt(0),Lre=BigInt(36);function AR(t){t=t.toLowerCase();const e=t.substring(2).split(""),n=new Uint8Array(40);for(let s=0;s<40;s++)n[s]=e[s].charCodeAt(0);const r=ct(en(n));for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(r[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}const Gx={};for(let t=0;t<10;t++)Gx[String(t)]=String(t);for(let t=0;t<26;t++)Gx[String.fromCharCode(65+t)]=String(10+t);const vR=15;function Bre(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>Gx[r]).join("");for(;e.length>=vR;){let r=e.substring(0,vR);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const Fre=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function jre(t){t=t.toLowerCase();let e=Ire;for(let n=0;n<t.length;n++)e=e*Lre+Fre[t[n]];return e}function gt(t){if($(typeof t=="string","invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=AR(t);return $(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){$(t.substring(2,4)===Bre(t),"bad icap checksum","address",t);let e=jre(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return AR("0x"+e)}$(!1,"invalid address","address",t)}function Ure(t){const e=gt(t.from);let r=xe(t.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,gt(Ht(en(El([e,r])),12))}function xR(t){return t&&typeof t.getAddress=="function"}function Vre(t){try{return gt(t),!0}catch{}return!1}async function Wx(t,e){const n=await e;return(n==null||n==="0x0000000000000000000000000000000000000000")&&(ee(typeof t!="string","unconfigured name","UNCONFIGURED_NAME",{value:t}),$(!1,"invalid AddressLike value; did not resolve to a value address","target",t)),gt(n)}function Qn(t,e){if(typeof t=="string")return t.match(/^0x[0-9a-f]{40}$/i)?gt(t):(ee(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),Wx(t,e.resolveName(t)));if(xR(t))return Wx(t,t.getAddress());if(t&&typeof t.then=="function")return Wx(t,t);$(!1,"unsupported addressable value","target",t)}const $i={};function Ae(t,e){let n=!1;return e<0&&(n=!0,e*=-1),new Rn($i,`${n?"":"u"}int${e}`,t,{signed:n,width:e})}function dt(t,e){return new Rn($i,`bytes${e||""}`,t,{size:e})}const kR=Symbol.for("_ethers_typed"),ao=class ao{constructor(e,n,r,s){W(this,"type");W(this,"value");J(this,nu);W(this,"_typedSymbol");s==null&&(s=null),$g($i,e,"Typed"),Oe(this,{_typedSymbol:kR,type:n,value:r}),I(this,nu,s),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return T(this,nu)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return T(this,nu)===!0?-1:T(this,nu)===!1?this.value.length:null}static from(e,n){return new ao($i,e,n)}static uint8(e){return Ae(e,8)}static uint16(e){return Ae(e,16)}static uint24(e){return Ae(e,24)}static uint32(e){return Ae(e,32)}static uint40(e){return Ae(e,40)}static uint48(e){return Ae(e,48)}static uint56(e){return Ae(e,56)}static uint64(e){return Ae(e,64)}static uint72(e){return Ae(e,72)}static uint80(e){return Ae(e,80)}static uint88(e){return Ae(e,88)}static uint96(e){return Ae(e,96)}static uint104(e){return Ae(e,104)}static uint112(e){return Ae(e,112)}static uint120(e){return Ae(e,120)}static uint128(e){return Ae(e,128)}static uint136(e){return Ae(e,136)}static uint144(e){return Ae(e,144)}static uint152(e){return Ae(e,152)}static uint160(e){return Ae(e,160)}static uint168(e){return Ae(e,168)}static uint176(e){return Ae(e,176)}static uint184(e){return Ae(e,184)}static uint192(e){return Ae(e,192)}static uint200(e){return Ae(e,200)}static uint208(e){return Ae(e,208)}static uint216(e){return Ae(e,216)}static uint224(e){return Ae(e,224)}static uint232(e){return Ae(e,232)}static uint240(e){return Ae(e,240)}static uint248(e){return Ae(e,248)}static uint256(e){return Ae(e,256)}static uint(e){return Ae(e,256)}static int8(e){return Ae(e,-8)}static int16(e){return Ae(e,-16)}static int24(e){return Ae(e,-24)}static int32(e){return Ae(e,-32)}static int40(e){return Ae(e,-40)}static int48(e){return Ae(e,-48)}static int56(e){return Ae(e,-56)}static int64(e){return Ae(e,-64)}static int72(e){return Ae(e,-72)}static int80(e){return Ae(e,-80)}static int88(e){return Ae(e,-88)}static int96(e){return Ae(e,-96)}static int104(e){return Ae(e,-104)}static int112(e){return Ae(e,-112)}static int120(e){return Ae(e,-120)}static int128(e){return Ae(e,-128)}static int136(e){return Ae(e,-136)}static int144(e){return Ae(e,-144)}static int152(e){return Ae(e,-152)}static int160(e){return Ae(e,-160)}static int168(e){return Ae(e,-168)}static int176(e){return Ae(e,-176)}static int184(e){return Ae(e,-184)}static int192(e){return Ae(e,-192)}static int200(e){return Ae(e,-200)}static int208(e){return Ae(e,-208)}static int216(e){return Ae(e,-216)}static int224(e){return Ae(e,-224)}static int232(e){return Ae(e,-232)}static int240(e){return Ae(e,-240)}static int248(e){return Ae(e,-248)}static int256(e){return Ae(e,-256)}static int(e){return Ae(e,-256)}static bytes1(e){return dt(e,1)}static bytes2(e){return dt(e,2)}static bytes3(e){return dt(e,3)}static bytes4(e){return dt(e,4)}static bytes5(e){return dt(e,5)}static bytes6(e){return dt(e,6)}static bytes7(e){return dt(e,7)}static bytes8(e){return dt(e,8)}static bytes9(e){return dt(e,9)}static bytes10(e){return dt(e,10)}static bytes11(e){return dt(e,11)}static bytes12(e){return dt(e,12)}static bytes13(e){return dt(e,13)}static bytes14(e){return dt(e,14)}static bytes15(e){return dt(e,15)}static bytes16(e){return dt(e,16)}static bytes17(e){return dt(e,17)}static bytes18(e){return dt(e,18)}static bytes19(e){return dt(e,19)}static bytes20(e){return dt(e,20)}static bytes21(e){return dt(e,21)}static bytes22(e){return dt(e,22)}static bytes23(e){return dt(e,23)}static bytes24(e){return dt(e,24)}static bytes25(e){return dt(e,25)}static bytes26(e){return dt(e,26)}static bytes27(e){return dt(e,27)}static bytes28(e){return dt(e,28)}static bytes29(e){return dt(e,29)}static bytes30(e){return dt(e,30)}static bytes31(e){return dt(e,31)}static bytes32(e){return dt(e,32)}static address(e){return new ao($i,"address",e)}static bool(e){return new ao($i,"bool",!!e)}static bytes(e){return new ao($i,"bytes",e)}static string(e){return new ao($i,"string",e)}static array(e,n){throw new Error("not implemented yet")}static tuple(e,n){throw new Error("not implemented yet")}static overrides(e){return new ao($i,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===kR}static dereference(e,n){if(ao.isTyped(e)){if(e.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${e.type}`);return e.value}return e}};nu=new WeakMap;let Rn=ao;class Hre extends Hi{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){let r=Rn.dereference(n,"string");try{r=gt(r)}catch(s){return this._throwError(s.message,n)}return e.writeValue(r)}decode(e){return gt(Xo(e.readValue(),20))}}class zre extends Hi{constructor(n){super(n.name,n.type,"_",n.dynamic);W(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}}function ER(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let l={};r=e.map(u=>{const c=u.localName;return ee(c,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:n}),ee(!l[c],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:n}),l[c]=!0,n[c]})}else $(!1,"invalid tuple value","tuple",n);$(e.length===r.length,"types/value length mismatch","tuple",n);let s=new Sx,i=new Sx,o=[];e.forEach((l,u)=>{let c=r[u];if(l.dynamic){let f=i.length;l.encode(i,c);let d=s.writeUpdatableValue();o.push(h=>{d(h+f)})}else l.encode(s,c)}),o.forEach(l=>{l(s.length)});let a=t.appendWriter(s);return a+=t.appendWriter(i),a}function CR(t,e){let n=[],r=[],s=t.subReader(0);return e.forEach(i=>{let o=null;if(i.dynamic){let a=t.readIndex(),l=s.subReader(a);try{o=i.decode(l)}catch(u){if(gn(u,"BUFFER_OVERRUN"))throw u;o=u,o.baseType=i.name,o.name=i.localName,o.type=i.type}}else try{o=i.decode(t)}catch(a){if(gn(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=i.name,o.name=i.localName,o.type=i.type}if(o==null)throw new Error("investigate");n.push(o),r.push(i.localName||null)}),Dc.fromItems(n,r)}class $re extends Hi{constructor(n,r,s){const i=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",i,s,o);W(this,"coder");W(this,"length");Oe(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let s=0;s<this.length;s++)r.push(n);return r}encode(n,r){const s=Rn.dereference(r,"array");Array.isArray(s)||this._throwError("expected array value",s);let i=this.length;i===-1&&(i=s.length,n.writeValue(s.length)),s4(s.length,i,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let a=0;a<s.length;a++)o.push(this.coder);return ER(n,o,s)}decode(n){let r=this.length;r===-1&&(r=n.readIndex(),ee(r*qn<=n.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:n.bytes,offset:r*qn,length:n.dataLength}));let s=[];for(let i=0;i<r;i++)s.push(new zre(this.coder));return CR(n,s)}}class Gre extends Hi{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,n){const r=Rn.dereference(n,"bool");return e.writeValue(r?1:0)}decode(e){return!!e.readValue()}}class SR extends Hi{constructor(e,n){super(e,e,n,!0)}defaultValue(){return"0x"}encode(e,n){n=Gn(n);let r=e.writeValue(n.length);return r+=e.writeBytes(n),r}decode(e){return e.readBytes(e.readIndex(),!0)}}class Wre extends SR{constructor(e){super("bytes",e)}decode(e){return we(super.decode(e))}}class Kre extends Hi{constructor(n,r){let s="bytes"+String(n);super(s,s,r,!1);W(this,"size");Oe(this,{size:n},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(n,r){let s=Gn(Rn.dereference(r,this.type));return s.length!==this.size&&this._throwError("incorrect data length",r),n.writeBytes(s)}decode(n){return we(n.readBytes(this.size))}}const qre=new Uint8Array([]);class Qre extends Hi{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,n){return n!=null&&this._throwError("not null",n),e.writeBytes(qre)}decode(e){return e.readBytes(0),null}}const Jre=BigInt(0),Yre=BigInt(1),Xre=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class Zre extends Hi{constructor(n,r,s){const i=(r?"int":"uint")+n*8;super(i,i,s,!1);W(this,"size");W(this,"signed");Oe(this,{size:n,signed:r},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(n,r){let s=xe(Rn.dereference(r,this.type)),i=Oh(Xre,qn*8);if(this.signed){let o=Oh(i,this.size*8-1);(s>o||s<-(o+Yre))&&this._throwError("value out-of-bounds",r),s=l4(s,8*qn)}else(s<Jre||s>Oh(i,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(s)}decode(n){let r=Oh(n.readValue(),this.size*8);return this.signed&&(r=rne(r,this.size*8)),r}}class ese extends SR{constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,Vi(Rn.dereference(n,"string")))}decode(e){return Tc(super.decode(e))}}class ry extends Hi{constructor(n,r){let s=!1;const i=[];n.forEach(a=>{a.dynamic&&(s=!0),i.push(a.type)});const o="tuple("+i.join(",")+")";super("tuple",o,r,s);W(this,"coders");Oe(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(s=>{n.push(s.defaultValue())});const r=this.coders.reduce((s,i)=>{const o=i.localName;return o&&(s[o]||(s[o]=0),s[o]++),s},{});return this.coders.forEach((s,i)=>{let o=s.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[i]))}),Object.freeze(n)}encode(n,r){const s=Rn.dereference(r,"tuple");return ER(n,this.coders,s)}decode(n){return CR(n,this.coders)}}function Ol(t){return en(Vi(t))}var tse="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";const TR=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),DR=4;function nse(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),s=1,i=[0,1];for(let x=1;x<r;x++)i.push(s+=n());let o=n(),a=e;e+=o;let l=0,u=0;function c(){return l==0&&(u=u<<8|t[e++],l=8),u>>--l&1}const f=31,d=2**f,h=d>>>1,p=h>>1,m=d-1;let g=0;for(let x=0;x<f;x++)g=g<<1|c();let y=[],v=0,w=d;for(;;){let x=Math.floor(((g-v+1)*s-1)/w),k=0,C=r;for(;C-k>1;){let D=k+C>>>1;x<i[D]?C=D:k=D}if(k==0)break;y.push(k);let O=v+Math.floor(w*i[k]/s),_=v+Math.floor(w*i[k+1]/s)-1;for(;!((O^_)&h);)g=g<<1&m|c(),O=O<<1&m,_=_<<1&m|1;for(;O&~_&p;)g=g&h|g<<1&m>>>1|c(),O=O<<1^h,_=(_^h)<<1|h|1;v=O,w=1+_-O}let A=r-4;return y.map(x=>{switch(x-A){case 3:return A+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return A+256+(t[a++]<<8|t[a++]);case 1:return A+t[a++];default:return x-1}})}function rse(t){let e=0;return()=>t[e++]}function OR(t){return rse(nse(sse(t)))}function sse(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,i)=>e[s.charCodeAt(0)]=i);let n=t.length,r=new Uint8Array(6*n>>3);for(let s=0,i=0,o=0,a=0;s<n;s++)a=a<<6|e[t.charCodeAt(s)],o+=6,o>=8&&(r[i++]=a>>(o-=8));return r}function ise(t){return t&1?~t>>1:t>>1}function ose(t,e){let n=Array(t);for(let r=0,s=0;r<t;r++)n[r]=s+=ise(e());return n}function Lh(t,e=0){let n=[];for(;;){let r=t(),s=t();if(!s)break;e+=r;for(let i=0;i<s;i++)n.push(e+i);e+=s+1}return n}function _R(t){return Bh(()=>{let e=Lh(t);if(e.length)return e})}function MR(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(ase(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(lse(n,t))}return e.flat()}function Bh(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function NR(t,e,n){let r=Array(t).fill().map(()=>[]);for(let s=0;s<e;s++)ose(t,n).forEach((i,o)=>r[o].push(i));return r}function ase(t,e){let n=1+e(),r=e(),s=Bh(e);return NR(s.length,1+t,e).flatMap((o,a)=>{let[l,...u]=o;return Array(s[a]).fill().map((c,f)=>{let d=f*r;return[l+f*n,u.map(h=>h+d)]})})}function lse(t,e){let n=1+e();return NR(n,1+t,e).map(s=>[s[0],s.slice(1)])}function use(t){let e=[],n=Lh(t);return s(r([]),[]),e;function r(i){let o=t(),a=Bh(()=>{let l=Lh(t).map(u=>n[u]);if(l.length)return r(l)});return{S:o,B:a,Q:i}}function s({S:i,B:o},a,l){if(!(i&4&&l===a[a.length-1])){i&2&&(l=a[a.length-1]),i&1&&e.push(a);for(let u of o)for(let c of u.Q)s(u,[...a,c],l)}}}function cse(t){return t.toString(16).toUpperCase().padStart(2,"0")}function RR(t){return`{${cse(t)}}`}function fse(t){let e=[];for(let n=0,r=t.length;n<r;){let s=t.codePointAt(n);n+=s<65536?1:2,e.push(s)}return e}function Ic(t){let n=t.length;if(n<4096)return String.fromCodePoint(...t);let r=[];for(let s=0;s<n;)r.push(String.fromCodePoint(...t.slice(s,s+=4096)));return r.join("")}function dse(t,e){let n=t.length,r=n-e.length;for(let s=0;r==0&&s<n;s++)r=t[s]-e[s];return r}var hse="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";const Fh=44032,sy=4352,iy=4449,oy=4519,PR=19,IR=21,Lc=28,ay=IR*Lc,pse=PR*ay,mse=Fh+pse,gse=sy+PR,yse=iy+IR,bse=oy+Lc;function jh(t){return t>>24&255}function LR(t){return t&16777215}let Kx,BR,qx,ly;function wse(){let t=OR(hse);Kx=new Map(_R(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),BR=new Set(Lh(t)),qx=new Map,ly=new Map;for(let[e,n]of MR(t)){if(!BR.has(e)&&n.length==2){let[r,s]=n,i=ly.get(r);i||(i=new Map,ly.set(r,i)),i.set(s,e)}qx.set(e,n.reverse())}}function FR(t){return t>=Fh&&t<mse}function Ase(t,e){if(t>=sy&&t<gse&&e>=iy&&e<yse)return Fh+(t-sy)*ay+(e-iy)*Lc;if(FR(t)&&e>oy&&e<bse&&(t-Fh)%Lc==0)return t+(e-oy);{let n=ly.get(t);return n&&(n=n.get(e),n)?n:-1}}function jR(t){Kx||wse();let e=[],n=[],r=!1;function s(i){let o=Kx.get(i);o&&(r=!0,i|=o),e.push(i)}for(let i of t)for(;;){if(i<128)e.push(i);else if(FR(i)){let o=i-Fh,a=o/ay|0,l=o%ay/Lc|0,u=o%Lc;s(sy+a),s(iy+l),u>0&&s(oy+u)}else{let o=qx.get(i);o?n.push(...o):s(i)}if(!n.length)break;i=n.pop()}if(r&&e.length>1){let i=jh(e[0]);for(let o=1;o<e.length;o++){let a=jh(e[o]);if(a==0||i<=a){i=a;continue}let l=o-1;for(;;){let u=e[l+1];if(e[l+1]=e[l],e[l]=u,!l||(i=jh(e[--l]),i<=a))break}i=jh(e[o])}}return e}function vse(t){let e=[],n=[],r=-1,s=0;for(let i of t){let o=jh(i),a=LR(i);if(r==-1)o==0?r=a:e.push(a);else if(s>0&&s>=o)o==0?(e.push(r,...n),n.length=0,r=a):n.push(a),s=o;else{let l=Ase(r,a);l>=0?r=l:s==0&&o==0?(e.push(r),r=a):(n.push(a),s=o)}}return r>=0&&e.push(r,...n),e}function UR(t){return jR(t).map(LR)}function xse(t){return vse(jR(t))}const VR=45,HR=".",zR=65039,$R=1,uy=t=>Array.from(t);function Uh(t,e){return t.P.has(e)||t.Q.has(e)}class kse extends Array{get is_emoji(){return!0}}let Qx,GR,_l,Jx,WR,Bc,Yx,Fc,Ml,KR,Xx;function Zx(){if(Qx)return;let t=OR(tse);const e=()=>Lh(t),n=()=>new Set(e()),r=(c,f)=>f.forEach(d=>c.add(d));Qx=new Map(MR(t)),GR=n(),_l=e(),Jx=new Set(e().map(c=>_l[c])),_l=new Set(_l),WR=n(),n();let s=_R(t),i=t();const o=()=>{let c=new Set;return e().forEach(f=>r(c,s[f])),r(c,e()),c};Bc=Bh(c=>{let f=Bh(t).map(d=>d+96);if(f.length){let d=c>=i;f[0]-=32,f=Ic(f),d&&(f=`Restricted[${f}]`);let h=o(),p=o(),m=!t();return{N:f,P:h,Q:p,M:m,R:d}}}),Yx=n(),Fc=new Map;let a=e().concat(uy(Yx)).sort((c,f)=>c-f);a.forEach((c,f)=>{let d=t(),h=a[f]=d?a[f-d]:{V:[],M:new Map};h.V.push(c),Yx.has(c)||Fc.set(c,h)});for(let{V:c,M:f}of new Set(Fc.values())){let d=[];for(let p of c){let m=Bc.filter(y=>Uh(y,p)),g=d.find(({G:y})=>m.some(v=>y.has(v)));g||(g={G:new Set,V:[]},d.push(g)),g.V.push(p),r(g.G,m)}let h=d.flatMap(p=>uy(p.G));for(let{G:p,V:m}of d){let g=new Set(h.filter(y=>!p.has(y)));for(let y of m)f.set(y,g)}}Ml=new Set;let l=new Set;const u=c=>Ml.has(c)?l.add(c):Ml.add(c);for(let c of Bc){for(let f of c.P)u(f);for(let f of c.Q)u(f)}for(let c of Ml)!Fc.has(c)&&!l.has(c)&&Fc.set(c,$R);r(Ml,UR(Ml)),KR=use(t).map(c=>kse.from(c)).sort(dse),Xx=new Map;for(let c of KR){let f=[Xx];for(let d of c){let h=f.map(p=>{let m=p.get(d);return m||(m=new Map,p.set(d,m)),m});d===zR?f.push(...h):f=h}for(let d of f)d.V=c}}function e2(t){return(qR(t)?"":`${t2(cy([t]))} `)+RR(t)}function t2(t){return`"${t}"`}function Ese(t){if(t.length>=4&&t[2]==VR&&t[3]==VR)throw new Error(`invalid label extension: "${Ic(t.slice(0,4))}"`)}function Cse(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function Sse(t){let e=t[0],n=TR.get(e);if(n)throw Vh(`leading ${n}`);let r=t.length,s=-1;for(let i=1;i<r;i++){e=t[i];let o=TR.get(e);if(o){if(s==i)throw Vh(`${n} + ${o}`);s=i+1,n=o}}if(s==r)throw Vh(`trailing ${n}`)}function cy(t,e=1/0,n=RR){let r=[];Tse(t[0])&&r.push("◌"),t.length>e&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let s=0,i=t.length;for(let o=0;o<i;o++){let a=t[o];qR(a)&&(r.push(Ic(t.slice(s,o))),r.push(n(a)),s=o+1)}return r.push(Ic(t.slice(s,i))),r.join("")}function Tse(t){return Zx(),_l.has(t)}function qR(t){return Zx(),WR.has(t)}function Dse(t){return Nse(Ose(t,xse,Ise))}function Ose(t,e,n){if(!t)return[];Zx();let r=0;return t.split(HR).map(s=>{let i=fse(s),o={input:i,offset:r};r+=i.length+1;try{let a=o.tokens=Pse(i,e,n),l=a.length,u;if(!l)throw new Error("empty label");let c=o.output=a.flat();if(Cse(c),!(o.emoji=l>1||a[0].is_emoji)&&c.every(d=>d<128))Ese(c),u="ASCII";else{let d=a.flatMap(h=>h.is_emoji?[]:h);if(!d.length)u="Emoji";else{if(_l.has(c[0]))throw Vh("leading combining mark");for(let m=1;m<l;m++){let g=a[m];if(!g.is_emoji&&_l.has(g[0]))throw Vh(`emoji + combining mark: "${Ic(a[m-1])} + ${cy([g[0]])}"`)}Sse(c);let h=uy(new Set(d)),[p]=Mse(h);Rse(p,d),_se(p,h),u=p.N}}o.type=u}catch(a){o.error=a}return o})}function _se(t,e){let n,r=[];for(let s of e){let i=Fc.get(s);if(i===$R)return;if(i){let o=i.M.get(s);if(n=n?n.filter(a=>o.has(a)):uy(o),!n.length)return}else r.push(s)}if(n){for(let s of n)if(r.every(i=>Uh(s,i)))throw new Error(`whole-script confusable: ${t.N}/${s.N}`)}}function Mse(t){let e=Bc;for(let n of t){let r=e.filter(s=>Uh(s,n));if(!r.length)throw Bc.some(s=>Uh(s,n))?JR(e[0],n):QR(n);if(e=r,r.length==1)break}return e}function Nse(t){return t.map(({input:e,error:n,output:r})=>{if(n){let s=n.message;throw new Error(t.length==1?s:`Invalid label ${t2(cy(e,63))}: ${s}`)}return Ic(r)}).join(HR)}function QR(t){return new Error(`disallowed character: ${e2(t)}`)}function JR(t,e){let n=e2(e),r=Bc.find(s=>s.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function Vh(t){return new Error(`illegal placement: ${t}`)}function Rse(t,e){for(let n of e)if(!Uh(t,n))throw JR(t,n);if(t.M){let n=UR(e);for(let r=1,s=n.length;r<s;r++)if(Jx.has(n[r])){let i=r+1;for(let o;i<s&&Jx.has(o=n[i]);i++)for(let a=r;a<i;a++)if(n[a]==o)throw new Error(`duplicate non-spacing marks: ${e2(o)}`);if(i-r>DR)throw new Error(`excessive non-spacing marks: ${t2(cy(n.slice(r-1,i)))} (${i-r}/${DR})`);r=i}}}function Pse(t,e,n){let r=[],s=[];for(t=t.slice().reverse();t.length;){let i=Lse(t);if(i)s.length&&(r.push(e(s)),s=[]),r.push(n(i));else{let o=t.pop();if(Ml.has(o))s.push(o);else{let a=Qx.get(o);if(a)s.push(...a);else if(!GR.has(o))throw QR(o)}}}return s.length&&r.push(e(s)),r}function Ise(t){return t.filter(e=>e!=zR)}function Lse(t,e){let n=Xx,r,s=t.length;for(;s&&(n=n.get(t[--s]),!!n);){let{V:i}=n;i&&(r=i,t.length=s)}return r}const YR=new Uint8Array(32);YR.fill(0);function XR(t){return $(t.length!==0,"invalid ENS name; empty component","comp",t),t}function ZR(t){const e=Vi(Bse(t)),n=[];if(t.length===0)return n;let r=0;for(let s=0;s<e.length;s++)e[s]===46&&(n.push(XR(e.slice(r,s))),r=s+1);return $(r<e.length,"invalid ENS name; empty component","name",t),n.push(XR(e.slice(r))),n}function Bse(t){try{if(t.length===0)throw new Error("empty label");return Dse(t)}catch(e){$(!1,`invalid ENS name (${e.message})`,"name",t)}}function n2(t){$(typeof t=="string","invalid ENS name; not a string","name",t),$(t.length,"invalid ENS name (empty label)","name",t);let e=YR;const n=ZR(t);for(;n.length;)e=en($t([e,en(n.pop())]));return we(e)}function Fse(t,e){const n=e;return $(n<=255,"DNS encoded label cannot exceed 255","length",n),we($t(ZR(t).map(r=>{$(r.length<=n,`label ${JSON.stringify(t)} exceeds ${n} bytes`,"name",t);const s=new Uint8Array(r.length+1);return s.set(r,1),s[0]=s.length-1,s})))+"00"}function r2(t,e){return{address:gt(t),storageKeys:e.map((n,r)=>($(St(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function ia(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?($(n.length===2,"invalid slot set",`value[${r}]`,n),r2(n[0],n[1])):($(n!=null&&typeof n=="object","invalid address-slot set","value",t),r2(n.address,n.storageKeys)));$(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(n=>{const r=t[n].reduce((s,i)=>(s[i]=!0,s),{});return r2(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function jse(t){let e;return typeof t=="string"?e=Ih.computePublicKey(t,!1):e=t.publicKey,gt(en("0x"+e.substring(4)).substring(26))}function Use(t,e){return jse(Ih.recoverPublicKey(t,e))}const bn=BigInt(0),Vse=BigInt(2),Hse=BigInt(27),zse=BigInt(28),$se=BigInt(35),Gse=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),s2=4096*32;function eP(t,e){let n=t.toString(16);for(;n.length<2;)n="0"+n;return n+=_c(e).substring(4),"0x"+n}function fy(t){return t==="0x"?null:gt(t)}function i2(t,e){try{return ia(t)}catch(n){$(!1,n.message,e,t)}}function Hh(t,e){return t==="0x"?0:Qe(t,e)}function Wt(t,e){if(t==="0x")return bn;const n=xe(t,e);return $(n<=Gse,"value exceeds uint size",e,n),n}function Ot(t,e){const n=xe(t,"value"),r=Wn(n);return $(r.length<=32,"value too large",`tx.${e}`,n),r}function o2(t){return ia(t).map(e=>[e.address,e.storageKeys])}function Wse(t,e){$(Array.isArray(t),`invalid ${e}`,"value",t);for(let n=0;n<t.length;n++)$(St(t[n],32),"invalid ${ param } hash",`value[${n}]`,t[n]);return t}function Kse(t){const e=Qg(t);$(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const n={type:0,nonce:Hh(e[0],"nonce"),gasPrice:Wt(e[1],"gasPrice"),gasLimit:Wt(e[2],"gasLimit"),to:fy(e[3]),value:Wt(e[4],"value"),data:we(e[5]),chainId:bn};if(e.length===6)return n;const r=Wt(e[6],"v"),s=Wt(e[7],"r"),i=Wt(e[8],"s");if(s===bn&&i===bn)n.chainId=r;else{let o=(r-$se)/Vse;o<bn&&(o=bn),n.chainId=o,$(o!==bn||r===Hse||r===zse,"non-canonical legacy v","v",e[6]),n.signature=Ss.from({r:xl(e[7],32),s:xl(e[8],32),v:r})}return n}function qse(t,e){const n=[Ot(t.nonce,"nonce"),Ot(t.gasPrice||0,"gasPrice"),Ot(t.gasLimit,"gasLimit"),t.to||"0x",Ot(t.value,"value"),t.data];let r=bn;if(t.chainId!=bn)r=xe(t.chainId,"tx.chainId"),$(!e||e.networkV==null||e.legacyChainId===r,"tx.chainId/sig.v mismatch","sig",e);else if(t.signature){const i=t.signature.legacyChainId;i!=null&&(r=i)}if(!e)return r!==bn&&(n.push(Wn(r)),n.push("0x"),n.push("0x")),El(n);let s=BigInt(27+e.yParity);return r!==bn?s=Ss.getChainIdV(r,e.v):BigInt(e.v)!==s&&$(!1,"tx.chainId/sig.v mismatch","sig",e),n.push(Wn(s)),n.push(Wn(e.r)),n.push(Wn(e.s)),El(n)}function a2(t,e){let n;try{if(n=Hh(e[0],"yParity"),n!==0&&n!==1)throw new Error("bad yParity")}catch{$(!1,"invalid yParity","yParity",e[0])}const r=xl(e[1],32),s=xl(e[2],32),i=Ss.from({r,s,yParity:n});t.signature=i}function Qse(t){const e=Qg(ct(t).slice(1));$(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",we(t));const n={type:2,chainId:Wt(e[0],"chainId"),nonce:Hh(e[1],"nonce"),maxPriorityFeePerGas:Wt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Wt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Wt(e[4],"gasLimit"),to:fy(e[5]),value:Wt(e[6],"value"),data:we(e[7]),accessList:i2(e[8],"accessList")};return e.length===9||a2(n,e.slice(9)),n}function Jse(t,e){const n=[Ot(t.chainId,"chainId"),Ot(t.nonce,"nonce"),Ot(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Ot(t.maxFeePerGas||0,"maxFeePerGas"),Ot(t.gasLimit,"gasLimit"),t.to||"0x",Ot(t.value,"value"),t.data,o2(t.accessList||[])];return e&&(n.push(Ot(e.yParity,"yParity")),n.push(Wn(e.r)),n.push(Wn(e.s))),$t(["0x02",El(n)])}function Yse(t){const e=Qg(ct(t).slice(1));$(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",we(t));const n={type:1,chainId:Wt(e[0],"chainId"),nonce:Hh(e[1],"nonce"),gasPrice:Wt(e[2],"gasPrice"),gasLimit:Wt(e[3],"gasLimit"),to:fy(e[4]),value:Wt(e[5],"value"),data:we(e[6]),accessList:i2(e[7],"accessList")};return e.length===8||a2(n,e.slice(8)),n}function Xse(t,e){const n=[Ot(t.chainId,"chainId"),Ot(t.nonce,"nonce"),Ot(t.gasPrice||0,"gasPrice"),Ot(t.gasLimit,"gasLimit"),t.to||"0x",Ot(t.value,"value"),t.data,o2(t.accessList||[])];return e&&(n.push(Ot(e.yParity,"recoveryParam")),n.push(Wn(e.r)),n.push(Wn(e.s))),$t(["0x01",El(n)])}function Zse(t){let e=Qg(ct(t).slice(1)),n="3",r=null;if(e.length===4&&Array.isArray(e[0])){n="3 (network format)";const i=e[1],o=e[2],a=e[3];$(Array.isArray(i),"invalid network format: blobs not an array","fields[1]",i),$(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),$(Array.isArray(a),"invalid network format: proofs not an array","fields[3]",a),$(i.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),$(i.length===a.length,"invalid network format: blobs/proofs length mismatch","fields",e),r=[];for(let l=0;l<e[1].length;l++)r.push({data:i[l],commitment:o[l],proof:a[l]});e=e[0]}$(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${n}`,"data",we(t));const s={type:3,chainId:Wt(e[0],"chainId"),nonce:Hh(e[1],"nonce"),maxPriorityFeePerGas:Wt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Wt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Wt(e[4],"gasLimit"),to:fy(e[5]),value:Wt(e[6],"value"),data:we(e[7]),accessList:i2(e[8],"accessList"),maxFeePerBlobGas:Wt(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};r&&(s.blobs=r),$(s.to!=null,`invalid address for transaction type: ${n}`,"data",t),$(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",t);for(let i=0;i<s.blobVersionedHashes.length;i++)$(St(s.blobVersionedHashes[i],32),`invalid blobVersionedHash at index ${i}: must be length 32`,"data",t);return e.length===11||a2(s,e.slice(11)),s}function eie(t,e,n){const r=[Ot(t.chainId,"chainId"),Ot(t.nonce,"nonce"),Ot(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Ot(t.maxFeePerGas||0,"maxFeePerGas"),Ot(t.gasLimit,"gasLimit"),t.to||Ph,Ot(t.value,"value"),t.data,o2(t.accessList||[]),Ot(t.maxFeePerBlobGas||0,"maxFeePerBlobGas"),Wse(t.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(r.push(Ot(e.yParity,"yParity")),r.push(Wn(e.r)),r.push(Wn(e.s)),n)?$t(["0x03",El([r,n.map(s=>s.data),n.map(s=>s.commitment),n.map(s=>s.proof)])]):$t(["0x03",El(r)])}const uo=class uo{constructor(){J(this,Ef);J(this,pi);J(this,hf);J(this,pf);J(this,mf);J(this,gf);J(this,yf);J(this,bf);J(this,wf);J(this,Af);J(this,vf);J(this,xf);J(this,kf);J(this,ru);J(this,ga);J(this,lo);J(this,ya);I(this,pi,null),I(this,hf,null),I(this,mf,0),I(this,gf,bn),I(this,yf,null),I(this,bf,null),I(this,wf,null),I(this,pf,"0x"),I(this,Af,bn),I(this,vf,bn),I(this,xf,null),I(this,kf,null),I(this,ru,null),I(this,ga,null),I(this,ya,null),I(this,lo,null)}get type(){return T(this,pi)}set type(e){switch(e){case null:I(this,pi,null);break;case 0:case"legacy":I(this,pi,0);break;case 1:case"berlin":case"eip-2930":I(this,pi,1);break;case 2:case"london":case"eip-1559":I(this,pi,2);break;case 3:case"cancun":case"eip-4844":I(this,pi,3);break;default:$(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844"}return null}get to(){const e=T(this,hf);return e==null&&this.type===3?Ph:e}set to(e){I(this,hf,e==null?null:gt(e))}get nonce(){return T(this,mf)}set nonce(e){I(this,mf,Qe(e,"value"))}get gasLimit(){return T(this,gf)}set gasLimit(e){I(this,gf,xe(e))}get gasPrice(){const e=T(this,yf);return e==null&&(this.type===0||this.type===1)?bn:e}set gasPrice(e){I(this,yf,e==null?null:xe(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=T(this,bf);return e??(this.type===2||this.type===3?bn:null)}set maxPriorityFeePerGas(e){I(this,bf,e==null?null:xe(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=T(this,wf);return e??(this.type===2||this.type===3?bn:null)}set maxFeePerGas(e){I(this,wf,e==null?null:xe(e,"maxFeePerGas"))}get data(){return T(this,pf)}set data(e){I(this,pf,we(e))}get value(){return T(this,Af)}set value(e){I(this,Af,xe(e,"value"))}get chainId(){return T(this,vf)}set chainId(e){I(this,vf,xe(e))}get signature(){return T(this,xf)||null}set signature(e){I(this,xf,e==null?null:Ss.from(e))}get accessList(){const e=T(this,kf)||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){I(this,kf,e==null?null:ia(e))}get maxFeePerBlobGas(){const e=T(this,ru);return e==null&&this.type===3?bn:e}set maxFeePerBlobGas(e){I(this,ru,e==null?null:xe(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=T(this,ga);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){$(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let n=0;n<e.length;n++)$(St(e[n],32),"invalid blobVersionedHash",`value[${n}]`,e[n])}I(this,ga,e)}get blobs(){return T(this,ya)==null?null:T(this,ya).map(e=>Object.assign({},e))}set blobs(e){if(e==null){I(this,ya,null);return}const n=[],r=[];for(let s=0;s<e.length;s++){const i=e[s];if(vx(i)){ee(T(this,lo),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=ct(i);if($(o.length<=s2,"blob is too large",`blobs[${s}]`,i),o.length!==s2){const u=new Uint8Array(s2);u.set(o),o=u}const a=T(this,lo).blobToKzgCommitment(o),l=we(T(this,lo).computeBlobKzgProof(o,a));n.push({data:we(o),commitment:we(a),proof:l}),r.push(eP(1,a))}else{const o=we(i.commitment);n.push({data:we(i.data),commitment:o,proof:we(i.proof)}),r.push(eP(1,o))}}I(this,ya,n),I(this,ga,r)}get kzg(){return T(this,lo)}set kzg(e){I(this,lo,e)}get hash(){return this.signature==null?null:en(fe(this,Ef,db).call(this,!0,!1))}get unsignedHash(){return en(this.unsignedSerialized)}get from(){return this.signature==null?null:Use(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:Ih.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){return fe(this,Ef,db).call(this,!0,!0)}get unsignedSerialized(){return fe(this,Ef,db).call(this,!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,r=this.accessList!=null,s=T(this,ru)!=null||T(this,ga);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&ee(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),ee(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),ee(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return this.type!=null?i.push(this.type):n?i.push(2):e?(i.push(1),r||i.push(0)):r?(i.push(1),i.push(2)):(s&&this.to||(i.push(0),i.push(1),i.push(2)),i.push(3)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return uo.from(this)}toJSON(){const e=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new uo;if(typeof e=="string"){const r=ct(e);if(r[0]>=127)return uo.from(Kse(r));switch(r[0]){case 1:return uo.from(Yse(r));case 2:return uo.from(Qse(r));case 3:return uo.from(Zse(r))}ee(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new uo;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=Ss.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.blobVersionedHashes!=null&&(n.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(n.kzg=e.kzg),e.blobs!=null&&(n.blobs=e.blobs),e.hash!=null&&($(n.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),$(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&($(n.isSigned(),"unsigned transaction cannot define '.from'","tx",e),$(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}};pi=new WeakMap,hf=new WeakMap,pf=new WeakMap,mf=new WeakMap,gf=new WeakMap,yf=new WeakMap,bf=new WeakMap,wf=new WeakMap,Af=new WeakMap,vf=new WeakMap,xf=new WeakMap,kf=new WeakMap,ru=new WeakMap,ga=new WeakMap,lo=new WeakMap,ya=new WeakMap,Ef=new WeakSet,db=function(e,n){ee(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const r=e?this.signature:null;switch(this.inferType()){case 0:return qse(this,r);case 1:return Xse(this,r);case 2:return Jse(this,r);case 3:return eie(this,r,n?this.blobs:null)}ee(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};let zh=uo;const tP=new Uint8Array(32);tP.fill(0);const tie=BigInt(-1),nP=BigInt(0),rP=BigInt(1),nie=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function rie(t){const e=ct(t),n=e.length%32;return n?$t([e,tP.slice(n)]):we(e)}const sie=Xo(rP,32),iie=Xo(nP,32),sP={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},l2=["name","version","chainId","verifyingContract","salt"];function iP(t){return function(e){return $(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const oie={name:iP("name"),version:iP("version"),chainId:function(t){const e=xe(t,"domain.chainId");return $(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):kl(e)},verifyingContract:function(t){try{return gt(t).toLowerCase()}catch{}$(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=ct(t,"domain.salt");return $(e.length===32,'invalid domain value "salt"',"domain.salt",t),we(e)}};function u2(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const n=e[1]==="",r=parseInt(e[2]);$(r%8===0&&r!==0&&r<=256&&e[2]===String(r),"invalid numeric width","type",t);const s=Oh(nie,n?r-1:r),i=n?(s+rP)*tie:nP;return function(o){const a=xe(o,"value");return $(a>=i&&a<=s,`value out-of-bounds for ${t}`,"value",a),Xo(n?l4(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return $(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const s=ct(r);return $(s.length===n,`invalid length for ${t}`,"value",r),rie(r)}}}switch(t){case"address":return function(e){return xl(gt(e),32)};case"bool":return function(e){return e?sie:iie};case"bytes":return function(e){return en(e)};case"string":return function(e){return Ol(e)}}return null}function oP(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}function dy(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}const ns=class ns{constructor(e){J(this,ib);W(this,"primaryType");J(this,gp);J(this,co);J(this,Cf);I(this,co,new Map),I(this,Cf,new Map);const n=new Map,r=new Map,s=new Map,i={};Object.keys(e).forEach(l=>{i[l]=e[l].map(({name:u,type:c})=>{let{base:f,index:d}=dy(c);return f==="int"&&!e.int&&(f="int256"),f==="uint"&&!e.uint&&(f="uint256"),{name:u,type:f+(d||"")}}),n.set(l,new Set),r.set(l,[]),s.set(l,new Set)}),I(this,gp,JSON.stringify(i));for(const l in i){const u=new Set;for(const c of i[l]){$(!u.has(c.name),`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(l)}`,"types",e),u.add(c.name);const f=dy(c.type).base;$(f!==l,`circular type reference to ${JSON.stringify(f)}`,"types",e),!u2(f)&&($(r.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),r.get(f).push(l),n.get(l).add(f))}}const o=Array.from(r.keys()).filter(l=>r.get(l).length===0);$(o.length!==0,"missing primary type","types",e),$(o.length===1,`ambiguous primary types or unused types: ${o.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),Oe(this,{primaryType:o[0]});function a(l,u){$(!u.has(l),`circular type reference to ${JSON.stringify(l)}`,"types",e),u.add(l);for(const c of n.get(l))if(r.has(c)){a(c,u);for(const f of u)s.get(f).add(c)}u.delete(l)}a(this.primaryType,new Set);for(const[l,u]of s){const c=Array.from(u);c.sort(),T(this,co).set(l,oP(l,i[l])+c.map(f=>oP(f,i[f])).join(""))}}get types(){return JSON.parse(T(this,gp))}getEncoder(e){let n=T(this,Cf).get(e);return n||(n=fe(this,ib,QL).call(this,e),T(this,Cf).set(e,n)),n}encodeType(e){const n=T(this,co).get(e);return $(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return en(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,r){if(u2(e))return r(e,n);const s=dy(e).array;if(s)return $(s.count===-1||s.count===n.length,`array length mismatch; expected length ${s.count}`,"value",n),n.map(o=>this._visit(s.prefix,o,r));const i=this.types[e];if(i)return i.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,n[a],r),o),{});$(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new ns(e)}static getPrimaryType(e){return ns.from(e).primaryType}static hashStruct(e,n,r){return ns.from(n).hashStruct(e,r)}static hashDomain(e){const n=[];for(const r in e){if(e[r]==null)continue;const s=sP[r];$(s,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:s})}return n.sort((r,s)=>l2.indexOf(r.name)-l2.indexOf(s.name)),ns.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,r){return $t(["0x1901",ns.hashDomain(e),ns.from(n).hash(r)])}static hash(e,n,r){return en(ns.encode(e,n,r))}static async resolveNames(e,n,r,s){e=Object.assign({},e);for(const a in e)e[a]==null&&delete e[a];const i={};e.verifyingContract&&!St(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=ns.from(n);o.visit(r,(a,l)=>(a==="address"&&!St(l,20)&&(i[l]="0x"),l));for(const a in i)i[a]=await s(a);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=o.visit(r,(a,l)=>a==="address"&&i[l]?i[l]:l),{domain:e,value:r}}static getPayload(e,n,r){ns.hashDomain(e);const s={},i=[];l2.forEach(l=>{const u=e[l];u!=null&&(s[l]=oie[l](u),i.push({name:l,type:sP[l]}))});const o=ns.from(n);n=o.types;const a=Object.assign({},n);return $(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),a.EIP712Domain=i,o.encode(r),{types:a,domain:s,primaryType:o.primaryType,message:o.visit(r,(l,u)=>{if(l.match(/^bytes(\d*)/))return we(ct(u));if(l.match(/^u?int/))return xe(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return $(typeof u=="string","invalid string","value",u),u}$(!1,"unsupported type","type",l)})}}};gp=new WeakMap,co=new WeakMap,Cf=new WeakMap,ib=new WeakSet,QL=function(e){{const s=u2(e);if(s)return s}const n=dy(e).array;if(n){const s=n.prefix,i=this.getEncoder(s);return o=>{$(n.count===-1||n.count===o.length,`array length mismatch; expected length ${n.count}`,"value",o);let a=o.map(i);return T(this,co).has(s)&&(a=a.map(en)),en($t(a))}}const r=this.types[e];if(r){const s=Ol(T(this,co).get(e));return i=>{const o=r.map(({name:a,type:l})=>{const u=this.getEncoder(l)(i[a]);return T(this,co).has(l)?en(u):u});return o.unshift(s),$t(o)}}$(!1,`unknown type: ${e}`,"type",e)};let hy=ns;function Jn(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const aie=Jn("external public payable override".split(" ")),aP="constant external internal payable private public pure view override",lie=Jn(aP.split(" ")),lP="constructor error event fallback function receive struct",uP=Jn(lP.split(" ")),cP="calldata memory storage payable indexed",uie=Jn(cP.split(" ")),cie=[lP,cP,"tuple returns",aP].join(" "),fie=Jn(cie.split(" ")),die={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},hie=new RegExp("^(\\s*)"),pie=new RegExp("^([0-9]+)"),mie=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),fP=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),dP=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),ob=class ob{constructor(e){J(this,yp);J(this,Dn);J(this,Ns);I(this,Dn,0),I(this,Ns,e.slice())}get offset(){return T(this,Dn)}get length(){return T(this,Ns).length-T(this,Dn)}clone(){return new ob(T(this,Ns))}reset(){I(this,Dn,0)}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const n=this.peek();throw new Error(`expected ${e}; got ${n.type} ${JSON.stringify(n.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=fe(this,yp,Zk).call(this,T(this,Dn)+1,e.match+1);return I(this,Dn,e.match+1),n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;T(this,Dn)<e.match-1;){const r=this.peek().linkNext;n.push(fe(this,yp,Zk).call(this,T(this,Dn)+1,r)),I(this,Dn,r)}return I(this,Dn,e.match+1),n}peek(){if(T(this,Dn)>=T(this,Ns).length)throw new Error("out-of-bounds");return T(this,Ns)[T(this,Dn)]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return Dp(this,Dn)._++,e}toString(){const e=[];for(let n=T(this,Dn);n<T(this,Ns).length;n++){const r=T(this,Ns)[n];e.push(`${r.type}:${r.text}`)}return`<TokenString ${e.join(" ")}>`}};Dn=new WeakMap,Ns=new WeakMap,yp=new WeakSet,Zk=function(e=0,n=0){return new ob(T(this,Ns).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))};let Ts=ob;function oa(t){const e=[],n=o=>{const a=i<t.length?JSON.stringify(t[i]):"$EOI";throw new Error(`invalid token ${a} at ${i}: ${o}`)};let r=[],s=[],i=0;for(;i<t.length;){let o=t.substring(i),a=o.match(hie);a&&(i+=a[1].length,o=t.substring(i));const l={depth:r.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:i,value:-1};e.push(l);let u=die[o[0]]||"";if(u){if(l.type=u,l.text=o[0],i++,u==="OPEN_PAREN")r.push(e.length-1),s.push(e.length-1);else if(u=="CLOSE_PAREN")r.length===0&&n("no matching open bracket"),l.match=r.pop(),e[l.match].match=e.length-1,l.depth--,l.linkBack=s.pop(),e[l.linkBack].linkNext=e.length-1;else if(u==="COMMA")l.linkBack=s.pop(),e[l.linkBack].linkNext=e.length-1,s.push(e.length-1);else if(u==="OPEN_BRACKET")l.type="BRACKET";else if(u==="CLOSE_BRACKET"){let c=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const f=e.pop().text;c=f+c,e[e.length-1].value=Qe(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=c}continue}if(a=o.match(mie),a){if(l.text=a[1],i+=l.text.length,fie.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(dP)){l.type="TYPE";continue}l.type="ID";continue}if(a=o.match(pie),a){l.text=a[1],l.type="NUMBER",i+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${i}`)}return new Ts(e.map(o=>Object.freeze(o)))}function hP(t,e){let n=[];for(const r in e.keys())t.has(r)&&n.push(r);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function py(t,e){if(e.peekKeyword(uP)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function Gi(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(r==null||e&&!e.has(r))break;if(t.pop(),n.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);n.add(r)}return Object.freeze(n)}function pP(t){let e=Gi(t,lie);return hP(e,Jn("constant payable nonpayable".split(" "))),hP(e,Jn("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function Wi(t,e){return t.popParams().map(n=>En.from(n,e))}function mP(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return xe(t.pop().text);throw new Error("invalid gas")}return null}function Nl(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const gie=new RegExp(/^(.*)\[([0-9]*)\]$/);function gP(t){const e=t.match(dP);if($(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);$(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);$(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const Lt={},dr=Symbol.for("_ethers_internal"),yP="_ParamTypeInternal",bP="_ErrorInternal",wP="_EventInternal",AP="_ConstructorInternal",vP="_FallbackInternal",xP="_FunctionInternal",kP="_StructInternal",rs=class rs{constructor(e,n,r,s,i,o,a,l){J(this,Sf);W(this,"name");W(this,"type");W(this,"baseType");W(this,"indexed");W(this,"components");W(this,"arrayLength");W(this,"arrayChildren");if($g(e,Lt,"ParamType"),Object.defineProperty(this,dr,{value:yP}),o&&(o=Object.freeze(o.slice())),s==="array"){if(a==null||l==null)throw new Error("")}else if(a!=null||l!=null)throw new Error("");if(s==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Oe(this,{name:n,type:r,baseType:s,indexed:i,components:o,arrayLength:a,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const i=JSON.parse(this.arrayChildren.format("json"));return i.name=r,i.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(i)}const s={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(s)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")":n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map(s=>r.arrayChildren.walk(s,n))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((s,i)=>r.components[i].walk(s,n))}return n(this.type,e)}async walkAsync(e,n){const r=[],s=[e];return fe(this,Sf,hb).call(this,r,e,n,i=>{s[0]=i}),r.length&&await Promise.all(r),s[0]}static from(e,n){if(rs.isParamType(e))return e;if(typeof e=="string")try{return rs.from(oa(e),n)}catch{$(!1,"invalid param type","obj",e)}else if(e instanceof Ts){let a="",l="",u=null;Gi(e,Jn(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",u=e.popParams().map(m=>rs.from(m)),a=`tuple(${u.map(m=>m.format()).join(",")})`):(a=gP(e.popType("TYPE")),l=a);let c=null,f=null;for(;e.length&&e.peekType("BRACKET");){const m=e.pop();c=new rs(Lt,"",a,l,null,u,f,c),f=m.value,a+=m.text,l="array",u=null}let d=null;if(Gi(e,uie).has("indexed")){if(!n)throw new Error("");d=!0}const p=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new rs(Lt,p,a,l,d,u,f,c)}const r=e.name;$(!r||typeof r=="string"&&r.match(fP),"invalid name","obj.name",r);let s=e.indexed;s!=null&&($(n,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let i=e.type,o=i.match(gie);if(o){const a=parseInt(o[2]||"-1"),l=rs.from({type:o[1],components:e.components});return new rs(Lt,r||"",i,"array",s,null,a,l)}if(i==="tuple"||i.startsWith("tuple(")||i.startsWith("(")){const a=e.components!=null?e.components.map(u=>rs.from(u)):null;return new rs(Lt,r||"",i,"tuple",s,a,null,null)}return i=gP(e.type),new rs(Lt,r||"",i,i,s,null,null,null)}static isParamType(e){return e&&e[dr]===yP}};Sf=new WeakSet,hb=function(e,n,r,s){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,a=n.slice();a.forEach((l,u)=>{var c;fe(c=o,Sf,hb).call(c,e,l,r,f=>{a[u]=f})}),s(a);return}if(this.isTuple()){const o=this.components;let a;if(Array.isArray(n))a=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");a=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((l,u)=>{var c;fe(c=o[u],Sf,hb).call(c,e,l,r,f=>{a[u]=f})}),s(a);return}const i=r(this.type,n);i.then?e.push(async function(){s(await i)}()):s(i)};let En=rs;class Rl{constructor(e,n,r){W(this,"type");W(this,"inputs");$g(e,Lt,"Fragment"),r=Object.freeze(r.slice()),Oe(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{Rl.from(JSON.parse(e))}catch{}return Rl.from(oa(e))}if(e instanceof Ts)switch(e.peekKeyword(uP)){case"constructor":return Ki.from(e);case"error":return hr.from(e);case"event":return ci.from(e);case"fallback":case"receive":return qi.from(e);case"function":return fi.from(e);case"struct":return Pl.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Ki.from(e);case"error":return hr.from(e);case"event":return ci.from(e);case"fallback":case"receive":return qi.from(e);case"function":return fi.from(e);case"struct":return Pl.from(e)}ee(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}$(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Ki.isFragment(e)}static isError(e){return hr.isFragment(e)}static isEvent(e){return ci.isFragment(e)}static isFunction(e){return fi.isFragment(e)}static isStruct(e){return Pl.isFragment(e)}}class my extends Rl{constructor(n,r,s,i){super(n,r,i);W(this,"name");$(typeof s=="string"&&s.match(fP),"invalid identifier","name",s),i=Object.freeze(i.slice()),Oe(this,{name:s})}}function $h(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}class hr extends my{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,dr,{value:bP})}get selector(){return Ol(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+$h(e,this.inputs)),n.join(" ")}static from(e){if(hr.isFragment(e))return e;if(typeof e=="string")return hr.from(oa(e));if(e instanceof Ts){const n=py("error",e),r=Wi(e);return Nl(e),new hr(Lt,n,r)}return new hr(Lt,e.name,e.inputs?e.inputs.map(En.from):[])}static isFragment(e){return e&&e[dr]===bP}}class ci extends my{constructor(n,r,s,i){super(n,"event",r,s);W(this,"anonymous");Object.defineProperty(this,dr,{value:wP}),Oe(this,{anonymous:i})}get topicHash(){return Ol(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(s=>JSON.parse(s.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+$h(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(i=>En.from(i)),new ci(Lt,n,r,!1).topicHash}static from(n){if(ci.isFragment(n))return n;if(typeof n=="string")try{return ci.from(oa(n))}catch{$(!1,"invalid event fragment","obj",n)}else if(n instanceof Ts){const r=py("event",n),s=Wi(n,!0),i=!!Gi(n,Jn(["anonymous"])).has("anonymous");return Nl(n),new ci(Lt,r,s,i)}return new ci(Lt,n.name,n.inputs?n.inputs.map(r=>En.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[dr]===wP}}class Ki extends Rl{constructor(n,r,s,i,o){super(n,r,s);W(this,"payable");W(this,"gas");Object.defineProperty(this,dr,{value:AP}),Oe(this,{payable:i,gas:o})}format(n){if(ee(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(s=>JSON.parse(s.format(n)))});const r=[`constructor${$h(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(Ki.isFragment(n))return n;if(typeof n=="string")try{return Ki.from(oa(n))}catch{$(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Ts){Gi(n,Jn(["constructor"]));const r=Wi(n),s=!!Gi(n,aie).has("payable"),i=mP(n);return Nl(n),new Ki(Lt,"constructor",r,s,i)}return new Ki(Lt,"constructor",n.inputs?n.inputs.map(En.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[dr]===AP}}class qi extends Rl{constructor(n,r,s){super(n,"fallback",r);W(this,"payable");Object.defineProperty(this,dr,{value:vP}),Oe(this,{payable:s})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const s=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:s})}return`${r}()${this.payable?" payable":""}`}static from(n){if(qi.isFragment(n))return n;if(typeof n=="string")try{return qi.from(oa(n))}catch{$(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Ts){const r=n.toString(),s=n.peekKeyword(Jn(["fallback","receive"]));if($(s,"type must be fallback or receive","obj",r),n.popKeyword(Jn(["fallback","receive"]))==="receive"){const l=Wi(n);return $(l.length===0,"receive cannot have arguments","obj.inputs",l),Gi(n,Jn(["payable"])),Nl(n),new qi(Lt,[],!0)}let o=Wi(n);o.length?$(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[En.from("bytes")];const a=pP(n);if($(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),Gi(n,Jn(["returns"])).has("returns")){const l=Wi(n);$(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(u=>u.format("minimal")).join(", "))}return Nl(n),new qi(Lt,o,a==="payable")}if(n.type==="receive")return new qi(Lt,[],!0);if(n.type==="fallback"){const r=[En.from("bytes")],s=n.stateMutability==="payable";return new qi(Lt,r,s)}$(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[dr]===vP}}class fi extends my{constructor(n,r,s,i,o,a){super(n,"function",r,i);W(this,"constant");W(this,"outputs");W(this,"stateMutability");W(this,"payable");W(this,"gas");Object.defineProperty(this,dr,{value:xP}),o=Object.freeze(o.slice()),Oe(this,{constant:s==="view"||s==="pure",gas:a,outputs:o,payable:s==="payable",stateMutability:s})}get selector(){return Ol(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="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!=null?this.gas:void 0,inputs:this.inputs.map(s=>JSON.parse(s.format(n))),outputs:this.outputs.map(s=>JSON.parse(s.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+$h(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push($h(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(i=>En.from(i)),new fi(Lt,n,"view",r,[],null).selector}static from(n){if(fi.isFragment(n))return n;if(typeof n=="string")try{return fi.from(oa(n))}catch{$(!1,"invalid function fragment","obj",n)}else if(n instanceof Ts){const s=py("function",n),i=Wi(n),o=pP(n);let a=[];Gi(n,Jn(["returns"])).has("returns")&&(a=Wi(n));const l=mP(n);return Nl(n),new fi(Lt,s,o,i,a,l)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new fi(Lt,n.name,r,n.inputs?n.inputs.map(En.from):[],n.outputs?n.outputs.map(En.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[dr]===xP}}class Pl extends my{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,dr,{value:kP})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Pl.from(oa(e))}catch{$(!1,"invalid struct fragment","obj",e)}else if(e instanceof Ts){const n=py("struct",e),r=Wi(e);return Nl(e),new Pl(Lt,n,r)}return new Pl(Lt,e.name,e.inputs?e.inputs.map(En.from):[])}static isFragment(e){return e&&e[dr]===kP}}const Ds=new Map;Ds.set(0,"GENERIC_PANIC"),Ds.set(1,"ASSERT_FALSE"),Ds.set(17,"OVERFLOW"),Ds.set(18,"DIVIDE_BY_ZERO"),Ds.set(33,"ENUM_RANGE_ERROR"),Ds.set(34,"BAD_STORAGE_DATA"),Ds.set(49,"STACK_UNDERFLOW"),Ds.set(50,"ARRAY_RANGE_ERROR"),Ds.set(65,"OUT_OF_MEMORY"),Ds.set(81,"UNINITIALIZED_FUNCTION_CALL");const yie=new RegExp(/^bytes([0-9]*)$/),bie=new RegExp(/^(u?int)([0-9]*)$/);let c2=null,EP=1024;function wie(t,e,n,r){let s="missing revert data",i=null;const o=null;let a=null;if(n){s="execution reverted";const u=ct(n);if(n=we(n),u.length===0)s+=" (no data present; likely require(false) occurred",i="require(false)";else if(u.length%32!==4)s+=" (could not decode reason; invalid data length)";else if(we(u.slice(0,4))==="0x08c379a0")try{i=r.decode(["string"],u.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[i]},s+=`: ${JSON.stringify(i)}`}catch{s+=" (could not decode reason; invalid string data)"}else if(we(u.slice(0,4))==="0x4e487b71")try{const c=Number(r.decode(["uint256"],u.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[c]},i=`Panic due to ${Ds.get(c)||"UNKNOWN"}(${c})`,s+=`: ${i}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}const l={to:e.to?gt(e.to):null,data:e.data||"0x"};return e.from&&(l.from=gt(e.from)),Nt(s,"CALL_EXCEPTION",{action:t,data:n,reason:i,transaction:l,invocation:o,revert:a})}const ab=class ab{constructor(){J(this,ba)}getDefaultValue(e){const n=e.map(s=>fe(this,ba,Qf).call(this,En.from(s)));return new ry(n,"_").defaultValue()}encode(e,n){s4(n.length,e.length,"types/values length mismatch");const r=e.map(o=>fe(this,ba,Qf).call(this,En.from(o))),s=new ry(r,"_"),i=new Sx;return s.encode(i,n),i.data}decode(e,n,r){const s=e.map(o=>fe(this,ba,Qf).call(this,En.from(o)));return new ry(s,"_").decode(new Tx(n,r,EP))}static _setDefaultMaxInflation(e){$(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),EP=e}static defaultAbiCoder(){return c2==null&&(c2=new ab),c2}static getBuiltinCallException(e,n,r){return wie(e,n,r,ab.defaultAbiCoder())}};ba=new WeakSet,Qf=function(e){if(e.isArray())return new $re(fe(this,ba,Qf).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new ry(e.components.map(r=>fe(this,ba,Qf).call(this,r)),e.name);switch(e.baseType){case"address":return new Hre(e.name);case"bool":return new Gre(e.name);case"string":return new ese(e.name);case"bytes":return new Wre(e.name);case"":return new Qre(e.name)}let n=e.type.match(bie);if(n){let r=parseInt(n[2]||"256");return $(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new Zre(r/8,n[1]==="int",e.name)}if(n=e.type.match(yie),n){let r=parseInt(n[1]);return $(r!==0&&r<=32,"invalid bytes length","param",e),new Kre(r,e.name)}$(!1,"invalid type","type",e.type)};let jc=ab;class Aie{constructor(e,n,r){W(this,"fragment");W(this,"name");W(this,"signature");W(this,"topic");W(this,"args");const s=e.name,i=e.format();Oe(this,{fragment:e,name:s,signature:i,topic:n,args:r})}}class vie{constructor(e,n,r,s){W(this,"fragment");W(this,"name");W(this,"args");W(this,"signature");W(this,"selector");W(this,"value");const i=e.name,o=e.format();Oe(this,{fragment:e,name:i,args:r,signature:o,selector:n,value:s})}}class xie{constructor(e,n,r){W(this,"fragment");W(this,"name");W(this,"args");W(this,"signature");W(this,"selector");const s=e.name,i=e.format();Oe(this,{fragment:e,name:s,args:r,signature:i,selector:n})}}class CP{constructor(e){W(this,"hash");W(this,"_isIndexed");Oe(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const SP={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},TP={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&SP[t.toString()]&&(e=SP[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}},su=class su{constructor(e){J(this,bi);W(this,"fragments");W(this,"deploy");W(this,"fallback");W(this,"receive");J(this,mi);J(this,gi);J(this,yi);J(this,Ln);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,I(this,yi,new Map),I(this,mi,new Map),I(this,gi,new Map);const r=[];for(const o of n)try{r.push(Rl.from(o))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,a.message)}Oe(this,{fragments:Object.freeze(r)});let s=null,i=!1;I(this,Ln,this.getAbiCoder()),this.fragments.forEach((o,a)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Oe(this,{deploy:o});return;case"fallback":o.inputs.length===0?i=!0:($(!s||o.payable!==s.payable,"conflicting fallback fragments",`fragments[${a}]`,o),s=o,i=s.payable);return;case"function":l=T(this,yi);break;case"event":l=T(this,gi);break;case"error":l=T(this,mi);break;default:return}const u=o.format();l.has(u)||l.set(u,o)}),this.deploy||Oe(this,{deploy:Ki.from("constructor()")}),Oe(this,{fallback:s,receive:i})}format(e){const n=e?"minimal":"full";return this.fragments.map(s=>s.format(n))}formatJson(){const e=this.fragments.map(n=>n.format("json"));return JSON.stringify(e.map(n=>JSON.parse(n)))}getAbiCoder(){return jc.defaultAbiCoder()}getFunctionName(e){const n=fe(this,bi,pb).call(this,e,null,!1);return $(n,"no matching function","key",e),n.name}hasFunction(e){return!!fe(this,bi,pb).call(this,e,null,!1)}getFunction(e,n){return fe(this,bi,pb).call(this,e,n||null,!0)}forEachFunction(e){const n=Array.from(T(this,yi).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];e(T(this,yi).get(s),r)}}getEventName(e){const n=fe(this,bi,mb).call(this,e,null,!1);return $(n,"no matching event","key",e),n.name}hasEvent(e){return!!fe(this,bi,mb).call(this,e,null,!1)}getEvent(e,n){return fe(this,bi,mb).call(this,e,n||null,!0)}forEachEvent(e){const n=Array.from(T(this,gi).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];e(T(this,gi).get(s),r)}}getError(e,n){if(St(e)){const s=e.toLowerCase();if(TP[s])return hr.from(TP[s].signature);for(const i of T(this,mi).values())if(s===i.selector)return i;return null}if(e.indexOf("(")===-1){const s=[];for(const[i,o]of T(this,mi))i.split("(")[0]===e&&s.push(o);if(s.length===0)return e==="Error"?hr.from("error Error(string)"):e==="Panic"?hr.from("error Panic(uint256)"):null;if(s.length>1){const i=s.map(o=>JSON.stringify(o.format())).join(", ");$(!1,`ambiguous error description (i.e. ${i})`,"name",e)}return s[0]}if(e=hr.from(e).format(),e==="Error(string)")return hr.from("error Error(string)");if(e==="Panic(uint256)")return hr.from("error Panic(uint256)");const r=T(this,mi).get(e);return r||null}forEachError(e){const n=Array.from(T(this,mi).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];e(T(this,mi).get(s),r)}}_decodeParams(e,n){return T(this,Ln).decode(e,n)}_encodeParams(e,n){return T(this,Ln).encode(e,n)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,n){if(typeof e=="string"){const r=this.getError(e);$(r,"unknown error","fragment",e),e=r}return $(Ht(n,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",n),this._decodeParams(e.inputs,Ht(n,4))}encodeErrorResult(e,n){if(typeof e=="string"){const r=this.getError(e);$(r,"unknown error","fragment",e),e=r}return $t([e.selector,this._encodeParams(e.inputs,n||[])])}decodeFunctionData(e,n){if(typeof e=="string"){const r=this.getFunction(e);$(r,"unknown function","fragment",e),e=r}return $(Ht(n,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",n),this._decodeParams(e.inputs,Ht(n,4))}encodeFunctionData(e,n){if(typeof e=="string"){const r=this.getFunction(e);$(r,"unknown function","fragment",e),e=r}return $t([e.selector,this._encodeParams(e.inputs,n||[])])}decodeFunctionResult(e,n){if(typeof e=="string"){const i=this.getFunction(e);$(i,"unknown function","fragment",e),e=i}let r="invalid length for result data";const s=Gn(n);if(s.length%32===0)try{return T(this,Ln).decode(e.outputs,s)}catch{r="could not decode result data"}ee(!1,r,"BAD_DATA",{value:we(s),info:{method:e.name,signature:e.format()}})}makeError(e,n){const r=ct(e,"data"),s=jc.getBuiltinCallException("call",n,r);if(s.message.startsWith("execution reverted (unknown custom error)")){const a=we(r.slice(0,4)),l=this.getError(a);if(l)try{const u=T(this,Ln).decode(l.inputs,r.slice(4));s.revert={name:l.name,signature:l.format(),args:u},s.reason=s.revert.signature,s.message=`execution reverted: ${s.reason}`}catch{s.message="execution reverted (coult not decode custom error)"}}const o=this.parseTransaction(n);return o&&(s.invocation={method:o.name,signature:o.signature,args:o.args}),s}encodeFunctionResult(e,n){if(typeof e=="string"){const r=this.getFunction(e);$(r,"unknown function","fragment",e),e=r}return we(T(this,Ln).encode(e.outputs,n||[]))}encodeFilterTopics(e,n){if(typeof e=="string"){const i=this.getEvent(e);$(i,"unknown event","eventFragment",e),e=i}ee(n.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:n.length,expectedCount:e.inputs.length});const r=[];e.anonymous||r.push(e.topicHash);const s=(i,o)=>i.type==="string"?Ol(o):i.type==="bytes"?en(we(o)):(i.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":i.type.match(/^u?int/)?o=Xo(o):i.type.match(/^bytes/)?o=nne(o,32):i.type==="address"&&T(this,Ln).encode(["address"],[o]),xl(we(o),32));for(n.forEach((i,o)=>{const a=e.inputs[o];if(!a.indexed){$(i==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,i);return}i==null?r.push(null):a.baseType==="array"||a.baseType==="tuple"?$(!1,"filtering with tuples or arrays not supported","contract."+a.name,i):Array.isArray(i)?r.push(i.map(l=>s(a,l))):r.push(s(a,i))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,n){if(typeof e=="string"){const o=this.getEvent(e);$(o,"unknown event","eventFragment",e),e=o}const r=[],s=[],i=[];return e.anonymous||r.push(e.topicHash),$(n.length===e.inputs.length,"event arguments/values mismatch","values",n),e.inputs.forEach((o,a)=>{const l=n[a];if(o.indexed)if(o.type==="string")r.push(Ol(l));else if(o.type==="bytes")r.push(en(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(T(this,Ln).encode([o.type],[l]))}else s.push(o),i.push(l)}),{data:T(this,Ln).encode(s,i),topics:r}}decodeEventLog(e,n,r){if(typeof e=="string"){const h=this.getEvent(e);$(h,"unknown event","eventFragment",e),e=h}if(r!=null&&!e.anonymous){const h=e.topicHash;$(St(r[0],32)&&r[0].toLowerCase()===h,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const s=[],i=[],o=[];e.inputs.forEach((h,p)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(s.push(En.from({type:"bytes32",name:h.name})),o.push(!0)):(s.push(h),o.push(!1)):(i.push(h),o.push(!1))});const a=r!=null?T(this,Ln).decode(s,$t(r)):null,l=T(this,Ln).decode(i,n,!0),u=[],c=[];let f=0,d=0;return e.inputs.forEach((h,p)=>{let m=null;if(h.indexed)if(a==null)m=new CP(null);else if(o[p])m=new CP(a[d++]);else try{m=a[d++]}catch(g){m=g}else try{m=l[f++]}catch(g){m=g}u.push(m),c.push(h.name||null)}),Dc.fromItems(u,c)}parseTransaction(e){const n=ct(e.data,"tx.data"),r=xe(e.value!=null?e.value:0,"tx.value"),s=this.getFunction(we(n.slice(0,4)));if(!s)return null;const i=T(this,Ln).decode(s.inputs,n.slice(4));return new vie(s,s.selector,i,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new Aie(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=we(e),r=this.getError(Ht(n,0,4));if(!r)return null;const s=T(this,Ln).decode(r.inputs,Ht(n,4));return new xie(r,r.selector,s)}static from(e){return e instanceof su?e:typeof e=="string"?new su(JSON.parse(e)):typeof e.formatJson=="function"?new su(e.formatJson()):typeof e.format=="function"?new su(e.format("json")):new su(e)}};mi=new WeakMap,gi=new WeakMap,yi=new WeakMap,Ln=new WeakMap,bi=new WeakSet,pb=function(e,n,r){if(St(e)){const i=e.toLowerCase();for(const o of T(this,yi).values())if(i===o.selector)return o;return null}if(e.indexOf("(")===-1){const i=[];for(const[o,a]of T(this,yi))o.split("(")[0]===e&&i.push(a);if(n){const o=n.length>0?n[n.length-1]:null;let a=n.length,l=!0;Rn.isTyped(o)&&o.type==="overrides"&&(l=!1,a--);for(let u=i.length-1;u>=0;u--){const c=i[u].inputs.length;c!==a&&(!l||c!==a-1)&&i.splice(u,1)}for(let u=i.length-1;u>=0;u--){const c=i[u].inputs;for(let f=0;f<n.length;f++)if(Rn.isTyped(n[f])){if(f>=c.length){if(n[f].type==="overrides")continue;i.splice(u,1);break}if(n[f].type!==c[f].baseType){i.splice(u,1);break}}}}if(i.length===1&&n&&n.length!==i[0].inputs.length){const o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&r){const o=i.map(a=>JSON.stringify(a.format())).join(", ");$(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return i[0]}const s=T(this,yi).get(fi.from(e).format());return s||null},mb=function(e,n,r){if(St(e)){const i=e.toLowerCase();for(const o of T(this,gi).values())if(i===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const i=[];for(const[o,a]of T(this,gi))o.split("(")[0]===e&&i.push(a);if(n){for(let o=i.length-1;o>=0;o--)i[o].inputs.length<n.length&&i.splice(o,1);for(let o=i.length-1;o>=0;o--){const a=i[o].inputs;for(let l=0;l<n.length;l++)if(Rn.isTyped(n[l])&&n[l].type!==a[l].baseType){i.splice(o,1);break}}}if(i.length===0)return null;if(i.length>1&&r){const o=i.map(a=>JSON.stringify(a.format())).join(", ");$(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return i[0]}const s=T(this,gi).get(ci.from(e).format());return s||null};let f2=su;const DP=BigInt(0);function Uc(t){return t??null}function Kt(t){return t==null?null:t.toString()}class OP{constructor(e,n,r){W(this,"gasPrice");W(this,"maxFeePerGas");W(this,"maxPriorityFeePerGas");Oe(this,{gasPrice:Uc(e),maxFeePerGas:Uc(n),maxPriorityFeePerGas:Uc(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Kt(e),maxFeePerGas:Kt(n),maxPriorityFeePerGas:Kt(r)}}}function gy(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=we(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const s of n)!(s in t)||t[s]==null||(e[s]=xe(t[s],`request.${s}`));const r="type,nonce".split(/,/);for(const s of r)!(s in t)||t[s]==null||(e[s]=Qe(t[s],`request.${s}`));return t.accessList&&(e.accessList=ia(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),"blobVersionedHashes"in t&&t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes.slice()),"kzg"in t&&(e.kzg=t.kzg),"blobs"in t&&t.blobs&&(e.blobs=t.blobs.map(s=>vx(s)?we(s):Object.assign({},s))),e}class kie{constructor(e,n){W(this,"provider");W(this,"number");W(this,"hash");W(this,"timestamp");W(this,"parentHash");W(this,"parentBeaconBlockRoot");W(this,"nonce");W(this,"difficulty");W(this,"gasLimit");W(this,"gasUsed");W(this,"stateRoot");W(this,"receiptsRoot");W(this,"blobGasUsed");W(this,"excessBlobGas");W(this,"miner");W(this,"prevRandao");W(this,"extraData");W(this,"baseFeePerGas");J(this,fo);I(this,fo,e.transactions.map(r=>typeof r!="string"?new Wh(r,n):r)),Oe(this,{provider:n,hash:Uc(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:Uc(e.prevRandao),extraData:e.extraData,baseFeePerGas:Uc(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return T(this,fo).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=T(this,fo).slice();return e.length===0?[]:(ee(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:n,extraData:r,gasLimit:s,gasUsed:i,hash:o,miner:a,prevRandao:l,nonce:u,number:c,parentHash:f,parentBeaconBlockRoot:d,stateRoot:h,receiptsRoot:p,timestamp:m,transactions:g}=this;return{_type:"Block",baseFeePerGas:Kt(e),difficulty:Kt(n),extraData:r,gasLimit:Kt(s),gasUsed:Kt(i),blobGasUsed:Kt(this.blobGasUsed),excessBlobGas:Kt(this.excessBlobGas),hash:o,miner:a,prevRandao:l,nonce:u,number:c,parentHash:f,timestamp:m,parentBeaconBlockRoot:d,stateRoot:h,receiptsRoot:p,transactions:g}}[Symbol.iterator](){let e=0;const n=this.transactions;return{next:()=>e<this.length?{value:n[e++],done:!1}:{value:void 0,done:!0}}}get length(){return T(this,fo).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let n;if(typeof e=="number")n=T(this,fo)[e];else{const r=e.toLowerCase();for(const s of T(this,fo))if(typeof s=="string"){if(s!==r)continue;n=s;break}else{if(s.hash===r)continue;n=s;break}}if(n==null)throw new Error("no such tx");return typeof n=="string"?await this.provider.getTransaction(n):n}getPrefetchedTransaction(e){const n=this.prefetchedTransactions;if(typeof e=="number")return n[e];e=e.toLowerCase();for(const r of n)if(r.hash===e)return r;$(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return Eie(this)}}fo=new WeakMap;class Gh{constructor(e,n){W(this,"provider");W(this,"transactionHash");W(this,"blockHash");W(this,"blockNumber");W(this,"removed");W(this,"address");W(this,"data");W(this,"topics");W(this,"index");W(this,"transactionIndex");this.provider=n;const r=Object.freeze(e.topics.slice());Oe(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:r,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:n,blockNumber:r,data:s,index:i,removed:o,topics:a,transactionHash:l,transactionIndex:u}=this;return{_type:"log",address:e,blockHash:n,blockNumber:r,data:s,index:i,removed:o,topics:a,transactionHash:l,transactionIndex:u}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return ee(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return ee(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return ee(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return Cie(this)}}class _P{constructor(e,n){W(this,"provider");W(this,"to");W(this,"from");W(this,"contractAddress");W(this,"hash");W(this,"index");W(this,"blockHash");W(this,"blockNumber");W(this,"logsBloom");W(this,"gasUsed");W(this,"blobGasUsed");W(this,"cumulativeGasUsed");W(this,"gasPrice");W(this,"blobGasPrice");W(this,"type");W(this,"status");W(this,"root");J(this,bp);I(this,bp,Object.freeze(e.logs.map(s=>new Gh(s,n))));let r=DP;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),Oe(this,{provider:n,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:r,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return T(this,bp)}toJSON(){const{to:e,from:n,contractAddress:r,hash:s,index:i,blockHash:o,blockNumber:a,logsBloom:l,logs:u,status:c,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:r,cumulativeGasUsed:Kt(this.cumulativeGasUsed),from:n,gasPrice:Kt(this.gasPrice),blobGasUsed:Kt(this.blobGasUsed),blobGasPrice:Kt(this.blobGasPrice),gasUsed:Kt(this.gasUsed),hash:s,index:i,logs:u,logsBloom:l,root:f,status:c,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return NP(this)}reorderedEvent(e){return ee(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),MP(this,e)}}bp=new WeakMap;const $k=class $k{constructor(e,n){W(this,"provider");W(this,"blockNumber");W(this,"blockHash");W(this,"index");W(this,"hash");W(this,"type");W(this,"to");W(this,"from");W(this,"nonce");W(this,"gasLimit");W(this,"gasPrice");W(this,"maxPriorityFeePerGas");W(this,"maxFeePerGas");W(this,"maxFeePerBlobGas");W(this,"data");W(this,"value");W(this,"chainId");W(this,"signature");W(this,"accessList");W(this,"blobVersionedHashes");J(this,wa);this.provider=n,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,I(this,wa,-1)}toJSON(){const{blockNumber:e,blockHash:n,index:r,hash:s,type:i,to:o,from:a,nonce:l,data:u,signature:c,accessList:f,blobVersionedHashes:d}=this;return{_type:"TransactionResponse",accessList:f,blockNumber:e,blockHash:n,blobVersionedHashes:d,chainId:Kt(this.chainId),data:u,from:a,gasLimit:Kt(this.gasLimit),gasPrice:Kt(this.gasPrice),hash:s,maxFeePerGas:Kt(this.maxFeePerGas),maxPriorityFeePerGas:Kt(this.maxPriorityFeePerGas),maxFeePerBlobGas:Kt(this.maxFeePerBlobGas),nonce:l,signature:c,to:o,index:r,type:i,value:Kt(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){const r=await this.getTransaction();r&&(e=r.blockNumber)}if(e==null)return null;const n=this.provider.getBlock(e);if(n==null)throw new Error("TODO");return n}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:n,blockNumber:r}=await Nn({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return n==null||n.blockNumber==null?0:r-n.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,n){const r=e??1,s=n??0;let i=T(this,wa),o=-1,a=i===-1;const l=async()=>{if(a)return null;const{blockNumber:d,nonce:h}=await Nn({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(h<this.nonce){i=d;return}if(a)return null;const p=await this.getTransaction();if(!(p&&p.blockNumber!=null))for(o===-1&&(o=i-3,o<T(this,wa)&&(o=T(this,wa)));o<=d;){if(a)return null;const m=await this.provider.getBlock(o,!0);if(m==null)return;for(const g of m)if(g===this.hash)return;for(let g=0;g<m.length;g++){const y=await m.getTransaction(g);if(y.from===this.from&&y.nonce===this.nonce){if(a)return null;const v=await this.provider.getTransactionReceipt(y.hash);if(v==null||d-v.blockNumber+1<r)return;let w="replaced";y.data===this.data&&y.to===this.to&&y.value===this.value?w="repriced":y.data==="0x"&&y.from===y.to&&y.value===DP&&(w="cancelled"),ee(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:w==="replaced"||w==="cancelled",reason:w,replacement:y.replaceableTransaction(i),hash:y.hash,receipt:v})}}o++}},u=d=>{if(d==null||d.status!==0)return d;ee(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:d.to,from:d.from,data:""},receipt:d})},c=await this.provider.getTransactionReceipt(this.hash);if(r===0)return u(c);if(c){if(await c.confirmations()>=r)return u(c)}else if(await l(),r===0)return null;return await new Promise((d,h)=>{const p=[],m=()=>{p.forEach(y=>y())};if(p.push(()=>{a=!0}),s>0){const y=setTimeout(()=>{m(),h(Nt("wait for transaction timeout","TIMEOUT"))},s);p.push(()=>{clearTimeout(y)})}const g=async y=>{if(await y.confirmations()>=r){m();try{d(u(y))}catch(v){h(v)}}};if(p.push(()=>{this.provider.off(this.hash,g)}),this.provider.on(this.hash,g),i>=0){const y=async()=>{try{await l()}catch(v){if(gn(v,"TRANSACTION_REPLACED")){m(),h(v);return}}a||this.provider.once("block",y)};p.push(()=>{this.provider.off("block",y)}),this.provider.once("block",y)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return ee(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),NP(this)}reorderedEvent(e){return ee(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ee(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),MP(this,e)}replaceableTransaction(e){$(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new $k(this,this.provider);return I(n,wa,e),n}};wa=new WeakMap;let Wh=$k;function Eie(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function MP(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function NP(t){return{orphan:"drop-transaction",tx:t}}function Cie(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class d2 extends Gh{constructor(n,r,s){super(n,n.provider);W(this,"interface");W(this,"fragment");W(this,"args");const i=r.decodeEventLog(s,n.data,n.topics);Oe(this,{args:i,fragment:s,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class RP extends Gh{constructor(n,r){super(n,n.provider);W(this,"error");Oe(this,{error:r})}}class Sie extends _P{constructor(n,r,s){super(s,r);J(this,Tf);I(this,Tf,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?T(this,Tf).getEvent(n.topics[0]):null;if(r)try{return new d2(n,T(this,Tf),r)}catch(s){return new RP(n,s)}return n})}}Tf=new WeakMap;class h2 extends Wh{constructor(n,r,s){super(s,r);J(this,wp);I(this,wp,n)}async wait(n,r){const s=await super.wait(n,r);return s==null?null:new Sie(T(this,wp),this.provider,s)}}wp=new WeakMap;class PP extends d4{constructor(n,r,s,i){super(n,r,s);W(this,"log");Oe(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class Tie extends PP{constructor(e,n,r,s,i){super(e,n,r,new d2(i,e.interface,s));const o=e.interface.decodeEventLog(s,this.log.data,this.log.topics);Oe(this,{args:o,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const IP=BigInt(0);function LP(t){return t&&typeof t.call=="function"}function BP(t){return t&&typeof t.estimateGas=="function"}function yy(t){return t&&typeof t.resolveName=="function"}function FP(t){return t&&typeof t.sendTransaction=="function"}function jP(t){if(t!=null){if(yy(t))return t;if(t.provider)return t.provider}}class Die{constructor(e,n,r){J(this,Ap);W(this,"fragment");if(Oe(this,{fragment:n}),n.inputs.length<r.length)throw new Error("too many arguments");const s=Il(e.runner,"resolveName"),i=yy(s)?s:null;I(this,Ap,async function(){const o=await Promise.all(n.inputs.map((a,l)=>r[l]==null?null:a.walkAsync(r[l],(c,f)=>c==="address"?Array.isArray(f)?Promise.all(f.map(d=>Qn(d,i))):Qn(f,i):f)));return e.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return T(this,Ap)}}Ap=new WeakMap;function Il(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function Ll(t){return t==null?null:t.provider||null}async function UP(t,e){const n=Rn.dereference(t,"overrides");$(typeof n=="object","invalid overrides parameter","overrides",t);const r=gy(n);return $(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),$(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function Oie(t,e,n){const r=Il(t,"resolveName"),s=yy(r)?r:null;return await Promise.all(e.map((i,o)=>i.walkAsync(n[o],(a,l)=>(l=Rn.dereference(l,a),a==="address"?Qn(l,s):l))))}function _ie(t){const e=async function(o){const a=await UP(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await Qn(a.from,jP(t.runner)));const l=t.interface,u=xe(a.value||IP,"overrides.value")===IP,c=(a.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!c&&!u&&$(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),$(l.fallback||c,"cannot send data to receive-only contract","overrides.data",a.data);const f=l.receive||l.fallback&&l.fallback.payable;return $(f||u,"cannot send value to non-payable fallback","overrides.value",a.value),$(l.fallback||c,"cannot send data to receive-only contract","overrides.data",a.data),a},n=async function(o){const a=Il(t.runner,"call");ee(LP(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await a.call(l)}catch(u){throw Ax(u)&&u.data?t.interface.makeError(u.data,l):u}},r=async function(o){const a=t.runner;ee(FP(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await a.sendTransaction(await e(o)),u=Ll(t.runner);return new h2(t.interface,u,l)},s=async function(o){const a=Il(t.runner,"estimateGas");return ee(BP(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},i=async o=>await r(o);return Oe(i,{_contract:t,estimateGas:s,populateTransaction:e,send:r,staticCall:n}),i}function Mie(t,e){const n=function(...u){const c=t.interface.getFunction(e,u);return ee(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),c},r=async function(...u){const c=n(...u);let f={};if(c.inputs.length+1===u.length&&(f=await UP(u.pop()),f.from&&(f.from=await Qn(f.from,jP(t.runner)))),c.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const d=await Oie(t.runner,c.inputs,u);return Object.assign({},f,await Nn({to:t.getAddress(),data:t.interface.encodeFunctionData(c,d)}))},s=async function(...u){const c=await a(...u);return c.length===1?c[0]:c},i=async function(...u){const c=t.runner;ee(FP(c),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await c.sendTransaction(await r(...u)),d=Ll(t.runner);return new h2(t.interface,d,f)},o=async function(...u){const c=Il(t.runner,"estimateGas");return ee(BP(c),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await c.estimateGas(await r(...u))},a=async function(...u){const c=Il(t.runner,"call");ee(LP(c),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...u);let d="0x";try{d=await c.call(f)}catch(p){throw Ax(p)&&p.data?t.interface.makeError(p.data,f):p}const h=n(...u);return t.interface.decodeFunctionResult(h,d)},l=async(...u)=>n(...u).constant?await s(...u):await i(...u);return Oe(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:n,estimateGas:o,populateTransaction:r,send:i,staticCall:s,staticCallResult:a}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const u=t.interface.getFunction(e);return ee(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),l}function Nie(t,e){const n=function(...s){const i=t.interface.getEvent(e,s);return ee(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:s}}),i},r=function(...s){return new Die(t,n(...s),s)};return Oe(r,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const s=t.interface.getEvent(e);return ee(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),s}}),r}const by=Symbol.for("_ethersInternal_contract"),VP=new WeakMap;function Rie(t,e){VP.set(t[by],e)}function Rr(t){return VP.get(t[by])}function Pie(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function p2(t,e){let n,r=null;if(Array.isArray(e)){const i=function(o){if(St(o,32))return o;const a=t.interface.getEvent(o);return $(a,"unknown fragment","name",o),a.topicHash};n=e.map(o=>o==null?null:Array.isArray(o)?o.map(i):i(o))}else e==="*"?n=[null]:typeof e=="string"?St(e,32)?n=[e]:(r=t.interface.getEvent(e),$(r,"unknown fragment","event",e),n=[r.topicHash]):Pie(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):$(!1,"unknown event name","event",e);n=n.map(i=>{if(i==null)return null;if(Array.isArray(i)){const o=Array.from(new Set(i.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return i.toLowerCase()});const s=n.map(i=>i==null?"null":Array.isArray(i)?i.join("|"):i).join("&");return{fragment:r,tag:s,topics:n}}async function Kh(t,e){const{subs:n}=Rr(t);return n.get((await p2(t,e)).tag)||null}async function HP(t,e,n){const r=Ll(t.runner);ee(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:s,tag:i,topics:o}=await p2(t,n),{addr:a,subs:l}=Rr(t);let u=l.get(i);if(!u){const f={address:a||t,topics:o},d=g=>{let y=s;if(y==null)try{y=t.interface.getEvent(g.topics[0])}catch{}if(y){const v=y,w=s?t.interface.decodeEventLog(s,g.data,g.topics):[];g2(t,n,w,A=>new Tie(t,A,n,v,g))}else g2(t,n,[],v=>new PP(t,v,n,g))};let h=[];u={tag:i,listeners:[],start:()=>{h.length||h.push(r.on(f,d))},stop:async()=>{if(h.length==0)return;let g=h;h=[],await Promise.all(g),r.off(f,d)}},l.set(i,u)}return u}let m2=Promise.resolve();async function Iie(t,e,n,r){await m2;const s=await Kh(t,e);if(!s)return!1;const i=s.listeners.length;return s.listeners=s.listeners.filter(({listener:o,once:a})=>{const l=Array.from(n);r&&l.push(r(a?null:o));try{o.call(t,...l)}catch{}return!a}),s.listeners.length===0&&(s.stop(),Rr(t).subs.delete(s.tag)),i>0}async function g2(t,e,n,r){try{await m2}catch{}const s=Iie(t,e,n,r);return m2=s,await s}const wy=["then"];zL=by;const vp=class vp{constructor(e,n,r,s){W(this,"target");W(this,"interface");W(this,"runner");W(this,"filters");W(this,zL);W(this,"fallback");$(typeof e=="string"||xR(e),"invalid value for Contract target","target",e),r==null&&(r=null);const i=f2.from(n);Oe(this,{target:e,runner:r,interface:i}),Object.defineProperty(this,by,{value:{}});let o,a=null,l=null;if(s){const f=Ll(r);l=new h2(this.interface,f,s)}let u=new Map;if(typeof e=="string")if(St(e))a=e,o=Promise.resolve(e);else{const f=Il(r,"resolveName");if(!yy(f))throw Nt("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(d=>{if(d==null)throw Nt("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Rr(this).addr=d,d})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Rr(this).addr=f,f});Rie(this,{addrPromise:o,addr:a,deployTx:l,subs:u});const c=new Proxy({},{get:(f,d,h)=>{if(typeof d=="symbol"||wy.indexOf(d)>=0)return Reflect.get(f,d,h);try{return this.getEvent(d)}catch(p){if(!gn(p,"INVALID_ARGUMENT")||p.argument!=="key")throw p}},has:(f,d)=>wy.indexOf(d)>=0?Reflect.has(f,d):Reflect.has(f,d)||this.interface.hasEvent(String(d))});return Oe(this,{filters:c}),Oe(this,{fallback:i.receive||i.fallback?_ie(this):null}),new Proxy(this,{get:(f,d,h)=>{if(typeof d=="symbol"||d in f||wy.indexOf(d)>=0)return Reflect.get(f,d,h);try{return f.getFunction(d)}catch(p){if(!gn(p,"INVALID_ARGUMENT")||p.argument!=="key")throw p}},has:(f,d)=>typeof d=="symbol"||d in f||wy.indexOf(d)>=0?Reflect.has(f,d):f.interface.hasFunction(d)})}connect(e){return new vp(this.target,this.interface,e)}attach(e){return new vp(e,this.interface,this.runner)}async getAddress(){return await Rr(this).addrPromise}async getDeployedCode(){const e=Ll(this.runner);ee(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await e.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=Ll(this.runner);return ee(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,i)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);r.once("block",o)}catch(a){i(a)}};o()})}deploymentTransaction(){return Rr(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),Mie(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),Nie(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:s,addrPromise:i}=Rr(this),o=s||await i,{fragment:a,topics:l}=await p2(this,e),u={address:o,topics:l,fromBlock:n,toBlock:r},c=Ll(this.runner);return ee(c,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await c.getLogs(u)).map(f=>{let d=a;if(d==null)try{d=this.interface.getEvent(f.topics[0])}catch{}if(d)try{return new d2(f,this.interface,d)}catch(h){return new RP(f,h)}return new Gh(f,c)})}async on(e,n){const r=await HP(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await HP(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await g2(this,e,n,null)}async listenerCount(e){if(e){const s=await Kh(this,e);return s?s.listeners.length:0}const{subs:n}=Rr(this);let r=0;for(const{listeners:s}of n.values())r+=s.length;return r}async listeners(e){if(e){const s=await Kh(this,e);return s?s.listeners.map(({listener:i})=>i):[]}const{subs:n}=Rr(this);let r=[];for(const{listeners:s}of n.values())r=r.concat(s.map(({listener:i})=>i));return r}async off(e,n){const r=await Kh(this,e);if(!r)return this;if(n){const s=r.listeners.map(({listener:i})=>i).indexOf(n);s>=0&&r.listeners.splice(s,1)}return(n==null||r.listeners.length===0)&&(r.stop(),Rr(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const n=await Kh(this,e);if(!n)return this;n.stop(),Rr(this).subs.delete(n.tag)}else{const{subs:n}=Rr(this);for(const{tag:r,stop:s}of n.values())s(),n.delete(r)}return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return await this.off(e,n)}static buildClass(e){class n extends vp{constructor(s,i=null){super(s,e,i)}}return n}static from(e,n,r){return r==null&&(r=null),new this(e,n,r)}};let y2=vp;function Lie(){return y2}class Vc extends Lie(){}function b2(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):$(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class Bie{constructor(e){W(this,"name");Oe(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,n){throw new Error("unsupported coin")}async decodeAddress(e,n){throw new Error("unsupported coin")}}const zP=new RegExp("^(ipfs)://(.*)$","i"),$P=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),zP,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")],Df=class Df{constructor(e,n,r){J(this,va);W(this,"provider");W(this,"address");W(this,"name");J(this,Aa);J(this,iu);Oe(this,{provider:e,address:n,name:r}),I(this,Aa,null),I(this,iu,new Vc(n,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return T(this,Aa)==null&&I(this,Aa,(async()=>{try{return await T(this,iu).supportsInterface("0x9061b923")}catch(e){if(gn(e,"CALL_EXCEPTION"))return!1;throw I(this,Aa,null),e}})()),await T(this,Aa)}async getAddress(e){if(e==null&&(e=60),e===60)try{const i=await fe(this,va,Jf).call(this,"addr(bytes32)");return i==null||i===Ph?null:i}catch(i){if(gn(i,"CALL_EXCEPTION"))return null;throw i}if(e>=0&&e<2147483648){let i=e+2147483648;const o=await fe(this,va,Jf).call(this,"addr(bytes32,uint)",[i]);if(St(o,20))return gt(o)}let n=null;for(const i of this.provider.plugins)if(i instanceof Bie&&i.supportsCoinType(e)){n=i;break}if(n==null)return null;const r=await fe(this,va,Jf).call(this,"addr(bytes32,uint)",[e]);if(r==null||r==="0x")return null;const s=await n.decodeAddress(e,r);if(s!=null)return s;ee(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const n=await fe(this,va,Jf).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await fe(this,va,Jf).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const n=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const s=n[1]==="e3010170"?"ipfs":"ipns",i=parseInt(n[4],16);if(n[5].length===i*2)return`${s}://${ine("0x"+n[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;ee(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(n==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let r=0;r<$P.length;r++){const s=n.match($P[r]);if(s==null)continue;const i=s[1].toLowerCase();switch(i){case"https":case"data":return e.push({type:"url",value:n}),{linkage:e,url:n};case"ipfs":{const o=b2(n);return e.push({type:"ipfs",value:n}),e.push({type:"url",value:o}),{linkage:e,url:o}}case"erc721":case"erc1155":{const o=i==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:i,value:n});const a=await this.getAddress();if(a==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const l=(s[2]||"").split("/");if(l.length!==2)return e.push({type:`!${i}caip`,value:s[2]||""}),{url:null,linkage:e};const u=l[1],c=new Vc(l[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(i==="erc721"){const m=await c.ownerOf(u);if(a!==m)return e.push({type:"!owner",value:m}),{url:null,linkage:e};e.push({type:"owner",value:m})}else if(i==="erc1155"){const m=await c.balanceOf(a,u);if(!m)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:m.toString()})}let f=await c[o](u);if(f==null||f==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:f}),i==="erc1155"&&(f=f.replace("{id}",Xo(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:f})),f.match(/^ipfs:/i)&&(f=b2(f)),e.push({type:"metadata-url",value:f});let d={};const h=await new Kn(f).send();h.assertOk();try{d=h.bodyJson}catch{try{e.push({type:"!metadata",value:h.bodyText})}catch{const y=h.body;return y&&e.push({type:"!metadata",value:we(y)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!d)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(d)});let p=d.image;if(typeof p!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!p.match(/^(https:\/\/|data:)/i)){if(p.match(zP)==null)return e.push({type:"!imageUrl-ipfs",value:p}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:p}),p=b2(p)}return e.push({type:"url",value:p}),{linkage:e,url:p}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){const n=await e.getNetwork(),r=n.getPlugin("org.ethers.plugins.network.Ens");return ee(r,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:n}}),r.address}static async fromName(e,n){var s;let r=n;for(;;){if(r===""||r==="."||n!=="eth"&&r==="eth")return null;const i=await fe(s=Df,lb,JL).call(s,e,r);if(i!=null){const o=new Df(e,i,n);return r!==n&&!await o.supportsWildcard()?null:o}r=r.split(".").slice(1).join(".")}}};Aa=new WeakMap,iu=new WeakMap,va=new WeakSet,Jf=async function(e,n){n=(n||[]).slice();const r=T(this,iu).interface;n.unshift(n2(this.name));let s=null;await this.supportsWildcard()&&(s=r.getFunction(e),ee(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),n=[Fse(this.name,255),r.encodeFunctionData(s,n)],e="resolve(bytes,bytes)"),n.push({enableCcipRead:!0});try{const i=await T(this,iu)[e](...n);return s?r.decodeFunctionResult(s,i)[0]:i}catch(i){if(!gn(i,"CALL_EXCEPTION"))throw i}return null},lb=new WeakSet,JL=async function(e,n){const r=await Df.getEnsAddress(e);try{const i=await new Vc(r,["function resolver(bytes32) view returns (address)"],e).resolver(n2(n),{enableCcipRead:!0});return i===Ph?null:i}catch(s){throw s}return null},J(Df,lb);let Ay=Df;const GP=BigInt(0);function lt(t,e){return function(n){return n==null?e:t(n)}}function vy(t,e){return n=>{if(e&&n==null)return null;if(!Array.isArray(n))throw new Error("not an array");return n.map(r=>t(r))}}function qh(t,e){return n=>{const r={};for(const s in t){let i=s;if(e&&s in e&&!(i in n)){for(const o of e[s])if(o in n){i=o;break}}try{const o=t[s](n[i]);o!==void 0&&(r[s]=o)}catch(o){const a=o instanceof Error?o.message:"not-an-error";ee(!1,`invalid value for value.${s} (${a})`,"BAD_DATA",{value:n})}}return r}}function Fie(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}$(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Hc(t){return $(St(t,!0),"invalid data","value",t),t}function Cn(t){return $(St(t,32),"invalid hash","value",t),t}const jie=qh({address:gt,blockHash:Cn,blockNumber:Qe,data:Hc,index:Qe,removed:lt(Fie,!1),topics:vy(Cn),transactionHash:Cn,transactionIndex:Qe},{index:["logIndex"]});function Uie(t){return jie(t)}const Vie=qh({hash:lt(Cn),parentHash:Cn,parentBeaconBlockRoot:lt(Cn,null),number:Qe,timestamp:Qe,nonce:lt(Hc),difficulty:xe,gasLimit:xe,gasUsed:xe,stateRoot:lt(Cn,null),receiptsRoot:lt(Cn,null),blobGasUsed:lt(xe,null),excessBlobGas:lt(xe,null),miner:lt(gt),prevRandao:lt(Cn,null),extraData:Hc,baseFeePerGas:lt(xe)},{prevRandao:["mixHash"]});function Hie(t){const e=Vie(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:WP(n)),e}const zie=qh({transactionIndex:Qe,blockNumber:Qe,transactionHash:Cn,address:gt,topics:vy(Cn),data:Hc,index:Qe,blockHash:Cn},{index:["logIndex"]});function $ie(t){return zie(t)}const Gie=qh({to:lt(gt,null),from:lt(gt,null),contractAddress:lt(gt,null),index:Qe,root:lt(we),gasUsed:xe,blobGasUsed:lt(xe,null),logsBloom:lt(Hc),blockHash:Cn,hash:Cn,logs:vy($ie),blockNumber:Qe,cumulativeGasUsed:xe,effectiveGasPrice:lt(xe),blobGasPrice:lt(xe,null),status:lt(Qe),type:lt(Qe,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function Wie(t){return Gie(t)}function WP(t){t.to&&xe(t.to)===GP&&(t.to="0x0000000000000000000000000000000000000000");const e=qh({hash:Cn,index:lt(Qe,void 0),type:n=>n==="0x"||n==null?0:Qe(n),accessList:lt(ia,null),blobVersionedHashes:lt(vy(Cn,!0),null),blockHash:lt(Cn,null),blockNumber:lt(Qe,null),transactionIndex:lt(Qe,null),from:gt,gasPrice:lt(xe),maxPriorityFeePerGas:lt(xe),maxFeePerGas:lt(xe),maxFeePerBlobGas:lt(xe,null),gasLimit:xe,to:lt(gt,null),value:xe,nonce:Qe,data:Hc,creates:lt(gt,null),chainId:lt(xe,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=Ure(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=Ss.from(t.signature):e.signature=Ss.from(t),e.chainId==null){const n=e.signature.legacyChainId;n!=null&&(e.chainId=n)}return e.blockHash&&xe(e.blockHash)===GP&&(e.blockHash=null),e}const Kie="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class Qh{constructor(e){W(this,"name");Oe(this,{name:e})}clone(){return new Qh(this.name)}}class xy extends Qh{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);W(this,"effectiveBlock");W(this,"txBase");W(this,"txCreate");W(this,"txDataZero");W(this,"txDataNonzero");W(this,"txAccessListStorageKey");W(this,"txAccessListAddress");const s={effectiveBlock:n};function i(o,a){let l=(r||{})[o];l==null&&(l=a),$(typeof l=="number",`invalud value for ${o}`,"costs",r),s[o]=l}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),Oe(this,s)}clone(){return new xy(this.effectiveBlock,this)}}class ky extends Qh{constructor(n,r){super("org.ethers.plugins.network.Ens");W(this,"address");W(this,"targetNetwork");Oe(this,{address:n||Kie,targetNetwork:r??1})}clone(){return new ky(this.address,this.targetNetwork)}}class qie extends Qh{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");J(this,xp);J(this,kp);I(this,xp,n),I(this,kp,r)}get url(){return T(this,xp)}get processFunc(){return T(this,kp)}clone(){return this}}xp=new WeakMap,kp=new WeakMap;const w2=new Map,Mf=class Mf{constructor(e,n){J(this,Of);J(this,_f);J(this,xa);I(this,Of,e),I(this,_f,xe(n)),I(this,xa,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return T(this,Of)}set name(e){I(this,Of,e)}get chainId(){return T(this,_f)}set chainId(e){I(this,_f,xe(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===xe(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===xe(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===xe(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(T(this,xa).values())}attachPlugin(e){if(T(this,xa).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return T(this,xa).set(e.name,e.clone()),this}getPlugin(e){return T(this,xa).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new Mf(this.name,this.chainId);return this.plugins.forEach(n=>{e.attachPlugin(n.clone())}),e}computeIntrinsicGas(e){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new xy;let r=n.txBase;if(e.to==null&&(r+=n.txCreate),e.data)for(let s=2;s<e.data.length;s+=2)e.data.substring(s,s+2)==="00"?r+=n.txDataZero:r+=n.txDataNonzero;if(e.accessList){const s=ia(e.accessList);for(const i in s)r+=n.txAccessListAddress+n.txAccessListStorageKey*s[i].storageKeys.length}return r}static from(e){if(Qie(),e==null)return Mf.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const n=w2.get(e);if(n)return n();if(typeof e=="bigint")return new Mf("unknown",e);$(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){$(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const n=new Mf(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&n.attachPlugin(new ky(e.ensAddress,e.ensNetwork)),n}$(!1,"invalid network","network",e)}static register(e,n){typeof e=="number"&&(e=BigInt(e));const r=w2.get(e);r&&$(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",e),w2.set(e,n)}};Of=new WeakMap,_f=new WeakMap,xa=new WeakMap;let rn=Mf;function KP(t,e){const n=String(t);if(!n.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${t}`);const r=n.split(".");if(r.length===1&&r.push(""),r.length!==2)throw new Error(`invalid gwei value: ${t}`);for(;r[1].length<e;)r[1]+="0";if(r[1].length>9){let s=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||s++,r[1]=s.toString()}return BigInt(r[0]+r[1])}function qP(t){return new qie(t,async(e,n,r)=>{r.setHeader("User-Agent","ethers");let s;try{const[i,o]=await Promise.all([r.send(),e()]);s=i;const a=s.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:KP(a.maxFee,9),maxPriorityFeePerGas:KP(a.maxPriorityFee,9)}}catch(i){ee(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:s,error:i})}})}let QP=!1;function Qie(){if(QP)return;QP=!0;function t(e,n,r){const s=function(){const i=new rn(e,n);return r.ensNetwork!=null&&i.attachPlugin(new ky(null,r.ensNetwork)),i.attachPlugin(new xy),(r.plugins||[]).forEach(o=>{i.attachPlugin(o)}),i};rn.register(e,s),rn.register(n,s),r.altNames&&r.altNames.forEach(i=>{rn.register(i,s)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("linea-sepolia",59141,{}),t("matic",137,{ensNetwork:1,plugins:[qP("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[qP("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function A2(t){return JSON.parse(JSON.stringify(t))}class Jie{constructor(e){J(this,Nf);J(this,ho);J(this,ss);J(this,ka);J(this,wi);I(this,ho,e),I(this,ss,null),I(this,ka,4e3),I(this,wi,-2)}get pollingInterval(){return T(this,ka)}set pollingInterval(e){I(this,ka,e)}start(){T(this,ss)||(I(this,ss,T(this,ho)._setTimeout(fe(this,Nf,gb).bind(this),T(this,ka))),fe(this,Nf,gb).call(this))}stop(){T(this,ss)&&(T(this,ho)._clearTimeout(T(this,ss)),I(this,ss,null))}pause(e){this.stop(),e&&I(this,wi,-2)}resume(){this.start()}}ho=new WeakMap,ss=new WeakMap,ka=new WeakMap,wi=new WeakMap,Nf=new WeakSet,gb=async function(){try{const e=await T(this,ho).getBlockNumber();if(T(this,wi)===-2){I(this,wi,e);return}if(e!==T(this,wi)){for(let n=T(this,wi)+1;n<=e;n++){if(T(this,ss)==null)return;await T(this,ho).emit("block",n)}I(this,wi,e)}}catch{}T(this,ss)!=null&&I(this,ss,T(this,ho)._setTimeout(fe(this,Nf,gb).bind(this),T(this,ka)))};class v2{constructor(e){J(this,ou);J(this,au);J(this,Ea);I(this,ou,e),I(this,Ea,!1),I(this,au,n=>{this._poll(n,T(this,ou))})}async _poll(e,n){throw new Error("sub-classes must override this")}start(){T(this,Ea)||(I(this,Ea,!0),T(this,au).call(this,-2),T(this,ou).on("block",T(this,au)))}stop(){T(this,Ea)&&(I(this,Ea,!1),T(this,ou).off("block",T(this,au)))}pause(e){this.stop()}resume(){this.start()}}ou=new WeakMap,au=new WeakMap,Ea=new WeakMap;class Yie extends v2{constructor(n,r){super(n);J(this,Rf);J(this,po);I(this,Rf,r),I(this,po,-2)}pause(n){n&&I(this,po,-2),super.pause(n)}async _poll(n,r){const s=await r.getBlock(T(this,Rf));s!=null&&(T(this,po)===-2?I(this,po,s.number):s.number>T(this,po)&&(r.emit(T(this,Rf),s.number),I(this,po,s.number)))}}Rf=new WeakMap,po=new WeakMap;class Xie extends v2{constructor(n,r){super(n);J(this,ub);I(this,ub,A2(r))}async _poll(n,r){throw new Error("@TODO")}}ub=new WeakMap;class Zie extends v2{constructor(n,r){super(n);J(this,Pf);I(this,Pf,r)}async _poll(n,r){const s=await r.getTransactionReceipt(T(this,Pf));s&&r.emit(T(this,Pf),s)}}Pf=new WeakMap;class x2{constructor(e,n){J(this,cb);J(this,mo);J(this,If);J(this,Lf);J(this,Ca);J(this,is);I(this,mo,e),I(this,If,A2(n)),I(this,Lf,fe(this,cb,YL).bind(this)),I(this,Ca,!1),I(this,is,-2)}start(){T(this,Ca)||(I(this,Ca,!0),T(this,is)===-2&&T(this,mo).getBlockNumber().then(e=>{I(this,is,e)}),T(this,mo).on("block",T(this,Lf)))}stop(){T(this,Ca)&&(I(this,Ca,!1),T(this,mo).off("block",T(this,Lf)))}pause(e){this.stop(),e&&I(this,is,-2)}resume(){this.start()}}mo=new WeakMap,If=new WeakMap,Lf=new WeakMap,Ca=new WeakMap,is=new WeakMap,cb=new WeakSet,YL=async function(e){if(T(this,is)===-2)return;const n=A2(T(this,If));n.fromBlock=T(this,is)+1,n.toBlock=e;const r=await T(this,mo).getLogs(n);if(r.length===0){T(this,is)<e-60&&I(this,is,e-60);return}for(const s of r)T(this,mo).emit(T(this,If),s),I(this,is,s.blockNumber)};const eoe=BigInt(2),toe=10;function Ey(t){return t&&typeof t.then=="function"}function Cy(t,e){return t+":"+JSON.stringify(e,(n,r)=>{if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const s=Object.keys(r);return s.sort(),s.reduce((i,o)=>(i[o]=r[o],i),{})}return r})}class Sy{constructor(e){W(this,"name");Oe(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function noe(t){return JSON.parse(JSON.stringify(t))}function k2(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function E2(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(St(t,32)){const n=t.toLowerCase();return{type:"transaction",tag:Cy("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:Cy("orphan",n),filter:noe(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(s=>s==null?null:Array.isArray(s)?k2(s.map(i=>i.toLowerCase())):s.toLowerCase())};if(n.address){const s=[],i=[],o=a=>{St(a)?s.push(a):i.push((async()=>{s.push(await Qn(a,e))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),i.length&&await Promise.all(i),r.address=k2(s.map(a=>a.toLowerCase()))}return{filter:r,tag:Cy("event",r),type:"event"}}$(!1,"unknown ProviderEvent","event",t)}function C2(){return new Date().getTime()}const roe={cacheTimeout:250,pollingInterval:4e3};class Ty{constructor(e,n){J(this,st);J(this,Bn);J(this,Sa);J(this,Fn);J(this,Bf);J(this,Fr);J(this,lu);J(this,Ta);J(this,go);J(this,Ep);J(this,as);J(this,Ff);J(this,jf);if(I(this,jf,Object.assign({},roe,n||{})),e==="any")I(this,lu,!0),I(this,Fr,null);else if(e){const r=rn.from(e);I(this,lu,!1),I(this,Fr,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else I(this,lu,!1),I(this,Fr,null);I(this,go,-1),I(this,Ta,new Map),I(this,Bn,new Map),I(this,Sa,new Map),I(this,Fn,null),I(this,Bf,!1),I(this,Ep,1),I(this,as,new Map),I(this,Ff,!1)}get pollingInterval(){return T(this,jf).pollingInterval}get provider(){return this}get plugins(){return Array.from(T(this,Sa).values())}attachPlugin(e){if(T(this,Sa).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return T(this,Sa).set(e.name,e.connect(this)),this}getPlugin(e){return T(this,Sa).get(e)||null}get disableCcipRead(){return T(this,Ff)}set disableCcipRead(e){I(this,Ff,!!e)}async ccipReadFetch(e,n,r){if(this.disableCcipRead||r.length===0||e.to==null)return null;const s=e.to.toLowerCase(),i=n.toLowerCase(),o=[];for(let a=0;a<r.length;a++){const l=r[a],u=l.replace("{sender}",s).replace("{data}",i),c=new Kn(u);l.indexOf("{data}")===-1&&(c.body={data:i,sender:s}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:c,index:a,urls:r});let f="unknown error";const d=await c.send();try{const h=d.bodyJson;if(h.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:c,result:h}),h.data;h.message&&(f=h.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:c,result:h})}catch{}ee(d.statusCode<400||d.statusCode>=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:f}}),o.push(f)}ee(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:o}})}_wrapBlock(e,n){return new kie(Hie(e),this)}_wrapLog(e,n){return new Gh(Uie(e),this)}_wrapTransactionReceipt(e,n){return new _P(Wie(e),this)}_wrapTransactionResponse(e,n){return new Wh(WP(e),this)}_detectNetwork(){ee(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){ee(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Qe(await fe(this,st,jr).call(this,{method:"getBlockNumber"}),"%response");return T(this,go)>=0&&I(this,go,e),e}_getAddress(e){return Qn(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(St(e))return St(e,32)?e:kl(e);if(typeof e=="bigint"&&(e=Qe(e,"blockTag")),typeof e=="number")return e>=0?kl(e):T(this,go)>=0?kl(T(this,go)+e):this.getBlockNumber().then(n=>kl(n+e));$(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?k2(l.map(u=>u.toLowerCase())):l.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,s=(l,u,c)=>{let f;switch(l.length){case 0:break;case 1:f=l[0];break;default:l.sort(),f=l}if(r&&(u!=null||c!=null))throw new Error("invalid filter");const d={};return f&&(d.address=f),n.length&&(d.topics=n),u&&(d.fromBlock=u),c&&(d.toBlock=c),r&&(d.blockHash=r),d};let i=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)i.push(this._getAddress(l));else i.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),i.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(i),o,a]).then(l=>s(l[0],l[1],l[2])):s(i,o,a)}_getTransactionRequest(e){const n=gy(e),r=[];if(["to","from"].forEach(s=>{if(n[s]==null)return;const i=Qn(n[s],this);Ey(i)?r.push(async function(){n[s]=await i}()):n[s]=i}),n.blockTag!=null){const s=this._getBlockTag(n.blockTag);Ey(s)?r.push(async function(){n.blockTag=await s}()):n.blockTag=s}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(T(this,Fr)==null){const s=(async()=>{try{const i=await this._detectNetwork();return this.emit("network",i,null),i}catch(i){throw T(this,Fr)===s&&I(this,Fr,null),i}})();return I(this,Fr,s),(await s).clone()}const e=T(this,Fr),[n,r]=await Promise.all([e,this._detectNetwork()]);return n.chainId!==r.chainId&&(T(this,lu)?(this.emit("network",r,n),T(this,Fr)===e&&I(this,Fr,Promise.resolve(r))):ee(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const e=await this.getNetwork(),n=async()=>{const{_block:s,gasPrice:i,priorityFee:o}=await Nn({_block:fe(this,st,nE).call(this,"latest",!1),gasPrice:(async()=>{try{const c=await fe(this,st,jr).call(this,{method:"getGasPrice"});return xe(c,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const c=await fe(this,st,jr).call(this,{method:"getPriorityFee"});return xe(c,"%response")}catch{}return null})()});let a=null,l=null;const u=this._wrapBlock(s,e);return u&&u.baseFeePerGas&&(l=o??BigInt("1000000000"),a=u.baseFeePerGas*eoe+l),new OP(i,a,l)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const s=new Kn(r.url),i=await r.processFunc(n,this,s);return new OP(i.gasPrice,i.maxFeePerGas,i.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return Ey(n)&&(n=await n),xe(await fe(this,st,jr).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await Nn({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await fe(this,st,tE).call(this,fe(this,st,eE).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return xe(await fe(this,st,_p).call(this,{method:"getBalance"},e,n),"%response")}async getTransactionCount(e,n){return Qe(await fe(this,st,_p).call(this,{method:"getTransactionCount"},e,n),"%response")}async getCode(e,n){return we(await fe(this,st,_p).call(this,{method:"getCode"},e,n))}async getStorage(e,n,r){const s=xe(n,"position");return we(await fe(this,st,_p).call(this,{method:"getStorage",position:s},e,r))}async broadcastTransaction(e){const{blockNumber:n,hash:r,network:s}=await Nn({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=zh.from(e);if(i.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,s).replaceableTransaction(n)}async getBlock(e,n){const{network:r,params:s}=await Nn({network:this.getNetwork(),params:fe(this,st,nE).call(this,e,!!n)});return s==null?null:this._wrapBlock(s,r)}async getTransaction(e){const{network:n,params:r}=await Nn({network:this.getNetwork(),params:fe(this,st,jr).call(this,{method:"getTransaction",hash:e})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(e){const{network:n,params:r}=await Nn({network:this.getNetwork(),params:fe(this,st,jr).call(this,{method:"getTransactionReceipt",hash:e})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const s=await fe(this,st,jr).call(this,{method:"getTransaction",hash:e});if(s==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=s.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(e){const{result:n}=await Nn({network:this.getNetwork(),result:fe(this,st,jr).call(this,{method:"getTransactionResult",hash:e})});return n==null?null:we(n)}async getLogs(e){let n=this._getFilter(e);Ey(n)&&(n=await n);const{network:r,params:s}=await Nn({network:this.getNetwork(),params:fe(this,st,jr).call(this,{method:"getLogs",filter:n})});return s.map(i=>this._wrapLog(i,r))}_getProvider(e){ee(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Ay.fromName(this,e)}async getAvatar(e){const n=await this.getResolver(e);return n?await n.getAvatar():null}async resolveName(e){const n=await this.getResolver(e);return n?await n.getAddress():null}async lookupAddress(e){e=gt(e);const n=n2(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await Ay.getEnsAddress(this),i=await new Vc(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(i==null||i===Ph)return null;const a=await new Vc(i,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(a)!==e?null:a}catch(r){if(gn(r,"BAD_DATA")&&r.value==="0x"||gn(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(e,n,r){const s=n??1;return s===0?this.getTransactionReceipt(e):new Promise(async(i,o)=>{let a=null;const l=async u=>{try{const c=await this.getTransactionReceipt(e);if(c!=null&&u-c.blockNumber+1>=s){i(c),a&&(clearTimeout(a),a=null);return}}catch(c){console.log("EEE",c)}this.once("block",l)};r!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",l),o(Nt("timeout","TIMEOUT",{reason:"timeout"})))},r)),l(await this.getBlockNumber())})}async waitForBlock(e){ee(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const n=T(this,as).get(e);n&&(n.timer&&clearTimeout(n.timer),T(this,as).delete(e))}_setTimeout(e,n){n==null&&(n=0);const r=Dp(this,Ep)._++,s=()=>{T(this,as).delete(r),e()};if(this.paused)T(this,as).set(r,{timer:null,func:s,time:n});else{const i=setTimeout(s,n);T(this,as).set(r,{timer:i,func:s,time:C2()})}return r}_forEachSubscriber(e){for(const n of T(this,Bn).values())e(n.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new Sy(e.type);case"block":{const n=new Jie(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new Yie(this,e.type);case"event":return new x2(this,e.filter);case"transaction":return new Zie(this,e.hash);case"orphan":return new Xie(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,n){for(const r of T(this,Bn).values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),T(this,Fn)!=null&&n.pause(T(this,Fn));break}}async on(e,n){const r=await fe(this,st,yb).call(this,e);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,T(this,Fn)!=null&&r.subscriber.pause(T(this,Fn))),this}async once(e,n){const r=await fe(this,st,yb).call(this,e);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,T(this,Fn)!=null&&r.subscriber.pause(T(this,Fn))),this}async emit(e,...n){const r=await fe(this,st,Mp).call(this,e,n);if(!r||r.listeners.length===0)return!1;const s=r.listeners.length;return r.listeners=r.listeners.filter(({listener:i,once:o})=>{const a=new d4(this,o?null:i,e);try{i.call(this,...n,a)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),T(this,Bn).delete(r.tag)),s>0}async listenerCount(e){if(e){const r=await fe(this,st,Mp).call(this,e);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of T(this,Bn).values())n+=r.length;return n}async listeners(e){if(e){const r=await fe(this,st,Mp).call(this,e);return r?r.listeners.map(({listener:s})=>s):[]}let n=[];for(const{listeners:r}of T(this,Bn).values())n=n.concat(r.map(({listener:s})=>s));return n}async off(e,n){const r=await fe(this,st,Mp).call(this,e);if(!r)return this;if(n){const s=r.listeners.map(({listener:i})=>i).indexOf(n);s>=0&&r.listeners.splice(s,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),T(this,Bn).delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:n,started:r,subscriber:s}=await fe(this,st,yb).call(this,e);r&&s.stop(),T(this,Bn).delete(n)}else for(const[n,{started:r,subscriber:s}]of T(this,Bn))r&&s.stop(),T(this,Bn).delete(n);return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return this.off(e,n)}get destroyed(){return T(this,Bf)}destroy(){this.removeAllListeners();for(const e of T(this,as).keys())this._clearTimeout(e);I(this,Bf,!0)}get paused(){return T(this,Fn)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(I(this,go,-1),T(this,Fn)!=null){if(T(this,Fn)==!!e)return;ee(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(e)),I(this,Fn,!!e);for(const n of T(this,as).values())n.timer&&clearTimeout(n.timer),n.time=C2()-n.time}resume(){if(T(this,Fn)!=null){this._forEachSubscriber(e=>e.resume()),I(this,Fn,null);for(const e of T(this,as).values()){let n=e.time;n<0&&(n=0),e.time=C2(),setTimeout(e.func,n)}}}}Bn=new WeakMap,Sa=new WeakMap,Fn=new WeakMap,Bf=new WeakMap,Fr=new WeakMap,lu=new WeakMap,Ta=new WeakMap,go=new WeakMap,Ep=new WeakMap,as=new WeakMap,Ff=new WeakMap,jf=new WeakMap,st=new WeakSet,jr=async function(e){const n=T(this,jf).cacheTimeout;if(n<0)return await this._perform(e);const r=Cy(e.method,e);let s=T(this,Ta).get(r);return s||(s=this._perform(e),T(this,Ta).set(r,s),setTimeout(()=>{T(this,Ta).get(r)===s&&T(this,Ta).delete(r)},n)),await s},eE=async function(e,n,r){ee(r<toe,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:n,enableCcipRead:!0})});const s=gy(e);try{return we(await this._perform({method:"call",transaction:s,blockTag:n}))}catch(i){if(!this.disableCcipRead&&Ax(i)&&i.data&&r>=0&&n==="latest"&&s.to!=null&&Ht(i.data,0,4)==="0x556f1830"){const o=i.data,a=await Qn(s.to,this);let l;try{l=loe(Ht(i.data,4))}catch(f){ee(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:o}})}ee(l.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const u=await this.ccipReadFetch(s,l.calldata,l.urls);ee(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:i.data,errorArgs:l.errorArgs}});const c={to:a,data:$t([l.selector,aoe([u,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:c});try{const f=await fe(this,st,eE).call(this,c,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},c),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},c),error:f}),f}}throw i}},tE=async function(e){const{value:n}=await Nn({network:this.getNetwork(),value:e});return n},_p=async function(e,n,r){let s=this._getAddress(n),i=this._getBlockTag(r);return(typeof s!="string"||typeof i!="string")&&([s,i]=await Promise.all([s,i])),await fe(this,st,tE).call(this,fe(this,st,jr).call(this,Object.assign(e,{address:s,blockTag:i})))},nE=async function(e,n){if(St(e,32))return await fe(this,st,jr).call(this,{method:"getBlock",blockHash:e,includeTransactions:n});let r=this._getBlockTag(e);return typeof r!="string"&&(r=await r),await fe(this,st,jr).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},Mp=async function(e,n){let r=await E2(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await E2({orphan:"drop-log",log:n[0]},this)),T(this,Bn).get(r.tag)||null},yb=async function(e){const n=await E2(e,this),r=n.tag;let s=T(this,Bn).get(r);return s||(s={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},T(this,Bn).set(r,s)),s};function soe(t,e){try{const n=S2(t,e);if(n)return Tc(n)}catch{}return null}function S2(t,e){if(t==="0x")return null;try{const n=Qe(Ht(t,e,e+32)),r=Qe(Ht(t,n,n+32));return Ht(t,n+32,n+32+r)}catch{}return null}function JP(t){const e=Wn(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function ioe(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const ooe=new Uint8Array([]);function aoe(t){const e=[];let n=0;for(let r=0;r<t.length;r++)e.push(ooe),n+=32;for(let r=0;r<t.length;r++){const s=ct(t[r]);e[r]=JP(n),e.push(JP(s.length)),e.push(ioe(s)),n+=32+Math.ceil(s.length/32)*32}return $t(e)}const YP="0x0000000000000000000000000000000000000000000000000000000000000000";function loe(t){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};ee(Cc(t)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Ht(t,0,32);ee(Ht(n,0,12)===Ht(YP,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Ht(n,12);try{const r=[],s=Qe(Ht(t,32,64)),i=Qe(Ht(t,s,s+32)),o=Ht(t,s+32);for(let a=0;a<i;a++){const l=soe(o,a*32);if(l==null)throw new Error("abort");r.push(l)}e.urls=r}catch{ee(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const r=S2(t,64);if(r==null)throw new Error("abort");e.calldata=r}catch{ee(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}ee(Ht(t,100,128)===Ht(YP,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=Ht(t,96,100);try{const r=S2(t,128);if(r==null)throw new Error("abort");e.extraData=r}catch{ee(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(r=>e[r]),e}function zc(t,e){if(t.provider)return t.provider;ee(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function XP(t,e){let n=gy(e);if(n.to!=null&&(n.to=Qn(n.to,t)),n.from!=null){const r=n.from;n.from=Promise.all([t.getAddress(),Qn(r,t)]).then(([s,i])=>($(s.toLowerCase()===i.toLowerCase(),"transaction from mismatch","tx.from",i),s))}else n.from=t.getAddress();return await Nn(n)}class uoe{constructor(e){W(this,"provider");Oe(this,{provider:e||null})}async getNonce(e){return zc(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await XP(this,e)}async populateTransaction(e){const n=zc(this,"populateTransaction"),r=await XP(this,e);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const s=await this.provider.getNetwork();if(r.chainId!=null){const o=xe(r.chainId);$(o===s.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=s.chainId;const i=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||i)?$(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&i&&$(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const o=await n.getFeeData();ee(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{const o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const a=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=a,r.maxPriorityFeePerGas=a}else r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(ee(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):ee(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(r.type===2||r.type===3)&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await Nn(r)}async estimateGas(e){return zc(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return zc(this,"call").call(await this.populateCall(e))}async resolveName(e){return await zc(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=zc(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const s=zh.from(r);return await n.broadcastTransaction(await this.signTransaction(s))}}const ZP=new Set;function $c(t){ZP.has(t)||(ZP.add(t),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${t} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))}function coe(t){return JSON.parse(JSON.stringify(t))}class eI{constructor(e){J(this,Oa);J(this,Yn);J(this,Ai);J(this,uu);J(this,Da);J(this,cu);J(this,Uf);I(this,Yn,e),I(this,Ai,null),I(this,uu,fe(this,Oa,rE).bind(this)),I(this,Da,!1),I(this,cu,null),I(this,Uf,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,n){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){T(this,Da)||(I(this,Da,!0),fe(this,Oa,rE).call(this,-2))}stop(){T(this,Da)&&(I(this,Da,!1),I(this,Uf,!0),fe(this,Oa,sE).call(this),T(this,Yn).off("block",T(this,uu)))}pause(e){e&&fe(this,Oa,sE).call(this),T(this,Yn).off("block",T(this,uu))}resume(){this.start()}}Yn=new WeakMap,Ai=new WeakMap,uu=new WeakMap,Da=new WeakMap,cu=new WeakMap,Uf=new WeakMap,Oa=new WeakSet,rE=async function(e){try{T(this,Ai)==null&&I(this,Ai,this._subscribe(T(this,Yn)));let n=null;try{n=await T(this,Ai)}catch(i){if(!gn(i,"UNSUPPORTED_OPERATION")||i.operation!=="eth_newFilter")throw i}if(n==null){I(this,Ai,null),T(this,Yn)._recoverSubscriber(this,this._recover(T(this,Yn)));return}const r=await T(this,Yn).getNetwork();if(T(this,cu)||I(this,cu,r),T(this,cu).chainId!==r.chainId)throw new Error("chaid changed");if(T(this,Uf))return;const s=await T(this,Yn).send("eth_getFilterChanges",[n]);await this._emitResults(T(this,Yn),s)}catch(n){console.log("@TODO",n)}T(this,Yn).once("block",T(this,uu))},sE=function(){const e=T(this,Ai);e&&(I(this,Ai,null),e.then(n=>{T(this,Yn).destroyed||T(this,Yn).send("eth_uninstallFilter",[n])}))};class foe extends eI{constructor(n,r){super(n);J(this,fu);I(this,fu,coe(r))}_recover(n){return new x2(n,T(this,fu))}async _subscribe(n){return await n.send("eth_newFilter",[T(this,fu)])}async _emitResults(n,r){for(const s of r)n.emit(T(this,fu),n._wrapLog(s,n._network))}}fu=new WeakMap;class doe extends eI{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}}const hoe="bigint,boolean,function,number,string,symbol".split(/,/g);function Dy(t){if(t==null||hoe.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(Dy);if(typeof t=="object")return Object.keys(t).reduce((e,n)=>(e[n]=t[n],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function poe(t){return new Promise(e=>{setTimeout(e,t)})}function Gc(t){return t&&t.toLowerCase()}function tI(t){return t&&typeof t.pollingInterval=="number"}const nI={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class T2 extends uoe{constructor(n,r){super(n);W(this,"address");r=gt(r),Oe(this,{address:r})}connect(n){ee(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=Dy(n),s=[];if(r.from){const o=r.from;s.push((async()=>{const a=await Qn(o,this.provider);$(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a})())}else r.from=this.address;if(r.gasLimit==null&&s.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;s.push((async()=>{r.to=await Qn(o,this.provider)})())}s.length&&await Promise.all(s);const i=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[i])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),s=await this.sendUncheckedTransaction(n);return await new Promise((i,o)=>{const a=[1e3,100];let l=0;const u=async()=>{try{const c=await this.provider.getTransaction(s);if(c!=null){i(c.replaceableTransaction(r));return}}catch(c){if(gn(c,"CANCELLED")||gn(c,"BAD_DATA")||gn(c,"NETWORK_ERROR")){c.info==null&&(c.info={}),c.info.sendTransactionHash=s,o(c);return}if(gn(c,"INVALID_ARGUMENT")&&(l++,c.info==null&&(c.info={}),c.info.sendTransactionHash=s,l>10)){o(c);return}this.provider.emit("error",Nt("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:c}))}this.provider._setTimeout(()=>{u()},a.pop()||4e3)};u()})}async signTransaction(n){const r=Dy(n);if(r.from){const i=await Qn(r.from,this.provider);$(i!=null&&i.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=i}else r.from=this.address;const s=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[s])}async signMessage(n){const r=typeof n=="string"?Vi(n):n;return await this.provider.send("personal_sign",[we(r),this.address.toLowerCase()])}async signTypedData(n,r,s){const i=Dy(s),o=await hy.resolveNames(n,r,i,async a=>{const l=await Qn(a);return $(l!=null,"TypedData does not support null address","value",a),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(hy.getPayload(o.domain,r,o.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?Vi(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),we(r)])}}class rI extends Ty{constructor(n,r){super(n,r);J(this,Cp);J(this,du);J(this,Vf);J(this,yo);J(this,vi);J(this,Rs);J(this,ls);J(this,mr);I(this,Vf,1),I(this,du,Object.assign({},nI,r||{})),I(this,yo,[]),I(this,vi,null),I(this,ls,null),I(this,mr,null);{let i=null;const o=new Promise(a=>{i=a});I(this,Rs,{promise:o,resolve:i})}const s=this._getOption("staticNetwork");typeof s=="boolean"?($(!s||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),s&&n!=null&&I(this,ls,rn.from(n))):s&&($(n==null||s.matches(n),"staticNetwork MUST match network object","options",r),I(this,ls,s))}_getOption(n){return T(this,du)[n]}get _network(){return ee(T(this,ls),"network is not available yet","NETWORK_ERROR"),T(this,ls)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let s=n.transaction;if(s&&s.type!=null&&xe(s.type)&&s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null){const i=await this.getFeeData();i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},s,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if(T(this,ls))return T(this,ls)}else return n;return T(this,mr)?await T(this,mr):this.ready?(I(this,mr,(async()=>{try{const r=rn.from(xe(await this.send("eth_chainId",[])));return I(this,mr,null),r}catch(r){throw I(this,mr,null),r}})()),await T(this,mr)):(I(this,mr,(async()=>{const r={id:Dp(this,Vf)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let s;try{s=(await this._send(r))[0],I(this,mr,null)}catch(i){throw I(this,mr,null),this.emit("debug",{action:"receiveRpcError",error:i}),i}if(this.emit("debug",{action:"receiveRpcResult",result:s}),"result"in s)return rn.from(xe(s.result));throw this.getRpcError(r,s)})()),await T(this,mr))}_start(){T(this,Rs)==null||T(this,Rs).resolve==null||(T(this,Rs).resolve(),I(this,Rs,null),(async()=>{for(;T(this,ls)==null&&!this.destroyed;)try{I(this,ls,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Nt("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await poe(1e3)}fe(this,Cp,iE).call(this)})())}async _waitUntilReady(){if(T(this,Rs)!=null)return await T(this,Rs).promise}_getSubscriber(n){return n.type==="pending"?new doe(this):n.type==="event"?this._getOption("polling")?new x2(this,n.filter):new foe(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new Sy("orphan"):super._getSubscriber(n)}get ready(){return T(this,Rs)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(s=>{if(n[s]==null)return;let i=s;s==="gasLimit"&&(i="gas"),r[i]=kl(xe(n[s],`tx.${s}`))}),["from","to","data"].forEach(s=>{n[s]!=null&&(r[s]=we(n[s]))}),n.accessList&&(r.accessList=ia(n.accessList)),n.blobVersionedHashes&&(r.blobVersionedHashes=n.blobVersionedHashes.map(s=>s.toLowerCase())),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Gc(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Gc(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[Gc(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Gc(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map(Gc):n.filter.address=Gc(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:s}=n,{error:i}=r;if(s==="eth_estimateGas"&&i.message){const l=i.message;if(!l.match(/revert/i)&&l.match(/insufficient funds/i))return Nt("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:i}})}if(s==="eth_call"||s==="eth_estimateGas"){const l=D2(i),u=jc.getBuiltinCallException(s==="eth_call"?"call":"estimateGas",n.params[0],l?l.data:null);return u.info={error:i,payload:n},u}const o=JSON.stringify(goe(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i))return Nt("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[s]||"unknown",reason:"rejected",info:{payload:n,error:i}});if(s==="eth_sendRawTransaction"||s==="eth_sendTransaction"){const l=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return Nt("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:i}});if(o.match(/nonce/i)&&o.match(/too low/i))return Nt("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:i}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return Nt("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:i}});if(o.match(/only replay-protected/i))return Nt("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:s,info:{transaction:l,info:{error:i}}})}let a=!!o.match(/the method .* does not exist/i);return a||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(a=!0),a?Nt("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:i,payload:n}}):Nt("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(Nt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const s=Dp(this,Vf)._++,i=new Promise((o,a)=>{T(this,yo).push({resolve:o,reject:a,payload:{method:n,params:r,id:s,jsonrpc:"2.0"}})});return fe(this,Cp,iE).call(this),i}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const i=await r;if(n>=i.length)throw new Error("no such account");return new T2(this,i[n])}const{accounts:s}=await Nn({network:this.getNetwork(),accounts:r});n=gt(n);for(const i of s)if(gt(i)===n)return new T2(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new T2(this,r))}destroy(){T(this,vi)&&(clearTimeout(T(this,vi)),I(this,vi,null));for(const{payload:n,reject:r}of T(this,yo))r(Nt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));I(this,yo,[]),super.destroy()}}du=new WeakMap,Vf=new WeakMap,yo=new WeakMap,vi=new WeakMap,Rs=new WeakMap,ls=new WeakMap,mr=new WeakMap,Cp=new WeakSet,iE=function(){if(T(this,vi))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");I(this,vi,setTimeout(()=>{I(this,vi,null);const r=T(this,yo);for(I(this,yo,[]);r.length;){const s=[r.shift()];for(;r.length&&s.length!==T(this,du).batchMaxCount;)if(s.push(r.shift()),JSON.stringify(s.map(o=>o.payload)).length>T(this,du).batchMaxSize){r.unshift(s.pop());break}(async()=>{const i=s.length===1?s[0].payload:s.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:i});try{const o=await this._send(i);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:a,reject:l,payload:u}of s){if(this.destroyed){l(Nt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:u.method}));continue}const c=o.filter(f=>f.id===u.id)[0];if(c==null){const f=Nt("missing response for request","BAD_DATA",{value:o,info:{payload:u}});this.emit("error",f),l(f);continue}if("error"in c){l(this.getRpcError(u,c));continue}a(c.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:a}of s)a(o)}})()}},n))};class moe extends rI{constructor(n,r){super(n,r);J(this,_a);let s=this._getOption("pollingInterval");s==null&&(s=nI.pollingInterval),I(this,_a,s)}_getSubscriber(n){const r=super._getSubscriber(n);return tI(r)&&(r.pollingInterval=T(this,_a)),r}get pollingInterval(){return T(this,_a)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");I(this,_a,n),this._forEachSubscriber(r=>{tI(r)&&(r.pollingInterval=T(this,_a))})}}_a=new WeakMap;class Qi extends moe{constructor(n,r,s){n==null&&(n="http://localhost:8545");super(r,s);J(this,Hf);typeof n=="string"?I(this,Hf,new Kn(n)):I(this,Hf,n.clone())}_getConnection(){return T(this,Hf).clone()}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){const r=this._getConnection();r.body=JSON.stringify(n),r.setHeader("content-type","application/json");const s=await r.send();s.assertOk();let i=s.bodyJson;return Array.isArray(i)||(i=[i]),i}}Hf=new WeakMap;function D2(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&St(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const n=D2(t[e]);if(n)return n}return null}if(typeof t=="string")try{return D2(JSON.parse(t))}catch{}return null}function O2(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)O2(t[n],e);if(typeof t=="string")try{return O2(JSON.parse(t),e)}catch{}}}function goe(t){const e=[];return O2(t,e),e}const Oy="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function yoe(t){switch(t){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}$(!1,"unsupported network","network",t)}class _y extends Qi{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Oy);const i={polling:!0,staticNetwork:s},o=_y.getRequest(s,r);super(o,s,i);W(this,"apiKey");Oe(this,{apiKey:r})}_getProvider(n){try{return new _y(n,this.apiKey)}catch{}return super._getProvider(n)}static getRequest(n,r){r==null&&(r=Oy);const s=new Kn(`https://${yoe(n.name)}/${r}`);return s.allowGzip=!0,r===Oy&&(s.retryFunc=async(i,o,a)=>($c("AnkrProvider"),!0)),s}getRpcError(n,r){return n.method==="eth_sendRawTransaction"&&r&&r.error&&r.error.message==="INTERNAL_ERROR: could not replace existing tx"&&(r.error.message="replacement transaction underpriced"),super.getRpcError(n,r)}isCommunityResource(){return this.apiKey===Oy}}const My="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function boe(t){switch(t){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-amoy":return"polygon-amoy.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}$(!1,"unsupported network","network",t)}class Ny extends Qi{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=My);const i=Ny.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"apiKey");Oe(this,{apiKey:r})}_getProvider(n){try{return new Ny(n,this.apiKey)}catch{}return super._getProvider(n)}async _perform(n){if(n.method==="getTransactionResult"){const{trace:r,tx:s}=await Nn({trace:this.send("trace_transaction",[n.hash]),tx:this.getTransaction(n.hash)});if(r==null||s==null)return null;let i,o=!1;try{i=r[0].result.output,o=r[0].error==="Reverted"}catch{}if(i)return ee(!o,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:i,reason:null,transaction:s,invocation:null,revert:null}),i;ee(!1,"could not parse trace result","BAD_DATA",{value:r})}return await super._perform(n)}isCommunityResource(){return this.apiKey===My}static getRequest(n,r){r==null&&(r=My);const s=new Kn(`https://${boe(n.name)}/v2/${r}`);return s.allowGzip=!0,r===My&&(s.retryFunc=async(i,o,a)=>($c("alchemy"),!0)),s}}function Ry(t){switch(t){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}$(!1,"unsupported network","network",t)}function woe(t){switch(t){case"mainnet":return"ethereum-mainnet.core.chainstack.com";case"arbitrum":return"arbitrum-mainnet.core.chainstack.com";case"bnb":return"bsc-mainnet.core.chainstack.com";case"matic":return"polygon-mainnet.core.chainstack.com"}$(!1,"unsupported network","network",t)}class Py extends Qi{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Ry(s.name));const i=Py.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"apiKey");Oe(this,{apiKey:r})}_getProvider(n){try{return new Py(n,this.apiKey)}catch{}return super._getProvider(n)}isCommunityResource(){return this.apiKey===Ry(this._network.name)}static getRequest(n,r){r==null&&(r=Ry(n.name));const s=new Kn(`https://${woe(n.name)}/${r}`);return s.allowGzip=!0,r===Ry(n.name)&&(s.retryFunc=async(i,o,a)=>($c("ChainstackProvider"),!0)),s}}class Aoe extends Qi{constructor(e){e==null&&(e="mainnet");const n=rn.from(e);$(n.name==="mainnet","unsupported network","network",e),super("https://cloudflare-eth.com/",n,{staticNetwork:n})}}const sI=2e3;function voe(t){return t&&typeof t.then=="function"}const xoe="org.ethers.plugins.provider.Etherscan",koe=["enableCcipRead"];let Eoe=1;class Coe extends Ty{constructor(n,r){const s=r??null;super();W(this,"network");W(this,"apiKey");J(this,zf);const i=rn.from(n);I(this,zf,i.getPlugin(xoe)),Oe(this,{apiKey:s,network:i}),this.getBaseUrl()}getBaseUrl(){if(T(this,zf))return T(this,zf).baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"base":return"https://api.basescan.org";case"base-sepolia":return"https://api-sepolia.basescan.org";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-amoy":return"https://api-amoy.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}$(!1,"unsupported network","network",this.network)}getUrl(n,r){const s=Object.keys(r).reduce((o,a)=>{const l=r[a];return l!=null&&(o+=`&${a}=${l}`),o},""),i=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.getBaseUrl()}/api?module=${n}${s}${i}`}getPostUrl(){return`${this.getBaseUrl()}/api`}getPostData(n,r){return r.module=n,r.apikey=this.apiKey,r}async detectNetwork(){return this.network}async fetch(n,r,s){const i=Eoe++,o=s?this.getPostUrl():this.getUrl(n,r),a=s?this.getPostData(n,r):null;this.emit("debug",{action:"sendRequest",id:i,url:o,payload:a});const l=new Kn(o);l.setThrottleParams({slotInterval:1e3}),l.retryFunc=(f,d,h)=>(this.isCommunityResource()&&$c("Etherscan"),Promise.resolve(!0)),l.processFunc=async(f,d)=>{const h=d.hasBody()?JSON.parse(Tc(d.body)):{},p=(typeof h.result=="string"?h.result:"").toLowerCase().indexOf("rate limit")>=0;return n==="proxy"?h&&h.status==0&&h.message=="NOTOK"&&p&&(this.emit("debug",{action:"receiveError",id:i,reason:"proxy-NOTOK",error:h}),d.throwThrottleError(h.result,sI)):p&&(this.emit("debug",{action:"receiveError",id:i,reason:"null result",error:h.result}),d.throwThrottleError(h.result,sI)),d},a&&(l.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),l.body=Object.keys(a).map(f=>`${f}=${a[f]}`).join("&"));const u=await l.send();try{u.assertOk()}catch(f){this.emit("debug",{action:"receiveError",id:i,error:f,reason:"assertOk"}),ee(!1,"response error","SERVER_ERROR",{request:l,response:u})}u.hasBody()||(this.emit("debug",{action:"receiveError",id:i,error:"missing body",reason:"null body"}),ee(!1,"missing response","SERVER_ERROR",{request:l,response:u}));const c=JSON.parse(Tc(u.body));return n==="proxy"?(c.jsonrpc!="2.0"&&(this.emit("debug",{action:"receiveError",id:i,result:c,reason:"invalid JSON-RPC"}),ee(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:l,response:u,info:{result:c}})),c.error&&(this.emit("debug",{action:"receiveError",id:i,result:c,reason:"JSON-RPC error"}),ee(!1,"error response","SERVER_ERROR",{request:l,response:u,info:{result:c}})),this.emit("debug",{action:"receiveRequest",id:i,result:c}),c.result):c.status==0&&(c.message==="No records found"||c.message==="No transactions found")?(this.emit("debug",{action:"receiveRequest",id:i,result:c}),c.result):((c.status!=1||typeof c.message=="string"&&!c.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:i,result:c}),ee(!1,"error response","SERVER_ERROR",{request:l,response:u,info:{result:c}})),this.emit("debug",{action:"receiveRequest",id:i,result:c}),c.result)}_getTransactionPostData(n){const r={};for(let s in n){if(koe.indexOf(s)>=0||n[s]==null)continue;let i=n[s];if(!(s==="type"&&i===0)&&!(s==="blockTag"&&i==="latest")){if({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[s])i=kl(i);else if(s==="accessList")i="["+ia(i).map(o=>`{address:"${o.address}",storageKeys:["${o.storageKeys.join('","')}"]}`).join(",")+"]";else if(s==="blobVersionedHashes"){if(i.length===0)continue;ee(!1,"Etherscan API does not support blobVersionedHashes","UNSUPPORTED_OPERATION",{operation:"_getTransactionPostData",info:{transaction:n}})}else i=we(i);r[s]=i}}return r}_checkError(n,r,s){let i="";if(gn(r,"SERVER_ERROR")){try{i=r.info.result.error.message}catch{}if(!i)try{i=r.info.message}catch{}}if(n.method==="estimateGas"&&!i.match(/revert/i)&&i.match(/insufficient funds/i)&&ee(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.transaction}),(n.method==="call"||n.method==="estimateGas")&&i.match(/execution reverted/i)){let o="";try{o=r.info.result.error.data}catch{}const a=jc.getBuiltinCallException(n.method,n.transaction,o);throw a.info={request:n,error:r},a}if(i&&n.method==="broadcastTransaction"){const o=zh.from(n.signedTransaction);i.match(/replacement/i)&&i.match(/underpriced/i)&&ee(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:o}),i.match(/insufficient funds/)&&ee(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:o}),i.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&ee(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:o})}throw r}async _detectNetwork(){return this.network}async _perform(n){switch(n.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if(this.network.name==="mainnet")return"1000000000";if(this.network.name==="optimism")return"1000000";throw new Error("fallback onto the AbstractProvider default");case"getBalance":return this.fetch("account",{action:"balance",address:n.address,tag:n.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:n.address,tag:n.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:n.address,tag:n.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:n.address,position:n.position,tag:n.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:n.signedTransaction},!0).catch(r=>this._checkError(n,r,n.signedTransaction));case"getBlock":if("blockTag"in n)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:n.blockTag,boolean:n.includeTransactions?"true":"false"});ee(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:n.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:n.hash});case"call":{if(n.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");const r=this._getTransactionPostData(n.transaction);r.module="proxy",r.action="eth_call";try{return await this.fetch("proxy",r,!0)}catch(s){return this._checkError(n,s,n.transaction)}}case"estimateGas":{const r=this._getTransactionPostData(n.transaction);r.module="proxy",r.action="eth_estimateGas";try{return await this.fetch("proxy",r,!0)}catch(s){return this._checkError(n,s,n.transaction)}}}return super._perform(n)}async getNetwork(){return this.network}async getEtherPrice(){return this.network.name!=="mainnet"?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(n){let r=this._getAddress(n);voe(r)&&(r=await r);try{const s=await this.fetch("contract",{action:"getabi",address:r}),i=JSON.parse(s);return new Vc(r,i,this)}catch{return null}}isCommunityResource(){return this.apiKey==null}}zf=new WeakMap;function Soe(){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 Toe=Soe().WebSocket;class _2{constructor(e,n){J(this,xi);J(this,Sp);J(this,Ma);J(this,hu);J(this,Na);I(this,xi,e),I(this,Sp,JSON.stringify(n)),I(this,Ma,null),I(this,hu,null),I(this,Na,null)}get filter(){return JSON.parse(T(this,Sp))}start(){I(this,Ma,T(this,xi).send("eth_subscribe",this.filter).then(e=>(T(this,xi)._register(e,this),e)))}stop(){T(this,Ma).then(e=>{T(this,xi).destroyed||T(this,xi).send("eth_unsubscribe",[e])}),I(this,Ma,null)}pause(e){ee(e,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),I(this,hu,!!e)}resume(){I(this,hu,null)}_handleMessage(e){if(T(this,Ma)!=null&&T(this,hu)===null){let n=T(this,Na);n==null?n=this._emit(T(this,xi),e):n=n.then(async()=>{await this._emit(T(this,xi),e)}),I(this,Na,n.then(()=>{T(this,Na)===n&&I(this,Na,null)}))}}async _emit(e,n){throw new Error("sub-classes must implemente this; _emit")}}xi=new WeakMap,Sp=new WeakMap,Ma=new WeakMap,hu=new WeakMap,Na=new WeakMap;class Doe extends _2{constructor(e){super(e,["newHeads"])}async _emit(e,n){e.emit("block",parseInt(n.number))}}class Ooe extends _2{constructor(e){super(e,["newPendingTransactions"])}async _emit(e,n){e.emit("pending",n)}}class _oe extends _2{constructor(n,r){super(n,["logs",r]);J(this,Tp);I(this,Tp,JSON.stringify(r))}get logFilter(){return JSON.parse(T(this,Tp))}async _emit(n,r){n.emit(this.logFilter,n._wrapLog(r,n._network))}}Tp=new WeakMap;class Moe extends rI{constructor(n,r){const s=Object.assign({},r??{});$(s.batchMaxCount==null||s.batchMaxCount===1,"sockets-based providers do not support batches","options.batchMaxCount",r),s.batchMaxCount=1,s.staticNetwork==null&&(s.staticNetwork=!0);super(n,s);J(this,pu);J(this,$f);J(this,Ra);I(this,pu,new Map),I(this,$f,new Map),I(this,Ra,new Map)}_getSubscriber(n){switch(n.type){case"close":return new Sy("close");case"block":return new Doe(this);case"pending":return new Ooe(this);case"event":return new _oe(this,n.filter);case"orphan":if(n.filter.orphan==="drop-log")return new Sy("drop-log")}return super._getSubscriber(n)}_register(n,r){T(this,$f).set(n,r);const s=T(this,Ra).get(n);if(s){for(const i of s)r._handleMessage(i);T(this,Ra).delete(n)}}async _send(n){$(!Array.isArray(n),"WebSocket does not support batch send","payload",n);const r=new Promise((s,i)=>{T(this,pu).set(n.id,{payload:n,resolve:s,reject:i})});return await this._waitUntilReady(),await this._write(JSON.stringify(n)),[await r]}async _processMessage(n){const r=JSON.parse(n);if(r&&typeof r=="object"&&"id"in r){const s=T(this,pu).get(r.id);if(s==null){this.emit("error",Nt("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:r}));return}T(this,pu).delete(r.id),s.resolve(r)}else if(r&&r.method==="eth_subscription"){const s=r.params.subscription,i=T(this,$f).get(s);if(i)i._handleMessage(r.params.result);else{let o=T(this,Ra).get(s);o==null&&(o=[],T(this,Ra).set(s,o)),o.push(r.params.result)}}else{this.emit("error",Nt("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:r}));return}}async _write(n){throw new Error("sub-classes must override this")}}pu=new WeakMap,$f=new WeakMap,Ra=new WeakMap;class iI extends Moe{constructor(n,r,s){super(r,s);J(this,mu);J(this,Ps);typeof n=="string"?(I(this,mu,()=>new Toe(n)),I(this,Ps,T(this,mu).call(this))):typeof n=="function"?(I(this,mu,n),I(this,Ps,n())):(I(this,mu,null),I(this,Ps,n)),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(i){console.log("failed to start WebsocketProvider",i)}},this.websocket.onmessage=i=>{this._processMessage(i.data)}}get websocket(){if(T(this,Ps)==null)throw new Error("websocket closed");return T(this,Ps)}async _write(n){this.websocket.send(n)}async destroy(){T(this,Ps)!=null&&(T(this,Ps).close(),I(this,Ps,null)),super.destroy()}}mu=new WeakMap,Ps=new WeakMap;const Jh="84842078b09946638c03157f83405213";function Noe(t){switch(t){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bnbsmartchain-mainnet.infura.io";case"bnbt":return"bnbsmartchain-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"linea-sepolia":return"linea-sepolia.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-amoy":return"polygon-amoy.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}$(!1,"unsupported network","network",t)}class Roe extends iI{constructor(n,r){const s=new Yh(n,r),i=s._getConnection();ee(!i.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});const o=i.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(o,s._network);W(this,"projectId");W(this,"projectSecret");Oe(this,{projectId:s.projectId,projectSecret:s.projectSecret})}isCommunityResource(){return this.projectId===Jh}}class Yh extends Qi{constructor(n,r,s){n==null&&(n="mainnet");const i=rn.from(n);r==null&&(r=Jh),s==null&&(s=null);const o=Yh.getRequest(i,r,s);super(o,i,{staticNetwork:i});W(this,"projectId");W(this,"projectSecret");Oe(this,{projectId:r,projectSecret:s})}_getProvider(n){try{return new Yh(n,this.projectId,this.projectSecret)}catch{}return super._getProvider(n)}isCommunityResource(){return this.projectId===Jh}static getWebSocketProvider(n,r){return new Roe(n,r)}static getRequest(n,r,s){r==null&&(r=Jh),s==null&&(s=null);const i=new Kn(`https://${Noe(n.name)}/v3/${r}`);return i.allowGzip=!0,s&&i.setCredentials("",s),r===Jh&&(i.retryFunc=async(o,a,l)=>($c("InfuraProvider"),!0)),i}}const Iy="919b412a057b5e9c9b6dce193c5a60242d6efadb";function Poe(t){switch(t){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}$(!1,"unsupported network","network",t)}class Ly extends Qi{constructor(n,r){n==null&&(n="mainnet");const s=rn.from(n);r==null&&(r=Iy);const i=Ly.getRequest(s,r);super(i,s,{staticNetwork:s});W(this,"token");Oe(this,{token:r})}_getProvider(n){try{return new Ly(n,this.token)}catch{}return super._getProvider(n)}isCommunityResource(){return this.token===Iy}static getRequest(n,r){r==null&&(r=Iy);const s=new Kn(`https://${Poe(n.name)}/${r}`);return s.allowGzip=!0,r===Iy&&(s.retryFunc=async(i,o,a)=>($c("QuickNodeProvider"),!0)),s}}const Ioe=BigInt("1"),Loe=BigInt("2");function Boe(t){for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1)),r=t[e];t[e]=t[n],t[n]=r}}function Foe(t){return new Promise(e=>{setTimeout(e,t)})}function M2(){return new Date().getTime()}function N2(t){return JSON.stringify(t,(e,n)=>typeof n=="bigint"?{type:"bigint",value:n.toString()}:n)}const oI={stallTimeout:400,priority:1,weight:1},aI={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};async function joe(t,e){for(;(t.blockNumber<0||t.blockNumber<e)&&(t._updateNumber||(t._updateNumber=(async()=>{try{const n=await t.provider.getBlockNumber();n>t.blockNumber&&(t.blockNumber=n)}catch(n){t.blockNumber=-2,t._lastFatalError=n,t._lastFatalErrorTimestamp=M2()}t._updateNumber=null})()),await t._updateNumber,t.outOfSync++,!t._lastFatalError););}function Xh(t){if(t==null)return"null";if(Array.isArray(t))return"["+t.map(Xh).join(",")+"]";if(typeof t=="object"&&typeof t.toJSON=="function")return Xh(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":case"number":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{"+e.map(n=>`${JSON.stringify(n)}:${Xh(t[n])}`).join(",")+"}"}}throw console.log("Could not serialize",t),new Error("Hmm...")}function R2(t){if("error"in t){const n=t.error;return{tag:Xh(n),value:n}}const e=t.result;return{tag:Xh(e),value:e}}function By(t,e){const n=new Map;for(const{value:s,tag:i,weight:o}of e){const a=n.get(i)||{value:s,weight:0};a.weight+=o,n.set(i,a)}let r=null;for(const s of n.values())s.weight>=t&&(!r||s.weight>r.weight)&&(r=s);if(r)return r.value}function P2(t,e){let n=0;const r=new Map;let s=null;const i=[];for(const{value:a,tag:l,weight:u}of e)if(a instanceof Error){const c=r.get(l)||{value:a,weight:0};c.weight+=u,r.set(l,c),(s==null||c.weight>s.weight)&&(s=c)}else i.push(BigInt(a)),n+=u;if(n<t)return s&&s.weight>=t?s.value:void 0;i.sort((a,l)=>a<l?-1:l>a?1:0);const o=Math.floor(i.length/2);return i.length%2?i[o]:(i[o-1]+i[o]+Ioe)/Loe}function I2(t,e){const n=By(t,e);if(n!==void 0)return n;for(const r of e)if(r.value)return r.value}function Uoe(t,e){if(t===1)return Qe(P2(t,e),"%internal");const n=new Map,r=(o,a)=>{const l=n.get(o)||{result:o,weight:0};l.weight+=a,n.set(o,l)};for(const{weight:o,value:a}of e){const l=Qe(a);r(l-1,o),r(l,o),r(l+1,o)}let s=0,i;for(const{weight:o,result:a}of n.values())o>=t&&(o>s||i!=null&&o===s&&a>i)&&(s=o,i=a);return i}class Voe extends Ty{constructor(n,r,s){super(r,s);J(this,yr);W(this,"quorum");W(this,"eventQuorum");W(this,"eventWorkers");J(this,gr);J(this,bo);J(this,Gf);I(this,gr,n.map(i=>i instanceof Ty?Object.assign({provider:i},oI,aI):Object.assign({},oI,i,aI))),I(this,bo,-2),I(this,Gf,null),s&&s.quorum!=null?this.quorum=s.quorum:this.quorum=Math.ceil(T(this,gr).reduce((i,o)=>(i+=o.weight,i),0)/2),this.eventQuorum=1,this.eventWorkers=1,$(this.quorum<=T(this,gr).reduce((i,o)=>i+o.weight,0),"quorum exceed provider weight","quorum",this.quorum)}get providerConfigs(){return T(this,gr).map(n=>{const r=Object.assign({},n);for(const s in r)s[0]==="_"&&delete r[s];return r})}async _detectNetwork(){return rn.from(xe(await this._perform({method:"chainId"})))}async _translatePerform(n,r){switch(r.method){case"broadcastTransaction":return await n.broadcastTransaction(r.signedTransaction);case"call":return await n.call(Object.assign({},r.transaction,{blockTag:r.blockTag}));case"chainId":return(await n.getNetwork()).chainId;case"estimateGas":return await n.estimateGas(r.transaction);case"getBalance":return await n.getBalance(r.address,r.blockTag);case"getBlock":{const s="blockHash"in r?r.blockHash:r.blockTag;return await n.getBlock(s,r.includeTransactions)}case"getBlockNumber":return await n.getBlockNumber();case"getCode":return await n.getCode(r.address,r.blockTag);case"getGasPrice":return(await n.getFeeData()).gasPrice;case"getPriorityFee":return(await n.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await n.getLogs(r.filter);case"getStorage":return await n.getStorage(r.address,r.position,r.blockTag);case"getTransaction":return await n.getTransaction(r.hash);case"getTransactionCount":return await n.getTransactionCount(r.address,r.blockTag);case"getTransactionReceipt":return await n.getTransactionReceipt(r.hash);case"getTransactionResult":return await n.getTransactionResult(r.hash)}}async _perform(n){if(n.method==="broadcastTransaction"){const o=T(this,gr).map(u=>null),a=T(this,gr).map(async({provider:u,weight:c},f)=>{try{const d=await u._perform(n);o[f]=Object.assign(R2({result:d}),{weight:c})}catch(d){o[f]=Object.assign(R2({error:d}),{weight:c})}});for(;;){const u=o.filter(d=>d!=null);for(const{value:d}of u)if(!(d instanceof Error))return d;const c=By(this.quorum,o.filter(d=>d!=null));if(gn(c,"INSUFFICIENT_FUNDS"))throw c;const f=a.filter((d,h)=>o[h]==null);if(f.length===0)break;await Promise.race(f)}const l=I2(this.quorum,o);if(ee(l!==void 0,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:n,results:o.map(N2)}}),l instanceof Error)throw l;return l}await fe(this,yr,ZL).call(this);const r=new Set;let s=0;for(;;){const o=fe(this,yr,oE).call(this,r,n);if(o==null||(s+=o.config.weight,s>=this.quorum))break}const i=await fe(this,yr,aE).call(this,r,n);for(const o of r)o.perform&&o.result==null&&o.config.lateResponses++;return i}async destroy(){for(const{provider:n}of T(this,gr))n.destroy();super.destroy()}}gr=new WeakMap,bo=new WeakMap,Gf=new WeakMap,yr=new WeakSet,XL=function(n){const r=Array.from(n).map(i=>i.config),s=T(this,gr).slice();Boe(s),s.sort((i,o)=>i.priority-o.priority);for(const i of s)if(!i._lastFatalError&&r.indexOf(i)===-1)return i;return null},oE=function(n,r){const s=fe(this,yr,XL).call(this,n);if(s==null)return null;const i={config:s,result:null,didBump:!1,perform:null,staller:null},o=M2();return i.perform=(async()=>{try{s.requests++;const l=await this._translatePerform(s.provider,r);i.result={result:l}}catch(l){s.errorResponses++,i.result={error:l}}const a=M2()-o;s._totalTime+=a,s.rollingDuration=.95*s.rollingDuration+.05*a,i.perform=null})(),i.staller=(async()=>{await Foe(s.stallTimeout),i.staller=null})(),n.add(i),i},ZL=async function(){let n=T(this,Gf);if(!n){const r=[];T(this,gr).forEach(s=>{r.push((async()=>{await joe(s,0),s._lastFatalError||(s._network=await s.provider.getNetwork())})())}),I(this,Gf,n=(async()=>{await Promise.all(r);let s=null;for(const i of T(this,gr)){if(i._lastFatalError)continue;const o=i._network;s==null?s=o.chainId:o.chainId!==s&&ee(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})())}await n},e5=async function(n,r){const s=[];for(const i of n)if(i.result!=null){const{tag:o,value:a}=R2(i.result);s.push({tag:o,value:a,weight:i.config.weight})}if(!(s.reduce((i,o)=>i+o.weight,0)<this.quorum)){switch(r.method){case"getBlockNumber":{T(this,bo)===-2&&I(this,bo,Math.ceil(Qe(P2(this.quorum,T(this,gr).filter(o=>!o._lastFatalError).map(o=>({value:o.blockNumber,tag:Qe(o.blockNumber).toString(),weight:o.weight}))))));const i=Uoe(this.quorum,s);return i===void 0?void 0:(i>T(this,bo)&&I(this,bo,i),T(this,bo))}case"getGasPrice":case"getPriorityFee":case"estimateGas":return P2(this.quorum,s);case"getBlock":return"blockTag"in r&&r.blockTag==="pending"?I2(this.quorum,s):By(this.quorum,s);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return By(this.quorum,s);case"broadcastTransaction":return I2(this.quorum,s)}ee(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${N2(r.method)})`})}},aE=async function(n,r){if(n.size===0)throw new Error("no runners?!");const s=[];let i=0;for(const a of n){if(a.perform&&s.push(a.perform),a.staller){s.push(a.staller);continue}a.didBump||(a.didBump=!0,i++)}const o=await fe(this,yr,e5).call(this,n,r);if(o!==void 0){if(o instanceof Error)throw o;return o}for(let a=0;a<i;a++)fe(this,yr,oE).call(this,n,r);return ee(s.length>0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:r,results:Array.from(n).map(a=>N2(a.result))}}),await Promise.race(s),await fe(this,yr,aE).call(this,n,r)};function Hoe(t){return t&&typeof t.send=="function"&&typeof t.close=="function"}const zoe="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function $oe(t,e){e==null&&(e={});const n=o=>e[o]==="-"?!1:typeof e.exclusive=="string"?o===e.exclusive:Array.isArray(e.exclusive)?e.exclusive.indexOf(o)!==-1:!0;if(typeof t=="string"&&t.match(/^https?:/))return new Qi(t);if(typeof t=="string"&&t.match(/^wss?:/)||Hoe(t))return new iI(t);let r=null;try{r=rn.from(t)}catch{}const s=[];if(n("publicPolygon")&&r&&(r.name==="matic"?s.push(new Qi("https://polygon-rpc.com/",r,{staticNetwork:r})):r.name==="matic-amoy"&&s.push(new Qi("https://rpc-amoy.polygon.technology/",r,{staticNetwork:r}))),n("alchemy"))try{s.push(new Ny(t,e.alchemy))}catch{}if(n("ankr")&&e.ankr!=null)try{s.push(new _y(t,e.ankr))}catch{}if(n("chainstack"))try{s.push(new Py(t,e.chainstack))}catch{}if(n("cloudflare"))try{s.push(new Aoe(t))}catch{}if(n("etherscan"))try{s.push(new Coe(t,e.etherscan))}catch{}if(n("infura"))try{let o=e.infura,a;typeof o=="object"&&(a=o.projectSecret,o=o.projectId),s.push(new Yh(t,o,a))}catch{}if(n("quicknode"))try{let o=e.quicknode;s.push(new Ly(t,o))}catch{}if(ee(s.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),s.length===1)return s[0];let i=Math.floor(s.length/2);return i>2&&(i=2),r&&zoe.indexOf(r.name)!==-1&&(i=1),e&&e.quorum&&(i=e.quorum),new Voe(s,void 0,{quorum:i})}const Goe=async(t,e)=>{const n={name:t,isEns:!1};if(!e)throw new Error("cannot fetch ens name without a provider url");if(!Vre(t))return n;try{const r=await Woe(t,e);r&&(n.name=r,n.isEns=!0)}catch(r){console.log(r)}return n},Woe=async(t,e)=>await Koe(e).lookupAddress(t),Koe=t=>$oe(t),qoe=(t,e,n)=>{if((t==null?void 0:t.length)>n){const r=t.substring(0,e),s=t.substring((t==null?void 0:t.length)-e);return`${r}...${s}`}return t};function Qoe(t){var e;const{char:n,allowSpaces:r,allowedPrefixes:s,startOfLine:i,$position:o}=t,a=z7(n),l=new RegExp(`\\s${a}$`),u=i?"^":"",c=r?new RegExp(`${u}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${u}(?:^)?${a}[^\\s${a}]*`,"gm"),f=((e=o.nodeBefore)===null||e===void 0?void 0:e.isText)&&o.nodeBefore.text;if(!f)return null;const d=o.pos-f.length,h=Array.from(f.matchAll(c)).pop();if(!h||h.input===void 0||h.index===void 0)return null;const p=h.input.slice(Math.max(0,h.index-1),h.index),m=new RegExp(`^[${s==null?void 0:s.join("")}\0]?$`).test(p);if(s!==null&&!m)return null;const g=d+h.index;let y=g+h[0].length;return r&&l.test(f.slice(y-1,y+1))&&(h[0]+=" ",y+=1),g<o.pos&&y>=o.pos?{range:{from:g,to:y},query:h[0].slice(n.length),text:h[0]}:null}const Joe=new _t("suggestion");function Yoe({pluginKey:t=Joe,editor:e,char:n="@",allowSpaces:r=!1,allowedPrefixes:s=[" "],startOfLine:i=!1,decorationTag:o="span",decorationClass:a="suggestion",command:l=()=>null,items:u=()=>[],render:c=()=>({}),allow:f=()=>!0,findSuggestionMatch:d=Qoe}){let h;const p=c==null?void 0:c(),m=new bt({key:t,view(){return{update:async(g,y)=>{var v,w,A,x,k,C,O;const _=(v=this.key)===null||v===void 0?void 0:v.getState(y),D=(w=this.key)===null||w===void 0?void 0:w.getState(g.state),R=_.active&&D.active&&_.range.from!==D.range.from,L=!_.active&&D.active,F=_.active&&!D.active,G=!L&&!F&&_.query!==D.query,B=L,H=G||R,Q=F;if(!B&&!H&&!Q)return;const te=Q&&!B?_:D,Z=g.dom.querySelector(`[data-decoration-id="${te.decorationId}"]`);h={editor:e,range:te.range,query:te.query,text:te.text,items:[],command:pe=>l({editor:e,range:te.range,props:pe}),decorationNode:Z,clientRect:Z?()=>{var pe;const{decorationId:Ee}=(pe=this.key)===null||pe===void 0?void 0:pe.getState(e.state),Re=g.dom.querySelector(`[data-decoration-id="${Ee}"]`);return(Re==null?void 0:Re.getBoundingClientRect())||null}:null},B&&((A=p==null?void 0:p.onBeforeStart)===null||A===void 0||A.call(p,h)),H&&((x=p==null?void 0:p.onBeforeUpdate)===null||x===void 0||x.call(p,h)),(H||B)&&(h.items=await u({editor:e,query:te.query})),Q&&((k=p==null?void 0:p.onExit)===null||k===void 0||k.call(p,h)),H&&((C=p==null?void 0:p.onUpdate)===null||C===void 0||C.call(p,h)),B&&((O=p==null?void 0:p.onStart)===null||O===void 0||O.call(p,h))},destroy:()=>{var g;h&&((g=p==null?void 0:p.onExit)===null||g===void 0||g.call(p,h))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(g,y,v,w){const{isEditable:A}=e,{composing:x}=e.view,{selection:k}=g,{empty:C,from:O}=k,_={...y};if(_.composing=x,A&&(C||e.view.composing)){(O<y.range.from||O>y.range.to)&&!x&&!y.composing&&(_.active=!1);const D=d({char:n,allowSpaces:r,allowedPrefixes:s,startOfLine:i,$position:k.$from}),R=`id_${Math.floor(Math.random()*4294967295)}`;D&&f({editor:e,state:w,range:D.range,isActive:y.active})?(_.active=!0,_.decorationId=y.decorationId?y.decorationId:R,_.range=D.range,_.query=D.query,_.text=D.text):_.active=!1}else _.active=!1;return _.active||(_.decorationId=null,_.range={from:0,to:0},_.query=null,_.text=null),_}},props:{handleKeyDown(g,y){var v;const{active:w,range:A}=m.getState(g.state);return w&&((v=p==null?void 0:p.onKeyDown)===null||v===void 0?void 0:v.call(p,{view:g,event:y,range:A}))||!1},decorations(g){const{active:y,range:v,decorationId:w}=m.getState(g);return y?kt.create(g.doc,[nn.inline(v.from,v.to,{nodeName:o,class:a,"data-decoration-id":w})]):null}}});return m}var Xoe=typeof tr=="object"&&tr&&tr.Object===Object&&tr,Zoe=typeof self=="object"&&self&&self.Object===Object&&self;Xoe||Zoe||Function("return this")();var eae=typeof window<"u"?N.useLayoutEffect:N.useEffect,tae=typeof window>"u";function L2(t,{defaultValue:e=!1,initializeWithValue:n=!0}={}){const r=a=>tae?e:window.matchMedia(a).matches,[s,i]=N.useState(()=>n?r(t):e);function o(){i(r(t))}return eae(()=>{const a=window.matchMedia(t);return o(),a.addListener?a.addListener(o):a.addEventListener("change",o),()=>{a.removeListener?a.removeListener(o):a.removeEventListener("change",o)}},[t]),s}const nae=wt.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:n})=>{n.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[Yoe({editor:this.editor,...this.options.suggestion})]}}),rae=({query:t,onError:e})=>[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:S.jsx(XT,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).toggleNode("paragraph","paragraph").run()}},{title:"To-do List",description:"Track tasks with a to-do list.",searchTerms:["todo","task","list","check","checkbox"],icon:S.jsx(YT,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).toggleTaskList().run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["title","big","large"],icon:S.jsx(C0,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["subtitle","medium"],icon:S.jsx(S0,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["subtitle","small"],icon:S.jsx(T0,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:S.jsx(D0,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:S.jsx(Uu,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).toggleOrderedList().run()}},{title:"Divider",description:"Visually divide content.",searchTerms:["hr","divider","break","line","delimiter"],icon:S.jsx(nV,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setHorizontalRule().run()}},{title:"Quote",description:"Capture a quote.",searchTerms:["blockquote"],icon:S.jsx(O0,{size:18}),image:"",command:({editor:n,range:r})=>n.chain().focus().deleteRange(r).toggleNode("paragraph","paragraph").toggleBlockquote().run()},{title:"Code",description:"Capture a code snippet.",searchTerms:["codeblock"],icon:S.jsx(Md,{size:18}),image:"",command:({editor:n,range:r})=>n.chain().focus().deleteRange(r).toggleCodeBlock().run()},{title:"Table",description:"Create a table.",searchTerms:["table"],icon:S.jsx(iw,{size:18}),image:"",command:({editor:n,range:r})=>n.chain().focus().deleteRange(r).insertTable({rows:3,cols:2,withHeaderRow:!0}).run()},{title:"Image",description:"Upload an image from your computer.",searchTerms:["photo","picture","media"],icon:S.jsx(ZU,{size:18}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).run();const s=document.createElement("input");s.type="file",s.accept="image/*",s.onchange=async()=>{var i;if((i=s.files)!=null&&i.length){const o=s.files[0];if(o.size>Vd){e&&typeof e=="function"&&e(Kw.IMAGE_SIZE);return}const l=n.view.state.selection.from;uw(o,n.view,l)}},s.click()}},{title:"Video Embed",description:"Embed a video from YouTube, Vimeo, etc.",searchTerms:["iframe","embed","video","youtube"],icon:S.jsx(e3,{}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setActionButton("iframe").run()}},{title:"Twitter",description:"Embed a Twitter tweet.",searchTerms:["embed","twitter","tweet"],icon:S.jsx(ZT,{}),image:"",command:({editor:n,range:r})=>{n.chain().focus().deleteRange(r).setActionButton("twitter").run()}},{title:"2 Columns",description:"Create 2 columns of block",searchTerms:["col","column","2","layout"],icon:S.jsx(qT,{}),image:"",command:({editor:n})=>{n.chain().focus().setColumns(2).focus(n.state.selection.head-1).run()}},{title:"3 Columns",description:"Create 3 columns of block",searchTerms:["col","column","3","layout"],icon:S.jsx(QU,{}),image:"",command:({editor:n})=>{n.chain().focus().setColumns(3).focus(n.state.selection.head-1).run()}}].filter(n=>{if(typeof t=="string"&&t.length>0){const r=t.toLowerCase();return n.title.toLowerCase().includes(r)||n.description.toLowerCase().includes(r)||n.searchTerms&&n.searchTerms.some(s=>s.includes(r))}return!0}),sae=(t,e)=>{const n=t.offsetHeight,r=e?e.offsetHeight:0,s=e.offsetTop,i=s+r;s<t.scrollTop?t.scrollTop-=t.scrollTop-s+5:i>n+t.scrollTop&&(t.scrollTop+=i-n-t.scrollTop+5)},iae=({items:t,command:e,editor:n})=>{const[r,s]=N.useState(0),[i,o]=N.useState(t),a=L2("(max-width: 640px)"),l=N.useCallback(c=>{const f=i[c];f&&(f.title==="Continue writing"||e(f))},[e,n,i]);N.useEffect(()=>{if(a){const c=t.filter(f=>!["2 Columns","3 Columns","Twitter","Video Embed"].includes(f.title));o(c)}else o(t)},[t,a]),N.useEffect(()=>{const c=["ArrowUp","ArrowDown","Enter"],f=d=>{if(c.includes(d.key))return d.preventDefault(),d.key==="ArrowUp"?(s((r+i.length-1)%i.length),!0):d.key==="ArrowDown"?(s((r+1)%i.length),!0):d.key==="Enter"?(l(r),!0):!1};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}},[i,r,s,l]),N.useEffect(()=>{s(0)},[i]);const u=N.useRef(null);return N.useLayoutEffect(()=>{const c=u==null?void 0:u.current,f=c==null?void 0:c.children[r];f&&c&&sae(c,f)},[r]),i.length>0?S.jsx("div",{id:"slash-command",ref:u,className:"z-50 h-auto max-h-[330px] w-72 overflow-y-auto scroll-smooth rounded-md border border-[#DDD] bg-white px-1 py-2 shadow-md transition-all",children:i.map((c,f)=>S.jsxs("button",{className:`flex w-full items-center space-x-2 rounded-md px-2 py-1 text-left text-sm text-neutral-500 hover:bg-neutral-100 hover:border-neutral-200 border border-transparent transition-all ${f===r?"bg-neutral-200 text-neutral-800":""}`,onClick:()=>l(f),children:[S.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-md border border-neutral-200 bg-white",children:c.icon}),S.jsxs("div",{children:[S.jsx("p",{className:"font-medium",children:c.title}),S.jsx("p",{className:"text-xs text-neutral-500",children:c.description})]})]},f))}):null},oae=()=>{let t=null,e=null;return{onStart:n=>{t=new GT(iae,{props:n,editor:n.editor}),e=Xa("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:n=>{t==null||t.updateProps(n),e&&e[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown:n=>{var r;return n.event.key==="Escape"?(e==null||e[0].hide(),!0):(r=t==null?void 0:t.ref)==null?void 0:r.onKeyDown(n)},onExit:()=>{e==null||e[0].destroy(),t==null||t.destroy()}}},aae=t=>{const e=({query:n})=>rae({query:n,onError:t});return nae.configure({suggestion:{items:e,render:oae}})},lI=["#30bced","#6eeb83","#fa69d1","#ecd444","#ee6352","#db3041","#0ad7f2","#1bff39"],lae=({isPreviewMode:t,initialContent:e,enableCollaboration:n,collaborationId:r,walletAddress:s,username:i,onChange:o,onCollaboratorChange:a,onCommentInteraction:l,onTextSelection:u,ensResolutionUrl:c,onError:f})=>{var O,_;const[d]=N.useState(new ul),[h,p]=N.useState([...qte,aae(f)]),m=N.useRef(!1),g=(D,R,L)=>{let F=!1;return D.doc.nodesBetween(R,L,G=>{G.marks&&G.marks.some(B=>B.type.name==="highlight"&&B.attrs.color==="yellow")&&(F=!0)}),F},y=(D,R)=>{var F;const L=R.target;if(L&&L.nodeName==="MARK"&&L.dataset.color&&((F=L==null?void 0:L.dataset)==null?void 0:F.color)==="yellow"){const G=L.textContent,B=D.posAtCoords({left:R.clientX,top:R.clientY});if(B){const{state:H}=D;let Q=B.pos,te=B.pos;if(H.doc.nodesBetween(Q,te,(Z,pe)=>{Z.marks&&Z.marks.length&&Z.marks.forEach(Ee=>{Ee.type.name==="highlight"&&(Q=pe,te=pe+Z.nodeSize)})}),Q!==te){const Z={text:G,from:Q,to:te,isHighlightedYellow:g(H,Q,te)};l==null||l(Z)}}}},w=FU({extensions:h,editorProps:{...cK,handleDOMEvents:{mouseover:y,keydown:(D,R)=>{if(["ArrowUp","ArrowDown","Enter"].includes(R.key)&&document.querySelector("#slash-command"))return!0}},handleClick:(D,R,L)=>{y(D,L)}},autofocus:"start",onTransaction:({editor:D,transaction:R})=>{D!=null&&D.isEmpty||R.docChanged&&(o==null||o(D.getJSON()))},shouldRerenderOnTransaction:!0,immediatelyRender:!1},[h]),A=N.useRef(()=>{}),x=(D,R=!1)=>{if(!n||!r)throw new Error("docId or username is not provided");const L=new uK(r,d,{signaling:["wss://fileverse-signaling-server-0529292ff51c.herokuapp.com/"]});return p([...h,LK.configure({document:d}),BK.configure({provider:L,user:{name:D&&D.length>20?qoe(D,7,15):D,color:lI[Math.floor(Math.random()*lI.length)],isEns:R},render:Zte})]),A.current=()=>{L.destroy(),d.destroy()},A.current},k=N.useRef(null);N.useEffect(()=>{w==null||w.setEditable(!t)},[t,w]),N.useEffect(()=>{e&&w&&!m.current&&(queueMicrotask(()=>{w.commands.setContent(e)}),m.current=!0),setTimeout(()=>{m.current=!1})},[e,w]),N.useEffect(()=>{if(!w)return;const D=()=>{const{state:R}=w,{from:L,to:F}=R.selection,G=R.doc.textBetween(L,F," ");u==null||u({text:G,from:L,to:F,isHighlightedYellow:g(R,L,F)})};return w.on("selectionUpdate",D),()=>{w.off("selectionUpdate",D)}},[w]);const C=async()=>{let D=i,R=!1;if(s&&c){const{name:L,isEns:F}=await Goe(s,c);D=L,R=F}if(!D)throw new Error("Cannot start collaboration without a username");x(D,R)};return N.useEffect(()=>{n?C():A.current()},[n]),N.useEffect(()=>{var D,R;a==null||a((R=(D=w==null?void 0:w.storage)==null?void 0:D.collaborationCursor)==null?void 0:R.users)},[(_=(O=w==null?void 0:w.storage)==null?void 0:O.collaborationCursor)==null?void 0:_.users]),{editor:w,ref:k,connect:x,ydoc:d}},uae=({title:t,content:e,contentClassName:n,open:r,onOpenChange:s,primaryAction:i,secondaryAction:o})=>S.jsx(dz,{open:r,onOpenChange:s,children:S.jsxs(bD,{className:"max-w-md sm:w-full w-[90%] z-20",children:[S.jsx(wD,{className:"px-4 pt-0 border-b-[1px]",children:S.jsx(vD,{className:"text-left text-base",children:t})}),S.jsx("div",{className:he("flex flex-col gap-4 w-full h-full pb-4 text-base text-black",n),children:e&&e}),S.jsxs(AD,{className:"px-5 pb-5 justify-end sm:",children:[o&&S.jsx(mz,{asChild:!0,children:S.jsx(sl,{disabled:o==null?void 0:o.isLoading,isLoading:o==null?void 0:o.isLoading,className:o==null?void 0:o.className,variant:(o==null?void 0:o.variant)||"ghost",onClick:o==null?void 0:o.onClick,children:o==null?void 0:o.label})}),i&&S.jsx(sl,{disabled:i==null?void 0:i.isLoading,isLoading:i==null?void 0:i.isLoading,className:i==null?void 0:i.className,variant:(i==null?void 0:i.variant)||"primary",onClick:i==null?void 0:i.onClick,children:i==null?void 0:i.label})]})]})}),cae=({editor:t,onError:e})=>{const{toolVisibilty:n,setToolVisibility:r,bottomToolbar:s}=qw({editor:t,onError:e}),i=L2("(max-width: 1023px)"),[o,a]=N.useState(""),[l,u]=N.useState(""),[c,f]=N.useState(!0),d=()=>{if(o===null){f(!1);return}if(o===""){t.chain().focus().extendMarkRange("link").unsetLink().run(),f(!1);return}let m=o;!o.startsWith("http://")&&!o.startsWith("https://")&&(m="https://"+o);try{m.match(/^((http|https):\/\/)?([w|W]{3}\.)+[a-zA-Z0-9\-\.]{3,}\.[a-zA-Z]{2,}(\.[a-zA-Z]{2,})?$/)&&t.chain().focus().extendMarkRange("link").setLink({href:m}).command(({tr:g})=>(g.insertText(l),!0)).run(),f(!0)}catch{console.error("Invalid URL"),f(!1);return}t.chain().focus().extendMarkRange("link").setLink({href:m}).command(({tr:g})=>(g.insertText(l),!0)).run(),f(!0),r(Me.NONE)},h=m=>{const{from:g,to:y}=m.state.selection,v=m.state.doc.textBetween(g,y);return u(v),v},p=N.useRef(null);return N.useEffect(()=>{let m=0;const g=()=>{m=Date.now()},y=()=>{var A;if(Date.now()-m>500){const{selection:x}=t.state;x.from!==x.to&&((A=p.current)==null||A.click())}},v=()=>{var x;if(!i)return;const{selection:w}=t.state;w.from!==w.to&&((x=p.current)==null||x.click())};return i?(document.addEventListener("touchstart",g),document.addEventListener("touchend",y)):document.addEventListener("mouseup",v),()=>{i?(document.removeEventListener("touchstart",g),document.removeEventListener("touchend",y)):document.removeEventListener("mouseup",v)}},[t,i]),N.useEffect(()=>{h(t)},[t]),N.useEffect(()=>{const m=g=>{g.key==="k"&&(g.metaKey||g.ctrlKey)&&(g.preventDefault(),n!==Me.LINK_POPUP?r(Me.LINK_POPUP):r(Me.NONE))};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[t,n]),S.jsxs(fD,{children:[S.jsx("div",{className:"flex w-full justify-between sm:justify-evenly select-none",children:s.map(m=>{if(m)return S.jsx("div",{className:"flex items-center",children:m.title==="Text formating"?S.jsx(dD,{asChild:!0,children:S.jsx("button",{ref:p,onClick:()=>m.onClick(),children:m.icon})}):m.title==="Text color"?S.jsx(dD,{asChild:!0,children:S.jsx("button",{onClick:()=>m.onClick(),children:m.icon})}):S.jsx("button",{className:he("flex items-center rounded px-2 py-1 transition",{"text-black":m.isActive,"text-[#A1AAB1]":!m.isActive}),onClick:()=>m.onClick(),disabled:!m.isActive,children:m.icon})},m.title)})}),n===Me.TEXT_FORMATING&&S.jsx(n$,{editor:t,setToolVisibility:r}),n===Me.LINK_POPUP&&S.jsx(uae,{open:n===Me.LINK_POPUP,onOpenChange:()=>r(Me.NONE),title:"Link",content:S.jsxs("div",{className:"flex flex-col gap-4 w-full h-full px-4",children:[S.jsx(q0,{label:"Text",placeholder:"Link text",className:"w-full",defaultValue:l,onChange:m=>{m.preventDefault(),u(m.target.value)}}),S.jsx(q0,{label:"Link",placeholder:"Paste URL",className:"w-full",defaultValue:t.getAttributes("link").href,onChange:m=>{m.preventDefault(),a(m.target.value)},isValid:c,message:c?"":"Invalid URL"})]}),primaryAction:{label:"Save",onClick:()=>d(),isLoading:!1,className:"w-auto min-w-[80px]"},secondaryAction:{label:"Cancel",variant:"secondary",onClick:()=>r(Me.NONE),className:"w-auto min-w-[80px]"}})]})},B2=N.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Fy=N.createContext({}),jy=N.createContext(null),F2=typeof document<"u",j2=F2?N.useLayoutEffect:N.useEffect,uI=N.createContext({strict:!1}),U2=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),cI="data-"+U2("framerAppearId"),fae={skipAnimations:!1,useManualTiming:!1};class fI{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const n=this.order.indexOf(e);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}function dae(t){let e=new fI,n=new fI,r=0,s=!1,i=!1;const o=new WeakSet,a={schedule:(l,u=!1,c=!1)=>{const f=c&&s,d=f?e:n;return u&&o.add(l),d.add(l)&&f&&s&&(r=e.order.length),l},cancel:l=>{n.remove(l),o.delete(l)},process:l=>{if(s){i=!0;return}if(s=!0,[e,n]=[n,e],n.clear(),r=e.order.length,r)for(let u=0;u<r;u++){const c=e.order[u];o.has(c)&&(a.schedule(c),t()),c(l)}s=!1,i&&(i=!1,a.process(l))}};return a}const Uy=["read","resolveKeyframes","update","preRender","render","postRender"],hae=40;function dI(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=Uy.reduce((f,d)=>(f[d]=dae(()=>n=!0),f),{}),o=f=>{i[f].process(s)},a=()=>{const f=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(f-s.timestamp,hae),1),s.timestamp=f,s.isProcessing=!0,Uy.forEach(o),s.isProcessing=!1,n&&e&&(r=!1,t(a))},l=()=>{n=!0,r=!0,s.isProcessing||t(a)};return{schedule:Uy.reduce((f,d)=>{const h=i[d];return f[d]=(p,m=!1,g=!1)=>(n||l(),h.schedule(p,m,g)),f},{}),cancel:f=>Uy.forEach(d=>i[d].cancel(f)),state:s,steps:i}}const{schedule:V2,cancel:Yde}=dI(queueMicrotask,!1);function Wc(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}const hI=N.createContext({});let pI=!1;function pae(t,e,n,r,s){const{visualElement:i}=N.useContext(Fy),o=N.useContext(uI),a=N.useContext(jy),l=N.useContext(B2).reducedMotion,u=N.useRef();r=r||o.renderer,!u.current&&r&&(u.current=r(t,{visualState:e,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const c=u.current,f=N.useContext(hI);c&&!c.projection&&s&&(c.type==="html"||c.type==="svg")&&gae(u.current,n,s,f),N.useInsertionEffect(()=>{c&&c.update(n,a)});const d=N.useRef(!!(n[cI]&&!window.HandoffComplete));return j2(()=>{c&&(c.updateFeatures(),V2.render(c.render),d.current&&c.animationState&&c.animationState.animateChanges())}),N.useEffect(()=>{c&&(!d.current&&c.animationState&&c.animationState.animateChanges(),d.current&&(d.current=!1,pI||(pI=!0,queueMicrotask(mae))))}),c}function mae(){window.HandoffComplete=!0}function gae(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:mI(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&Wc(a),visualElement:t,scheduleRender:()=>t.scheduleRender(),animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function mI(t){if(t)return t.options.allowProjection!==!1?t.projection:mI(t.parent)}function yae(t,e,n){return N.useCallback(r=>{r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):Wc(n)&&(n.current=r))},[e])}function Zh(t){return typeof t=="string"||Array.isArray(t)}function Vy(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const H2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],z2=["initial",...H2];function Hy(t){return Vy(t.animate)||z2.some(e=>Zh(t[e]))}function gI(t){return!!(Hy(t)||t.variants)}function bae(t,e){if(Hy(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Zh(n)?n:void 0,animate:Zh(r)?r:void 0}}return t.inherit!==!1?e:{}}function wae(t){const{initial:e,animate:n}=bae(t,N.useContext(Fy));return N.useMemo(()=>({initial:e,animate:n}),[yI(e),yI(n)])}function yI(t){return Array.isArray(t)?t.join(" "):t}const bI={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Kc={};for(const t in bI)Kc[t]={isEnabled:e=>bI[t].some(n=>!!e[n])};function Aae(t){for(const e in t)Kc[e]={...Kc[e],...t[e]}}const $2=N.createContext({}),vae=Symbol.for("motionComponentSymbol"),Sn=t=>t;let qc=Sn,Ji=Sn;process.env.NODE_ENV!=="production"&&(qc=(t,e)=>{!t&&typeof console<"u"&&console.warn(e)},Ji=(t,e)=>{if(!t)throw new Error(e)});function xae({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:s}){t&&Aae(t);function i(a,l){let u;const c={...N.useContext(B2),...a,layoutId:kae(a)},{isStatic:f}=c,d=wae(a),h=r(a,f);if(!f&&F2){Eae(c,t);const p=Cae(c);u=p.MeasureLayout,d.visualElement=pae(s,h,c,e,p.ProjectionNode)}return S.jsxs(Fy.Provider,{value:d,children:[u&&d.visualElement?S.jsx(u,{visualElement:d.visualElement,...c}):null,n(s,a,yae(h,d.visualElement,l),h,f,d.visualElement)]})}const o=N.forwardRef(i);return o[vae]=s,o}function kae({layoutId:t}){const e=N.useContext($2).id;return e&&t!==void 0?e+"-"+t:t}function Eae(t,e){const n=N.useContext(uI).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?qc(!1,r):Ji(!1,r)}}function Cae(t){const{drag:e,layout:n}=Kc;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Sae(t){function e(r,s={}){return xae(t(r,s))}if(typeof Proxy>"u")return e;const n=new Map;return new Proxy(e,{get:(r,s)=>(n.has(s)||n.set(s,e(s)),n.get(s))})}const Tae=["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 G2(t){return typeof t!="string"||t.includes("-")?!1:!!(Tae.indexOf(t)>-1||/[A-Z]/u.test(t))}const zy={};function Dae(t){Object.assign(zy,t)}const ep=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Bl=new Set(ep);function wI(t,{layout:e,layoutId:n}){return Bl.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!zy[t]||t==="opacity")}const Pn=t=>!!(t&&t.getVelocity),Oae={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_ae=ep.length;function Mae(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},r,s){let i="";for(let o=0;o<_ae;o++){const a=ep[o];if(t[a]!==void 0){const l=Oae[a]||a;i+=`${l}(${t[a]}) `}}return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),s?i=s(t,r?"":i):n&&r&&(i="none"),i}const AI=t=>e=>typeof e=="string"&&e.startsWith(t),vI=AI("--"),Nae=AI("var(--"),W2=t=>Nae(t)?Rae.test(t.split("/*")[0].trim()):!1,Rae=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Pae=(t,e)=>e&&typeof t=="number"?e.transform(t):t,aa=(t,e,n)=>n>e?e:n<t?t:n,Qc={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},tp={...Qc,transform:t=>aa(0,1,t)},$y={...Qc,default:1},np=t=>Math.round(t*1e5)/1e5,K2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Iae=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Lae=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function rp(t){return typeof t=="string"}const sp=t=>({test:e=>rp(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),la=sp("deg"),di=sp("%"),Ie=sp("px"),Bae=sp("vh"),Fae=sp("vw"),xI={...di,parse:t=>di.parse(t)/100,transform:t=>di.transform(t*100)},kI={...Qc,transform:Math.round},EI={borderWidth:Ie,borderTopWidth:Ie,borderRightWidth:Ie,borderBottomWidth:Ie,borderLeftWidth:Ie,borderRadius:Ie,radius:Ie,borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomRightRadius:Ie,borderBottomLeftRadius:Ie,width:Ie,maxWidth:Ie,height:Ie,maxHeight:Ie,size:Ie,top:Ie,right:Ie,bottom:Ie,left:Ie,padding:Ie,paddingTop:Ie,paddingRight:Ie,paddingBottom:Ie,paddingLeft:Ie,margin:Ie,marginTop:Ie,marginRight:Ie,marginBottom:Ie,marginLeft:Ie,rotate:la,rotateX:la,rotateY:la,rotateZ:la,scale:$y,scaleX:$y,scaleY:$y,scaleZ:$y,skew:la,skewX:la,skewY:la,distance:Ie,translateX:Ie,translateY:Ie,translateZ:Ie,x:Ie,y:Ie,z:Ie,perspective:Ie,transformPerspective:Ie,opacity:tp,originX:xI,originY:xI,originZ:Ie,zIndex:kI,backgroundPositionX:Ie,backgroundPositionY:Ie,fillOpacity:tp,strokeOpacity:tp,numOctaves:kI};function q2(t,e,n,r){const{style:s,vars:i,transform:o,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const f in e){const d=e[f];if(vI(f)){i[f]=d;continue}const h=EI[f],p=Pae(d,h);if(Bl.has(f)){if(l=!0,o[f]=p,!c)continue;d!==(h.default||0)&&(c=!1)}else f.startsWith("origin")?(u=!0,a[f]=p):s[f]=p}if(e.transform||(l||r?s.transform=Mae(t.transform,n,c,r):s.transform&&(s.transform="none")),u){const{originX:f="50%",originY:d="50%",originZ:h=0}=a;s.transformOrigin=`${f} ${d} ${h}`}}const Q2=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function CI(t,e,n){for(const r in e)!Pn(e[r])&&!wI(r,n)&&(t[r]=e[r])}function jae({transformTemplate:t},e,n){return N.useMemo(()=>{const r=Q2();return q2(r,e,{enableHardwareAcceleration:!n},t),Object.assign({},r.vars,r.style)},[e])}function Uae(t,e,n){const r=t.style||{},s={};return CI(s,r,t),Object.assign(s,jae(t,e,n)),s}function Vae(t,e,n){const r={},s=Uae(t,e,n);return t.drag&&t.dragListener!==!1&&(r.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=s,r}const Hae=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Gy(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Hae.has(t)}let SI=t=>!Gy(t);function zae(t){t&&(SI=e=>e.startsWith("on")?!Gy(e):t(e))}try{zae(require("@emotion/is-prop-valid").default)}catch{}function $ae(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||(SI(s)||n===!0&&Gy(s)||!e&&!Gy(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}function TI(t,e,n){return typeof t=="string"?t:Ie.transform(e+n*t)}function Gae(t,e,n){const r=TI(e,t.x,t.width),s=TI(n,t.y,t.height);return`${r} ${s}`}const Wae={offset:"stroke-dashoffset",array:"stroke-dasharray"},Kae={offset:"strokeDashoffset",array:"strokeDasharray"};function qae(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?Wae:Kae;t[i.offset]=Ie.transform(-r);const o=Ie.transform(e),a=Ie.transform(n);t[i.array]=`${o} ${a}`}function J2(t,{attrX:e,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,f,d){if(q2(t,u,c,d),f){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:p,dimensions:m}=t;h.transform&&(m&&(p.transform=h.transform),delete h.transform),m&&(s!==void 0||i!==void 0||p.transform)&&(p.transformOrigin=Gae(m,s!==void 0?s:.5,i!==void 0?i:.5)),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&qae(h,o,a,l,!1)}const DI=()=>({...Q2(),attrs:{}}),Y2=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Qae(t,e,n,r){const s=N.useMemo(()=>{const i=DI();return J2(i,e,{enableHardwareAcceleration:!1},Y2(r),t.transformTemplate),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};CI(i,t.style,t),s.style={...i,...s.style}}return s}function Jae(t=!1){return(n,r,s,{latestValues:i},o)=>{const l=(G2(n)?Qae:Vae)(r,i,o,n),u=$ae(r,typeof n=="string",t),c=n!==N.Fragment?{...u,...l,ref:s}:{},{children:f}=r,d=N.useMemo(()=>Pn(f)?f.get():f,[f]);return N.createElement(n,{...c,children:d})}}function OI(t,{style:e,vars:n},r,s){Object.assign(t.style,e,s&&s.getProjectionStyles(r));for(const i in n)t.style.setProperty(i,n[i])}const _I=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 MI(t,e,n,r){OI(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(_I.has(s)?s:U2(s),e.attrs[s])}function X2(t,e,n){var r;const{style:s}=t,i={};for(const o in s)(Pn(s[o])||e.style&&Pn(e.style[o])||wI(o,t)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}function NI(t,e,n){const r=X2(t,e,n);for(const s in t)if(Pn(t[s])||Pn(e[s])){const i=ep.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}function RI(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Z2(t,e,n,r){if(typeof e=="function"){const[s,i]=RI(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=RI(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function PI(t){const e=N.useRef(null);return e.current===null&&(e.current=t()),e.current}const ek=t=>Array.isArray(t),Yae=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Xae=t=>ek(t)?t[t.length-1]||0:t;function Wy(t){const e=Pn(t)?t.get():t;return Yae(e)?e.toValue():e}function Zae({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,s,i){const o={latestValues:ele(r,s,i,t),renderState:e()};return n&&(o.mount=a=>n(r,a,o)),o}const II=t=>(e,n)=>{const r=N.useContext(Fy),s=N.useContext(jy),i=()=>Zae(t,e,r,s);return n?i():PI(i)};function ele(t,e,n,r){const s={},i=r(t,{});for(const d in i)s[d]=Wy(i[d]);let{initial:o,animate:a}=t;const l=Hy(t),u=gI(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const f=c?a:o;return f&&typeof f!="boolean"&&!Vy(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=Z2(t,h);if(!p)return;const{transitionEnd:m,transition:g,...y}=p;for(const v in y){let w=y[v];if(Array.isArray(w)){const A=c?w.length-1:0;w=w[A]}w!==null&&(s[v]=w)}for(const v in m)s[v]=m[v]}),s}const{schedule:pt,cancel:Yi,state:Tn,steps:tk}=dI(typeof requestAnimationFrame<"u"?requestAnimationFrame:Sn,!0),tle={useVisualState:II({scrapeMotionValuesFromProps:NI,createRenderState:DI,onMount:(t,e,{renderState:n,latestValues:r})=>{pt.read(()=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),pt.render(()=>{J2(n,r,{enableHardwareAcceleration:!1},Y2(e.tagName),t.transformTemplate),MI(e,n)})}})},nle={useVisualState:II({scrapeMotionValuesFromProps:X2,createRenderState:Q2})};function rle(t,{forwardMotionProps:e=!1},n,r){return{...G2(t)?tle:nle,preloadedFeatures:n,useRender:Jae(e),createVisualElement:r,Component:t}}function Xi(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const LI=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function Ky(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}const sle=t=>e=>LI(e)&&t(e,Ky(e));function Zi(t,e,n,r){return Xi(t,e,sle(n),r)}const ile=(t,e)=>n=>e(t(n)),eo=(...t)=>t.reduce(ile);function BI(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const FI=BI("dragHorizontal"),jI=BI("dragVertical");function UI(t){let e=!1;if(t==="y")e=jI();else if(t==="x")e=FI();else{const n=FI(),r=jI();n&&r?e=()=>{n(),r()}:(n&&n(),r&&r())}return e}function VI(){const t=UI(!0);return t?(t(),!1):!0}class ua{constructor(e){this.isMounted=!1,this.node=e}update(){}}function HI(t,e){const n=e?"pointerenter":"pointerleave",r=e?"onHoverStart":"onHoverEnd",s=(i,o)=>{if(i.pointerType==="touch"||VI())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e);const l=a[r];l&&pt.postRender(()=>l(i,o))};return Zi(t.current,n,s,{passive:!t.getProps()[r]})}class ole extends ua{mount(){this.unmount=eo(HI(this.node,!0),HI(this.node,!1))}unmount(){}}class ale extends ua{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=eo(Xi(this.node.current,"focus",()=>this.onFocus()),Xi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const zI=(t,e)=>e?t===e?!0:zI(t,e.parentElement):!1;function nk(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,Ky(n))}class lle extends ua{constructor(){super(...arguments),this.removeStartListeners=Sn,this.removeEndListeners=Sn,this.removeAccessibleListeners=Sn,this.startPointerPress=(e,n)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),i=Zi(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:f}=this.node.getProps(),d=!f&&!zI(this.node.current,a.target)?c:u;d&&pt.update(()=>d(a,l))},{passive:!(r.onTap||r.onPointerUp)}),o=Zi(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=eo(i,o),this.startPress(e,n)},this.startAccessiblePress=()=>{const e=i=>{if(i.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||nk("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&pt.postRender(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Xi(this.node.current,"keyup",o),nk("down",(a,l)=>{this.startPress(a,l)})},n=Xi(this.node.current,"keydown",e),r=()=>{this.isPressing&&nk("cancel",(i,o)=>this.cancelPress(i,o))},s=Xi(this.node.current,"blur",r);this.removeAccessibleListeners=eo(n,s)}}startPress(e,n){this.isPressing=!0;const{onTapStart:r,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&pt.postRender(()=>r(e,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!VI()}cancelPress(e,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&pt.postRender(()=>r(e,n))}mount(){const e=this.node.getProps(),n=Zi(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),r=Xi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=eo(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const rk=new WeakMap,sk=new WeakMap,ule=t=>{const e=rk.get(t.target);e&&e(t)},cle=t=>{t.forEach(ule)};function fle({root:t,...e}){const n=t||document;sk.has(n)||sk.set(n,{});const r=sk.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(cle,{root:t,...e})),r[s]}function dle(t,e,n){const r=fle(e);return rk.set(t,n),r.observe(t),()=>{rk.delete(t),r.unobserve(t)}}const hle={some:0,all:1};class ple extends ua{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:hle[s]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),d=u?c:f;d&&d(l)};return dle(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(mle(e,n))&&this.startObserver()}unmount(){}}function mle({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const gle={inView:{Feature:ple},tap:{Feature:lle},focus:{Feature:ale},hover:{Feature:ole}};function $I(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function qy(t,e,n){const r=t.getProps();return Z2(r,e,n!==void 0?n:r.custom,t)}const to=t=>t*1e3,no=t=>t/1e3,yle={type:"spring",stiffness:500,damping:25,restSpeed:10},ble=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),wle={type:"keyframes",duration:.8},Ale={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},vle=(t,{keyframes:e})=>e.length>2?wle:Bl.has(t)?t.startsWith("scale")?ble(e[1]):yle:Ale;function xle({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}function ik(t,e){return t[e]||t.default||t}const kle=t=>t!==null;function Qy(t,{repeat:e,repeatType:n="loop"},r){const s=t.filter(kle),i=e&&n!=="loop"&&e%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}let Jy;function Ele(){Jy=void 0}const ca={now:()=>(Jy===void 0&&ca.set(Tn.isProcessing||fae.useManualTiming?Tn.timestamp:performance.now()),Jy),set:t=>{Jy=t,queueMicrotask(Ele)}},GI=t=>/^0[^.\s]+$/u.test(t);function Cle(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||GI(t):!0}const WI=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Sle=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Tle(t){const e=Sle.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}const Dle=4;function KI(t,e,n=1){Ji(n<=Dle,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,s]=Tle(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return WI(o)?parseFloat(o):o}return W2(s)?KI(s,e,n+1):s}const Ole=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),qI=t=>t===Qc||t===Ie,QI=(t,e)=>parseFloat(t.split(", ")[e]),JI=(t,e)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return QI(s[1],e);{const i=r.match(/^matrix\((.+)\)$/u);return i?QI(i[1],t):0}},_le=new Set(["x","y","z"]),Mle=ep.filter(t=>!_le.has(t));function Nle(t){const e=[];return Mle.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Jc={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),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:JI(4,13),y:JI(5,14)};Jc.translateX=Jc.x,Jc.translateY=Jc.y;const YI=t=>e=>e.test(t),XI=[Qc,Ie,di,la,Fae,Bae,{test:t=>t==="auto",parse:t=>t}],ZI=t=>XI.find(YI(t)),Fl=new Set;let ok=!1,ak=!1;function e8(){if(ak){const t=Array.from(Fl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=Nle(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))===null||a===void 0||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ak=!1,ok=!1,Fl.forEach(t=>t.complete()),Fl.clear()}function t8(){Fl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ak=!0)})}function Rle(){t8(),e8()}class lk{constructor(e,n,r,s,i,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Fl.add(this),ok||(ok=!0,pt.read(t8),pt.resolveKeyframes(e8))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;for(let i=0;i<e.length;i++)if(e[i]===null)if(i===0){const o=s==null?void 0:s.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),s&&o===void 0&&s.set(e[0])}else e[i]=e[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Fl.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Fl.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const uk=(t,e)=>n=>!!(rp(n)&&Lae.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),n8=(t,e,n)=>r=>{if(!rp(r))return r;const[s,i,o,a]=r.match(K2);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Ple=t=>aa(0,255,t),ck={...Qc,transform:t=>Math.round(Ple(t))},jl={test:uk("rgb","red"),parse:n8("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+ck.transform(t)+", "+ck.transform(e)+", "+ck.transform(n)+", "+np(tp.transform(r))+")"};function Ile(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const fk={test:uk("#"),parse:Ile,transform:jl.transform},Yc={test:uk("hsl","hue"),parse:n8("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+di.transform(np(e))+", "+di.transform(np(n))+", "+np(tp.transform(r))+")"},In={test:t=>jl.test(t)||fk.test(t)||Yc.test(t),parse:t=>jl.test(t)?jl.parse(t):Yc.test(t)?Yc.parse(t):fk.parse(t),transform:t=>rp(t)?t:t.hasOwnProperty("red")?jl.transform(t):Yc.transform(t)};function Lle(t){var e,n;return isNaN(t)&&rp(t)&&(((e=t.match(K2))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(Iae))===null||n===void 0?void 0:n.length)||0)>0}const r8="number",s8="color",Ble="var",Fle="var(",i8="${}",jle=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ip(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=e.replace(jle,l=>(In.test(l)?(r.color.push(i),s.push(s8),n.push(In.parse(l))):l.startsWith(Fle)?(r.var.push(i),s.push(Ble),n.push(l)):(r.number.push(i),s.push(r8),n.push(parseFloat(l))),++i,i8)).split(i8);return{values:n,split:a,indexes:r,types:s}}function o8(t){return ip(t).values}function a8(t){const{split:e,types:n}=ip(t),r=e.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=e[o],s[o]!==void 0){const a=n[o];a===r8?i+=np(s[o]):a===s8?i+=In.transform(s[o]):i+=s[o]}return i}}const Ule=t=>typeof t=="number"?0:t;function Vle(t){const e=o8(t);return a8(t)(e.map(Ule))}const fa={test:Lle,parse:o8,createTransformer:a8,getAnimatableNone:Vle},Hle=new Set(["brightness","contrast","saturate","opacity"]);function zle(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(K2)||[];if(!r)return t;const s=n.replace(r,"");let i=Hle.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const $le=/\b([a-z-]*)\(.*?\)/gu,dk={...fa,getAnimatableNone:t=>{const e=t.match($le);return e?e.map(zle).join(" "):t}},Gle={...EI,color:In,backgroundColor:In,outlineColor:In,fill:In,stroke:In,borderColor:In,borderTopColor:In,borderRightColor:In,borderBottomColor:In,borderLeftColor:In,filter:dk,WebkitFilter:dk},hk=t=>Gle[t];function l8(t,e){let n=hk(t);return n!==dk&&(n=fa),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Wle=new Set(["auto","none","0"]);function Kle(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!Wle.has(i)&&ip(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=l8(n,s)}class u8 extends lk{constructor(e,n,r,s){super(e,n,r,s,s==null?void 0:s.owner,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),W2(u))){const c=KI(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Ole.has(r)||e.length!==2)return;const[s,i]=e,o=ZI(s),a=ZI(i);if(o!==a)if(qI(o)&&qI(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)Cle(e[s])&&r.push(s);r.length&&Kle(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Jc[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var e;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n.current)return;const i=n.getValue(r);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,a=s[o];s[o]=Jc[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function c8(t){let e;return()=>(e===void 0&&(e=t()),e)}const f8=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(fa.test(t)||t==="0")&&!t.startsWith("url("));function qle(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Qle(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=f8(s,e),a=f8(i,e);return qc(o===a,`You are trying to animate ${e} from "${s}" to "${i}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${i} via the \`style\` property.`),!o||!a?!1:qle(t)||n==="spring"&&r}class d8{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...a},this.updateFinishedPromise()}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Rle(),this._resolved}onKeyframesResolved(e,n){this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Qle(e,r,s,i))if(o)this.options.duration=0;else{l==null||l(Qy(e,this.options,n)),a==null||a(),this.resolveFinishedPromise();return}const c=this.initPlayback(e,n);c!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function h8(t,e){return e?t*(1e3/e):0}const Jle=5;function p8(t,e,n){const r=Math.max(e-Jle,0);return h8(n-t(r),e-r)}const pk=.001,Yle=.01,m8=10,Xle=.05,Zle=1;function eue({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let s,i;qc(t<=to(m8),"Spring duration must be 10 seconds or less");let o=1-e;o=aa(Xle,Zle,o),t=aa(Yle,m8,no(t)),o<1?(s=u=>{const c=u*o,f=c*t,d=c-n,h=mk(u,o),p=Math.exp(-f);return pk-d/h*p},i=u=>{const f=u*o*t,d=f*n+n,h=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-f),m=mk(Math.pow(u,2),o);return(-s(u)+pk>0?-1:1)*((d-h)*p)/m}):(s=u=>{const c=Math.exp(-u*t),f=(u-n)*t+1;return-pk+c*f},i=u=>{const c=Math.exp(-u*t),f=(n-u)*(t*t);return c*f});const a=5/t,l=nue(s,i,a);if(t=to(t),isNaN(l))return{stiffness:100,damping:10,duration:t};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:t}}}const tue=12;function nue(t,e,n){let r=n;for(let s=1;s<tue;s++)r=r-t(r)/e(r);return r}function mk(t,e){return t*Math.sqrt(1-e*e)}const rue=["duration","bounce"],sue=["stiffness","damping","mass"];function g8(t,e){return e.some(n=>t[n]!==void 0)}function iue(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!g8(t,sue)&&g8(t,rue)){const n=eue(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}function y8({keyframes:t,restDelta:e,restSpeed:n,...r}){const s=t[0],i=t[t.length-1],o={done:!1,value:s},{stiffness:a,damping:l,mass:u,duration:c,velocity:f,isResolvedFromDuration:d}=iue({...r,velocity:-no(r.velocity||0)}),h=f||0,p=l/(2*Math.sqrt(a*u)),m=i-s,g=no(Math.sqrt(a/u)),y=Math.abs(m)<5;n||(n=y?.01:2),e||(e=y?.005:.5);let v;if(p<1){const w=mk(g,p);v=A=>{const x=Math.exp(-p*g*A);return i-x*((h+p*g*m)/w*Math.sin(w*A)+m*Math.cos(w*A))}}else if(p===1)v=w=>i-Math.exp(-g*w)*(m+(h+g*m)*w);else{const w=g*Math.sqrt(p*p-1);v=A=>{const x=Math.exp(-p*g*A),k=Math.min(w*A,300);return i-x*((h+p*g*m)*Math.sinh(k)+w*m*Math.cosh(k))/w}}return{calculatedDuration:d&&c||null,next:w=>{const A=v(w);if(d)o.done=w>=c;else{let x=h;w!==0&&(p<1?x=p8(v,w,A):x=0);const k=Math.abs(x)<=n,C=Math.abs(i-A)<=e;o.done=k&&C}return o.value=o.done?i:A,o}}}function b8({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const f=t[0],d={done:!1,value:f},h=O=>a!==void 0&&O<a||l!==void 0&&O>l,p=O=>a===void 0?l:l===void 0||Math.abs(a-O)<Math.abs(l-O)?a:l;let m=n*e;const g=f+m,y=o===void 0?g:o(g);y!==g&&(m=y-f);const v=O=>-m*Math.exp(-O/r),w=O=>y+v(O),A=O=>{const _=v(O),D=w(O);d.done=Math.abs(_)<=u,d.value=d.done?y:D};let x,k;const C=O=>{h(d.value)&&(x=O,k=y8({keyframes:[d.value,p(d.value)],velocity:p8(w,O,d.value),damping:s,stiffness:i,restDelta:u,restSpeed:c}))};return C(0),{calculatedDuration:null,next:O=>{let _=!1;return!k&&x===void 0&&(_=!0,A(O),C(O)),x!==void 0&&O>=x?k.next(O-x):(!_&&A(O),d)}}}const w8=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,oue=1e-7,aue=12;function lue(t,e,n,r,s){let i,o,a=0;do o=e+(n-e)/2,i=w8(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>oue&&++a<aue);return o}function op(t,e,n,r){if(t===e&&n===r)return Sn;const s=i=>lue(i,0,1,t,n);return i=>i===0||i===1?i:w8(s(i),e,r)}const uue=op(.42,0,1,1),cue=op(0,0,.58,1),A8=op(.42,0,.58,1),fue=t=>Array.isArray(t)&&typeof t[0]!="number",v8=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,x8=t=>e=>1-t(1-e),gk=t=>1-Math.sin(Math.acos(t)),k8=x8(gk),due=v8(gk),E8=op(.33,1.53,.69,.99),yk=x8(E8),hue=v8(yk),C8={linear:Sn,easeIn:uue,easeInOut:A8,easeOut:cue,circIn:gk,circInOut:due,circOut:k8,backIn:yk,backInOut:hue,backOut:E8,anticipate:t=>(t*=2)<1?.5*yk(t):.5*(2-Math.pow(2,-10*(t-1)))},S8=t=>{if(Array.isArray(t)){Ji(t.length===4,"Cubic bezier arrays must contain four numerical values.");const[e,n,r,s]=t;return op(e,n,r,s)}else if(typeof t=="string")return Ji(C8[t]!==void 0,`Invalid easing type '${t}'`),C8[t];return t},ap=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r},Bt=(t,e,n)=>t+(e-t)*n;function bk(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function pue({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;s=bk(l,a,t+1/3),i=bk(l,a,t),o=bk(l,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Yy(t,e){return n=>n>0?e:t}const wk=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},mue=[fk,jl,Yc],gue=t=>mue.find(e=>e.test(t));function T8(t){const e=gue(t);if(qc(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let n=e.parse(t);return e===Yc&&(n=pue(n)),n}const D8=(t,e)=>{const n=T8(t),r=T8(e);if(!n||!r)return Yy(t,e);const s={...n};return i=>(s.red=wk(n.red,r.red,i),s.green=wk(n.green,r.green,i),s.blue=wk(n.blue,r.blue,i),s.alpha=Bt(n.alpha,r.alpha,i),jl.transform(s))},Ak=new Set(["none","hidden"]);function yue(t,e){return Ak.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function bue(t,e){return n=>Bt(t,e,n)}function vk(t){return typeof t=="number"?bue:typeof t=="string"?W2(t)?Yy:In.test(t)?D8:vue:Array.isArray(t)?O8:typeof t=="object"?In.test(t)?D8:wue:Yy}function O8(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>vk(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function wue(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=vk(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function Aue(t,e){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],a=t.indexes[o][s[o]],l=(n=t.values[a])!==null&&n!==void 0?n:0;r[i]=l,s[o]++}return r}const vue=(t,e)=>{const n=fa.createTransformer(e),r=ip(t),s=ip(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Ak.has(t)&&!s.values.length||Ak.has(e)&&!r.values.length?yue(t,e):eo(O8(Aue(r,s),s.values),n):(qc(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Yy(t,e))};function _8(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Bt(t,e,n):vk(t)(t,e)}function xue(t,e,n){const r=[],s=n||_8,i=t.length-1;for(let o=0;o<i;o++){let a=s(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||Sn:e;a=eo(l,a)}r.push(a)}return r}function kue(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(Ji(i===e.length,"Both input and output ranges must be the same length"),i===1)return()=>e[0];if(i===2&&t[0]===t[1])return()=>e[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=xue(e,r,s),a=o.length,l=u=>{let c=0;if(a>1)for(;c<t.length-2&&!(u<t[c+1]);c++);const f=ap(t[c],t[c+1],u);return o[c](f)};return n?u=>l(aa(t[0],t[i-1],u)):l}function Eue(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=ap(0,e,r);t.push(Bt(n,1,s))}}function Cue(t){const e=[0];return Eue(e,t.length-1),e}function Sue(t,e){return t.map(n=>n*e)}function Tue(t,e){return t.map(()=>e||A8).splice(0,t.length-1)}function Xy({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=fue(r)?r.map(S8):S8(r),i={done:!1,value:e[0]},o=Sue(n&&n.length===e.length?n:Cue(e),t),a=kue(o,e,{ease:Array.isArray(s)?s:Tue(e,s)});return{calculatedDuration:t,next:l=>(i.value=a(l),i.done=l>=t,i)}}const M8=2e4;function Due(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<M8;)e+=n,r=t.next(e);return e>=M8?1/0:e}const Oue=t=>{const e=({timestamp:n})=>t(n);return{start:()=>pt.update(e,!0),stop:()=>Yi(e),now:()=>Tn.isProcessing?Tn.timestamp:ca.now()}},_ue={decay:b8,inertia:b8,tween:Xy,keyframes:Xy,spring:y8},Mue=t=>t/100;class xk extends d8{constructor({KeyframeResolver:e=lk,...n}){super(n),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:a}=this.options;a&&a()};const{name:r,motionValue:s,keyframes:i}=this.options,o=(a,l)=>this.onKeyframesResolved(a,l);r&&s&&s.owner?this.resolver=s.owner.resolveKeyframes(i,o,r,s):this.resolver=new e(i,o,r,s),this.resolver.scheduleResolve()}initPlayback(e){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=this.options,a=_ue[n]||Xy;let l,u;a!==Xy&&typeof e[0]!="number"&&(process.env.NODE_ENV!=="production"&&Ji(e.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),l=eo(Mue,_8(e[0],e[1])),e=[0,100]);const c=a({...this.options,keyframes:e});i==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Due(c));const{calculatedDuration:f}=c,d=f+s,h=d*(r+1)-s;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:d,totalDuration:h}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:r}=this;if(!r){const{keyframes:O}=this.options;return{done:!0,value:O[O.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:d,repeat:h,repeatType:p,repeatDelay:m,onUpdate:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const y=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?y<0:y>c;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let w=this.currentTime,A=i;if(h){const O=Math.min(this.currentTime,c)/f;let _=Math.floor(O),D=O%1;!D&&O>=1&&(D=1),D===1&&_--,_=Math.min(_,h+1),!!(_%2)&&(p==="reverse"?(D=1-D,m&&(D-=m/f)):p==="mirror"&&(A=o)),w=aa(0,1,D)*f}const x=v?{done:!1,value:l[0]}:A.next(w);a&&(x.value=a(x.value));let{done:k}=x;!v&&u!==null&&(k=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return C&&s!==void 0&&(x.value=Qy(l,this.options,s)),g&&g(x.value),C&&this.finish(),x}get duration(){const{resolved:e}=this;return e?no(e.calculatedDuration):0}get time(){return no(this.currentTime)}set time(e){e=to(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=no(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Oue,onPlay:n}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:(!this.startTime||this.state==="finished")&&(this.startTime=r),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const N8=t=>Array.isArray(t)&&typeof t[0]=="number";function R8(t){return!!(!t||typeof t=="string"&&t in kk||N8(t)||Array.isArray(t)&&t.every(R8))}const lp=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,kk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:lp([0,.65,.55,1]),circOut:lp([.55,0,1,.45]),backIn:lp([.31,.01,.66,-.59]),backOut:lp([.33,1.53,.69,.99])};function Nue(t){return P8(t)||kk.easeOut}function P8(t){if(t)return N8(t)?lp(t):Array.isArray(t)?t.map(Nue):kk[t]}function Rue(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=P8(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:r,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const Pue=c8(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Iue=new Set(["opacity","clipPath","filter","transform"]),Zy=10,Lue=2e4;function Bue(t){return t.type==="spring"||t.name==="backgroundColor"||!R8(t.ease)}function Fue(t,e){const n=new xk({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const s=[];let i=0;for(;!r.done&&i<Lue;)r=n.sample(i),s.push(r.value),i+=Zy;return{times:void 0,keyframes:s,duration:i-Zy,ease:"linear"}}class I8 extends d8{constructor(e){super(e);const{name:n,motionValue:r,keyframes:s}=this.options;this.resolver=new u8(s,(i,o)=>this.onKeyframesResolved(i,o),n,r),this.resolver.scheduleResolve()}initPlayback(e,n){var r;let{duration:s=300,times:i,ease:o,type:a,motionValue:l,name:u}=this.options;if(!(!((r=l.owner)===null||r===void 0)&&r.current))return!1;if(Bue(this.options)){const{onComplete:f,onUpdate:d,motionValue:h,...p}=this.options,m=Fue(e,p);e=m.keyframes,e.length===1&&(e[1]=e[0]),s=m.duration,i=m.times,o=m.ease,a="keyframes"}const c=Rue(l.owner.current,u,e,{...this.options,duration:s,times:i,ease:o});return c.startTime=ca.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:f}=this.options;l.set(Qy(e,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:s,times:i,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return no(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return no(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=to(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return Sn;const{animation:r}=n;r.timeline=e,r.onfinish=null}return Sn}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:r,duration:s,type:i,ease:o,times:a}=e;if(!(n.playState==="idle"||n.playState==="finished")){if(this.time){const{motionValue:l,onUpdate:u,onComplete:c,...f}=this.options,d=new xk({...f,keyframes:r,duration:s,type:i,ease:o,times:a,isGenerator:!0}),h=to(this.time);l.setWithVelocity(d.sample(h-Zy).value,d.sample(h).value,Zy)}this.cancel()}}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:r,repeatDelay:s,repeatType:i,damping:o,type:a}=e;return Pue()&&r&&Iue.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!s&&i!=="mirror"&&o!==0&&a!=="inertia"}}function jue(t,e){let n;const r=()=>{const{currentTime:s}=e,o=(s===null?0:s.value)/100;n!==o&&t(o),n=o};return pt.update(r,!0),()=>Yi(r)}const Uue=c8(()=>window.ScrollTimeline!==void 0);class Vue{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,n){return Promise.all(this.animations).then(e).catch(n)}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=n}attachTimeline(e){const n=this.animations.map(r=>{if(Uue()&&r.attachTimeline)r.attachTimeline(e);else return r.pause(),jue(s=>{r.time=r.duration*s},e)});return()=>{n.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const Ek=(t,e,n,r={},s,i)=>o=>{const a=ik(r,t)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-to(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:i?void 0:s};xle(a)||(c={...c,...vle(t,c)}),c.duration&&(c.duration=to(c.duration)),c.repeatDelay&&(c.repeatDelay=to(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(f=!0)),f&&!i&&e.get()!==void 0){const d=Qy(c.keyframes,a);if(d!==void 0)return pt.update(()=>{c.onUpdate(d),c.onComplete()}),new Vue([])}return!i&&I8.supports(c)?new I8(c):new xk(c)};function eb(t){return!!(Pn(t)&&t.add)}function Ck(t,e){t.indexOf(e)===-1&&t.push(e)}function Sk(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Tk{constructor(){this.subscriptions=[]}add(e){return Ck(this.subscriptions,e),()=>Sk(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const L8=new Set;function Dk(t,e,n){t||L8.has(e)||(console.warn(e),L8.add(e))}const B8=30,Hue=t=>!isNaN(parseFloat(t));class zue{constructor(e,n={}){this.version="11.2.12",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=ca.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=ca.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Hue(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&Dk(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Tk);const r=this.events[e].add(n);return e==="change"?()=>{r(),pt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ca.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>B8)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,B8);return h8(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),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(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function up(t,e){return new zue(t,e)}function $ue(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,up(n))}function Gue(t,e){const n=qy(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=Xae(i[o]);$ue(t,o,a)}}function F8(t){return t.getProps()[cI]}function Wue({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function j8(t,e,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;const u=t.getValue("willChange");r&&(o=r);const c=[],f=s&&t.animationState&&t.animationState.getState()[s];for(const d in l){const h=t.getValue(d,(i=t.latestValues[d])!==null&&i!==void 0?i:null),p=l[d];if(p===void 0||f&&Wue(f,d))continue;const m={delay:n,elapsed:0,...ik(o||{},d)};let g=!1;if(window.HandoffAppearAnimations){const v=F8(t);if(v){const w=window.HandoffAppearAnimations(v,d,h,pt);w!==null&&(m.elapsed=w,g=!0)}}h.start(Ek(d,h,p,t.shouldReduceMotion&&Bl.has(d)?{type:!1}:m,t,g));const y=h.animation;y&&(eb(u)&&(u.add(d),y.then(()=>u.remove(d))),c.push(y))}return a&&Promise.all(c).then(()=>{pt.update(()=>{a&&Gue(t,a)})}),c}function Ok(t,e,n={}){var r;const s=qy(t,e,n.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(j8(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:d}=i;return Kue(t,e,c+u,f,d,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[u,c]=l==="beforeChildren"?[o,a]:[a,o];return u().then(()=>c())}else return Promise.all([o(),a(n.delay)])}function Kue(t,e,n=0,r=0,s=1,i){const o=[],a=(t.variantChildren.size-1)*r,l=s===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(t.variantChildren).sort(que).forEach((u,c)=>{u.notify("AnimationStart",e),o.push(Ok(u,e,{...i,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function que(t,e){return t.sortNodePosition(e)}function Que(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>Ok(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=Ok(t,e,n);else{const s=typeof e=="function"?qy(t,e,n.custom):e;r=Promise.all(j8(t,s,n))}return r.then(()=>{pt.postRender(()=>{t.notify("AnimationComplete",e)})})}const Jue=[...H2].reverse(),Yue=H2.length;function Xue(t){return e=>Promise.all(e.map(({animation:n,options:r})=>Que(t,n,r)))}function Zue(t){let e=Xue(t),n=U8(),r=!0;const s=l=>(u,c)=>{var f;const d=qy(t,c,l==="exit"?(f=t.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:p,...m}=d;u={...u,...m,...p}}return u};function i(l){e=l(t)}function o(l){const u=t.getProps(),c=t.getVariantContext(!0)||{},f=[],d=new Set;let h={},p=1/0;for(let g=0;g<Yue;g++){const y=Jue[g],v=n[y],w=u[y]!==void 0?u[y]:c[y],A=Zh(w),x=y===l?v.isActive:null;x===!1&&(p=g);let k=w===c[y]&&w!==u[y]&&A;if(k&&r&&t.manuallyAnimateOnMount&&(k=!1),v.protectedKeys={...h},!v.isActive&&x===null||!w&&!v.prevProp||Vy(w)||typeof w=="boolean")continue;let O=ece(v.prevProp,w)||y===l&&v.isActive&&!k&&A||g>p&&A,_=!1;const D=Array.isArray(w)?w:[w];let R=D.reduce(s(y),{});x===!1&&(R={});const{prevResolvedValues:L={}}=v,F={...L,...R},G=B=>{O=!0,d.has(B)&&(_=!0,d.delete(B)),v.needsAnimating[B]=!0;const H=t.getValue(B);H&&(H.liveStyle=!1)};for(const B in F){const H=R[B],Q=L[B];if(h.hasOwnProperty(B))continue;let te=!1;ek(H)&&ek(Q)?te=!$I(H,Q):te=H!==Q,te?H!=null?G(B):d.add(B):H!==void 0&&d.has(B)?G(B):v.protectedKeys[B]=!0}v.prevProp=w,v.prevResolvedValues=R,v.isActive&&(h={...h,...R}),r&&t.blockInitialAnimation&&(O=!1),O&&(!k||_)&&f.push(...D.map(B=>({animation:B,options:{type:y}})))}if(d.size){const g={};d.forEach(y=>{const v=t.getBaseTarget(y),w=t.getValue(y);w&&(w.liveStyle=!0),g[y]=v??null}),f.push({animation:g})}let m=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(m=!1),r=!1,m?e(f):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=t.variantChildren)===null||c===void 0||c.forEach(d=>{var h;return(h=d.animationState)===null||h===void 0?void 0:h.setActive(l,u)}),n[l].isActive=u;const f=o(l);for(const d in n)n[d].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=U8(),r=!0}}}function ece(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!$I(e,t):!1}function Ul(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function U8(){return{animate:Ul(!0),whileInView:Ul(),whileHover:Ul(),whileTap:Ul(),whileDrag:Ul(),whileFocus:Ul(),exit:Ul()}}class tce extends ua{constructor(e){super(e),e.animationState||(e.animationState=Zue(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Vy(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let nce=0;class rce extends ua{constructor(){super(...arguments),this.id=nce++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const sce={animation:{Feature:tce},exit:{Feature:rce}},V8=(t,e)=>Math.abs(t-e);function ice(t,e){const n=V8(t.x,e.x),r=V8(t.y,e.y);return Math.sqrt(n**2+r**2)}class H8{constructor(e,n,{transformPagePoint:r,contextWindow:s,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Mk(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,h=ice(f.offset,{x:0,y:0})>=3;if(!d&&!h)return;const{point:p}=f,{timestamp:m}=Tn;this.history.push({...p,timestamp:m});const{onStart:g,onMove:y}=this.handlers;d||(g&&g(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,d)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=_k(d,this.transformPagePoint),pt.update(this.updatePoint,!0)},this.handlePointerUp=(f,d)=>{this.end();const{onEnd:h,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=Mk(f.type==="pointercancel"?this.lastMoveEventInfo:_k(d,this.transformPagePoint),this.history);this.startEvent&&h&&h(f,g),p&&p(f,g)},!LI(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const o=Ky(e),a=_k(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=Tn;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,Mk(a,this.history)),this.removeListeners=eo(Zi(this.contextWindow,"pointermove",this.handlePointerMove),Zi(this.contextWindow,"pointerup",this.handlePointerUp),Zi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Yi(this.updatePoint)}}function _k(t,e){return e?{point:e(t.point)}:t}function z8(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Mk({point:t},e){return{point:t,delta:z8(t,$8(e)),offset:z8(t,oce(e)),velocity:ace(e,.1)}}function oce(t){return t[0]}function $8(t){return t[t.length-1]}function ace(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=$8(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>to(e)));)n--;if(!r)return{x:0,y:0};const i=no(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Pr(t){return t.max-t.min}function Nk(t,e=0,n=.01){return Math.abs(t-e)<=n}function G8(t,e,n,r=.5){t.origin=r,t.originPoint=Bt(e.min,e.max,t.origin),t.scale=Pr(n)/Pr(e),(Nk(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Bt(n.min,n.max,t.origin)-t.originPoint,(Nk(t.translate)||isNaN(t.translate))&&(t.translate=0)}function cp(t,e,n,r){G8(t.x,e.x,n.x,r?r.originX:void 0),G8(t.y,e.y,n.y,r?r.originY:void 0)}function W8(t,e,n){t.min=n.min+e.min,t.max=t.min+Pr(e)}function lce(t,e,n){W8(t.x,e.x,n.x),W8(t.y,e.y,n.y)}function K8(t,e,n){t.min=e.min-n.min,t.max=t.min+Pr(e)}function fp(t,e,n){K8(t.x,e.x,n.x),K8(t.y,e.y,n.y)}function uce(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Bt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Bt(n,t,r.max):Math.min(t,n)),t}function q8(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function cce(t,{top:e,left:n,bottom:r,right:s}){return{x:q8(t.x,n,s),y:q8(t.y,e,r)}}function Q8(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function fce(t,e){return{x:Q8(t.x,e.x),y:Q8(t.y,e.y)}}function dce(t,e){let n=.5;const r=Pr(t),s=Pr(e);return s>r?n=ap(e.min,e.max-r,t.min):r>s&&(n=ap(t.min,t.max-s,e.min)),aa(0,1,n)}function hce(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Rk=.35;function pce(t=Rk){return t===!1?t=0:t===!0&&(t=Rk),{x:J8(t,"left","right"),y:J8(t,"top","bottom")}}function J8(t,e,n){return{min:Y8(t,e),max:Y8(t,n)}}function Y8(t,e){return typeof t=="number"?t:t[e]||0}const X8=()=>({translate:0,scale:1,origin:0,originPoint:0}),Xc=()=>({x:X8(),y:X8()}),Z8=()=>({min:0,max:0}),qt=()=>({x:Z8(),y:Z8()});function es(t){return[t("x"),t("y")]}function eL({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function mce({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function gce(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Pk(t){return t===void 0||t===1}function Ik({scale:t,scaleX:e,scaleY:n}){return!Pk(t)||!Pk(e)||!Pk(n)}function Vl(t){return Ik(t)||tL(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function tL(t){return nL(t.x)||nL(t.y)}function nL(t){return t&&t!=="0%"}function tb(t,e,n){const r=t-n,s=e*r;return n+s}function rL(t,e,n,r,s){return s!==void 0&&(t=tb(t,s,r)),tb(t,n,r)+e}function Lk(t,e=0,n=1,r,s){t.min=rL(t.min,e,n,r,s),t.max=rL(t.max,e,n,r,s)}function sL(t,{x:e,y:n}){Lk(t.x,e.translate,e.scale,e.originPoint),Lk(t.y,n.translate,n.scale,n.originPoint)}function yce(t,e,n,r=!1){const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const l=i.instance;l&&l.style&&l.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Zc(t,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,sL(t,o)),r&&Vl(i.latestValues)&&Zc(t,i.latestValues))}e.x=iL(e.x),e.y=iL(e.y)}function iL(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function da(t,e){t.min=t.min+e,t.max=t.max+e}function oL(t,e,[n,r,s]){const i=e[s]!==void 0?e[s]:.5,o=Bt(t.min,t.max,i);Lk(t,e[n],e[r],o,e.scale)}const bce=["x","scaleX","originX"],wce=["y","scaleY","originY"];function Zc(t,e){oL(t.x,e,bce),oL(t.y,e,wce)}function aL(t,e){return eL(gce(t.getBoundingClientRect(),e))}function Ace(t,e,n){const r=aL(t,n),{scroll:s}=e;return s&&(da(r.x,s.offset.x),da(r.y,s.offset.y)),r}const lL=({current:t})=>t?t.ownerDocument.defaultView:null,vce=new WeakMap;class xce{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=qt(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=c=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ky(c,"page").point)},i=(c,f)=>{const{drag:d,dragPropagation:h,onDragStart:p}=this.getProps();if(d&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=UI(d),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),es(g=>{let y=this.getAxisMotionValue(g).get()||0;if(di.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[g];w&&(y=Pr(w)*(parseFloat(y)/100))}}this.originPoint[g]=y}),p&&pt.postRender(()=>p(c,f));const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(c,f)=>{const{dragPropagation:d,dragDirectionLock:h,onDirectionLock:p,onDrag:m}=this.getProps();if(!d&&!this.openGlobalLock)return;const{offset:g}=f;if(h&&this.currentDirection===null){this.currentDirection=kce(g),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",f.point,g),this.updateAxis("y",f.point,g),this.visualElement.render(),m&&m(c,f)},a=(c,f)=>this.stop(c,f),l=()=>es(c=>{var f;return this.getAnimationState(c)==="paused"&&((f=this.getAxisMotionValue(c).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new H8(e,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:lL(this.visualElement)})}stop(e,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&pt.postRender(()=>i(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!nb(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=uce(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,i=this.constraints;n&&Wc(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=cce(s.layoutBox,n):this.constraints=!1,this.elastic=pce(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&es(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=hce(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Wc(e))return!1;const r=e.current;Ji(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=Ace(r,s.root,this.visualElement.getTransformPagePoint());let o=fce(s.layout.layoutBox,i);if(n){const a=n(mce(o));this.hasMutatedConstraints=!!a,a&&(o=eL(a))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=es(c=>{if(!nb(c,n,this.currentDirection))return;let f=l&&l[c]||{};o&&(f={min:0,max:0});const d=s?200:1e6,h=s?40:1e7,p={type:"inertia",velocity:r?e[c]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return r.start(Ek(e,r,0,n,this.visualElement))}stopAnimation(){es(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){es(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){es(n=>{const{drag:r}=this.getProps();if(!nb(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];i.set(e[n]-Bt(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Wc(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};es(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=dce({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),es(o=>{if(!nb(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(Bt(l,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;vce.set(this.visualElement,this);const e=this.visualElement.current,n=Zi(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Wc(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),pt.read(r);const o=Xi(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(es(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Rk,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function nb(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function kce(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Ece extends ua{constructor(e){super(e),this.removeGroupControls=Sn,this.removeListeners=Sn,this.controls=new xce(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Sn}unmount(){this.removeGroupControls(),this.removeListeners()}}const uL=t=>(e,n)=>{t&&pt.postRender(()=>t(e,n))};class Cce extends ua{constructor(){super(...arguments),this.removePointerDownListener=Sn}onPointerDown(e){this.session=new H8(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:lL(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:uL(e),onStart:uL(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&pt.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=Zi(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function Sce(){const t=N.useContext(jy);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:r}=t,s=N.useId();return N.useEffect(()=>r(s),[]),!e&&n?[!1,()=>n&&n(s)]:[!0]}const rb={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function cL(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const dp={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Ie.test(t))t=parseFloat(t);else return t;const n=cL(t,e.target.x),r=cL(t,e.target.y);return`${n}% ${r}%`}},Tce={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=fa.parse(t);if(s.length>5)return r;const i=fa.createTransformer(t),o=typeof s[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const u=Bt(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),i(s)}};class Dce extends N.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;Dae(Oce),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),rb.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||e.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||pt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),V2.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function fL(t){const[e,n]=Sce(),r=N.useContext($2);return S.jsx(Dce,{...t,layoutGroup:r,switchLayoutGroup:N.useContext(hI),isPresent:e,safeToRemove:n})}const Oce={borderRadius:{...dp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:dp,borderTopRightRadius:dp,borderBottomLeftRadius:dp,borderBottomRightRadius:dp,boxShadow:Tce},dL=["TopLeft","TopRight","BottomLeft","BottomRight"],_ce=dL.length,hL=t=>typeof t=="string"?parseFloat(t):t,pL=t=>typeof t=="number"||Ie.test(t);function Mce(t,e,n,r,s,i){s?(t.opacity=Bt(0,n.opacity!==void 0?n.opacity:1,Nce(r)),t.opacityExit=Bt(e.opacity!==void 0?e.opacity:1,0,Rce(r))):i&&(t.opacity=Bt(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<_ce;o++){const a=`border${dL[o]}Radius`;let l=mL(e,a),u=mL(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||pL(l)===pL(u)?(t[a]=Math.max(Bt(hL(l),hL(u),r),0),(di.test(u)||di.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=Bt(e.rotate||0,n.rotate||0,r))}function mL(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Nce=gL(0,.5,k8),Rce=gL(.5,.95,Sn);function gL(t,e,n){return r=>r<t?0:r>e?1:n(ap(t,e,r))}function yL(t,e){t.min=e.min,t.max=e.max}function ts(t,e){yL(t.x,e.x),yL(t.y,e.y)}function bL(t,e,n,r,s){return t-=e,t=tb(t,1/n,r),s!==void 0&&(t=tb(t,1/s,r)),t}function Pce(t,e=0,n=1,r=.5,s,i=t,o=t){if(di.test(e)&&(e=parseFloat(e),e=Bt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Bt(i.min,i.max,r);t===i&&(a-=e),t.min=bL(t.min,e,n,a,s),t.max=bL(t.max,e,n,a,s)}function wL(t,e,[n,r,s],i,o){Pce(t,e[n],e[r],e[s],e.scale,i,o)}const Ice=["x","scaleX","originX"],Lce=["y","scaleY","originY"];function AL(t,e,n,r){wL(t.x,e,Ice,n?n.x:void 0,r?r.x:void 0),wL(t.y,e,Lce,n?n.y:void 0,r?r.y:void 0)}function vL(t){return t.translate===0&&t.scale===1}function xL(t){return vL(t.x)&&vL(t.y)}function Bce(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 kL(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function EL(t){return Pr(t.x)/Pr(t.y)}class Fce{constructor(){this.members=[]}add(e){Ck(this.members,e),e.scheduleRender()}remove(e){if(Sk(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(s=>e===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:s}=e.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function CL(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:f,rotateY:d,skewX:h,skewY:p}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),f&&(r+=`rotateX(${f}deg) `),d&&(r+=`rotateY(${d}deg) `),h&&(r+=`skewX(${h}deg) `),p&&(r+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const jce=(t,e)=>t.depth-e.depth;class Uce{constructor(){this.children=[],this.isDirty=!1}add(e){Ck(this.children,e),this.isDirty=!0}remove(e){Sk(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(jce),this.isDirty=!1,this.children.forEach(e)}}function Vce(t,e){const n=ca.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Yi(r),t(i-e))};return pt.read(r,!0),()=>Yi(r)}function Hce(t){window.MotionDebug&&window.MotionDebug.record(t)}function zce(t){return t instanceof SVGElement&&t.tagName!=="svg"}function $ce(t,e,n){const r=Pn(t)?t:up(t);return r.start(Ek("",r,e,n)),r.animation}const Bk=["","X","Y","Z"],Gce={visibility:"hidden"},SL=1e3;let Wce=0;const Hl={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Fk(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function TL(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return!1;const{visualElement:e}=t.options;return e?F8(e)?!0:t.parent&&!t.parent.hasCheckedOptimisedAppear?TL(t.parent):!1:!1}function DL({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=e==null?void 0:e()){this.id=Wce++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Hl.totalNodes=Hl.resolvedTargetDeltas=Hl.recalculatedProjection=0,this.nodes.forEach(Qce),this.nodes.forEach(efe),this.nodes.forEach(tfe),this.nodes.forEach(Jce),Hce(Hl)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Uce)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Tk),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=zce(o),this.instance=o;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),t){let f;const d=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Vce(d,250),rb.hasAnimatedSinceResize&&(rb.hasAnimatedSinceResize=!1,this.nodes.forEach(_L))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:d,hasRelativeTargetChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||ofe,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=c.getProps(),v=!this.targetLayout||!kL(this.targetLayout,p)||h,w=!d&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,w);const A={...ik(m,"layout"),onPlay:g,onComplete:y};(c.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A)}else d||_L(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Yi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(nfe),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.HandoffCancelAllAnimations&&TL(this)&&window.HandoffCancelAllAnimations(),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const f=this.path[c];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(OL);return}this.isUpdating||this.nodes.forEach(Xce),this.isUpdating=!1,this.nodes.forEach(Zce),this.nodes.forEach(Kce),this.nodes.forEach(qce),this.clearAllSnapshots();const a=ca.now();Tn.delta=aa(0,1e3/60,a-Tn.timestamp),Tn.timestamp=a,Tn.isProcessing=!0,tk.update.process(Tn),tk.preRender.process(Tn),tk.render.process(Tn),Tn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,V2.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Yce),this.sharedNodes.forEach(rfe)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,pt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){pt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=qt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&(this.scroll={animationId:this.root.animationId,phase:o,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!xL(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(a||Vl(this.latestValues)||c)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),afe(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return qt();const a=o.measureViewportBox(),{scroll:l}=this.root;return l&&(da(a.x,l.offset.x),da(a.y,l.offset.y)),a}removeElementScroll(o){const a=qt();ts(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:f}=u;if(u!==this.root&&c&&f.layoutScroll){if(c.isRoot){ts(a,o);const{scroll:d}=this.root;d&&(da(a.x,-d.offset.x),da(a.y,-d.offset.y))}da(a.x,c.offset.x),da(a.y,c.offset.y)}}return a}applyTransform(o,a=!1){const l=qt();ts(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Zc(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Vl(c.latestValues)&&Zc(l,c.latestValues)}return Vl(this.latestValues)&&Zc(l,this.latestValues),l}removeTransform(o){const a=qt();ts(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Vl(u.latestValues))continue;Ik(u.latestValues)&&u.updateSnapshot();const c=qt(),f=u.measurePageBox();ts(c,f),AL(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Vl(this.latestValues)&&AL(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Tn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:f,layoutId:d}=this.options;if(!(!this.layout||!(f||d))){if(this.resolvedRelativeTargetAt=Tn.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=qt(),this.relativeTargetOrigin=qt(),fp(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),ts(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=qt(),this.targetWithTransforms=qt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),lce(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ts(this.target,this.layout.layoutBox),sL(this.target,this.targetDelta)):ts(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=qt(),this.relativeTargetOrigin=qt(),fp(this.relativeTargetOrigin,this.target,h.target),ts(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Hl.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Ik(this.parent.latestValues)||tL(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Tn.timestamp&&(u=!1),u)return;const{layout:c,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||f))return;ts(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;yce(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=qt());const{target:p}=a;if(!p){this.projectionTransform&&(this.projectionDelta=Xc(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=Xc(),this.projectionDeltaWithTransform=Xc());const m=this.projectionTransform;cp(this.projectionDelta,this.layoutCorrected,p,this.latestValues),this.projectionTransform=CL(this.projectionDelta,this.treeScale),(this.projectionTransform!==m||this.treeScale.x!==d||this.treeScale.y!==h)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Hl.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},f=Xc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=qt(),h=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=h!==p,g=this.getStack(),y=!g||g.members.length<=1,v=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(ife));this.animationProgress=0;let w;this.mixTargetDelta=A=>{const x=A/1e3;ML(f.x,o.x,x),ML(f.y,o.y,x),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(fp(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),sfe(this.relativeTarget,this.relativeTargetOrigin,d,x),w&&Bce(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=qt()),ts(w,this.relativeTarget)),m&&(this.animationValues=c,Mce(c,u,this.latestValues,x,v,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=x},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Yi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pt.update(()=>{rb.hasAnimatedSinceResize=!0,this.currentAnimation=$ce(0,SL,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(SL),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&LL(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||qt();const f=Pr(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const d=Pr(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}ts(a,l),Zc(a,c),cp(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Fce),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}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:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&Fk("z",o,u,this.animationValues);for(let c=0;c<Bk.length;c++)Fk(`rotate${Bk[c]}`,o,u,this.animationValues),Fk(`skew${Bk[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Gce;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Wy(o==null?void 0:o.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=Wy(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Vl(this.latestValues)&&(m.transform=c?c({},""):"none",this.hasProjected=!1),m}const d=f.animationValues||f.latestValues;this.applyTransformsToTarget(),u.transform=CL(this.projectionDeltaWithTransform,this.treeScale,d),c&&(u.transform=c(d,u.transform));const{x:h,y:p}=this.projectionDelta;u.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,f.animationValues?u.opacity=f===this?(l=(a=d.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:u.opacity=f===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in zy){if(d[m]===void 0)continue;const{correct:g,applyTo:y}=zy[m],v=u.transform==="none"?d[m]:g(d[m],f);if(y){const w=y.length;for(let A=0;A<w;A++)u[y[A]]=v}else u[m]=v}return this.options.layoutId&&(u.pointerEvents=f===this?Wy(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(OL),this.root.sharedNodes.clear()}}}function Kce(t){t.updateLayout()}function qce(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,o=n.source!==t.layout.source;i==="size"?es(f=>{const d=o?n.measuredBox[f]:n.layoutBox[f],h=Pr(d);d.min=r[f].min,d.max=d.min+h}):LL(i,n.layoutBox,r)&&es(f=>{const d=o?n.measuredBox[f]:n.layoutBox[f],h=Pr(r[f]);d.max=d.min+h,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[f].max=t.relativeTarget[f].min+h)});const a=Xc();cp(a,r,n.layoutBox);const l=Xc();o?cp(l,t.applyTransform(s,!0),n.measuredBox):cp(l,r,n.layoutBox);const u=!xL(a);let c=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:d,layout:h}=f;if(d&&h){const p=qt();fp(p,n.layoutBox,d.layoutBox);const m=qt();fp(m,r,h.layoutBox),kL(p,m)||(c=!0),f.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=p,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function Qce(t){Hl.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Jce(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Yce(t){t.clearSnapshot()}function OL(t){t.clearMeasurements()}function Xce(t){t.isLayoutDirty=!1}function Zce(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function _L(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function efe(t){t.resolveTargetDelta()}function tfe(t){t.calcProjection()}function nfe(t){t.resetSkewAndRotation()}function rfe(t){t.removeLeadSnapshot()}function ML(t,e,n){t.translate=Bt(e.translate,0,n),t.scale=Bt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function NL(t,e,n,r){t.min=Bt(e.min,n.min,r),t.max=Bt(e.max,n.max,r)}function sfe(t,e,n,r){NL(t.x,e.x,n.x,r),NL(t.y,e.y,n.y,r)}function ife(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const ofe={duration:.45,ease:[.4,0,.1,1]},RL=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),PL=RL("applewebkit/")&&!RL("chrome/")?Math.round:Sn;function IL(t){t.min=PL(t.min),t.max=PL(t.max)}function afe(t){IL(t.x),IL(t.y)}function LL(t,e,n){return t==="position"||t==="preserve-aspect"&&!Nk(EL(e),EL(n),.2)}const lfe=DL({attachResizeListener:(t,e)=>Xi(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),jk={current:void 0},BL=DL({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!jk.current){const t=new lfe({});t.mount(window),t.setOptions({layoutScroll:!0}),jk.current=t}return jk.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),ufe={pan:{Feature:Cce},drag:{Feature:Ece,ProjectionNode:BL,MeasureLayout:fL}},Uk={current:null},FL={current:!1};function cfe(){if(FL.current=!0,!!F2)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Uk.current=t.matches;t.addListener(e),e()}else Uk.current=!1}function ffe(t,e,n){const{willChange:r}=e;for(const s in e){const i=e[s],o=n[s];if(Pn(i))t.addValue(s,i),eb(r)&&r.add(s),process.env.NODE_ENV==="development"&&Dk(i.version==="11.2.12",`Attempting to mix Framer Motion versions ${i.version} with 11.2.12 may not work as expected.`);else if(Pn(o))t.addValue(s,up(i,{owner:t})),eb(r)&&r.remove(s);else if(o!==i)if(t.hasValue(s)){const a=t.getValue(s);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=t.getStaticValue(s);t.addValue(s,up(a!==void 0?a:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const jL=new WeakMap,dfe=[...XI,In,fa],hfe=t=>dfe.find(YI(t)),UL=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],pfe=z2.length;class mfe{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},a={}){this.resolveKeyframes=(d,h,p,m)=>new this.KeyframeResolver(d,h,p,m,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=lk,this.features={},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=()=>pt.render(this.render,!1,!0);const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=Hy(n),this.isVariantNode=gI(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const h=f[d];l[d]!==void 0&&Pn(h)&&(h.set(l[d],!1),eb(c)&&c.add(d))}}mount(e){this.current=e,jL.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),FL.current||cfe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Uk.current,process.env.NODE_ENV!=="production"&&Dk(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){jL.delete(this.current),this.projection&&this.projection.unmount(),Yi(this.notifyUpdate),Yi(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){const r=Bl.has(e),s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&pt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{s(),i(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Kc){const n=Kc[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):qt()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<UL.length;r++){const s=UL[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=e[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=ffe(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const r=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(r.initial=this.props.initial),r}const n={};for(let r=0;r<pfe;r++){const s=z2[r],i=this.props[s];(Zh(i)||i===!1)&&(n[s]=i)}return n}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=up(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){var r;let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(r=this.getBaseTargetFromProps(this.props,e))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(WI(s)||GI(s))?s=parseFloat(s):!hfe(s)&&fa.test(n)&&(s=l8(e,n)),this.setBaseTarget(e,Pn(s)?s.get():s)),Pn(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=Z2(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[e])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!Pn(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Tk),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class VL extends mfe{constructor(){super(...arguments),this.KeyframeResolver=u8}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}}function gfe(t){return window.getComputedStyle(t)}class yfe extends VL{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,n){if(Bl.has(n)){const r=hk(n);return r&&r.default||0}else{const r=gfe(e),s=(vI(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return aL(e,n)}build(e,n,r,s){q2(e,n,r,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return X2(e,n,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Pn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(e,n,r,s){OI(e,n,r,s)}}class bfe extends VL{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Bl.has(n)){const r=hk(n);return r&&r.default||0}return n=_I.has(n)?n:U2(n),e.getAttribute(n)}measureInstanceViewportBox(){return qt()}scrapeMotionValuesFromProps(e,n,r){return NI(e,n,r)}build(e,n,r,s){J2(e,n,r,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,r,s){MI(e,n,r,s)}mount(e){this.isSVGTag=Y2(e.tagName),super.mount(e)}}const wfe=(t,e)=>G2(t)?new bfe(e,{enableHardwareAcceleration:!1}):new yfe(e,{allowProjection:t!==N.Fragment,enableHardwareAcceleration:!0}),Afe={...sce,...gle,...ufe,...{layout:{ProjectionNode:BL,MeasureLayout:fL}}},vfe=Sae((t,e)=>rle(t,e,Afe,wfe));function HL(){const t=N.useRef(!1);return j2(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function xfe(){const t=HL(),[e,n]=N.useState(0),r=N.useCallback(()=>{t.current&&n(e+1)},[e]);return[N.useCallback(()=>pt.postRender(r),[r]),e]}class kfe extends V.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Efe({children:t,isPresent:e}){const n=N.useId(),r=N.useRef(null),s=N.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=N.useContext(B2);return N.useInsertionEffect(()=>{const{width:o,height:a,top:l,left:u}=s.current;if(e||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return i&&(c.nonce=i),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
|
|
516
516
|
[data-motion-pop-id="${n}"] {
|
|
517
517
|
position: absolute !important;
|
|
518
518
|
width: ${o}px !important;
|